1 | /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ |
---|
2 | /* e-storage-set.h |
---|
3 | * |
---|
4 | * Copyright (C) 2000 Ximian, Inc. |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or |
---|
7 | * modify it under the terms of version 2 of the GNU General Public |
---|
8 | * License as published by the Free Software Foundation. |
---|
9 | * |
---|
10 | * This program is distributed in the hope that it will be useful, |
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
13 | * General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU General Public |
---|
16 | * License along with this program; if not, write to the |
---|
17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
18 | * Boston, MA 02111-1307, USA. |
---|
19 | * |
---|
20 | * Author: Ettore Perazzoli |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef _E_STORAGE_SET_H_ |
---|
24 | #define _E_STORAGE_SET_H_ |
---|
25 | |
---|
26 | #include <gtk/gtkwidget.h> |
---|
27 | |
---|
28 | #include <bonobo/bonobo-ui-container.h> |
---|
29 | |
---|
30 | #include "e-folder-type-registry.h" |
---|
31 | #include "e-storage.h" |
---|
32 | |
---|
33 | #ifdef __cplusplus |
---|
34 | extern "C" { |
---|
35 | #pragma } |
---|
36 | #endif /* __cplusplus */ |
---|
37 | |
---|
38 | #define E_TYPE_STORAGE_SET (e_storage_set_get_type ()) |
---|
39 | #define E_STORAGE_SET(obj) (GTK_CHECK_CAST ((obj), E_TYPE_STORAGE_SET, EStorageSet)) |
---|
40 | #define E_STORAGE_SET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_STORAGE_SET, EStorageSetClass)) |
---|
41 | #define E_IS_STORAGE_SET(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_STORAGE_SET)) |
---|
42 | #define E_IS_STORAGE_SET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_STORAGE_SET)) |
---|
43 | |
---|
44 | |
---|
45 | typedef struct _EStorageSet EStorageSet; |
---|
46 | typedef struct _EStorageSetPrivate EStorageSetPrivate; |
---|
47 | typedef struct _EStorageSetClass EStorageSetClass; |
---|
48 | |
---|
49 | typedef void (* EStorageSetResultCallback) (EStorageSet *storage_set, EStorageResult result, void *data); |
---|
50 | |
---|
51 | struct _EStorageSet { |
---|
52 | GtkObject parent; |
---|
53 | |
---|
54 | EStorageSetPrivate *priv; |
---|
55 | }; |
---|
56 | |
---|
57 | struct _EStorageSetClass { |
---|
58 | GtkObjectClass parent_class; |
---|
59 | |
---|
60 | /* Signals. */ |
---|
61 | |
---|
62 | void (* new_storage) (EStorageSet *storage_set, EStorage *storage); |
---|
63 | void (* removed_storage) (EStorageSet *storage_set, EStorage *storage); |
---|
64 | /* FIXME? Inconsistency between storage and folders. */ |
---|
65 | void (* new_folder) (EStorageSet *storage_set, const char *path); |
---|
66 | void (* updated_folder) (EStorageSet *storage_set, const char *path); |
---|
67 | void (* removed_folder) (EStorageSet *storage_set, const char *path); |
---|
68 | void (* moved_folder) (EStorageSet *storage_set, const char *source_path, const char *destination_path); |
---|
69 | void (* close_folder) (EStorageSet *storage_set, const char *path); |
---|
70 | }; |
---|
71 | |
---|
72 | |
---|
73 | GtkType e_storage_set_get_type (void); |
---|
74 | void e_storage_set_construct (EStorageSet *storage_set, |
---|
75 | EFolderTypeRegistry *folder_type_registry); |
---|
76 | EStorageSet *e_storage_set_new (EFolderTypeRegistry *folder_type_registry); |
---|
77 | gboolean e_storage_set_add_storage (EStorageSet *storage_set, |
---|
78 | EStorage *storage); |
---|
79 | gboolean e_storage_set_remove_storage (EStorageSet *storage_set, |
---|
80 | EStorage *storage); |
---|
81 | void e_storage_set_remove_all_storages (EStorageSet *storage_set); |
---|
82 | GList *e_storage_set_get_storage_list (EStorageSet *storage_set); |
---|
83 | EStorage *e_storage_set_get_storage (EStorageSet *storage_set, |
---|
84 | const char *storage_name); |
---|
85 | EFolder *e_storage_set_get_folder (EStorageSet *storage_set, |
---|
86 | const char *path); |
---|
87 | GtkWidget *e_storage_set_create_new_view (EStorageSet *storage_set, |
---|
88 | BonoboUIContainer *container); |
---|
89 | |
---|
90 | void e_storage_set_async_create_folder (EStorageSet *storage_set, |
---|
91 | const char *path, |
---|
92 | const char *type, |
---|
93 | const char *description, |
---|
94 | EStorageSetResultCallback callback, |
---|
95 | void *data); |
---|
96 | void e_storage_set_async_remove_folder (EStorageSet *storage_set, |
---|
97 | const char *path, |
---|
98 | EStorageSetResultCallback callback, |
---|
99 | void *data); |
---|
100 | void e_storage_set_async_xfer_folder (EStorageSet *storage_set, |
---|
101 | const char *source_path, |
---|
102 | const char *destination_path, |
---|
103 | gboolean remove_source, |
---|
104 | EStorageSetResultCallback callback, |
---|
105 | void *data); |
---|
106 | |
---|
107 | void e_storage_set_async_remove_shared_folder (EStorageSet *storage_set, |
---|
108 | const char *path, |
---|
109 | EStorageSetResultCallback callback, |
---|
110 | void *data); |
---|
111 | |
---|
112 | EFolderTypeRegistry *e_storage_set_get_folder_type_registry (EStorageSet *storage_set); |
---|
113 | |
---|
114 | /* Utility functions. */ |
---|
115 | |
---|
116 | char *e_storage_set_get_path_for_physical_uri (EStorageSet *storage_set, |
---|
117 | const char *physical_uri); |
---|
118 | |
---|
119 | #ifdef __cplusplus |
---|
120 | } |
---|
121 | #endif /* __cplusplus */ |
---|
122 | |
---|
123 | #endif /* _E_STORAGE_SET_H_ */ |
---|