aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.h
blob: dd83d05d87c2ed40b229e76cdb432ed6b0dc82d2 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */


#ifndef _FOLDER_BROWSER_H_
#define _FOLDER_BROWSER_H_

#include <gtk/gtktable.h>
#include "camel/camel-stream.h"
#include <bonobo/bonobo-property-bag.h>
#include <bonobo/bonobo-ui-component.h>
#include <widgets/misc/e-filter-bar.h>
#include "widgets/menus/gal-view-menus.h"
#include "filter/filter-rule.h"
#include "filter/filter-context.h" /*eek*/
#include "message-list.h"
#include "mail-display.h"
#include "mail-types.h"
#include "shell/Evolution.h"

#define FOLDER_BROWSER_TYPE        (folder_browser_get_type ())
#define FOLDER_BROWSER(o)          (G_TYPE_CHECK_INSTANCE_CAST ((o), FOLDER_BROWSER_TYPE, FolderBrowser))
#define FOLDER_BROWSER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST ((k), FOLDER_BROWSER_TYPE, FolderBrowserClass))
#define IS_FOLDER_BROWSER(o)       (G_TYPE_CHECK_INSTANCE_TYPE ((o), FOLDER_BROWSER_TYPE))
#define IS_FOLDER_BROWSER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), FOLDER_BROWSER_TYPE))

#define FB_DEFAULT_CHARSET _("Default")

#define FOLDER_BROWSER_IS_DESTROYED(fb) (!fb || !fb->message_list || !fb->mail_display || !fb->folder)

typedef enum _FolderBrowserSelectionState {
    FB_SELSTATE_NONE,
    FB_SELSTATE_SINGLE,
    FB_SELSTATE_MULTIPLE,
    FB_SELSTATE_UNDEFINED
} FolderBrowserSelectionState;

struct  _FolderBrowser {
    GtkTable parent;
    
    BonoboPropertyBag *properties;
    
    GNOME_Evolution_Shell shell;
    GNOME_Evolution_ShellView shell_view;
    
    BonoboUIComponent *uicomp;
    
    /*
     * The current URI being displayed by the FolderBrowser
     */
    char        *uri;
    CamelFolder *folder;
    int          unread_count; /* last known unread message count */
    
    /* async loading stuff */
    char        *loading_uid;  /* what uid am i loading now */
    char        *pending_uid;  /* what uid should i load next */
    char        *new_uid;      /* place to save the next uid during idle timeout */
    char        *loaded_uid;   /* what we have loaded */
    guint        loading_id;
    guint        seen_id;
    
    gulong       resize_id;
    
    /* a folder we are expunging, dont use other than to compare the pointer value */
    CamelFolder *expunging;
    
    MessageList *message_list;
    MailDisplay *mail_display;
    GtkWidget   *vpaned;
    
    EFilterBar  *search;
    FilterRule  *search_full; /* if we have a full search active */
    
    guint32 preview_shown  : 1;
    guint32 threaded       : 1;
    guint32 pref_master    : 1;
    
    FolderBrowserSelectionState selection_state;
    GSList *sensitize_changes;
    GHashTable *sensitise_state; /* the last sent sensitise state, to avoid much bonobo overhead */
    int sensitize_timeout_id;
    int update_status_bar_idle_id;
    
    /* View instance and the menu handler object */
    GalViewInstance *view_instance;
    GalViewMenus *view_menus;
    
    GtkWidget *invisible;
    GByteArray *clipboard_selection;
    
    /* for async events */
    struct _MailAsyncEvent *async_event;
    
    int get_id;     /* for getting folder op */
    
    /* info used by popup for filter/vfolder */
    struct _popup_filter_data *popup;
};

typedef struct {
    GtkTableClass parent_class;
    
    /* signals */
    void (*folder_loaded)  (FolderBrowser *fb, const char *uri);
    void (*message_loaded) (FolderBrowser *fb, const char *uid);
} FolderBrowserClass;

struct fb_ondemand_closure {
    FilterRule *rule;
    FolderBrowser *fb;
    gchar *path;
};

GtkType    folder_browser_get_type             (void);
GtkWidget *folder_browser_new                  (const GNOME_Evolution_Shell  shell,
                        const char *uri);

void       folder_browser_set_folder           (FolderBrowser *fb, CamelFolder *folder, const char *uri);

void       folder_browser_set_ui_component     (FolderBrowser *fb, BonoboUIComponent *uicomp);
void       folder_browser_set_shell_view       (FolderBrowser *fb, GNOME_Evolution_ShellView shell_view);

void       folder_browser_set_message_preview  (FolderBrowser         *folder_browser,
                        gboolean               show_message_preview);
void       folder_browser_clear_search         (FolderBrowser         *fb);

void       folder_browser_cut                  (GtkWidget *widget, FolderBrowser *fb);
void       folder_browser_copy                 (GtkWidget *widget, FolderBrowser *fb);
void       folder_browser_paste                (GtkWidget *widget, FolderBrowser *fb);

void       folder_browser_reload               (FolderBrowser *fb);

/* callbacks for functions on the folder-browser */
void vfolder_subject   (GtkWidget *w, FolderBrowser *fb);
void vfolder_sender    (GtkWidget *w, FolderBrowser *fb);
void vfolder_recipient (GtkWidget *w, FolderBrowser *fb);
void vfolder_mlist     (GtkWidget *w, FolderBrowser *fb);

void filter_subject    (GtkWidget *w, FolderBrowser *fb);
void filter_sender     (GtkWidget *w, FolderBrowser *fb);
void filter_recipient  (GtkWidget *w, FolderBrowser *fb);
void filter_mlist      (GtkWidget *w, FolderBrowser *fb);

void hide_read(GtkWidget *w, FolderBrowser *fb);
void hide_deleted(GtkWidget *w, FolderBrowser *fb);
void hide_selected(GtkWidget *w, FolderBrowser *fb);
void hide_none(GtkWidget *w, FolderBrowser *fb);
void hide_subject(GtkWidget *w, FolderBrowser *fb);
void hide_sender(GtkWidget *w, FolderBrowser *fb);

void folder_browser_toggle_preview (BonoboUIComponent           *component,
                    const char                  *path,
                    Bonobo_UIComponent_EventType type,
                    const char                  *state,
                    gpointer                     user_data);

void folder_browser_toggle_threads (BonoboUIComponent           *component,
                    const char                  *path,
                    Bonobo_UIComponent_EventType type,
                    const char                  *state,
                    gpointer                     user_data);

void folder_browser_toggle_hide_deleted (BonoboUIComponent           *component,
                     const char                  *path,
                     Bonobo_UIComponent_EventType type,
                     const char                  *state,
                     gpointer                     user_data);

void folder_browser_set_message_display_style (BonoboUIComponent           *component,
                           const char                  *path,
                           Bonobo_UIComponent_EventType type,
                           const char                  *state,
                           gpointer                     user_data);

void folder_browser_charset_changed (BonoboUIComponent *component,
                     const char *path,
                     Bonobo_UIComponent_EventType type,
                     const char *state,
                     gpointer user_data);

gboolean folder_browser_is_drafts (FolderBrowser *fb);
gboolean folder_browser_is_sent   (FolderBrowser *fb);
gboolean folder_browser_is_outbox (FolderBrowser *fb);

#endif /* _FOLDER_BROWSER_H_ */
2011-12-144-17/+17 * - Update to 5.0.1novel2011-12-134-24/+57 * - Update to 0.3.3culot2011-12-122-4/+4 * - Fix problem that was reintroduced with the upgrade to 5.7.1 [1]zi2011-12-085-3/+54 * A plugin for Nagios to query common NetSNMP-exported information:demon2011-12-075-0/+389 * Update to 0.8.7hskreuzer2011-12-062-12/+4 * - Add shutdown keyword to rc scriptscheidell2011-12-041-0/+1 * - Take maintainership per private conversation with current maintainerzi2011-12-021-1/+1 * - Fix libtool typo in ltmain.shzi2011-12-023-0/+23 * - Update to 5.7.1zi2011-12-0112-261/+21 * - links to libmysqlclient/libpq but doesn't register dependenciesscheidell2011-11-293-103/+163 * PR: 146145scheidell2011-11-291-1/+7 * Update to 4.058.tobez2011-11-283-12/+18 * - Bump PORTREVISION for previous commitzi2011-11-241-1/+1 * - Fix TCP-MIB::tcpCurrEstab.0 reportingzi2011-11-241-0/+20 * - Update to 1.0.13miwi2011-11-192-3/+3 * - Update to 1.9miwi2011-11-193-3/+5 * - update to 0.1.2rm2011-11-193-8/+11 * - update to 0.3.1rm2011-11-192-5/+6 * - update to 4.2.1rm2011-11-193-7/+9 * Remove trailing whitespaces.ehaupt2011-11-191-1/+1 * - Update to 1.4.0.7miwi2011-11-149-104/+38 * Remove CMAKE_USE_PTHREAD from the ports using it.rakuco2011-11-141-1/+0 * - fix broken layout in mrtgohauer2011-11-142-0/+19 * - Update to 1.5.1lme2011-11-132-3/+3 * Mark broken on powerpc as well as sparc64. (In fact, on all the tier-2s.)linimon2011-11-101-3/+3 * Freshmeat is now called Freecode. Change all freshmeat.net URLs for toehaupt2011-11-101-1/+1 * - Remove WITH_FBSD10_FIX, is no longer neededmiwi2011-11-091-1/+0 * - Update to 1.11sunpoet2011-11-062-19/+24 * Update to version 0.82pawel2011-11-052-4/+3 * Update to 2.9mm2011-11-052-4/+3 * - Update to 2.06jadawin2011-11-023-13/+18 * Remove ports@ ports that have been DEPRECATED for at least 1 monthdougb2011-11-028-679/+0 * - Fix memleak (obtained from upstream commit: 6ef6907642247c663b9b8964b9fd44a...zi2011-11-023-9/+25 * Remove references to unsupported FreeBSD versions. Mostly of the form:dougb2011-11-021-7/+1 * DellMonitor provides custom modeling of devices running the Dell OpenManagecrees2011-10-317-0/+55 * This ZenPack leverages the libvirt API for monitoring virtualization serverscrees2011-10-317-0/+53 * Zenoss comes with the nagios command check_ping. This zenpack implements thatcrees2011-10-317-0/+50 * This ZenPack adds a portlet called "Show Graph" which enables users to show anycrees2011-10-317-0/+52 * This ZenPack consists of a report for listing each MAC address and the Devicecrees2011-10-317-0/+57 * - Update to 1.0.4swills2011-10-302-3/+3 * This ZenPack provides performance monitoring of the Apache HTTP Server.crees2011-10-307-0/+47 * This ZenPack provides the ability to quickly search for Devices by their namecrees2011-10-307-0/+50 * - Fix build on FreeBSD 10beat2011-10-295-3/+9 * - Update to 0.8.7h.zi2011-10-284-13/+18 * When troubleshooting network issues, it can be very useful to have all thecrees2011-10-277-0/+62 * Add patch fixing Cavebear Ethernet manufacturer listings locationpawel2011-10-262-0/+15 * Update to 0.9.8ehaupt2011-10-242-5/+5 * The vast majority of pkg-descr files had the following format when theydougb2011-10-2416-36/+9 * Remove more tags from pkg-descr files fo the form:dougb2011-10-2414-44/+5 * - Return my ports back to the pool. I was unable to make any fixes tostas2011-10-242-2/+2 * This ZenPack is currently used by the HP ProLiant Monitor, Dell Monitor and ODBCcrees2011-10-227-0/+61 * This ZenPack provides additional monitoring options for Dell machines withcrees2011-10-197-0/+62 * Update to 1.0.12ehaupt2011-10-183-37/+52 * - Update MASTER_SITES and WWWehaupt2011-10-183-51/+17 * Support USE_TKehaupt2011-10-181-6/+4 * - fix build for FreeBSD-10dinoex2011-10-181-0/+4 * - update to 0.2.15eadler2011-10-163-5/+5 * - update to 1.8.8eadler2011-10-1510-64/+42 * As previously advertised, complete removal of vulnerable ports thatdougb2011-10-1520-1691/+0 * Add new mirror, apparently the current mirrors are somewhat unreliablecrees2011-10-101-1/+2 * Remove ports maintainted by ports@ which have passed their EXPIRATION_DATEdougb2011-10-094-59/+0 * Looks like it was a false negative on distfile tests; undeprecate.crees2011-10-081-3/+0 * - Updated to 0.2.11bglarkin2011-10-072-5/+5 * - Updated to 4.1.16dglarkin2011-10-072-8/+8 * As previously advertised, remove ports that previously had beendougb2011-09-309-502/+0 * - Add configtest command to rc scriptzi2011-09-301-1/+2 * - Add a patch that allows packet injection with capable wireless chipsets inlme2011-09-302-4/+16 * - Instruct portscout to ignore this port due to false positiveszi2011-09-291-3/+5 * - Reset maintainerwen2011-09-272-2/+2 * Mark FORBIDDEN the remaining ports that are vulnerable for more thandougb2011-09-261-0/+3 * - Update to 2.1.1 [1]zi2011-09-263-14/+20 * - Should use LOGIN unless there's a valid reason not to.zi2011-09-261-1/+2 * - Update to 1.3.5zi2011-09-264-23/+33 * - Silence startup noise [1]zi2011-09-262-3/+13 * - Add LICENSEzi2011-09-26