aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-component.h
blob: 901e612a2106a86b1f38c4c3a64deec8ee0e9c84 (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
/* -*- 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., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, 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 <bonobo/bonobo-object.h>
#include "shell/evolution-component.h"
#include "Evolution-Mail.h"

struct _CamelStore;

#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 {
    EvolutionComponent parent;
    
    MailComponentPrivate *priv;
};

struct _MailComponentClass {
    EvolutionComponentClass parent_class;
    
    POA_GNOME_Evolution_MailComponent__epv epv;
};

GType  mail_component_get_type  (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);
struct _RuleContext      *mail_component_peek_search_context    (MailComponent *component);
struct _EActivityHandler *mail_component_peek_activity_handler  (MailComponent *component);

struct _CamelSession *mail_component_peek_session(MailComponent *);

void        mail_component_add_store            (MailComponent *component,
                         struct _CamelStore    *store,
                         const char    *name);
struct _CamelStore *mail_component_load_store_by_uri    (MailComponent *component,
                         const char    *uri,
                         const char    *name);

void        mail_component_remove_store         (MailComponent *component,
                         struct _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, struct _CamelStore *store, const char *path);

struct _EMFolderTreeModel *mail_component_peek_tree_model (MailComponent *component);

struct _CamelStore *mail_component_peek_local_store (MailComponent *mc);
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);

int status_check (GNOME_Evolution_ShellState shell_state);

void mail_indicate_new_mail (gboolean have_new_mail);

#endif /* _MAIL_COMPONENT_H_ */