aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage.h
blob: c32a054dd377397435af8c5bb733d7a37b604fc6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-storage.h
 *
 * Copyright (C) 2000  Helix Code, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Ettore Perazzoli
 */

#ifndef _E_STORAGE_H_
#define _E_STORAGE_H_

#include <gtk/gtkobject.h>

#include "evolution-shell-component-client.h"

#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */

#define E_TYPE_STORAGE          (e_storage_get_type ())
#define E_STORAGE(obj)          (GTK_CHECK_CAST ((obj), E_TYPE_STORAGE, EStorage))
#define E_STORAGE_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_STORAGE, EStorageClass))
#define E_IS_STORAGE(obj)       (GTK_CHECK_TYPE ((obj), E_TYPE_STORAGE))
#define E_IS_STORAGE_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((obj), E_TYPE_STORAGE))


typedef struct _EStorage        EStorage;
typedef struct _EStoragePrivate EStoragePrivate;
typedef struct _EStorageClass   EStorageClass;

enum _EStorageResult {
    E_STORAGE_OK,
    E_STORAGE_GENERICERROR,
    E_STORAGE_EXISTS,
    E_STORAGE_INVALIDTYPE,
    E_STORAGE_IOERROR,
    E_STORAGE_NOSPACE,
    E_STORAGE_NOTEMPTY,
    E_STORAGE_NOTFOUND,
    E_STORAGE_NOTIMPLEMENTED,
    E_STORAGE_PERMISSIONDENIED,
    E_STORAGE_UNSUPPORTEDOPERATION,
    E_STORAGE_UNSUPPORTEDTYPE,
    E_STORAGE_INVALIDNAME
};
typedef enum _EStorageResult EStorageResult;

typedef void (* EStorageResultCallback) (EStorage *storage, EStorageResult result, void *data);

#include "e-folder.h"

struct _EStorage {
    GtkObject parent;

    EStoragePrivate *priv;
};

struct _EStorageClass {
    GtkObjectClass parent_class;

    /* Signals.  */

    void * (* new_folder)     (EStorage *storage, const char *path);
    void * (* updated_folder) (EStorage *storage, const char *path);
    void * (* removed_folder) (EStorage *storage, const char *path);

    /* Virtual methods.  */

    GList      * (* get_subfolder_paths)  (EStorage *storage, const char *path);
    EFolder    * (* get_folder)           (EStorage *storage, const char *path);
    const char * (* get_name)             (EStorage *storage);

    void         (* async_create_folder)  (EStorage *storage,
                           const char *path,
                           const char *type,
                           const char *description,
                           EStorageResultCallback callback,
                           void *data);

    void         (* async_remove_folder)  (EStorage *storage,
                           const char *path,
                           EStorageResultCallback callback,
                           void *data);

    void         (* async_xfer_folder)    (EStorage *storage,
                           const char *source_path,
                           const char *destination_path,
                           const gboolean remove_source,
                           EStorageResultCallback callback,
                           void *data);
};


GtkType   e_storage_get_type   (void);
void      e_storage_construct  (EStorage   *storage,
                const char *toplevel_node_uri,
                const char *toplevel_node_type);
EStorage *e_storage_new        (const char *toplevel_node_uri,
                const char *toplevel_node_type);

gboolean    e_storage_path_is_relative      (const char *path);
gboolean    e_storage_path_is_absolute      (const char *path);

GList      *e_storage_get_subfolder_paths   (EStorage   *storage,
                         const char *path);
EFolder    *e_storage_get_folder            (EStorage   *storage,
                         const char *path);

const char *e_storage_get_name                (EStorage *storage);
const char *e_storage_get_toplevel_node_uri   (EStorage *storage);
const char *e_storage_get_toplevel_node_type  (EStorage *storage);

/* Folder operations.  */

void  e_storage_async_create_folder  (EStorage               *storage,
                      const char             *path,
                      const char             *type,
                      const char             *description,
                      EStorageResultCallback  callback,
                      void                   *data);
void  e_storage_async_remove_folder  (EStorage               *storage,
                      const char             *path,
                      EStorageResultCallback  callback,
                      void                   *data);
void  e_storage_async_xfer_folder    (EStorage               *storage,
                      const char             *source_path,
                      const char             *destination_path,
                      const gboolean          remove_source,
                      EStorageResultCallback  callback,
                      void                   *data);

const char *e_storage_result_to_string  (EStorageResult result);

/* Utility functions.  */

char *e_storage_get_path_for_physical_uri  (EStorage   *storage,
                        const char *physical_uri);

/* Protected.  C++ anyone?  */
gboolean  e_storage_new_folder      (EStorage *storage, const char *path, EFolder *folder);
gboolean  e_storage_removed_folder  (EStorage *storage, const char *path);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _E_STORAGE_H_ */
ot buildpav2010-09-191-0/+2 * Unbroke port by checking of EV_MINIMAL macro inside ev.c as well.vsevolod2010-09-191-0/+1 * Add a regression test target. Attempt to fix the build on sparc64.philip2010-09-192-0/+14 * Update to 1.9.1philip2010-09-194-9/+67 * Remove dependency to net-snmp4. Because, it's marked as DEPRECATEDume2010-09-191-8/+2 * Update to 1.2017lth2010-09-193-8/+28 * Update to 2.19.0makc2010-09-186-12/+12 * Update to 2.4.0.0makc2010-09-183-61/+73 * Update to 1.3.5makc2010-09-182-10/+9 * Update to 0.10.6makc2010-09-182-7/+4 * Update to 2.5.0makc2010-09-184-43/+33 * Update to 1.2.2makc2010-09-184-10/+10 * Update to 4.29makc2010-09-183-5/+6 * Update to version 5e7makc2010-09-183-9/+10 * Update to 1.0.16makc2010-09-184-26/+18 * Fix build on 7.xmakc2010-09-186-27/+220 * Update to 1.2.0makc2010-09-182-7/+7 * Fix CONFIGURE_ARGSmakc2010-09-181-2/+5 * Update to 0.4.3makc2010-09-184-44/+12 * Update to 2.6.5makc2010-09-183-11/+14 * Update to 2.3.1makc2010-09-183-6/+14 * Update to 1.5makc2010-09-183-4/+16 * Update libtcd to version 2.2.5makc2010-09-182-25/+23 * Update to 1.26lth2010-09-182-4/+4 * Update to 6.0.1lth2010-09-184-18/+22 * - Mark DEPRECATED: Development has ceased and distfile is no longer availablelioux2010-09-181-0/+2 * - Mark BROKEN on 6.X: bad plistpav2010-09-181-0/+1 * Update to 2.0.1johans2010-09-182-4/+4 * Update xpaint to version 2.9.6johans2010-09-182-4/+4 * Update FreeCiv to 2.2.3johans2010-09-182-5/+4 * - Update to 0.6.2pav2010-09-1812-1050/+1291 * - Hotfix this high-profile port so it does not install into /pav2010-09-181-1/+1 * Update to 2.4.2makc2010-09-182-4/+4 * Update to 1.3makc2010-09-182-8/+5 * - Update to 0.1400az2010-09-182-8/+10 * - Add additional MASTER_SITES to fix distfile fetchingbeat2010-09-181-1/+2 * - Update to 05_20100905gahr2010-09-183-4/+6 * Mark BROKEN: does not builderwin2010-09-181-0/+2 * Mark BROKEN: does not fetch.erwin2010-09-181-0/+1 * Update mozc to 0.13.464.102daichi2010-09-1868-430/+625 * - Update to 0.1.2tota2010-09-182-4/+4 * Replace the partial memory reservation patch by a simpler variation.gerald2010-09-182-36/+6 * - Update to 0.18sahil2010-09-182-4/+4 * - Update to 0.19sahil2010-09-182-4/+4 * - Update to 1.217sahil2010-09-182-4/+4 * - Update to 1.52sahil2010-09-182-4/+4 * - Update to 0.8sahil2010-09-182-5/+5 * This is yet another module that lets you access or change the elementssahil2010-09-185-0/+43 * - Update to r13861lwhsu2010-09-183-4/+54 * - Update to 1.102260wen2010-09-183-8/+11 * - Update to 0.47wen2010-09-182-4/+4 * - Update to 1.2.3lwhsu2010-09-1812-3213/+159 * - Update to 0.07wen2010-09-182-4/+4 * Update to the 20100916 snapshot of GCC 4.5.2 which already includes one ofgerald2010-09-183-36/+16 * Ports modules update at Saturday 18 September 2010 at 00:09edwin2010-09-181-3/+2 * Test::Corpus::Audio::MPD will try to launch a new mpd server forwen2010-09-185-0/+58 * - Fix include dir in mozilla-plugin.pcdecke2010-09-182-0/+10 * - Update to 2.4.3nivit2010-09-182-4/+4 * - Fix size mismatchnivit2010-09-181-3/+3 * Update to version 4.4.8.bsam2010-09-185-13/+13 * Correct discovery date, my bad :(delphij2010-09-181-1/+1 * Chase flexdock updatemakc2010-09-181-3/+3 * Update to 0.5.2makc2010-09-183-14/+11 * - Add pkg-plist which should have been added with the previous commitehaupt2010-09-183-14/+16 * Document django XSS vulnerability.delphij2010-09-181-0/+47 * Unbreak on 6.xmakc2010-09-181-1/+2 * Set expiration date to 2010-11-15: depends on deprecated audio/libmpcdecmakc2010-09-182-0/+6 * Deprecate: superseded by audio/musepackmakc2010-09-181-0/+3 * Update WWW addressmakc2010-09-181-1/+1 * Update to 3.6makc2010-09-182-4/+4 * Add a hack allowing to building with TARGET and TARGET_ARCH set in themarius2010-09-182-0/+10 * Forcibly tell gettext not to use git to compress the infrastructureade2010-09-181-1/+2 * - Update to 6.6.3-10mm2010-09-173-4/+6 * - Update to 8.5.9mm2010-09-179-69/+62 * - Recent Flock versions are based on Chromium so reassign maintainershipbeat2010-09-172-2/+4 * Update to OOO330_m9.maho2010-09-172-5/+5 * - Switch to musepack from deprecated libmpcdecamdmi32010-09-171-2/+2 * Chase swank-clojure version number.olgeni2010-09-172-1/+2 * - fix reload targetdinoex2010-09-171-10/+2 * - Update to 3.0.8beat2010-09-174-152/+152 * - Update to 3.1.4beat2010-09-1710-290/+290 * Update to 0.4.1ehaupt2010-09-175-78/+72 * Mark as broken on sparc64 (and, by implication, the other tier-2 archs).linimon2010-09-171-0/+3 * - Update to 3.18gahr2010-09-173-6/+4 * Mark as broken on sparc64 (and, presumably, ia64): runtime CPU detectionlinimon2010-09-171-0/+4 * Mark as broken on sparc64: fails to compile.linimon2010-09-171-1/+7 * - Update to 2.13decke2010-09-173-6/+6 * Also broken on sparc64 (and, by implication, ia64).linimon2010-09-171-2/+2 * Mark as broken on sparc64: does not compile.linimon2010-09-171-0/+4 * Mark as broken on sparc64: fails to compile.linimon2010-09-171-0/+3 * Mark as broken on sparc64-7.linimon2010-09-171-0/+3 * Reassign to flo@kasimir.com after inactivity from sobomax.linimon2010-09-171-1/+1 * - Remove sysutils/cdrtools-cjk port, please use sysutils/cdrtools nowpav2010-09-176-75/+2 * - Desupport USE_CDRTOOLS=cjkpav2010-09-172-8/+8 * - Update to 1.2.4wen2010-09-172-4/+4 * Fix the name of the manpagesumikawa2010-09-171-2/+2 * - Update to 3.11.4wen2010-09-173-7/+6 * Swift is a highly available, distributed, eventually consistentwen2010-09-175-0/+328 * - Update to 0.32wen2010-09-172-4/+4 * Remove expired portsgarga2010-09-1712-767/+2 * Enable MAKE_JOBS_SAFE for Vim build so it will build in parallel.obrien2010-09-171-1/+7 * Ports modules update at Friday 17 September 2010 at 00:09edwin2010-09-171-1/+6 * - Update to 1.15.5wen2010-09-178-16/+16 * - Update to revision 3.stas2010-09-172-5/+5 * - Update to 0.7.20pgollucci2010-09-172-4/+4 * - Mark MAKE_JOBS_UNSAFE=yespgollucci2010-09-171-0/+2 * - update to viewvc-1.1.7ohauer2010-09-173-5/+6 * - make port IGNORE and point user to bacula-bat if WXCONSLE is choosenohauer2010-09-171-2/+3 * Update to 1.3r1.3913.maho2010-09-174-636/+699 * Chase Code_Aster's upgrade.thierry2010-09-178-62/+11 * Chase Code_Aster's upgrade and depends on Tcl/Tk 8.5.thierry2010-09-172-16/+4 * Upgrade to 1.8.3 and depends on Tcl/Tk 8.5.thierry2010-09-173-14/+17 * Upgrade to 10.2.0-2, add a common file to be included by thethierry2010-09-173-9/+36 * - Mark BROKEN: does not buildpav2010-09-171-0/+2 * Update to the 20100913 snapshot of GCC 4.4.5.gerald2010-09-172-13/+13 * Monast is a monitoring interface which acts as an operator panel for AsteriskTMgarga2010-09-175-0/+162 * - Update to 0.32.0.1garga2010-09-176-882/+1385 * - Only for i386 and amd64pgollucci2010-09-171-0/+1 * - Update to 2.11decke2010-09-175-37/+21 * - Update to 1.1.5decke2010-09-172-5/+5 * - Update to 4.2.0decke2010-09-172-4/+6 * Fix dependency list, add p5-Shorten-Bitlygarga2010-09-171-2/+3 * Convert strings to utf8 before sendgarga2010-09-172-0/+36 * - Update to 4.180tabthorpe2010-09-173-5/+5 * - Fix perl-after-upgrade [1]skv2010-09-169-6/+12 * Provide symlinks for clang and llvm-gcc compilers in addition to gccehaupt2010-09-16