summaryrefslogtreecommitdiffstats
path: root/kipi-plugins/sync/sink.h
blob: fd8392b89ea959ceb315e8204de57a17e1b18f76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* ============================================================
 * File  : sink.h
 * Author: Colin Guthrie <kde@colin.guthr.ie>
 * Date  : 2007-01-22
 *
 * Copyright 2007 Colin Guthrie <kde@colin.guthr.ie>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * ============================================================ */

#ifndef SINK_H
#define SINK_H

#include <tqstring.h>
#include "libkipi2/interface.h"

#include <tdeconfig.h>
#include <tdeversion.h>
#if KDE_IS_VERSION(3,2,0)
#include <tdewallet.h>
#endif

namespace KIPI2
{
class Collection;
} 

namespace KIPISyncPlugin
{

// Foreard definition
/// @todo Convert this to an Interface/Factory type setup.
class Sink : public KIPI2::Interface
{
public:
  Sink(unsigned int sinkId, TQString name, TDEConfig* pConfig, TDEWallet::Wallet* pWallet);

  unsigned int SinkId();

  /// The Name of the Sink as chosen by the user.
  TQString Name();
  
  /// An internal, unique type as specified by the sink.
  virtual TQString Type() = 0;
  
  /// Some information about the sink type for the benefit of the user.
  virtual TQString TypeDescription() = 0;
  
  virtual const KIPI2::CollectionList* getCollections() = 0;

  virtual void Save(TDEConfig* pConfig, TDEWallet::Wallet* pWallet) = 0;
  
  // As some Sinks are remote, we have the concept of connect/disconnect
  virtual bool Connect() { return true; };
  
  virtual void Disconnect() { };
  
  //virtual void asTQListViewItem(TQListView* pParent) = 0;

protected:

  unsigned int mSinkId;
  TQString mName;


};

// Play at creating a sink (this will be removed)
class Sink2 : Sink
{
public:
  Sink2(unsigned int sinkId, TQString name, TDEConfig* pConfig, TDEWallet::Wallet* pWallet);
  TQString Type();
  TQString TypeDescription();
  KIPI2::CollectionList* getCollections();
  void Save(TDEConfig* pConfig, TDEWallet::Wallet* pWallet);
};


}
#endif /* SINK_H */