OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ContactsStorage.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 CONTACTSSTORAGE_H_
11 #define CONTACTSSTORAGE_H_
12 
13 #include "Storage.hpp"
15 
19 namespace OpenAB_Storage {
20 
27 class ContactsStorage : public Storage
28 {
29  public:
34 
38  virtual ~ContactsStorage();
39 
41  OpenAB::PIMItem::ID & newId,
42  OpenAB::PIMItem::Revision & revision);
43  enum Storage::eAddItem addItems(const std::vector<OpenAB::SmartPtr<OpenAB::PIMItem> > & items,
44  OpenAB::PIMItem::IDs & newIds,
45  OpenAB::PIMItem::Revisions & revisions);
47  const OpenAB::PIMItem::ID & id,
48  OpenAB::PIMItem::Revision & revision);
50  const OpenAB::PIMItem::IDs & ids,
51  OpenAB::PIMItem::Revisions & revisions);
56 
65  virtual enum Storage::eAddItem addContact( const std::string& vCard,
66  OpenAB::PIMItem::ID& newId,
67  OpenAB::PIMItem::Revision& revision) = 0;
68 
78  virtual enum Storage::eAddItem addContacts( const std::vector<std::string> &vCards,
79  OpenAB::PIMItem::IDs& newIds,
80  OpenAB::PIMItem::Revisions& revisions) = 0;
81 
90  virtual enum Storage::eModifyItem modifyContact( const std::string& vCard,
91  const OpenAB::PIMItem::ID& id,
92  OpenAB::PIMItem::Revision& revision) = 0;
93 
102  virtual enum Storage::eModifyItem modifyContacts( const std::vector<std::string> &vCards,
103  const OpenAB::PIMItem::IDs& ids,
104  OpenAB::PIMItem::Revisions& revisions) = 0;
105 
112  virtual enum Storage::eRemoveItem removeContact( const OpenAB::PIMItem::ID& id) = 0;
113 
120  virtual enum Storage::eRemoveItem removeContacts( const OpenAB::PIMItem::IDs& ids) = 0;
121 
129  virtual enum Storage::eGetItem getContact (const OpenAB::PIMItem::ID & id,
131 
139  virtual enum eGetItem getContacts(const OpenAB::PIMItem::IDs & ids,
140  std::vector<OpenAB::SmartPtr<OpenAB::PIMContactItem> > & items) = 0;
141 
142  private:
146  ContactsStorage(ContactsStorage const &other);
147 
151  ContactsStorage& operator=(ContactsStorage const &other);
152 };
153 
154 } // namespace OpenAB_Storage
155 
156 #endif // CONTACTSSTORAGE_H_
std::string Revision
Definition: PIMItem.hpp:89
virtual enum Storage::eRemoveItem removeContact(const OpenAB::PIMItem::ID &id)=0
Removes contact from the ContactsStorage.
enum Storage::eRemoveItem removeItem(const OpenAB::PIMItem::ID &id)
Removes item from the Storage.
Definition: ContactsStorage.cpp:122
Documentation for ContactsStorage interface. Provides functionalities specific to Storage of OpenAB::...
Definition: ContactsStorage.hpp:27
ContactsStorage()
Constructor.
Definition: ContactsStorage.cpp:14
virtual enum eGetItem getContacts(const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMContactItem > > &items)=0
Get the contacts from the Storage.
eModifyItem
Definition: Storage.hpp:164
std::vector< OpenAB::PIMItem::Revision > Revisions
Definition: PIMItem.hpp:111
enum Storage::eAddItem addItems(const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
Adds new items (OpenAB::PIMItem) to the Storage.
Definition: ContactsStorage.cpp:45
virtual ~ContactsStorage()
Destructor, virtual by default.
Definition: ContactsStorage.cpp:19
eAddItem
Definition: Storage.hpp:126
Documentation for Storage plugin interface. Generic interface is modeled over Sync Plugin specific re...
Definition: Storage.hpp:106
virtual enum Storage::eGetItem getContact(const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMContactItem > &item)=0
Get the contact from the Storage.
enum Storage::eModifyItem modifyItems(const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
Modifies items (OpenAB::PIMItem) in the Storage.
Definition: ContactsStorage.cpp:95
std::vector< OpenAB::PIMItem::ID > IDs
Definition: PIMItem.hpp:110
virtual enum Storage::eRemoveItem removeContacts(const OpenAB::PIMItem::IDs &ids)=0
Removes contacts from the ContactsStorage.
enum Storage::eAddItem addItem(const OpenAB::SmartPtr< OpenAB::PIMItem > &item, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
Adds a new item (OpenAB::PIMItem) to the Storage.
Definition: ContactsStorage.cpp:23
eGetItem
Definition: Storage.hpp:226
virtual enum Storage::eModifyItem modifyContacts(const std::vector< std::string > &vCards, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)=0
Modifies contacts in the ContactsStorage.
enum Storage::eRemoveItem removeItems(const OpenAB::PIMItem::IDs &ids)
Removes items from the Storage.
Definition: ContactsStorage.cpp:127
enum Storage::eGetItem getItems(const OpenAB::PIMItem::IDs &id, std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &item)
Get the items from the Storage.
Definition: ContactsStorage.cpp:147
std::string ID
Definition: PIMItem.hpp:64
virtual enum Storage::eModifyItem modifyContact(const std::string &vCard, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)=0
Modifies contact in the ContactsStorage.
enum Storage::eGetItem getItem(const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMItem > &item)
Get the item from the Storage.
Definition: ContactsStorage.cpp:132
virtual enum Storage::eAddItem addContact(const std::string &vCard, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)=0
Adds a new contact to the ContactsStorage.
eRemoveItem
Definition: Storage.hpp:201
virtual enum Storage::eAddItem addContacts(const std::vector< std::string > &vCards, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)=0
Adds new contacts to the ContactsStorage.
enum Storage::eModifyItem modifyItem(const OpenAB::SmartPtr< OpenAB::PIMItem > &item, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
Modifies item (OpenAB::PIMItem) in the Storage.
Definition: ContactsStorage.cpp:73