/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-store.h : Abstract class for an email store */

/* 
 *
 * Authors: Bertrand Guiheneuf <bertrand@helixcode.com>
 *
 * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
 *
 * 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
 */


#ifndef CAMEL_STORE_H
#define CAMEL_STORE_H 1


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

#include <camel/camel-object.h>
#include <camel/camel-service.h>


typedef struct _CamelFolderInfo {
	struct _CamelFolderInfo *parent, *sibling, *child;
	char *url, *full_name, *name;
	int unread_message_count;
} CamelFolderInfo;


#define CAMEL_STORE_TYPE     (camel_store_get_type ())
#define CAMEL_STORE(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_STORE_TYPE, CamelStore))
#define CAMEL_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STORE_TYPE, CamelStoreClass))
#define CAMEL_IS_STORE(o)    (CAMEL_CHECK_TYPE((o), CAMEL_STORE_TYPE))


/* Flags for store flags */
#define CAMEL_STORE_SUBSCRIPTIONS (1 << 0)

struct _CamelStore
{
	CamelService parent_object;
	struct _CamelStorePrivate *priv;
	
	CamelFolder *vtrash;
	
	/* should have cache_lock when accessing this (priv->cache_lock) */
	GHashTable *folders;

	int flags;
};


/* open mode for folder */
#define CAMEL_STORE_FOLDER_CREATE (1<<0)
#define CAMEL_STORE_FOLDER_BODY_INDEX (1<<1)
#define CAMEL_STORE_FOLDER_PRIVATE (1<<2) /* a private folder, that shouldn't show up in unmatched/folder info's, etc */

#define CAMEL_STORE_FOLDER_INFO_FAST       (1 << 0)
#define CAMEL_STORE_FOLDER_INFO_RECURSIVE  (1 << 1)
#define CAMEL_STORE_FOLDER_INFO_SUBSCRIBED (1 << 2)

typedef struct {
	CamelServiceClass parent_class;

	GHashFunc       hash_folder_name;
	GCompareFunc    compare_folder_name;

	CamelFolder *   (*get_folder)               (CamelStore *store,
						     const char *folder_name,
						     guint32 flags,
						     CamelException *ex);
	CamelFolder *   (*get_inbox)                (CamelStore *store,
						     CamelException *ex);
	
	void            (*init_trash)               (CamelStore *store);
	CamelFolder *   (*get_trash)                (CamelStore *store,
						     CamelException *ex);
	
	CamelFolderInfo *(*create_folder)           (CamelStore *store,
						     const char *parent_name,
						     const char *folder_name,
						     CamelException *ex);
	void            (*delete_folder)            (CamelStore *store,
						     const char *folder_name,
						     CamelException *ex);
	void		(*rename_folder)	    (CamelStore *store,
						     const char *old_name,
						     const char *new_name,
						     CamelException *ex);

	void            (*sync)                     (CamelStore *store,
						     CamelException *ex);

	CamelFolderInfo *(*get_folder_info)         (CamelStore *store,
						     const char *top,
						     guint32 flags,
						     CamelException *ex);
	void            (*free_folder_info)         (CamelStore *store,
						     CamelFolderInfo *fi);

	gboolean        (*folder_subscribed)        (CamelStore *store,
						     const char *folder_name);
	void            (*subscribe_folder)         (CamelStore *store,
						     const char *folder_name,
						     CamelException *ex);
	void            (*unsubscribe_folder)       (CamelStore *store,
						     const char *folder_name,
						     CamelException *ex);
} CamelStoreClass;


/* Standard Camel function */
CamelType camel_store_get_type (void);

/* public methods */
CamelFolder *    camel_store_get_folder         (CamelStore *store,
					         const char *folder_name,
						 guint32 flags,
					         CamelException *ex);
CamelFolder *    camel_store_get_inbox          (CamelStore *store,
						 CamelException *ex);
CamelFolder *    camel_store_get_trash          (CamelStore *store,
						 CamelException *ex);

CamelFolderInfo *camel_store_create_folder      (CamelStore *store,
						 const char *parent_name,
						 const char *folder_name,
						 CamelException *ex);
void             camel_store_delete_folder      (CamelStore *store,
						 const char *folder_name,
						 CamelException *ex);
void             camel_store_rename_folder      (CamelStore *store,
						 const char *old_name,
						 const char *new_name,
						 CamelException *ex);

void             camel_store_sync               (CamelStore *store,
						 CamelException *ex);

CamelFolderInfo *camel_store_get_folder_info    (CamelStore *store,
						 const char *top,
						 guint32 flags,
						 CamelException *ex);
void             camel_store_free_folder_info   (CamelStore *store,
						 CamelFolderInfo *fi);

void             camel_store_free_folder_info_full (CamelStore *store,
						    CamelFolderInfo *fi);
void             camel_store_free_folder_info_nop  (CamelStore *store,
						    CamelFolderInfo *fi);

void             camel_folder_info_free            (CamelFolderInfo *fi);
CamelFolderInfo *camel_folder_info_build           (GPtrArray *folders,
						    const char *namespace,
						    char separator,
						    gboolean short_names);

gboolean         camel_store_supports_subscriptions   (CamelStore *store);

gboolean         camel_store_folder_subscribed        (CamelStore *store,
						       const char *folder_name);
void             camel_store_subscribe_folder         (CamelStore *store,
						       const char *folder_name,
						       CamelException *ex);
void             camel_store_unsubscribe_folder       (CamelStore *store,
						       const char *folder_name,
						       CamelException *ex);


/* utility needed by some stores */
int camel_mkdir_hier (const char *path, mode_t mode);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* CAMEL_STORE_H */

<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/?h=gstreamer&amp;id=29e98fda03a61a22e24f6d026d0d91f041e59921'>root</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/textproc?h=gstreamer&amp;id=29e98fda03a61a22e24f6d026d0d91f041e59921'>textproc</a>/<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/textproc/bib2html?h=gstreamer&amp;id=29e98fda03a61a22e24f6d026d0d91f041e59921'>bib2html</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th></th><th class='left'>Commit message (<a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/log/textproc/bib2html?h=gstreamer&amp;id=29e98fda03a61a22e24f6d026d0d91f041e59921&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Age</th><th class='left'>Files</th><th class='left'>Lines</th></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=624ee9c5359e98129191bf0c6a4fc9e68adababa'>Update to 6.7.</a></td><td>mat</td><td><span title='2016-03-08 07:01:26 +0800'>2016-03-08</span></td><td>3</td><td><span class='deletions'>-22</span>/<span class='insertions'>+79</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=f5c820f44ef3ac0da915aa0f52b5b54fddedf017'>Convert LICENSE= "GPLxx # or later" to "GPLxx+"</a></td><td>amdmi3</td><td><span title='2016-01-13 00:20:31 +0800'>2016-01-13</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=22f7514ac919166ba72b426b3e50500eb7045feb'>Mark a few ports BROKEN: unfetchable</a></td><td>antoine</td><td><span title='2015-11-09 20:59:03 +0800'>2015-11-09</span></td><td>1</td><td><span class='deletions'>-0</span>/<span class='insertions'>+2</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=8d98011174773c044603ec9adcc3a06b3f9fe845'>- Fix shebangs</a></td><td>amdmi3</td><td><span title='2015-03-01 23:04:14 +0800'>2015-03-01</span></td><td>1</td><td><span class='deletions'>-3</span>/<span class='insertions'>+7</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=83d0da0a67d5de32918ff5a4eca0e57965927f43'>Reset maintainership:</a></td><td>bapt</td><td><span title='2014-12-03 06:40:56 +0800'>2014-12-03</span></td><td>1</td><td><span class='deletions'>-1</span>/<span class='insertions'>+1</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=9debac461b7729b783ca5a0f5e46461ddac07173'>Change the way Perl modules are installed, update the default Perl to 5.18.</a></td><td>mat</td><td><span title='2014-11-26 21:08:24 +0800'>2014-11-26</span></td><td>1</td><td><span class='deletions'>-5</span>/<span class='insertions'>+4</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=c15ce4262cd4b5a1f84cf34d34bee82dd872eae4'>- Convert to staging</a></td><td>mat</td><td><span title='2014-01-26 08:03:51 +0800'>2014-01-26</span></td><td>1</td><td><span class='deletions'>-17</span>/<span class='insertions'>+10</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=260207ce91e2656af49dbcb8b2556c315389b3a2'>Add NO_STAGE all over the place in preparation for the staging support (cat: ...</a></td><td>bapt</td><td><span title='2013-09-21 07:17:30 +0800'>2013-09-21</span></td><td>1</td><td><span class='deletions'>-0</span>/<span class='insertions'>+1</span></td></tr>
<tr><td class='commitgraph'>* </td><td><a href='/~lantw44/cgit/cgit.cgi/freebsd-ports-gnome/commit/textproc/bib2html?h=gstreamer&amp;id=f577189aa1373816a4191a45bdc9b91646944700'>- convert to the new perl5 framework</a></td><td>az</td><td><span title='2013-09-11 15:12:18 +0800'>2013-09-11</span></td><td>1</td><td><span class='deletions'>-7</span>/<span class='insertions'>+3</span></td></tr>