0.9.6claws83
[claws.git] / src / folderview.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2002 Hiroyuki Yamamoto
4  *
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 2 of the License, or
8  * (at your option) any later version.
9  *
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.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __FOLDERVIEW_H__
21 #define __FOLDERVIEW_H__
22
23 typedef struct _FolderView      FolderView;
24
25 #include <glib.h>
26 #include <gtk/gtkwidget.h>
27 #include <gtk/gtkctree.h>
28
29 #include "folder.h"
30 #include "mainwindow.h"
31 #include "summaryview.h"
32
33 struct _FolderView
34 {
35         GtkWidget *scrolledwin;
36         GtkWidget *ctree;
37         GtkWidget *mail_popup;
38         GtkWidget *imap_popup;
39         GtkWidget *news_popup;
40 #if 0
41         GtkWidget *mbox_popup;
42 #endif
43
44         GtkItemFactory *mail_factory;
45         GtkItemFactory *imap_factory;
46         GtkItemFactory *news_factory;
47 #if 0
48         GtkItemFactory *mbox_factory;
49 #endif
50
51         GtkCTreeNode *selected;
52         GtkCTreeNode *opened;
53
54         gboolean open_folder;
55
56         GdkColor color_new;
57         GdkColor color_op;
58
59         MainWindow   *mainwin;
60         SummaryView  *summaryview;
61
62         gint folder_update_callback_id;
63         gint folder_item_update_callback_id;
64         
65         /* DND states */
66         GSList *nodes_to_recollapse;
67         guint   drag_timer;             /* timer id */
68         FolderItem *drag_item;          /* dragged item */
69         GtkCTreeNode *drag_node;        /* drag node */
70         
71         GtkTargetList *target_list; /* DnD */
72 };
73
74 FolderView *folderview_create           (void);
75 void folderview_init                    (FolderView     *folderview);
76 void folderview_set                     (FolderView     *folderview);
77 void folderview_set_all                 (void);
78 void folderview_select                  (FolderView     *folderview,
79                                          FolderItem     *item);
80 void folderview_unselect                (FolderView     *folderview);
81 void folderview_select_next_unread      (FolderView     *folderview);
82 void folderview_update_msg_num          (FolderView     *folderview,
83                                          GtkCTreeNode   *row);
84 void folderview_rescan_tree             (Folder         *folder);
85 void folderview_rescan_all              (void);
86 gint folderview_check_new               (Folder         *folder);
87 void folderview_check_new_all           (void);
88
89 void folderview_new_folder              (FolderView     *folderview);
90 void folderview_rename_folder           (FolderView     *folderview);
91 void folderview_delete_folder           (FolderView     *folderview);
92
93 void folderview_set_target_folder_color (gint           color_op);
94
95 void folderview_reflect_prefs_pixmap_theme      (FolderView *folderview);
96
97 #endif /* __FOLDERVIEW_H__ */