1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-disco-store.h: abstruct class for a disconnectable store */
5 * Authors: Dan Winship <danw@ximian.com>
7 * Copyright (C) 2001 Ximian, Inc.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of version 2 of the GNU Lesser General Public
11 * License as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
25 #ifndef CAMEL_DISCO_STORE_H
26 #define CAMEL_DISCO_STORE_H 1
28 #include <camel/camel-store.h>
30 #define CAMEL_DISCO_STORE_TYPE (camel_disco_store_get_type ())
31 #define CAMEL_DISCO_STORE(obj) (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_STORE_TYPE, CamelDiscoStore))
32 #define CAMEL_DISCO_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_STORE_TYPE, CamelDiscoStoreClass))
33 #define CAMEL_IS_DISCO_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_STORE_TYPE))
38 CAMEL_DISCO_STORE_ARG_FIRST = CAMEL_STORE_ARG_FIRST + 100,
42 CAMEL_DISCO_STORE_ONLINE,
43 CAMEL_DISCO_STORE_OFFLINE,
44 CAMEL_DISCO_STORE_RESYNCING
45 } CamelDiscoStoreStatus;
47 struct _CamelDiscoStore {
48 CamelStore parent_object;
50 CamelDiscoStoreStatus status;
51 CamelDiscoDiary *diary;
56 CamelStoreClass parent_class;
58 void (*set_status) (CamelDiscoStore *,
59 CamelDiscoStoreStatus,
61 gboolean (*can_work_offline) (CamelDiscoStore *);
64 gboolean (*connect_online) (CamelService *,
66 gboolean (*connect_offline) (CamelService *,
69 gboolean (*disconnect_online) (CamelService *, gboolean,
71 gboolean (*disconnect_offline) (CamelService *, gboolean,
74 CamelFolder * (*get_folder_online) (CamelStore *store,
78 CamelFolder * (*get_folder_offline) (CamelStore *store,
82 CamelFolder * (*get_folder_resyncing) (CamelStore *store,
87 CamelFolderInfo * (*get_folder_info_online) (CamelStore *store,
91 CamelFolderInfo * (*get_folder_info_offline) (CamelStore *store,
95 CamelFolderInfo * (*get_folder_info_resyncing) (CamelStore *store,
100 } CamelDiscoStoreClass;
103 /* Standard Camel function */
104 CamelType camel_disco_store_get_type (void);
107 CamelDiscoStoreStatus camel_disco_store_status (CamelDiscoStore *);
108 void camel_disco_store_set_status (CamelDiscoStore *,
109 CamelDiscoStoreStatus,
111 gboolean camel_disco_store_can_work_offline (CamelDiscoStore *);
114 /* Convenience functions */
115 gboolean camel_disco_store_check_online (CamelDiscoStore *store, CamelException *ex);
116 void camel_disco_store_prepare_for_offline(CamelDiscoStore *store, CamelException *ex);
120 #endif /* CAMEL_DISCO_STORE_H */