5 #ifndef INCLUDE_CBE_TYPES_H_
6 #define INCLUDE_CBE_TYPES_H_
16 typedef uint64_t container_id_t;
17 typedef uint64_t date_t;
18 typedef uint64_t device_id_t;
19 typedef uint64_t document_id_t;
20 typedef uint64_t drive_id_t;
21 typedef uint64_t favorite_id_t;
22 typedef uint64_t folder_id_t;
23 typedef uint64_t group_id_t;
24 typedef uint64_t item_id_t;
25 typedef uint64_t object_id_t;
26 typedef uint64_t sync_id_t;
27 typedef uint64_t user_id_t;
28 typedef uint64_t webshare_id_t;
29 typedef uint64_t share_id_t;
31 typedef uint32_t account_status_t;
32 typedef uint32_t failed_status_t;
33 typedef uint32_t http_t;
34 typedef uint32_t network_action_t;
35 typedef uint32_t persistence_t;
36 typedef uint32_t service_t;
37 typedef uint32_t sync_direction_t;
38 typedef uint32_t sync_status_t;
39 typedef uint32_t transfer_t;
40 typedef uint32_t webshare_access_t;
41 typedef uint32_t webshare_visibility_t;
43 typedef signed int permission_status_t;
46 typedef int visibility;
47 typedef int application_t;
49 namespace XmlNamespaces {
50 static const std::string ATOM =
"http://www.w3.org/2005/Atom";
51 static const std::string OS =
"http://a9.com/-/spec/opensearch/1.1/";
52 static const std::string DC =
"http://xcerion.com/directory.xsd";
53 static const std::string NI =
"http://xcerion.com/noindex.xsd";
57 static const CBE::service_t Network = 1;
58 static const CBE::service_t LocalDB = 2;
64 enum ApplicationType : application_t {
71 enum ObjectType : object_t {
81 enum Visibility : visibility {
90 enum Permissions : permission_status_t
102 ReadWriteChangeACL = 11,
103 DeleteChangeACL = 12,
104 ReadDeleteChangeACL = 13,
105 WriteDeleteChangeACL = 14,
113 enum FilterOrder : uint32_t {
128 namespace Operations {
133 DataLoaderOperation = 4,
134 AccountOperation = 5,
145 static const CBE::item_t Unapplicable = 1;
146 static const CBE::item_t Unknown = 2;
147 static const CBE::item_t
Object = 4;
148 static const CBE::item_t Document = 4;
150 static const CBE::item_t Folder = 8;
151 static const CBE::item_t Tag = 16;
152 static const CBE::item_t
Group = 32;
155 namespace SyncFolderType {
156 static const uint32_t Folder = 1;
157 static const uint32_t Favorite = 2;
161 static const CBE::webshare_access_t Read = 1;
162 static const CBE::webshare_access_t Update = 2;
163 static const CBE::webshare_access_t Create = 3;
166 namespace WebShareVisibility {
167 static const CBE::webshare_visibility_t Public = 1;
168 static const CBE::webshare_visibility_t Friends = 2;
169 static const CBE::webshare_visibility_t Private = 3;
172 namespace AccountStatus {
173 static const CBE::account_status_t NotLoggedIn = 1;
174 static const CBE::account_status_t LoggedIn = 2;
175 static const CBE::account_status_t Failed = 3;
178 namespace NetworkAction {
179 static const CBE::network_action_t Copy = 1;
180 static const CBE::network_action_t Create = 2;
181 static const CBE::network_action_t Login = 3;
182 static const CBE::network_action_t Move = 4;
183 static const CBE::network_action_t Remove = 5;
184 static const CBE::network_action_t Rename = 6;
185 static const CBE::network_action_t Restore = 7;
188 namespace PersistenceOperation {
189 static const persistence_t None = 0;
190 static const persistence_t Copy = 1;
191 static const persistence_t Create = 2;
192 static const persistence_t Login = 3;
193 static const persistence_t Move = 4;
194 static const persistence_t Remove = 5;
195 static const persistence_t Rename = 6;
196 static const persistence_t Restore = 7;
197 static const persistence_t Update = 8;
198 static const persistence_t ReadOnly = 9;
199 static const persistence_t List = 10;
200 static const persistence_t Upload = 11;
201 static const persistence_t Download = 12;
202 static const persistence_t Save = 13;
203 static const persistence_t Share = 14;
204 static const persistence_t listShares = 15;
205 static const persistence_t listMyShares = 16;
206 static const persistence_t Invite = 17;
207 static const persistence_t UnShare = 18;
208 static const persistence_t SetContainerACL = 19;
209 static const persistence_t SetObjectACL = 20;
210 static const persistence_t GetContainerACL = 21;
211 static const persistence_t GetObjectACL = 22;
212 static const persistence_t Join = 23;
213 static const persistence_t Leave = 24;
214 static const persistence_t Search = 25;
215 static const persistence_t AcceptJoinRequest = 26;
216 static const persistence_t RejectJoinRequest = 27;
217 static const persistence_t Kick = 28;
218 static const persistence_t Ban = 29;
219 static const persistence_t UnBan = 30;
223 namespace PersistenceState {
224 static const CBE::persistence_t Memory = 1;
225 static const CBE::persistence_t Local = 2;
226 static const CBE::persistence_t Cloud = 3;
230 class AccountEventProtocol;
232 class GroupEventProtocol;
233 class ItemEventProtocol;
234 class ItemDataEventProtocol;
235 class NetworkEventProtocol;
236 class RemoteEventProtocol;
237 class ShareEventProtocol;
238 class TransferDownloadEventProtocol;
239 class TransferEventProtocol;
240 class TransferUploadEventProtocol;
265 bool isUserId =
true;
270 template<
typename IDType>
278 template<
class ItemType>
279 bool operator()(
const ItemType &item)
const
281 return item.id == _id;
286 typedef std::shared_ptr<CBE::Item> ItemPtr;
287 typedef std::shared_ptr<CBE::Object> ObjectPtr;
288 typedef std::shared_ptr<CBE::Container> ContainerPtr;
289 typedef std::shared_ptr<CBE::Group> GroupPtr;
290 typedef std::shared_ptr<CBE::Member> MemberPtr;
291 typedef std::shared_ptr<CBE::GroupInvite> GroupInvitePtr;
292 typedef std::shared_ptr<CBE::Account> AccountPtr;
293 typedef std::shared_ptr<CBE::CloudBackend> CloudBackendPtr;
295 typedef std::shared_ptr<AccountEventProtocol> AccountDelegatePtr;
296 typedef std::shared_ptr<ItemEventProtocol> ItemDelegatePtr;
297 typedef std::shared_ptr<ItemDataEventProtocol> ItemDataDelegatePtr;
298 typedef std::shared_ptr<TransferEventProtocol> TransferDelegatePtr;
299 typedef std::shared_ptr<TransferDownloadEventProtocol> TransferDownloadDelegatePtr;
300 typedef std::shared_ptr<TransferUploadEventProtocol> TransferUploadDelegatePtr;
301 typedef std::shared_ptr<ShareEventProtocol> ShareDelegatePtr;
302 typedef std::shared_ptr<GroupEventProtocol> GroupDelegatePtr;
303 typedef std::shared_ptr<QueryResult> QueryResultPtr;
304 typedef std::shared_ptr<GroupQuery> GroupQueryPtr;
305 typedef std::shared_ptr<QueryChain> QueryChainPtr;
308 typedef std::map<std::string, std::pair<std::string, bool>> metadata_type;
310 #define metadata_dataindex_value 0
311 #define metadata_dataindex_indexed 1
314 #endif // INCLUDE_CBE_TYPES_H_