libmapistore: Switch to using an enum to indicate the type of deletion operation...
[jelmer/openchange.git] / mapiproxy / libmapistore / mapistore_defs.h
1 /*
2    OpenChange Storage Abstraction Layer library
3
4    OpenChange Project
5
6    Copyright (C) Julien Kerihuel 2009-2011
7    Copyright (C) Brad Hards <bradh@openchange.org> 2010-2011
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 3 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22
23 /**
24    \file mapistore_defs.h
25
26    \brief MAPISTORE common definitions
27    
28    This header contains the shared definitions for data structures,
29    enumerations and defines that are used across the MAPISTORE API.
30  */
31
32 #ifndef __MAPISTORE_DEFS_H
33 #define __MAPISTORE_DEFS_H
34
35 /**
36   \brief Special Folder identifiers
37   
38   This list identifies each of the folder identifiers.
39  */
40 enum MAPISTORE_DFLT_FOLDERS {
41         MDB_ROOT_FOLDER         = 1,    /**< The root folder */
42         MDB_DEFERRED_ACTIONS    = 2,    /**< Deferred actions special folder  */
43         MDB_SPOOLER_QUEUE       = 3,    /**< Mail spooler queue special folder */
44         MDB_TODO_SEARCH         = 4,    /**< Special folder for "todo" search */
45         MDB_IPM_SUBTREE         = 5,    /**< Root folder for inter-personal messages */
46         MDB_INBOX               = 6,    /**< Inbox special folder */
47         MDB_OUTBOX              = 7,    /**< Outbox (to be send) special folder */
48         MDB_SENT_ITEMS          = 8,    /**< Sent items (previously sent) special folder */
49         MDB_DELETED_ITEMS       = 9,    /**< Deleted items special folder */
50         MDB_COMMON_VIEWS        = 10,   /**< Special folder for common views metadata */
51         MDB_SCHEDULE            = 11,   /**< Schedule (Free/busy) special folder */
52         MDB_SEARCH              = 12,   /**< Search root folder */
53         MDB_VIEWS               = 13,   /**< Special folder for views metadata */
54         MDB_SHORTCUTS           = 14,   /**< Special folder for "shortcuts" action storage */
55         MDB_REMINDERS           = 15,   /**< Special folder for reminders */
56         MDB_CALENDAR            = 16,   /**< The user calendar */
57         MDB_CONTACTS            = 17,   /**< The user's private address book (contacts) */
58         MDB_JOURNAL             = 18,   /**< The user's journal */
59         MDB_NOTES               = 19,   /**< The user's short notes */
60         MDB_TASKS               = 20,   /**< The user's tasks ("todo list") */
61         MDB_DRAFTS              = 21,   /**< Special folder for draft messages */
62         MDB_TRACKED_MAIL        = 22,   /**< Special folder for tracked mail */
63         MDB_SYNC_ISSUES         = 23,   /**< Special folder to handle messages that failed synchronization */
64         MDB_CONFLICTS           = 24,   /**< Special folder for server-side conflicts (from synchronization)  */
65         MDB_LOCAL_FAILURES      = 25,   /**< Special folder for client side failures */
66         MDB_SERVER_FAILURES     = 26,   /**< Special folder for server side failures */
67         MDB_JUNK_EMAIL          = 27,   /**< Special folder for junk ("spam") email */
68         MDB_RSS_FEEDS           = 28,   /**< Special folder for RSS feeds */
69         MDB_CONVERSATION_ACT    = 29,   /**< Conversation Actions folder */
70         MDB_LAST_SPECIALFOLDER  = MDB_CONVERSATION_ACT, /**< the last identifier, used for iteration */
71         MDB_CUSTOM              = 999   /**< This is a custom (or generic) folder with no special meaning */
72 };
73
74 /**
75   A message object
76   
77   This is used to handle the contents of a message. Note that the body of the message
78   is just another property.
79   
80   Attachments are handled by a separate table, and are not available here.
81  */
82 struct mapistore_message {
83         struct SRowSet                  *recipients; /**< the list of recipient rows */
84         struct SRow                     *properties; /**< the properties of the message */
85 };
86
87 /**
88   Table types
89  */
90 enum MAPISTORE_TABLE_TYPE {
91         MAPISTORE_FOLDER_TABLE = 1,     /**< This table is for a folder */
92         MAPISTORE_MESSAGE_TABLE = 2     /**< This table is for a message */
93 };
94
95 #define MAPISTORE_FOLDER                1
96 #define MAPISTORE_MESSAGE               2
97
98 /**
99   Deletion types
100  */
101 enum MAPISTORE_DELETION_TYPE {
102         MAPISTORE_SOFT_DELETE = 1,      /**< The item is "soft" deleted */
103         MAPISTORE_PERMANENT_DELETE = 2  /**< The item is hard deleted */
104 };
105
106 /* TODO: perhaps this should be in another header */
107 const char              *mapistore_get_mapping_path(void);
108
109 #endif /* __MAPISTORE_DEFS_H */