Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / providers / nntp / camel-nntp-store.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-nntp-store.h : class for an nntp store */
3
4 /* 
5  *
6  * Copyright (C) 2000 Ximian, Inc. <toshok@ximian.com>
7  *
8  * This program is free software; you can redistribute it and/or 
9  * modify it under the terms of version 2 of the GNU Lesser General Public 
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22
23
24 #ifndef CAMEL_NNTP_STORE_H
25 #define CAMEL_NNTP_STORE_H 1
26
27 #include <camel/camel-disco-store.h>
28
29 #include "camel-nntp-stream.h"
30 #include "camel-nntp-store-summary.h"
31
32 #define CAMEL_NNTP_STORE_TYPE     (camel_nntp_store_get_type ())
33 #define CAMEL_NNTP_STORE(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_NNTP_STORE_TYPE, CamelNNTPStore))
34 #define CAMEL_NNTP_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_NNTP_STORE_TYPE, CamelNNTPStoreClass))
35 #define CAMEL_IS_NNTP_STORE(o)    (CAMEL_CHECK_TYPE((o), CAMEL_NNTP_STORE_TYPE))
36
37 #define CAMEL_NNTP_EXT_SEARCH     (1<<0)
38 #define CAMEL_NNTP_EXT_SETGET     (1<<1)
39 #define CAMEL_NNTP_EXT_OVER       (1<<2)
40 #define CAMEL_NNTP_EXT_XPATTEXT   (1<<3)
41 #define CAMEL_NNTP_EXT_XACTIVE    (1<<4)
42 #define CAMEL_NNTP_EXT_LISTMOTD   (1<<5)
43 #define CAMEL_NNTP_EXT_LISTSUBSCR (1<<6)
44 #define CAMEL_NNTP_EXT_LISTPNAMES (1<<7)
45
46 G_BEGIN_DECLS
47
48 struct _CamelNNTPFolder;
49 struct _CamelException;
50
51 typedef struct _CamelNNTPStore CamelNNTPStore;
52 typedef struct _CamelNNTPStoreClass CamelNNTPStoreClass;
53
54 typedef enum _xover_t {
55         XOVER_STRING = 0,
56         XOVER_MSGID,
57         XOVER_SIZE,
58 } xover_t;
59
60 struct _xover_header {
61         struct _xover_header *next;
62
63         const char *name;
64         unsigned int skip:8;
65         xover_t type:8;
66 };
67
68 struct _CamelNNTPStore {
69         CamelDiscoStore parent_object;  
70         
71         struct _CamelNNTPStorePrivate *priv;
72         
73         guint32 extensions;
74         
75         unsigned int posting_allowed:1;
76         unsigned int do_short_folder_notation:1;
77         unsigned int folder_hierarchy_relative:1;
78
79         struct _CamelNNTPStoreSummary *summary;
80         
81         struct _CamelNNTPStream *stream;
82         struct _CamelStreamMem *mem;
83         
84         struct _CamelDataCache *cache;
85         
86         char *current_folder, *storage_path, *base_url;
87
88         struct _xover_header *xover;
89 };
90
91 struct _CamelNNTPStoreClass {
92         CamelDiscoStoreClass parent_class;
93
94 };
95
96 /* Standard Camel function */
97 CamelType camel_nntp_store_get_type (void);
98
99 int camel_nntp_raw_commandv (CamelNNTPStore *store, struct _CamelException *ex, char **line, const char *fmt, va_list ap);
100 int camel_nntp_raw_command(CamelNNTPStore *store, struct _CamelException *ex, char **line, const char *fmt, ...);
101 int camel_nntp_raw_command_auth(CamelNNTPStore *store, struct _CamelException *ex, char **line, const char *fmt, ...);
102 int camel_nntp_command (CamelNNTPStore *store, struct _CamelException *ex, struct _CamelNNTPFolder *folder, char **line, const char *fmt, ...);
103
104 G_END_DECLS
105
106 #endif /* CAMEL_NNTP_STORE_H */
107
108