~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to camel/providers/imapx/camel-imapx-server.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2005 Novell Inc.
 
3
 *
 
4
 *  Authors:
 
5
 *    Michael Zucchi <notzed@ximian.com>
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or
 
8
 * modify it under the terms of version 2 of the GNU General Public
 
9
 * License as published by the Free Software Foundation.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public
 
17
 * License along with this program; if not, write to the
 
18
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
19
 * Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifndef _CAMEL_IMAPX_SERVER_H
 
23
#define _CAMEL_IMAPX_SERVER_H
 
24
 
 
25
#include <camel/camel-msgport.h>
 
26
#include <camel/camel-list-utils.h>
 
27
#include <libedataserver/e-flag.h>
 
28
 
 
29
struct _CamelFolder;
 
30
struct _CamelException;
 
31
struct _CamelMimeMessage;
 
32
struct _CamelMessageInfo;
 
33
 
 
34
#define CAMEL_IMAPX_SERVER(obj)         CAMEL_CHECK_CAST (obj, camel_imapx_server_get_type (), CamelIMAPPServer)
 
35
#define CAMEL_IMAPX_SERVER_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_imapx_server_get_type (), CamelIMAPPServerClass)
 
36
#define CAMEL_IS_IMAPX_SERVER(obj)      CAMEL_CHECK_TYPE (obj, camel_imapx_server_get_type ())
 
37
 
 
38
typedef struct _CamelIMAPXServer CamelIMAPXServer;
 
39
typedef struct _CamelIMAPXServerClass CamelIMAPXServerClass;
 
40
 
 
41
#define IMAPX_MODE_READ (1<<0)
 
42
#define IMAPX_MODE_WRITE (1<<1)
 
43
 
 
44
struct _CamelIMAPXServer {
 
45
        CamelObject cobject;
 
46
 
 
47
        struct _CamelStore *store;
 
48
        struct _CamelSession *session;
 
49
 
 
50
        /* Info about the current connection */
 
51
        struct _CamelURL *url;
 
52
        struct _CamelIMAPXStream *stream;
 
53
        struct _capability_info *cinfo;
 
54
        gboolean is_ssl_stream;
 
55
 
 
56
        CamelIMAPXNamespaceList *nsl;
 
57
 
 
58
        /* incoming jobs */
 
59
        CamelMsgPort *port;
 
60
        CamelDList jobs;
 
61
        /* in micro seconds */
 
62
        guint job_timeout;
 
63
 
 
64
        gchar tagprefix;
 
65
        gint state:4;
 
66
 
 
67
        /* Current command/work queue.  All commands are stored in one list,
 
68
           all the time, so they can be cleaned up in exception cases */
 
69
        GStaticRecMutex queue_lock;
 
70
        struct _CamelIMAPXCommand *literal;
 
71
        CamelDList queue;
 
72
        CamelDList active;
 
73
        CamelDList done;
 
74
 
 
75
        /* info on currently selected folder */
 
76
        struct _CamelFolder *select_folder;
 
77
        gchar *select;
 
78
        struct _CamelFolderChangeInfo *changes;
 
79
        struct _CamelFolder *select_pending;
 
80
        guint32 permanentflags;
 
81
        guint32 uidvalidity;
 
82
        guint32 unseen;
 
83
        guint32 exists;
 
84
        guint32 recent;
 
85
        guint32 mode;
 
86
        guint32 unread;
 
87
 
 
88
        /* any expunges that happened from the last command, they are
 
89
           processed after the command completes. */
 
90
        GSList *expunged;
 
91
 
 
92
        GThread *parser_thread;
 
93
        /* Protects the output stream between parser thread (which can disconnect from server) and other threads that issue
 
94
           commands. Input stream does not require a lock since only parser_thread can operate on it */
 
95
        GStaticRecMutex ostream_lock;
 
96
        /* Used for canceling operations as well as signaling parser thread to disconnnect/quit */
 
97
        CamelOperation *op;
 
98
        gboolean parser_quit;
 
99
 
 
100
        /* Idle */
 
101
        struct _CamelIMAPXIdle *idle;
 
102
        gboolean use_idle;
 
103
 
 
104
        /* used for storing eflags to syncronize duplicate get_message requests */
 
105
        GHashTable *uid_eflags;
 
106
};
 
107
 
 
108
struct _CamelIMAPXServerClass {
 
109
        CamelObjectClass cclass;
 
110
 
 
111
        gchar tagprefix;
 
112
};
 
113
 
 
114
CamelType               camel_imapx_server_get_type     (void);
 
115
CamelIMAPXServer *camel_imapx_server_new(struct _CamelStore *store, struct _CamelURL *url);
 
116
 
 
117
gboolean camel_imapx_server_connect(CamelIMAPXServer *is, gint state, CamelException *ex);
 
118
gboolean imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex);
 
119
 
 
120
GPtrArray *camel_imapx_server_list(CamelIMAPXServer *is, const gchar *top, guint32 flags, CamelException *ex);
 
121
 
 
122
void camel_imapx_server_refresh_info(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelException *ex);
 
123
void camel_imapx_server_sync_changes(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
 
124
void camel_imapx_server_expunge(CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
 
125
void camel_imapx_server_noop (CamelIMAPXServer *is, CamelFolder *folder, CamelException *ex);
 
126
 
 
127
CamelStream *camel_imapx_server_get_message(CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, struct _CamelException *ex);
 
128
void camel_imapx_server_copy_message (CamelIMAPXServer *is, CamelFolder *source, CamelFolder *dest, GPtrArray *uids, gboolean delete_originals, CamelException *ex);
 
129
void camel_imapx_server_append_message(CamelIMAPXServer *is, CamelFolder *folder, struct _CamelMimeMessage *message, const struct _CamelMessageInfo *mi, CamelException *ex);
 
130
void camel_imapx_server_sync_message (CamelIMAPXServer *is, CamelFolder *folder, const gchar *uid, CamelException *ex);
 
131
 
 
132
void camel_imapx_server_manage_subscription (CamelIMAPXServer *is, const gchar *folder_name, gboolean subscribe, CamelException *ex);
 
133
void camel_imapx_server_create_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
 
134
void camel_imapx_server_delete_folder (CamelIMAPXServer *is, const gchar *folder_name, CamelException *ex);
 
135
void camel_imapx_server_rename_folder (CamelIMAPXServer *is, const gchar *old_name, const gchar *new_name, CamelException *ex);
 
136
 
 
137
#endif /* _CAMEL_IMAPX_SERVER_H */