2004-05-10 12:22:28 +02:00
|
|
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
/*
|
|
|
|
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
|
2009-01-09 18:47:23 +01:00
|
|
|
* Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
|
2001-04-19 14:21:46 +02:00
|
|
|
*
|
|
|
|
* 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
|
2007-07-11 18:38:12 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-04-19 14:21:46 +02:00
|
|
|
* (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
|
2007-07-11 18:38:12 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2001-04-19 14:21:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FOLDER_H__
|
|
|
|
#define __FOLDER_H__
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
typedef struct _Folder Folder;
|
|
|
|
typedef struct _FolderClass FolderClass;
|
2003-06-22 20:25:59 +02:00
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
typedef struct _FolderItem FolderItem;
|
2003-06-22 20:25:59 +02:00
|
|
|
typedef struct _FolderUpdateData FolderUpdateData;
|
2002-12-02 22:50:19 +01:00
|
|
|
typedef struct _FolderItemUpdateData FolderItemUpdateData;
|
2004-01-12 22:28:31 +01:00
|
|
|
typedef struct _PersistPrefs PersistPrefs;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
#define FOLDER(obj) ((Folder *)obj)
|
2003-04-05 22:38:53 +02:00
|
|
|
#define FOLDER_CLASS(obj) (FOLDER(obj)->klass)
|
2004-01-12 22:28:31 +01:00
|
|
|
#define FOLDER_TYPE(obj) (FOLDER(obj)->klass->type)
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-08-16 13:28:10 +02:00
|
|
|
#define FOLDER_IS_LOCAL(obj) (FOLDER_TYPE(obj) == F_MH || \
|
|
|
|
FOLDER_TYPE(obj) == F_MBOX || \
|
|
|
|
FOLDER_TYPE(obj) == F_MAILDIR)
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
#define FOLDER_ITEM(obj) ((FolderItem *)obj)
|
|
|
|
|
2003-06-22 20:25:59 +02:00
|
|
|
#define FOLDER_UPDATE_HOOKLIST "folder_update"
|
2002-12-03 00:06:13 +01:00
|
|
|
#define FOLDER_ITEM_UPDATE_HOOKLIST "folder_item_update"
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
F_MH,
|
|
|
|
F_MBOX,
|
|
|
|
F_MAILDIR,
|
|
|
|
F_IMAP,
|
|
|
|
F_NEWS,
|
|
|
|
F_UNKNOWN
|
|
|
|
} FolderType;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
F_NORMAL,
|
|
|
|
F_INBOX,
|
|
|
|
F_OUTBOX,
|
|
|
|
F_DRAFT,
|
|
|
|
F_QUEUE,
|
|
|
|
F_TRASH
|
|
|
|
} SpecialFolderItemType;
|
|
|
|
|
2002-06-03 08:03:31 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SORT_BY_NONE,
|
|
|
|
SORT_BY_NUMBER,
|
|
|
|
SORT_BY_SIZE,
|
|
|
|
SORT_BY_DATE,
|
|
|
|
SORT_BY_FROM,
|
|
|
|
SORT_BY_SUBJECT,
|
|
|
|
SORT_BY_SCORE,
|
|
|
|
SORT_BY_LABEL,
|
|
|
|
SORT_BY_MARK,
|
2003-01-26 13:56:56 +01:00
|
|
|
SORT_BY_STATUS,
|
2002-06-03 08:03:31 +02:00
|
|
|
SORT_BY_MIME,
|
2002-12-26 01:40:41 +01:00
|
|
|
SORT_BY_TO,
|
2007-07-02 18:35:40 +02:00
|
|
|
SORT_BY_LOCKED,
|
2007-07-02 20:15:53 +02:00
|
|
|
SORT_BY_TAGS,
|
|
|
|
SORT_BY_THREAD_DATE
|
2002-06-03 08:03:31 +02:00
|
|
|
} FolderSortKey;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SORT_ASCENDING,
|
|
|
|
SORT_DESCENDING
|
|
|
|
} FolderSortType;
|
|
|
|
|
2002-11-15 20:51:25 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
2003-03-14 02:38:17 +01:00
|
|
|
F_MOVE_OK = 0,
|
|
|
|
F_MOVE_FAILED_DEST_IS_PARENT = -1,
|
|
|
|
F_MOVE_FAILED_DEST_IS_CHILD = -2,
|
|
|
|
F_MOVE_FAILED_DEST_OUTSIDE_MAILBOX = -3,
|
2005-09-14 10:11:20 +02:00
|
|
|
F_MOVE_FAILED = -4
|
2003-03-14 02:38:17 +01:00
|
|
|
} FolderItemMoveResult;
|
2002-11-15 20:51:25 +01:00
|
|
|
|
2003-06-22 20:25:59 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2004-05-10 12:22:28 +02:00
|
|
|
FOLDER_ADD_FOLDER = 1 << 0,
|
|
|
|
FOLDER_REMOVE_FOLDER = 1 << 1,
|
2004-02-21 12:01:01 +01:00
|
|
|
FOLDER_TREE_CHANGED = 1 << 2,
|
2004-05-10 12:22:28 +02:00
|
|
|
FOLDER_ADD_FOLDERITEM = 1 << 3,
|
2006-03-07 10:55:13 +01:00
|
|
|
FOLDER_REMOVE_FOLDERITEM = 1 << 4,
|
|
|
|
FOLDER_RENAME_FOLDERITEM = 1 << 5
|
2003-06-22 20:25:59 +02:00
|
|
|
} FolderUpdateFlags;
|
|
|
|
|
2003-01-07 22:49:44 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
F_ITEM_UPDATE_MSGCNT = 1 << 0,
|
|
|
|
F_ITEM_UPDATE_CONTENT = 1 << 1,
|
2004-06-25 10:05:09 +02:00
|
|
|
F_ITEM_UPDATE_ADDMSG = 1 << 2,
|
|
|
|
F_ITEM_UPDATE_REMOVEMSG = 1 << 3,
|
2005-09-14 10:11:20 +02:00
|
|
|
F_ITEM_UPDATE_NAME = 1 << 4
|
2003-01-07 22:49:44 +01:00
|
|
|
} FolderItemUpdateFlags;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
typedef void (*FolderUIFunc) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gpointer data);
|
|
|
|
typedef void (*FolderDestroyNotify) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gpointer data);
|
2004-05-10 12:22:28 +02:00
|
|
|
typedef void (*FolderItemFunc) (FolderItem *item,
|
2002-06-30 01:33:42 +02:00
|
|
|
gpointer data);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
|
2003-07-20 03:15:54 +02:00
|
|
|
#include "folder_item_prefs.h"
|
2003-03-18 19:24:34 +01:00
|
|
|
|
|
|
|
#include "procmsg.h"
|
|
|
|
#include "msgcache.h"
|
2004-01-12 22:28:31 +01:00
|
|
|
#include "xml.h"
|
|
|
|
#include "prefs_account.h"
|
2003-03-18 19:24:34 +01:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
struct _Folder
|
|
|
|
{
|
2003-04-05 22:38:53 +02:00
|
|
|
FolderClass *klass;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
gchar *name;
|
|
|
|
PrefsAccount *account;
|
2004-05-10 12:22:28 +02:00
|
|
|
guint sort;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
FolderItem *inbox;
|
|
|
|
FolderItem *outbox;
|
|
|
|
FolderItem *draft;
|
|
|
|
FolderItem *queue;
|
|
|
|
FolderItem *trash;
|
|
|
|
|
|
|
|
FolderUIFunc ui_func;
|
|
|
|
gpointer ui_func_data;
|
|
|
|
|
|
|
|
GNode *node;
|
|
|
|
|
|
|
|
gpointer data;
|
|
|
|
|
2002-03-17 10:50:46 +01:00
|
|
|
GHashTable *newsart;
|
2003-03-12 16:40:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _FolderClass
|
|
|
|
{
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* A numeric identifier for the FolderClass. Will be removed in the future
|
|
|
|
*/
|
2003-03-12 16:40:51 +01:00
|
|
|
FolderType type;
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* A string identifier for the FolderClass. Currently used in folderlist.xml.
|
|
|
|
* Should be lowercase.
|
|
|
|
*/
|
2003-03-12 16:40:51 +01:00
|
|
|
gchar *idstr;
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* A string for the User Interface that identifies the FolderClass to the
|
|
|
|
* user. Can be upper and lowercase unlike the idstr.
|
|
|
|
*/
|
2003-03-13 22:21:39 +01:00
|
|
|
gchar *uistr;
|
2004-05-10 12:22:28 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
/* virtual functions */
|
2003-03-13 16:31:22 +01:00
|
|
|
|
|
|
|
/* Folder funtions */
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Create a new \c Folder of this \c FolderClass.
|
|
|
|
*
|
|
|
|
* \param name The name of the new Folder
|
|
|
|
* \param path The path of the new Folder
|
|
|
|
* \return The new \c Folder, or \c NULL when creating the \c Folder
|
|
|
|
* failed
|
|
|
|
*/
|
2003-04-05 22:38:53 +02:00
|
|
|
Folder *(*new_folder) (const gchar *name,
|
2003-03-13 16:31:22 +01:00
|
|
|
const gchar *path);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Destroy a \c Folder of this \c FolderClass, frees all resources
|
|
|
|
* allocated by the Folder
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder that should be destroyed.
|
|
|
|
*/
|
2003-04-05 22:38:53 +02:00
|
|
|
void (*destroy_folder) (Folder *folder);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Set the Folder's internal attributes from an \c XMLTag. Also sets the
|
|
|
|
* parameters of the root-FolderItem of the \c Folder. If \c NULL
|
|
|
|
* the default function of the basic \¢ FolderClass is used, so it
|
|
|
|
* must not be \c NULL if one of the parent \c FolderClasses has a \c set_xml
|
|
|
|
* function. In that case the parent \c FolderClass' \c set_xml function
|
|
|
|
* can be used or it has to be called with the \c folder and \c tag by
|
|
|
|
* the implementation.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder which's attributes should be updated
|
|
|
|
* \param tag The \c XMLTag containing the \c XMLAttrs for the attributes
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
void (*set_xml) (Folder *folder,
|
|
|
|
XMLTag *tag);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get an \c XMLTag for the attributes of the \c Folder and the root-FolderItem
|
|
|
|
* of the \c Folder. If \c NULL the default implementation for the basic
|
|
|
|
* FolderClass will be used, so it must not be \c NULL if one of the
|
|
|
|
* parent \c FolderClasses has it's own implementation for \c get_xml.
|
|
|
|
* In that case the parent FolderClass' \c get_xml function can be
|
|
|
|
* used or the \c XMLTag has to be fetched from the parent's \c get_xml
|
|
|
|
* function and then the \c FolderClass specific attributes can be
|
|
|
|
* added to it.
|
|
|
|
*
|
|
|
|
* \param Folder The \c Folder which's attributes should be set in the
|
|
|
|
* \c XMLTag's \c XMLAttrs
|
|
|
|
* \return XMLTag An \c XMLTag with \c XMLAttrs containing the \c Folder's
|
|
|
|
* attributes.
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
XMLTag *(*get_xml) (Folder *folder);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Rebuild the folder tree from the folder's data
|
|
|
|
* \todo New implementations of MH and IMAP are actually syncronizing
|
|
|
|
* the tree with the folder by reusing the old \c FolderItems.
|
|
|
|
* Claws still destroys the old tree before calling this function.
|
|
|
|
*
|
|
|
|
* \param folder The folder which's tree should be rebuild
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
gint (*scan_tree) (Folder *folder);
|
2003-03-13 16:31:22 +01:00
|
|
|
|
|
|
|
gint (*create_tree) (Folder *folder);
|
|
|
|
|
|
|
|
/* FolderItem functions */
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Create a new \c FolderItem structure for the \c FolderClass.
|
|
|
|
* \c FolderClasses can have their own \c FolderItem structure with
|
|
|
|
* extra attributes.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder for that a \c FolderItem should be
|
|
|
|
* created
|
|
|
|
* \return The new \c FolderItem or NULL in case of an error
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *(*item_new) (Folder *folder);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Destroy a \c FolderItem from this \c FolderClass. The \c FolderClass
|
|
|
|
* has to free all private resources used by the \c FolderItem.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the \c FolderItem
|
|
|
|
* \param item The \c FolderItem that should be destroyed
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
void (*item_destroy) (Folder *folder,
|
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Set the \c FolderItem's internal attributes from an \c XMLTag. If
|
|
|
|
* \c NULL the default function of the basic \c FolderClass is used, so it
|
|
|
|
* must not be \c NULL if one of the parent \c FolderClasses has a \c item_set_xml
|
|
|
|
* function. In that case the parent \c FolderClass' \c item_set_xml function
|
|
|
|
* can be used or it has to be called with the \c folder, \c item and \c tag by
|
|
|
|
* the implementation.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the \c FolderItem
|
|
|
|
* \param item The \c FolderItems which's attributes should be set
|
|
|
|
* \param tag The \c XMLTag with \c XMLAttrs for the \c FolderItem's
|
|
|
|
* attributes
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
void (*item_set_xml) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
XMLTag *tag);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get an \c XMLTag for the attributes of the \c FolderItem If \c NULL
|
|
|
|
* the default implementation for the basic \c FolderClass will be used,
|
|
|
|
* so it must not be \c NULL if one of the parent \c FolderClasses has
|
|
|
|
* it's own implementation for \c item_get_xml. In that case the parent
|
|
|
|
* FolderClass' \c item_get_xml function can be used or the \c XMLTag
|
|
|
|
* has to be fetched from the parent's \c item_get_xml function and
|
|
|
|
* then the \c FolderClass specific attributes can be added to it.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the \c FolderItem
|
|
|
|
* \parem item The \c FolderItem which's attributes should be set in
|
|
|
|
* the \c XMLTag's \c XMLAttrs
|
|
|
|
* \return An \c XMLTag with \c XMLAttrs containing the \c FolderItem's
|
|
|
|
* attributes.
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
XMLTag *(*item_get_xml) (Folder *folder,
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get a local path for the \c FolderItem where Sylpheed can save
|
|
|
|
* it's cache data. For local directory based folders this can be the
|
|
|
|
* real path. For other folders it can be the local cache directory.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the \c FolderItem
|
|
|
|
* \param item The \c FolderItem for that a path should be returned
|
|
|
|
* \return A path for the \c FolderItem
|
|
|
|
*/
|
2003-07-03 22:37:07 +02:00
|
|
|
gchar *(*item_get_path) (Folder *folder,
|
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Create a new \c FolderItem. The function must use folder_item_append
|
|
|
|
* to add the new \c FolderItem to the folder tree
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder in which a new \c FolderItem should be
|
|
|
|
* created
|
|
|
|
* \param parent \c The parent \c FolderItem for the new \c FolderItem
|
|
|
|
* \parem name The name for the new \c FolderItem
|
|
|
|
* \return The new \c FolderItem
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *(*create_folder) (Folder *folder,
|
|
|
|
FolderItem *parent,
|
|
|
|
const gchar *name);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Rename a \c FolderItem
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the \c FolderItem that should be
|
|
|
|
* renamed
|
|
|
|
* \param item The \c FolderItem that should be renamed
|
|
|
|
* \param name The new name of the \c FolderItem
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
gint (*rename_folder) (Folder *folder,
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *item,
|
|
|
|
const gchar *name);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Remove a \c FolderItem from the \c Folder
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder that contains the \c FolderItem
|
|
|
|
* \param item The \c FolderItem that should be removed
|
|
|
|
* \return 0 on sucess, a negative number otherwise
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
gint (*remove_folder) (Folder *folder,
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Close a \c FolderItem. Called when the user deselects a
|
|
|
|
* \c FolderItem.
|
|
|
|
*
|
|
|
|
* \attention In Sylpheed-Main operations can only be done on the
|
|
|
|
* \c FolderItem that is opened in the SummaryView. This
|
|
|
|
* \c FolderItem will be closed when you select a new
|
|
|
|
* \c FolderItem in the FolderView. In Claws operations can
|
|
|
|
* be done any time on any folder and you should not expect
|
|
|
|
* that all \c FolderItems get closed after operations
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder that contains the \c FolderItem
|
|
|
|
* \param item The \c FolderItem that should be closed
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
gint (*close) (Folder *folder,
|
2003-07-26 21:07:16 +02:00
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get the list of message numbers for the messages in the \c FolderItem
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder that contains the \c FolderItem
|
|
|
|
* \param item The \c FolderItem for which the message numbers should
|
|
|
|
* be fetched
|
|
|
|
* \param list Pointer to a GSList where message numbers have to be
|
|
|
|
* added. Because of the implementation of the GSList that
|
|
|
|
* changes the pointer of the GSList itself when the first
|
|
|
|
* item is added this is a pointer to a pointer to a
|
|
|
|
* GSList structure. Use *item = g_slist_...(*item, ...)
|
|
|
|
* operations to modify the list.
|
|
|
|
* \param old_uids_valid In some \c Folders the old UIDs can be invalid.
|
|
|
|
* Set this pointer to a gboolean to TRUE if the
|
|
|
|
* old UIDs are still valid, otherwise set it to
|
|
|
|
* FALSE and the folder system will discard it's
|
|
|
|
* cache data of the previously know UIDs
|
|
|
|
* \return The number of message numbers add to the list on success,
|
|
|
|
* a negative number otherwise.
|
|
|
|
*/
|
2004-01-12 22:28:31 +01:00
|
|
|
gint (*get_num_list) (Folder *folder,
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *item,
|
2003-08-21 22:08:27 +02:00
|
|
|
GSList **list,
|
|
|
|
gboolean *old_uids_valid);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Tell the folder system if a \c FolderItem should be scanned
|
|
|
|
* (cache data syncronized with the folder content) when it is required
|
|
|
|
* because the \c FolderItem's content changed. If NULL the folder
|
|
|
|
* system will not do automatic scanning of \c FolderItems
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder that contains the \c FolderItem
|
|
|
|
* \param item The \c FolderItem which's content should be checked
|
|
|
|
* \return TRUE if the \c FolderItem should be scanned, FALSE otherwise
|
|
|
|
*/
|
2003-08-21 22:08:27 +02:00
|
|
|
gboolean (*scan_required) (Folder *folder,
|
|
|
|
FolderItem *item);
|
2007-09-26 09:53:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Updates the known mtime of a folder
|
|
|
|
*/
|
|
|
|
void (*set_mtime) (Folder *folder,
|
|
|
|
FolderItem *item);
|
2003-03-13 16:31:22 +01:00
|
|
|
|
|
|
|
/* Message functions */
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get a MsgInfo for a message in a \c FolderItem
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder containing the message
|
|
|
|
* \param item The \c FolderItem containing the message
|
|
|
|
* \param num The message number of the message
|
|
|
|
* \return A pointer to a \c MsgInfo decribing the message or \c
|
|
|
|
* NULL in case of an error
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
MsgInfo *(*get_msginfo) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gint num);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get \c MsgInfos for a list of message numbers
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder containing the message
|
|
|
|
* \param item The \c FolderItem containing the message
|
|
|
|
* \param msgnum_list A list of message numbers for which the
|
|
|
|
* \c MsgInfos should be fetched
|
|
|
|
* \return A list of \c MsgInfos for the messages in the \c msgnum_list
|
|
|
|
* that really exist. Messages that are not found can simply
|
|
|
|
* be left out.
|
|
|
|
*/
|
|
|
|
MsgInfoList *(*get_msginfos) (Folder *folder,
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *item,
|
2003-04-05 22:38:53 +02:00
|
|
|
MsgNumberList *msgnum_list);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get the filename for a message. This can either be the real message
|
|
|
|
* file for local folders or a temporary file for remote folders.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder containing the message
|
|
|
|
* \param item The \c FolderItem containing the message
|
|
|
|
* \param num The message number of the message
|
|
|
|
* \return A string with the filename of the message file. The returned
|
|
|
|
* string has to be freed with \c g_free(). If message is not
|
|
|
|
* available return NULL.
|
|
|
|
*/
|
|
|
|
gchar *(*fetch_msg) (Folder *folder,
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderItem *item,
|
|
|
|
gint num);
|
2005-06-13 21:37:01 +02:00
|
|
|
gchar *(*fetch_msg_full) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gint num,
|
|
|
|
gboolean headers,
|
|
|
|
gboolean body);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Add a single message file to a folder with the given flags (if
|
|
|
|
* flag handling is supported by the folder)
|
|
|
|
*
|
|
|
|
* \param folder The target \c Folder for the message
|
|
|
|
* \param dest the target \c FolderItem for the message
|
|
|
|
* \param file The file that contains the message
|
|
|
|
* \param flags The flags the new message should have in the folder
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
gint (*add_msg) (Folder *folder,
|
|
|
|
FolderItem *dest,
|
2003-07-26 20:30:25 +02:00
|
|
|
const gchar *file,
|
|
|
|
MsgFlags *flags);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Add multiple messages to a \c FolderItem. If NULL the folder
|
|
|
|
* system will add messages with \c add_msg one by one
|
|
|
|
*
|
|
|
|
* \param folder The target \c Folder for the messages
|
|
|
|
* \param dest the target \c FolderItem for the messages
|
|
|
|
* \param file_list A list of \c MsgFileInfos which contain the
|
|
|
|
* filenames and flags for the new messages
|
|
|
|
* \param relation Insert tuples of (MsgFileInfo, new message number) to
|
|
|
|
* provide feedback for the folder system which new
|
|
|
|
* message number a \c MsgFileInfo got in dest. Insert
|
|
|
|
* 0 if the new message number is unknown.
|
|
|
|
*/
|
2003-07-23 16:51:47 +02:00
|
|
|
gint (*add_msgs) (Folder *folder,
|
|
|
|
FolderItem *dest,
|
|
|
|
GSList *file_list,
|
2003-07-28 17:47:24 +02:00
|
|
|
GRelation *relation);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Copy a message to a FolderItem
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the destination FolderItem
|
|
|
|
* \param dest The destination \c FolderItem for the message
|
|
|
|
* \param msginfo The message that should be copied
|
|
|
|
* \return The message number the copied message got, 0 if it is
|
|
|
|
* unknown because message numbers are assigned by an external
|
|
|
|
* system and not available after copying or a negative number
|
|
|
|
* if an error occuried
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
gint (*copy_msg) (Folder *folder,
|
|
|
|
FolderItem *dest,
|
|
|
|
MsgInfo *msginfo);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Copy multiple messages to a \c FolderItem. If \c NULL the folder
|
|
|
|
* system will use \c copy_msg to copy messages one by one.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the destination FolderItem
|
|
|
|
* \param dest The destination \c FolderItem for the message
|
|
|
|
* \param msglist A list of \c MsgInfos which should be copied to dest
|
|
|
|
* \param relation Insert tuples of (MsgInfo, new message number) to
|
|
|
|
* provide feedback for the folder system which new
|
|
|
|
* message number a \c MsgInfo got in dest. Insert
|
|
|
|
* 0 if the new message number is unknown.
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
2003-07-26 19:01:47 +02:00
|
|
|
gint (*copy_msgs) (Folder *folder,
|
|
|
|
FolderItem *dest,
|
|
|
|
MsgInfoList *msglist,
|
2003-07-28 17:47:24 +02:00
|
|
|
GRelation *relation);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Remove a message from a \c FolderItem.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the message
|
|
|
|
* \param item The \c FolderItem containing the message
|
|
|
|
* \param num The message number of the message
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
gint (*remove_msg) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gint num);
|
2005-06-12 20:59:21 +02:00
|
|
|
gint (*remove_msgs) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
MsgInfoList *msglist,
|
|
|
|
GRelation *relation);
|
2009-03-30 19:20:02 +02:00
|
|
|
gint (*expunge) (Folder *folder,
|
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Remove all messages in a \ c FolderItem
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the \c FolderItem
|
|
|
|
* \param item The \FolderItem which's messages should be deleted
|
|
|
|
* \return 0 on succes, a negative number otherwise
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
gint (*remove_all_msg) (Folder *folder,
|
|
|
|
FolderItem *item);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Check if a message has been modified by someone else
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the message
|
|
|
|
* \param item The \c FolderItem containing the message
|
|
|
|
* \param msginfo The \c MsgInfo for the message that should be checked
|
|
|
|
* \return \c TRUE if the message was modified, \c FALSE otherwise
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
gboolean (*is_msg_changed) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
MsgInfo *msginfo);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Update a message's flags in the folder data. If NULL only the
|
|
|
|
* internal flag management will be used. The function has to set
|
|
|
|
* \c msginfo->flags.perm_flags. It does not have to set the flags
|
|
|
|
* that it got as \c newflags. If a flag can not be set in this
|
|
|
|
* \c FolderClass the function can refuse to set it. Flags that are not
|
|
|
|
* supported by the \c FolderClass should not be refused. They will be
|
|
|
|
* managed by the internal cache in this case.
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the message
|
|
|
|
* \param item The \c FolderItem of the message
|
|
|
|
* \param msginfo The \c MsgInfo for the message which's flags should be
|
|
|
|
* updated
|
|
|
|
* \param newflags The flags the message should get
|
|
|
|
*/
|
2003-03-13 16:31:22 +01:00
|
|
|
void (*change_flags) (Folder *folder,
|
|
|
|
FolderItem *item,
|
2003-03-18 19:24:34 +01:00
|
|
|
MsgInfo *msginfo,
|
|
|
|
MsgPermFlags newflags);
|
2004-05-10 12:22:28 +02:00
|
|
|
/**
|
|
|
|
* Get the flags for a list of messages. Flags that are not supported
|
|
|
|
* by the folder should be preserved. They can be copied from
|
|
|
|
* \c msginfo->flags.perm_flags
|
|
|
|
*
|
|
|
|
* \param folder The \c Folder of the messages
|
|
|
|
* \param item The \c FolderItem of the messages
|
|
|
|
* \param msglist The list of \c MsgInfos for which the flags should
|
|
|
|
* be returned
|
|
|
|
* \param msgflags A \c GRelation for tuples of (MsgInfo, new permanent
|
|
|
|
* flags for MsgInfo). Add tuples for the messages in msglist
|
|
|
|
* \return 0 on success, a negative number otherwise
|
|
|
|
*/
|
|
|
|
gint (*get_flags) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
MsgInfoList *msglist,
|
|
|
|
GRelation *msgflags);
|
2005-06-13 21:37:01 +02:00
|
|
|
|
2006-10-31 19:44:35 +01:00
|
|
|
/* Sets batch mode for a FolderItem. It means that numerous flags updates
|
|
|
|
* could follow, and the FolderClass implementation can cache them in order
|
|
|
|
* to process them later when set_false will be called again with the
|
|
|
|
* batch parameter set to FALSE.
|
|
|
|
*/
|
2005-06-13 21:37:01 +02:00
|
|
|
void (*set_batch) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
gboolean batch);
|
2006-10-31 19:44:35 +01:00
|
|
|
/* Called when switching offline or asking for synchronisation. the imple
|
|
|
|
* mentation should do what's necessary to be able to read mails present
|
|
|
|
* in the FolderItem at this time with no network connectivity.
|
2007-07-20 18:20:59 +02:00
|
|
|
* Days: max number of days of mail to fetch.
|
2006-10-31 19:44:35 +01:00
|
|
|
*/
|
2007-07-20 18:20:59 +02:00
|
|
|
void (*synchronise) (FolderItem *item,
|
|
|
|
gint days);
|
2006-10-31 19:44:35 +01:00
|
|
|
|
2006-11-07 11:47:23 +01:00
|
|
|
/* Passed from claws-mail --subscribe scheme://uri. Implementations
|
2006-10-31 19:44:35 +01:00
|
|
|
* should check if they handle this type of URI, and return TRUE in this
|
|
|
|
* case after having subscribed it.
|
|
|
|
*/
|
2006-01-12 21:01:48 +01:00
|
|
|
gboolean (*subscribe) (Folder *folder,
|
|
|
|
const gchar *uri);
|
2006-10-31 19:44:35 +01:00
|
|
|
|
|
|
|
/* Gets the preferred sort key and type for a folderclass. */
|
2006-10-04 08:18:28 +02:00
|
|
|
void (*get_sort_type) (Folder *folder,
|
|
|
|
FolderSortKey *sort_key,
|
|
|
|
FolderSortType *sort_type);
|
2006-10-31 19:44:35 +01:00
|
|
|
|
|
|
|
/* Copies internal FolderItem data from one folderItem to another. Used
|
|
|
|
* when moving folders (this move is in reality a folder creation, content
|
|
|
|
* move, folder delettion).
|
|
|
|
*/
|
|
|
|
void (*copy_private_data) (Folder *folder,
|
|
|
|
FolderItem *src,
|
|
|
|
FolderItem *dest);
|
2007-07-20 18:20:59 +02:00
|
|
|
|
|
|
|
void (*remove_cached_msg) (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
MsgInfo *msginfo);
|
2007-11-26 23:30:58 +01:00
|
|
|
void (*commit_tags) (FolderItem *item,
|
|
|
|
MsgInfo *msginfo,
|
|
|
|
GSList *tags_set,
|
|
|
|
GSList *tags_unset);
|
2008-03-05 18:25:15 +01:00
|
|
|
void (*item_opened) (FolderItem *item);
|
|
|
|
void (*item_closed) (FolderItem *item);
|
2001-04-19 14:21:46 +02:00
|
|
|
};
|
|
|
|
|
2007-12-03 18:32:15 +01:00
|
|
|
enum {
|
|
|
|
ITEM_NOT_SCANNING,
|
|
|
|
ITEM_SCANNING_WITH_FLAGS,
|
|
|
|
ITEM_SCANNING
|
|
|
|
};
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
struct _FolderItem
|
|
|
|
{
|
|
|
|
SpecialFolderItemType stype;
|
|
|
|
|
2003-10-05 12:10:30 +02:00
|
|
|
gchar *name; /* UTF-8 */
|
|
|
|
gchar *path; /* UTF-8 */
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
time_t mtime;
|
|
|
|
|
2003-04-05 22:38:53 +02:00
|
|
|
gint new_msgs;
|
|
|
|
gint unread_msgs;
|
|
|
|
gint total_msgs;
|
|
|
|
gint unreadmarked_msgs;
|
2005-07-01 19:33:02 +02:00
|
|
|
gint marked_msgs;
|
2008-03-12 07:22:29 +01:00
|
|
|
gint replied_msgs;
|
|
|
|
gint forwarded_msgs;
|
|
|
|
gint locked_msgs;
|
|
|
|
gint ignored_msgs;
|
|
|
|
gint watched_msgs;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-03-28 21:51:06 +02:00
|
|
|
gint order;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gint last_num;
|
|
|
|
|
2002-06-30 01:33:42 +02:00
|
|
|
MsgCache *cache;
|
2009-03-16 18:59:26 +01:00
|
|
|
gboolean cache_dirty;
|
|
|
|
gboolean mark_dirty;
|
|
|
|
gboolean tags_dirty;
|
2002-06-30 01:33:42 +02:00
|
|
|
|
2001-07-10 18:14:23 +02:00
|
|
|
/* special flags */
|
2001-12-11 16:06:46 +01:00
|
|
|
guint no_sub : 1; /* no child allowed? */
|
|
|
|
guint no_select : 1; /* not selectable? */
|
|
|
|
guint collapsed : 1; /* collapsed item */
|
2003-01-25 02:30:03 +01:00
|
|
|
guint thread_collapsed : 1; /* collapsed item */
|
2001-12-11 16:06:46 +01:00
|
|
|
guint threaded : 1; /* threaded folder view */
|
|
|
|
guint hide_read_msgs : 1; /* hide read messages */
|
|
|
|
guint ret_rcpt : 1; /* return receipt */
|
2005-01-21 11:25:14 +01:00
|
|
|
guint search_match : 1;
|
2009-03-30 19:20:02 +02:00
|
|
|
guint hide_del_msgs : 1; /* hide deleted messages */
|
2001-06-28 10:44:31 +02:00
|
|
|
|
2001-07-31 08:17:48 +02:00
|
|
|
gint op_count;
|
2003-01-07 22:49:44 +01:00
|
|
|
guint opened : 1; /* opened by summary view */
|
|
|
|
FolderItemUpdateFlags update_flags; /* folderview for this folder should be updated */
|
2001-07-31 08:17:48 +02:00
|
|
|
|
2002-06-03 08:03:31 +02:00
|
|
|
FolderSortKey sort_key;
|
|
|
|
FolderSortType sort_type;
|
|
|
|
|
2003-08-25 16:14:47 +02:00
|
|
|
GNode *node;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
Folder *folder;
|
|
|
|
|
2002-10-13 16:12:29 +02:00
|
|
|
PrefsAccount *account;
|
|
|
|
|
|
|
|
gboolean apply_sub;
|
|
|
|
|
2002-04-03 10:58:44 +02:00
|
|
|
GSList *mark_queue;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gpointer data;
|
2001-05-06 06:27:28 +02:00
|
|
|
|
2003-07-20 03:15:54 +02:00
|
|
|
FolderItemPrefs * prefs;
|
2005-08-08 18:45:29 +02:00
|
|
|
|
|
|
|
/* for faster search of special parents */
|
|
|
|
SpecialFolderItemType parent_stype;
|
2005-10-08 12:38:28 +02:00
|
|
|
gboolean processing_pending;
|
2007-12-03 18:32:15 +01:00
|
|
|
gint scanning;
|
2007-05-15 20:45:52 +02:00
|
|
|
guint last_seen;
|
2001-04-19 14:21:46 +02:00
|
|
|
};
|
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
struct _PersistPrefs
|
|
|
|
{
|
2002-06-16 20:16:57 +02:00
|
|
|
FolderSortKey sort_key;
|
|
|
|
FolderSortType sort_type;
|
|
|
|
guint collapsed : 1;
|
2003-01-25 02:30:03 +01:00
|
|
|
guint thread_collapsed : 1;
|
2002-06-16 20:16:57 +02:00
|
|
|
guint threaded : 1;
|
|
|
|
guint hide_read_msgs : 1; /* CLAWS */
|
|
|
|
guint ret_rcpt : 1; /* CLAWS */
|
2009-03-30 19:20:02 +02:00
|
|
|
guint hide_del_msgs : 1; /* CLAWS */
|
2004-01-12 22:28:31 +01:00
|
|
|
};
|
2001-12-30 02:27:14 +01:00
|
|
|
|
2003-06-22 20:25:59 +02:00
|
|
|
struct _FolderUpdateData
|
|
|
|
{
|
|
|
|
Folder *folder;
|
|
|
|
FolderUpdateFlags update_flags;
|
2003-09-08 12:33:11 +02:00
|
|
|
FolderItem *item;
|
2003-06-22 20:25:59 +02:00
|
|
|
};
|
|
|
|
|
2002-12-02 22:50:19 +01:00
|
|
|
struct _FolderItemUpdateData
|
|
|
|
{
|
2003-01-07 22:49:44 +01:00
|
|
|
FolderItem *item;
|
|
|
|
FolderItemUpdateFlags update_flags;
|
2004-06-25 10:05:09 +02:00
|
|
|
MsgInfo *msg;
|
2002-12-02 22:50:19 +01:00
|
|
|
};
|
|
|
|
|
2003-05-13 13:54:19 +02:00
|
|
|
void folder_system_init (void);
|
2003-04-05 22:38:53 +02:00
|
|
|
void folder_register_class (FolderClass *klass);
|
2004-02-21 12:01:01 +01:00
|
|
|
void folder_unregister_class (FolderClass *klass);
|
2003-03-13 16:31:22 +01:00
|
|
|
Folder *folder_new (FolderClass *type,
|
2002-01-16 12:48:36 +01:00
|
|
|
const gchar *name,
|
|
|
|
const gchar *path);
|
2004-01-12 22:28:31 +01:00
|
|
|
void folder_init (Folder *folder,
|
|
|
|
const gchar *name);
|
2002-01-16 12:48:36 +01:00
|
|
|
|
|
|
|
void folder_destroy (Folder *folder);
|
2004-01-12 22:28:31 +01:00
|
|
|
|
|
|
|
void folder_set_xml (Folder *folder,
|
|
|
|
XMLTag *tag);
|
|
|
|
XMLTag *folder_get_xml (Folder *folder);
|
2001-12-30 02:27:14 +01:00
|
|
|
|
2003-08-26 09:13:40 +02:00
|
|
|
FolderItem *folder_item_new (Folder *folder,
|
|
|
|
const gchar *name,
|
|
|
|
const gchar *path);
|
|
|
|
void folder_item_append (FolderItem *parent,
|
|
|
|
FolderItem *item);
|
|
|
|
void folder_item_remove (FolderItem *item);
|
|
|
|
void folder_item_remove_children (FolderItem *item);
|
|
|
|
void folder_item_destroy (FolderItem *item);
|
2004-02-21 12:01:01 +01:00
|
|
|
FolderItem *folder_item_parent (FolderItem *item);
|
2002-01-16 12:48:36 +01:00
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
void folder_item_set_xml (Folder *folder,
|
|
|
|
FolderItem *item,
|
|
|
|
XMLTag *tag);
|
|
|
|
XMLTag *folder_item_get_xml (Folder *folder,
|
|
|
|
FolderItem *item);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void folder_set_ui_func (Folder *folder,
|
|
|
|
FolderUIFunc func,
|
|
|
|
gpointer data);
|
|
|
|
void folder_set_name (Folder *folder,
|
|
|
|
const gchar *name);
|
2004-05-10 12:22:28 +02:00
|
|
|
void folder_set_sort (Folder *folder,
|
|
|
|
guint sort);
|
2001-04-19 14:21:46 +02:00
|
|
|
void folder_tree_destroy (Folder *folder);
|
|
|
|
|
|
|
|
void folder_add (Folder *folder);
|
2004-05-10 12:22:28 +02:00
|
|
|
void folder_remove (Folder *folder);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-11-26 08:53:20 +01:00
|
|
|
GList *folder_get_list (void);
|
|
|
|
gint folder_read_list (void);
|
|
|
|
void folder_write_list (void);
|
2005-10-05 21:26:02 +02:00
|
|
|
void folder_scan_tree (Folder *folder, gboolean rebuild);
|
2007-01-17 18:35:04 +01:00
|
|
|
void folder_fast_scan_tree (Folder *folder);
|
2002-10-07 23:47:32 +02:00
|
|
|
FolderItem *folder_create_folder(FolderItem *parent, const gchar *name);
|
2004-05-10 12:22:28 +02:00
|
|
|
gint folder_item_rename (FolderItem *item, gchar *newname);
|
2001-11-23 16:58:59 +01:00
|
|
|
void folder_update_op_count (void);
|
2002-06-30 01:33:42 +02:00
|
|
|
void folder_func_to_all_folders (FolderItemFunc function,
|
|
|
|
gpointer data);
|
2005-07-01 19:33:02 +02:00
|
|
|
void folder_count_total_msgs(guint *new_msgs, guint *unread_msgs,
|
|
|
|
guint *unreadmarked_msgs, guint *marked_msgs,
|
2008-03-12 07:22:29 +01:00
|
|
|
guint *total_msgs, guint *replied_msgs,
|
|
|
|
guint *forwarded_msgs, guint *locked_msgs,
|
|
|
|
guint *ignored_msgs, guint *watched_msgs);
|
2003-07-04 13:59:46 +02:00
|
|
|
gchar *folder_get_status (GPtrArray *folders,
|
|
|
|
gboolean full);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2002-04-05 10:20:10 +02:00
|
|
|
Folder *folder_find_from_path (const gchar *path);
|
|
|
|
Folder *folder_find_from_name (const gchar *name,
|
2003-04-05 22:38:53 +02:00
|
|
|
FolderClass *klass);
|
2002-04-05 10:20:10 +02:00
|
|
|
FolderItem *folder_find_item_from_path (const gchar *path);
|
2008-01-23 07:43:15 +01:00
|
|
|
FolderItem *folder_find_item_from_real_path (const gchar *path);
|
2003-03-13 16:31:22 +01:00
|
|
|
FolderClass *folder_get_class_from_string (const gchar *str);
|
2004-05-10 12:22:28 +02:00
|
|
|
FolderItem *folder_find_child_item_by_name (FolderItem *item,
|
|
|
|
const gchar *name);
|
2008-02-12 12:38:19 +01:00
|
|
|
/* return value is locale charset */
|
2008-02-12 11:44:26 +01:00
|
|
|
gchar *folder_get_identifier (Folder *folder);
|
2008-02-12 12:38:19 +01:00
|
|
|
/* return value is locale charset */
|
2002-04-05 10:20:10 +02:00
|
|
|
gchar *folder_item_get_identifier (FolderItem *item);
|
|
|
|
FolderItem *folder_find_item_from_identifier (const gchar *identifier);
|
2010-01-19 22:32:04 +01:00
|
|
|
FolderItem *folder_get_item_from_identifier (const gchar *identifier);
|
2003-03-13 22:21:39 +01:00
|
|
|
gchar *folder_item_get_name (FolderItem *item);
|
2002-04-05 10:20:10 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *folder_get_default_inbox (void);
|
2007-03-20 18:39:33 +01:00
|
|
|
FolderItem *folder_get_default_inbox_for_class(FolderType type);
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *folder_get_default_outbox (void);
|
2007-08-24 13:07:45 +02:00
|
|
|
FolderItem *folder_get_default_outbox_for_class(FolderType type);
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *folder_get_default_draft (void);
|
2007-08-24 13:07:45 +02:00
|
|
|
FolderItem *folder_get_default_draft_for_class(FolderType type);
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *folder_get_default_queue (void);
|
2007-08-24 18:40:39 +02:00
|
|
|
FolderItem *folder_get_default_queue_for_class(FolderType type);
|
2001-04-19 14:21:46 +02:00
|
|
|
FolderItem *folder_get_default_trash (void);
|
2007-08-24 13:07:45 +02:00
|
|
|
FolderItem *folder_get_default_trash_for_class(FolderType type);
|
2001-12-05 23:09:25 +01:00
|
|
|
FolderItem *folder_get_default_processing (void);
|
2002-03-19 09:37:53 +01:00
|
|
|
void folder_set_missing_folders (void);
|
2002-10-13 17:43:22 +02:00
|
|
|
void folder_unref_account_all (PrefsAccount *account);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2008-02-12 12:38:19 +01:00
|
|
|
/* return value is locale encoded file name */
|
|
|
|
gchar *folder_item_get_path (FolderItem *item);
|
|
|
|
|
2002-11-09 23:06:23 +01:00
|
|
|
gint folder_item_open (FolderItem *item);
|
2003-07-26 21:07:16 +02:00
|
|
|
gint folder_item_close (FolderItem *item);
|
2002-04-21 00:57:52 +02:00
|
|
|
gint folder_item_scan (FolderItem *item);
|
2006-09-13 08:42:36 +02:00
|
|
|
gint folder_item_scan_full (FolderItem *item,
|
|
|
|
gboolean filtering);
|
2002-11-16 20:53:47 +01:00
|
|
|
MsgInfo *folder_item_get_msginfo (FolderItem *item,
|
2002-06-30 01:33:42 +02:00
|
|
|
gint num);
|
2002-11-16 20:53:47 +01:00
|
|
|
MsgInfo *folder_item_get_msginfo_by_msgid(FolderItem *item,
|
2002-07-10 15:11:25 +02:00
|
|
|
const gchar *msgid);
|
2002-06-30 01:33:42 +02:00
|
|
|
GSList *folder_item_get_msg_list (FolderItem *item);
|
2003-10-05 12:10:30 +02:00
|
|
|
/* return value is locale charset */
|
2001-04-19 14:21:46 +02:00
|
|
|
gchar *folder_item_fetch_msg (FolderItem *item,
|
|
|
|
gint num);
|
2005-06-13 21:37:01 +02:00
|
|
|
gchar *folder_item_fetch_msg_full (FolderItem *item,
|
|
|
|
gint num,
|
|
|
|
gboolean get_headers,
|
|
|
|
gboolean get_body);
|
2001-04-19 14:21:46 +02:00
|
|
|
gint folder_item_add_msg (FolderItem *dest,
|
2001-05-17 15:25:31 +02:00
|
|
|
const gchar *file,
|
2003-07-26 20:30:25 +02:00
|
|
|
MsgFlags *flags,
|
2001-05-17 15:25:31 +02:00
|
|
|
gboolean remove_source);
|
2003-07-23 16:51:47 +02:00
|
|
|
gint folder_item_add_msgs (FolderItem *dest,
|
|
|
|
GSList *file_list,
|
2003-07-25 20:47:43 +02:00
|
|
|
gboolean remove_source);
|
2002-11-15 20:51:25 +01:00
|
|
|
gint folder_item_move_to (FolderItem *src,
|
2002-11-15 16:36:30 +01:00
|
|
|
FolderItem *dest,
|
2006-12-26 22:34:00 +01:00
|
|
|
FolderItem **new_item,
|
|
|
|
gboolean copy);
|
2001-04-19 14:21:46 +02:00
|
|
|
gint folder_item_move_msg (FolderItem *dest,
|
|
|
|
MsgInfo *msginfo);
|
2003-08-05 11:01:01 +02:00
|
|
|
gint folder_item_move_msgs (FolderItem *dest,
|
2001-04-19 14:21:46 +02:00
|
|
|
GSList *msglist);
|
|
|
|
gint folder_item_copy_msg (FolderItem *dest,
|
|
|
|
MsgInfo *msginfo);
|
2003-08-05 11:01:01 +02:00
|
|
|
gint folder_item_copy_msgs (FolderItem *dest,
|
2001-04-19 14:21:46 +02:00
|
|
|
GSList *msglist);
|
|
|
|
gint folder_item_remove_msg (FolderItem *item,
|
|
|
|
gint num);
|
2001-10-07 11:15:06 +02:00
|
|
|
gint folder_item_remove_msgs (FolderItem *item,
|
|
|
|
GSList *msglist);
|
2009-03-30 19:20:02 +02:00
|
|
|
gint folder_item_expunge (FolderItem *item);
|
2001-04-19 14:21:46 +02:00
|
|
|
gint folder_item_remove_all_msg (FolderItem *item);
|
2003-03-18 19:24:34 +01:00
|
|
|
void folder_item_change_msg_flags (FolderItem *item,
|
|
|
|
MsgInfo *msginfo,
|
|
|
|
MsgPermFlags newflags);
|
2001-04-19 14:21:46 +02:00
|
|
|
gboolean folder_item_is_msg_changed (FolderItem *item,
|
|
|
|
MsgInfo *msginfo);
|
|
|
|
|
2006-04-25 10:00:00 +02:00
|
|
|
void folder_clean_cache_memory (FolderItem *protected_item);
|
2005-08-02 11:45:54 +02:00
|
|
|
void folder_clean_cache_memory_force (void);
|
2002-07-02 21:49:11 +02:00
|
|
|
void folder_item_write_cache (FolderItem *item);
|
2001-12-30 02:27:14 +01:00
|
|
|
|
2002-07-23 20:18:21 +02:00
|
|
|
void folder_item_apply_processing (FolderItem *item);
|
|
|
|
|
2003-01-07 22:49:44 +01:00
|
|
|
void folder_item_update (FolderItem *item,
|
|
|
|
FolderItemUpdateFlags update_flags);
|
|
|
|
void folder_item_update_recursive (FolderItem *item,
|
|
|
|
FolderItemUpdateFlags update_flags);
|
2003-05-13 13:54:19 +02:00
|
|
|
void folder_item_update_freeze (void);
|
|
|
|
void folder_item_update_thaw (void);
|
2005-06-13 21:37:01 +02:00
|
|
|
void folder_item_set_batch (FolderItem *item, gboolean batch);
|
2005-08-07 15:39:27 +02:00
|
|
|
gboolean folder_has_parent_of_type (FolderItem *item, SpecialFolderItemType type);
|
2005-09-08 20:28:36 +02:00
|
|
|
void folder_synchronise (Folder *folder);
|
|
|
|
gboolean folder_want_synchronise (Folder *folder);
|
2006-01-12 21:01:48 +01:00
|
|
|
gboolean folder_subscribe (const gchar *uri);
|
2006-01-15 19:05:16 +01:00
|
|
|
gboolean folder_have_mailbox (void);
|
2006-06-12 19:08:19 +02:00
|
|
|
gboolean folder_item_free_cache (FolderItem *item, gboolean force);
|
|
|
|
void folder_item_change_type (FolderItem *item,
|
|
|
|
SpecialFolderItemType newtype);
|
2006-10-04 08:18:28 +02:00
|
|
|
gboolean folder_get_sort_type (Folder *folder,
|
|
|
|
FolderSortKey *sort_key,
|
|
|
|
FolderSortType *sort_type);
|
2007-04-03 09:08:26 +02:00
|
|
|
void folder_item_synchronise (FolderItem *item);
|
2007-09-22 14:00:27 +02:00
|
|
|
void folder_item_discard_cache (FolderItem *item);
|
2007-11-26 23:30:58 +01:00
|
|
|
void folder_item_commit_tags(FolderItem *item, MsgInfo *msginfo, GSList *tags_set, GSList *tags_unset);
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
#endif /* __FOLDER_H__ */
|