1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3 * Author: Michael Zucchi <notzed@ximian.com>
5 * Copyright (C) 1999 Ximian (www.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
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
22 #ifndef CAMEL_LOCAL_FOLDER_H
23 #define CAMEL_LOCAL_FOLDER_H 1
25 #include <camel/camel-folder.h>
26 #include <camel/camel-folder-search.h>
27 #include <camel/camel-index.h>
28 #include "camel-local-summary.h"
29 #include "camel-lock.h"
31 /* #include "camel-store.h" */
33 #define CAMEL_LOCAL_FOLDER_TYPE (camel_local_folder_get_type ())
34 #define CAMEL_LOCAL_FOLDER(obj) (CAMEL_CHECK_CAST((obj), CAMEL_LOCAL_FOLDER_TYPE, CamelLocalFolder))
35 #define CAMEL_LOCAL_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_LOCAL_FOLDER_TYPE, CamelLocalFolderClass))
36 #define CAMEL_IS_LOCAL_FOLDER(o) (CAMEL_CHECK_TYPE((o), CAMEL_LOCAL_FOLDER_TYPE))
41 CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY = CAMEL_FOLDER_ARG_LAST,
43 CAMEL_LOCAL_FOLDER_ARG_LAST = CAMEL_FOLDER_ARG_LAST + 0x100
47 CAMEL_LOCAL_FOLDER_INDEX_BODY = CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY | CAMEL_ARG_BOO,
51 CamelFolder parent_object;
52 struct _CamelLocalFolderPrivate *priv;
54 guint32 flags; /* open mode flags */
56 int locked; /* lock counter */
57 CamelLockType locktype; /* what type of lock we have */
59 char *base_path; /* base path of the local folder */
60 char *folder_path; /* the path to the folder itself */
61 char *summary_path; /* where the summary lives */
62 char *index_path; /* where the index file lives */
64 CamelIndex *index; /* index for this folder */
65 CamelFolderSearch *search; /* used to run searches, we just use the real thing (tm) */
66 CamelFolderChangeInfo *changes; /* used to store changes to the folder during processing */
70 CamelFolderClass parent_class;
74 /* summary factory, only used at init */
75 CamelLocalSummary *(*create_summary)(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
77 /* Lock the folder for my operations */
78 int (*lock)(CamelLocalFolder *, CamelLockType type, CamelException *ex);
80 /* Unlock the folder for my operations */
81 void (*unlock)(CamelLocalFolder *);
82 } CamelLocalFolderClass;
86 /* flags are taken from CAMEL_STORE_FOLDER_* flags */
87 CamelLocalFolder *camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store,
88 const char *full_name, guint32 flags, CamelException *ex);
90 /* Standard Camel function */
91 CamelType camel_local_folder_get_type(void);
93 /* Lock the folder for internal use. May be called repeatedly */
95 int camel_local_folder_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
96 int camel_local_folder_unlock(CamelLocalFolder *lf);
100 #endif /* CAMEL_LOCAL_FOLDER_H */