1 /*
2  * libEtPan! -- a mail stuff library
3  *
4  * Copyright (C) 2001, 2005 - DINH Viet Hoa
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the libEtPan! project nor the names of its
16  *    contributors may be used to endorse or promote products derived
17  *    from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  */
31 
32 /*
33  * $Id: mboxdriver_types.h,v 1.7 2006/05/22 13:39:40 hoa Exp $
34  */
35 
36 #ifndef MBOXDRIVER_TYPES_H
37 
38 #define MBOXDRIVER_TYPES_H
39 
40 #include <libetpan/maildriver_types.h>
41 #include <libetpan/mailmbox.h>
42 #include <libetpan/mailstorage_types.h>
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /* mbox driver */
49 
50 enum {
51   MBOXDRIVER_SET_READ_ONLY = 1,
52   MBOXDRIVER_SET_NO_UID
53 };
54 
55 struct mbox_session_state_data {
56   struct mailmbox_folder * mbox_folder;
57   int mbox_force_read_only;
58   int mbox_force_no_uid;
59 };
60 
61 /* cached version */
62 
63 enum {
64   /* the mapping of the parameters should be the same as for mbox */
65   MBOXDRIVER_CACHED_SET_READ_ONLY = 1,
66   MBOXDRIVER_CACHED_SET_NO_UID,
67   /* cache specific */
68   MBOXDRIVER_CACHED_SET_CACHE_DIRECTORY,
69   MBOXDRIVER_CACHED_SET_FLAGS_DIRECTORY
70 };
71 
72 struct mbox_cached_session_state_data {
73   mailsession * mbox_ancestor;
74   char * mbox_quoted_mb;
75   char mbox_cache_directory[PATH_MAX];
76   char mbox_flags_directory[PATH_MAX];
77   struct mail_flags_store * mbox_flags_store;
78 };
79 
80 /* mbox storage */
81 
82 /*
83   mbox_mailstorage is the state data specific to the mbox storage.
84 
85   - pathname is the filename that contains the mailbox.
86 
87   - cached if this value is != 0, a persistant cache will be
88       stored on local system.
89 
90   - cache_directory is the location of the cache.
91 
92   - flags_directory is the location of the flags.
93 */
94 
95 struct mbox_mailstorage {
96   char * mbox_pathname;
97 
98   int mbox_cached;
99   char * mbox_cache_directory;
100   char * mbox_flags_directory;
101 };
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif
108