1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2002 Ximian Inc.
5 * Authors: Michael Zucchi <notzed@ximian.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU Lesser General Public
9 * License as published by the Free Software Foundation.
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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 /* currently, this is just a straigt s/imap/nntp from the IMAP file*/
25 #ifndef _CAMEL_NNTP_STORE_SUMMARY_H
26 #define _CAMEL_NNTP_STORE_SUMMARY_H
28 #include <camel/camel-object.h>
29 #include <camel/camel-store-summary.h>
31 #define CAMEL_NNTP_STORE_SUMMARY(obj) CAMEL_CHECK_CAST (obj, camel_nntp_store_summary_get_type (), CamelNNTPStoreSummary)
32 #define CAMEL_NNTP_STORE_SUMMARY_CLASS(klass) CAMEL_CHECK_CLASS_CAST (klass, camel_nntp_store_summary_get_type (), CamelNNTPStoreSummaryClass)
33 #define CAMEL_IS_NNTP_STORE_SUMMARY(obj) CAMEL_CHECK_TYPE (obj, camel_nntp_store_summary_get_type ())
37 typedef struct _CamelNNTPStoreSummary CamelNNTPStoreSummary;
38 typedef struct _CamelNNTPStoreSummaryClass CamelNNTPStoreSummaryClass;
40 typedef struct _CamelNNTPStoreInfo CamelNNTPStoreInfo;
43 CAMEL_NNTP_STORE_INFO_FULL_NAME = CAMEL_STORE_INFO_LAST,
44 CAMEL_NNTP_STORE_INFO_LAST,
47 struct _CamelNNTPStoreInfo {
50 guint32 first; /* from LIST or NEWGROUPS return */
54 #define NNTP_DATE_SIZE 14
56 struct _CamelNNTPStoreSummary {
57 CamelStoreSummary summary;
59 struct _CamelNNTPStoreSummaryPrivate *priv;
62 guint32 version; /* version of base part of file */
63 char last_newslist[NNTP_DATE_SIZE];
66 struct _CamelNNTPStoreSummaryClass {
67 CamelStoreSummaryClass summary_class;
70 CamelType camel_nntp_store_summary_get_type (void);
71 CamelNNTPStoreSummary *camel_nntp_store_summary_new (void);
73 /* TODO: this api needs some more work, needs to support lists */
74 /*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_new(CamelNNTPStoreSummary *s, const char *full_name, char dir_sep);*/
75 /*void camel_nntp_store_summary_namespace_set(CamelNNTPStoreSummary *s, CamelNNTPStoreNamespace *ns);*/
76 /*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_find_path(CamelNNTPStoreSummary *s, const char *path);*/
77 /*CamelNNTPStoreNamespace *camel_nntp_store_summary_namespace_find_full(CamelNNTPStoreSummary *s, const char *full_name);*/
80 #define camel_nntp_store_info_full_name(s, i) (camel_store_info_string((CamelStoreSummary *)s, (const CamelStoreInfo *)i, CAMEL_NNTP_STORE_INFO_FULL_NAME))
82 /* converts to/from utf8 canonical nasmes */
83 char *camel_nntp_store_summary_full_to_path(CamelNNTPStoreSummary *s, const char *full_name, char dir_sep);
85 char *camel_nntp_store_summary_path_to_full(CamelNNTPStoreSummary *s, const char *path, char dir_sep);
86 char *camel_nntp_store_summary_dotted_to_full(CamelNNTPStoreSummary *s, const char *dotted, char dir_sep);
88 CamelNNTPStoreInfo *camel_nntp_store_summary_full_name(CamelNNTPStoreSummary *s, const char *full_name);
89 CamelNNTPStoreInfo *camel_nntp_store_summary_add_from_full(CamelNNTPStoreSummary *s, const char *full_name, char dir_sep);
91 /* a convenience lookup function. always use this if path known */
92 char *camel_nntp_store_summary_full_from_path(CamelNNTPStoreSummary *s, const char *path);
96 #endif /* ! _CAMEL_NNTP_STORE_SUMMARY_H */