2004-01-27 Not Zed <NotZed@Ximian.com> ** See bug #53084 and others. * em-migrate.c (em_migrate): remove the vfolder_revert hack. * em-composer-utils.c (ask_confirm_for_only_bcc): removed unused vars. * mail-tools.c (mail_tool_get_local_inbox): removed, handled by mail_component_get_folder now. * mail-component.c (mail_component_*): Changed the api slightly. Using NULL as the component argument automatically implies you want the default component. (em_uri_from_camel, em_uri_to_camel): moved to em-utils.[ch]. Ok so it isn't namespaced right ... *shrug*. (mail_component_get_local_inbox): removed. (mail_component_get_folder): single entry point for getting standard folders. This is MT-Safe. (mail_component_get_folder_uri): single entry point for getting standard folder uri's. This is MT-Safe. (add_store): removed, moved to mail_component_add_store. (mail_component_load_store_by_uri): call mail_component_add_store directly rather than copying its code. (default_*_folder*): Removed, use accessor methods instead, fixed all callers. (setup_local_store): renamed to mc_setup_local_store, use proper url encoding too. make run-once and thread-safe. (MailComponentPrivate): Added a lock. (mail_control_new): exported properly to kill warnings. (mail_component_init): dont setup_local_store or add accounts here. (impl_createControls): setup local store/accounts here. (mail_component_peek): dont setup vfolder storage here. (mc_startup): internal function to startup stuff needed for gui operation. (setup_search_context): make run-once. (mail_component_peek_search_context): call setup_search_context incase it isn't setup yet. (impl_upgradeFromVersion): remove the local store setup hack. svn path=/trunk/; revision=24462
103 lines
3.6 KiB
C
103 lines
3.6 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
/* mail-component.h
|
|
*
|
|
* Copyright (C) 2003 Ximian Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of version 2 of the GNU General Public
|
|
* License as published by the Free Software Foundation.
|
|
*
|
|
* 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.
|
|
*
|
|
* Authors:
|
|
* Michael Zucchi <notzed@ximian.com>
|
|
* Jeffrey Stedfast <fejj@ximian.com>
|
|
* Ettore Perazzoli <ettore@ximian.com>
|
|
*/
|
|
|
|
#ifndef _MAIL_COMPONENT_H_
|
|
#define _MAIL_COMPONENT_H_
|
|
|
|
#include <camel/camel-store.h>
|
|
#include <filter/rule-context.h>
|
|
#include <bonobo/bonobo-object.h>
|
|
|
|
#include "e-activity-handler.h"
|
|
|
|
#include "Evolution.h"
|
|
|
|
#define MAIL_TYPE_COMPONENT (mail_component_get_type ())
|
|
#define MAIL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIL_TYPE_COMPONENT, MailComponent))
|
|
#define MAIL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAIL_TYPE_COMPONENT, MailComponentClass))
|
|
#define MAIL_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAIL_TYPE_COMPONENT))
|
|
#define MAIL_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MAIL_TYPE_COMPONENT))
|
|
|
|
typedef struct _MailComponent MailComponent;
|
|
typedef struct _MailComponentPrivate MailComponentPrivate;
|
|
typedef struct _MailComponentClass MailComponentClass;
|
|
|
|
enum _mail_component_folder_t {
|
|
MAIL_COMPONENT_FOLDER_INBOX = 0,
|
|
MAIL_COMPONENT_FOLDER_DRAFTS,
|
|
MAIL_COMPONENT_FOLDER_OUTBOX,
|
|
MAIL_COMPONENT_FOLDER_SENT,
|
|
MAIL_COMPONENT_FOLDER_LOCAL_INBOX,
|
|
};
|
|
|
|
struct _MailComponent {
|
|
BonoboObject parent;
|
|
|
|
MailComponentPrivate *priv;
|
|
};
|
|
|
|
struct _MailComponentClass {
|
|
BonoboObjectClass parent_class;
|
|
|
|
POA_GNOME_Evolution_Component__epv epv;
|
|
};
|
|
|
|
GType mail_component_get_type (void);
|
|
|
|
struct _BonoboControl *mail_control_new(void);
|
|
|
|
MailComponent *mail_component_peek (void);
|
|
|
|
/* NOTE: Using NULL as the component implies using the default component */
|
|
const char *mail_component_peek_base_directory (MailComponent *component);
|
|
RuleContext *mail_component_peek_search_context (MailComponent *component);
|
|
EActivityHandler *mail_component_peek_activity_handler (MailComponent *component);
|
|
|
|
void mail_component_add_store (MailComponent *component,
|
|
CamelStore *store,
|
|
const char *name);
|
|
CamelStore *mail_component_load_store_by_uri (MailComponent *component,
|
|
const char *uri,
|
|
const char *name);
|
|
|
|
void mail_component_remove_store (MailComponent *component,
|
|
CamelStore *store);
|
|
void mail_component_remove_store_by_uri (MailComponent *component,
|
|
const char *uri);
|
|
|
|
int mail_component_get_store_count (MailComponent *component);
|
|
void mail_component_stores_foreach (MailComponent *component,
|
|
GHFunc func,
|
|
void *data);
|
|
|
|
void mail_component_remove_folder (MailComponent *component, CamelStore *store, const char *path);
|
|
|
|
struct _EMFolderTreeModel *mail_component_peek_tree_model (MailComponent *component);
|
|
|
|
struct _CamelFolder *mail_component_get_folder(MailComponent *mc, enum _mail_component_folder_t id);
|
|
const char *mail_component_get_folder_uri(MailComponent *mc, enum _mail_component_folder_t id);
|
|
|
|
#endif /* _MAIL_COMPONENT_H_ */
|