2 * Claws Mail -- a GTK based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef __FOLDERVIEW_H__
21 #define __FOLDERVIEW_H__
23 typedef struct _FolderViewPopup FolderViewPopup
;
24 typedef struct _FolderColumnState FolderColumnState
;
28 #include "gtk/gtksctree.h"
30 #include "mainwindow.h"
31 #include "viewtypes.h"
42 #define N_FOLDER_COLS 4
44 struct _FolderColumnState
46 FolderColumnType type
;
52 GtkWidget
*scrolledwin
;
54 GtkWidget
*headerpopupmenu
;
58 GtkCMCTreeNode
*selected
;
59 GtkCMCTreeNode
*opened
;
67 SummaryView
*summaryview
;
69 gint folder_update_callback_id
;
70 gint folder_item_update_callback_id
;
73 GSList
*nodes_to_recollapse
;
74 guint drag_timer_id
; /* timer id */
75 FolderItem
*drag_item
; /* dragged item */
76 GtkCMCTreeNode
*drag_node
; /* drag node */
78 GtkTargetList
*target_list
; /* DnD */
79 FolderColumnState col_state
[N_FOLDER_COLS
];
80 gint col_pos
[N_FOLDER_COLS
];
81 Folder
*scanning_folder
;
82 GtkUIManager
*ui_manager
;
83 GtkActionGroup
*popup_common_action_group
;
84 GtkActionGroup
*popup_specific_action_group
;
86 guint deferred_refresh_id
;
87 guint scroll_timeout_id
;
88 guint postpone_select_id
;
91 struct _FolderViewPopup
95 GtkActionEntry
*entries
;
97 GtkToggleActionEntry
*toggle_entries
;
98 gint n_toggle_entries
;
99 GtkRadioActionEntry
*radio_entries
;
100 gint n_radio_entries
;
102 void (*radio_callback
) (GtkAction
*action
, GtkRadioAction
*current
, gpointer data
);
103 void (*add_menuitems
) (GtkUIManager
*ui_manager
, FolderItem
*item
);
104 void (*set_sensitivity
) (GtkUIManager
*ui_manager
, FolderItem
*item
);
107 void folderview_initialize (void);
108 FolderView
*folderview_create (MainWindow
*mainwin
);
109 void folderview_init (FolderView
*folderview
);
111 void folderview_set (FolderView
*folderview
);
112 void folderview_set_all (void);
114 void folderview_select (FolderView
*folderview
,
116 void folderview_unselect (FolderView
*folderview
);
117 void folderview_select_next_with_flag (FolderView
*folderview
,
120 FolderItem
*folderview_get_selected_item(FolderView
*folderview
);
121 FolderItem
*folderview_get_opened_item(FolderView
*folderview
);
123 void folderview_rescan_tree (Folder
*folder
,
125 gint
folderview_check_new (Folder
*folder
);
126 void folderview_check_new_all (void);
128 void folderview_update_all_updated (gboolean update_summary
);
130 void folderview_run_processing(FolderItem
*item
);
132 void folderview_move_folder (FolderView
*folderview
,
133 FolderItem
*from_folder
,
134 FolderItem
*to_folder
,
137 void folderview_set_target_folder_color (GdkRGBA color_op
);
139 void folderview_reinit_fonts (FolderView
*folderview
);
141 void folderview_reflect_prefs (void);
142 void folderview_register_popup (FolderViewPopup
*fpopup
);
143 void folderview_unregister_popup (FolderViewPopup
*fpopup
);
144 void folderview_update_search_icon (FolderItem
*item
,
146 void folderview_set_column_order (FolderView
*folderview
);
147 void folderview_finish_dnd (const gchar
*data
,
148 GdkDragContext
*drag_context
,
151 void folderview_close_opened (FolderView
*folderview
,
153 void folderview_remove_item(FolderView
*folderview
,
156 void folderview_freeze(FolderView
*folderview
);
157 void folderview_thaw(FolderView
*folderview
);
158 void folderview_grab_focus(FolderView
*folderview
);
160 #endif /* __FOLDERVIEW_H__ */