OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Source.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  */
10 #ifndef SOURCE_HPP_
11 #define SOURCE_HPP_
12 
13 #include <map>
14 #include <string>
15 #include <vector>
16 #include <plugin/Plugin.hpp>
18 #include <PIMItem/PIMItem.hpp>
19 
23 namespace OpenAB_Source {
24 
71 
72 
76 class Source
77 {
78  public:
84  itemType(t) {};
85 
89  virtual ~Source(){};
90 
94  enum eInit{
97  };
98 
103  virtual enum eInit init() = 0;
104 
112  };
113 
118  virtual enum eSuspendRet suspend() = 0;
119 
127  };
128 
133  virtual enum eResumeRet resume() = 0;
134 
142  };
143 
150  virtual enum eCancelRet cancel() = 0;
151 
155  enum eGetItemRet {
159  };
160 
170  virtual enum eGetItemRet getItem(OpenAB::SmartPtr<OpenAB::PIMItem> &item) = 0;
171 
177  virtual int getTotalCount() const = 0;
178 
184  {
185  return itemType;
186  }
187 
188  private:
192  Source(Source const &other);
193 
197  Source& operator=(Source const &other);
198 
199  OpenAB::PIMItemType itemType;
200 };
201 
202 } // namespace OpenAB_Source
203 
204 DECLARE_PLUGIN_INTERFACE(OpenAB_Source, Source, Parameters);
205 
206 #endif // SOURCE_HPP_
virtual ~Source()
Destructor, virtual by default.
Definition: Source.hpp:89
eCancelRet
Definition: Source.hpp:138
eResumeRet
Definition: Source.hpp:123
virtual enum eCancelRet cancel()=0
Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should...
Definition: Source.hpp:139
Definition: Source.hpp:110
eSuspendRet
Definition: Source.hpp:108
virtual enum eResumeRet resume()=0
Resumes Source, if such operation is supported.
Definition: Source.hpp:95
Definition: Source.hpp:96
Documentation for Source plugin interface.
Definition: Source.hpp:76
eGetItemRet
Definition: Source.hpp:155
Definition: Source.hpp:124
virtual enum eGetItemRet getItem(OpenAB::SmartPtr< OpenAB::PIMItem > &item)=0
Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed...
PIMItemType
Definition: PIMItemIndex.hpp:24
Source(OpenAB::PIMItemType t)
Constructor.
Definition: Source.hpp:83
Definition: Source.hpp:156
OpenAB_Plugin::GenericParameters Parameters
Use generic parameters.
Definition: Source.hpp:70
Definition: Source.hpp:140
Definition: Source.hpp:125
eInit
Definition: Source.hpp:94
virtual enum eInit init()=0
Initializes Source.
Definition: Source.hpp:158
OpenAB::PIMItemType getItemType() const
Returns type of PIM Item supported by Source.
Definition: Source.hpp:183
DECLARE_PLUGIN_INTERFACE(OpenAB_Source, Source, Parameters)
Generic storage for plugin parameters. Allows to store map of parameters with different types (OpenAB...
Definition: GenericParameters.hpp:25
Definition: Source.hpp:157
virtual int getTotalCount() const =0
Returns total count of items available from Source, if such information is available.
Definition: Source.hpp:109
virtual enum eSuspendRet suspend()=0
Suspends Source, if such operation is supported.