~cldunlap1/ubuntu/quantal/buffy/typo-fix

« back to all changes in this revision

Viewing changes to src/FolderList.h

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Zini
  • Date: 2004-10-31 14:50:26 UTC
  • Revision ID: james.westby@ubuntu.com-20041031145026-9z3xr78y8j3o5uis
Tags: upstream-0.5
ImportĀ upstreamĀ versionĀ 0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef FOLDER_LIST_H
 
2
#define FOLDER_LIST_H
 
3
 
 
4
/*
 
5
 * Folder list widget
 
6
 *
 
7
 * Copyright (C) 2003  Enrico Zini <enrico@debian.org>
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
22
 */
 
23
 
 
24
#pragma interface
 
25
 
 
26
#include <libbuffy/MailFolder.h>
 
27
 
 
28
#include <sigc++/sigc++.h>
 
29
#include <gtkmm/scrolledwindow.h>
 
30
#include <gtkmm/treeview.h>
 
31
#include <gtkmm/liststore.h>
 
32
#include <gtkmm/treemodelfilter.h>
 
33
#include <gtkmm/treemodelsort.h>
 
34
#include <gtkmm/box.h>
 
35
#include <gtkmm/label.h>
 
36
#include <gtkmm/entry.h>
 
37
#include <gtkmm/menu.h>
 
38
 
 
39
class FolderList : public Gtk::VBox, public MailFolderConsumer
 
40
{
 
41
public:
 
42
        typedef SigC::Signal1<void, MailFolder> type_signal_open_folder;
 
43
 
 
44
protected:
 
45
 
 
46
        Gtk::TreeView folderList;
 
47
        Glib::RefPtr<Gtk::ListStore> folderListModel;
 
48
        Glib::RefPtr<Gtk::TreeModelFilter> filteredModel;
 
49
        Glib::RefPtr<Gtk::TreeModelSort> sortedModel;
 
50
        Gtk::ScrolledWindow scrolledFolderList;
 
51
 
 
52
        bool viewEmpty, viewRead, viewImportant;
 
53
 
 
54
        /*
 
55
        Glib::ustring filter;
 
56
 
 
57
        Gtk::HBox filterHBox;
 
58
        Gtk::Label filterLabel;
 
59
        Gtk::Entry filterEdit;
 
60
        Gtk::Menu itemPopup;
 
61
 
 
62
        std::vector<std::string> selected;
 
63
        */
 
64
        
 
65
        // Tree model columns
 
66
        class FolderListModelColumns : public Gtk::TreeModel::ColumnRecord
 
67
        {
 
68
        public:
 
69
                FolderListModelColumns() { add(folder); add(name); add(msg_new); add(msg_unread); add(msg_total); add(msg_flagged); }
 
70
 
 
71
                Gtk::TreeModelColumn<MailFolder> folder;
 
72
                Gtk::TreeModelColumn<Glib::ustring> name;
 
73
                Gtk::TreeModelColumn<int> msg_new;
 
74
                Gtk::TreeModelColumn<int> msg_unread;
 
75
                Gtk::TreeModelColumn<int> msg_total;
 
76
                Gtk::TreeModelColumn<int> msg_flagged;
 
77
        };
 
78
 
 
79
        FolderListModelColumns folderListModelColumns;
 
80
 
 
81
        type_signal_open_folder _signal_open_folder;
 
82
 
 
83
        
 
84
        //void updateList();
 
85
 
 
86
        /*
 
87
        void on_filter_changed();
 
88
        void on_document_changed();
 
89
        */
 
90
        bool on_event(GdkEvent* e);
 
91
        void on_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
 
92
        bool filter_row(const Gtk::TreeModel::const_iterator& iter);
 
93
 
 
94
public:
 
95
        FolderList();
 
96
        virtual ~FolderList() {}
 
97
 
 
98
        void consume(MailFolder& folder);
 
99
 
 
100
        void clear();
 
101
        void do_update();
 
102
        bool do_timer_tick();
 
103
 
 
104
        void configureFilter(bool viewEmpty, bool viewRead, bool viewImportant);
 
105
 
 
106
        type_signal_open_folder signal_open_folder() throw ()
 
107
                { return _signal_open_folder; }
 
108
 
 
109
 
 
110
        /*
 
111
        std::map< std::string, Tagcoll::TagSet > getAllFolders();
 
112
        std::map< std::string, Tagcoll::TagSet > getSelection();
 
113
        int getSelectionSize();
 
114
        */
 
115
 
 
116
        //type_signal_changed signal_changed() throw () { return _signal_changed; }
 
117
        //virtual void do_changed();
 
118
 
 
119
        /*
 
120
        virtual void do_selection_changed();
 
121
        virtual void do_focus_in();
 
122
        virtual void on_itemList_drag_data_get(
 
123
                        const Glib::RefPtr<Gdk::DragContext>&, Gtk::SelectionData& selection_data, guint, guint);
 
124
        virtual void on_itemList_drop_drag_data_received(
 
125
                        const Glib::RefPtr<Gdk::DragContext>& context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
 
126
        virtual bool on_focus_in(GdkEventFocus*);
 
127
 
 
128
        // Signals
 
129
        type_signal_selection_changed signal_selection_changed() throw ()
 
130
                { return _signal_selection_changed; }
 
131
        type_signal_focus_in signal_focus_in() throw ()
 
132
                { return _signal_focus_in; }
 
133
        type_signal_request_tagcoll_change signal_request_tagcoll_change() throw ()
 
134
                { return _signal_request_tagcoll_change; }
 
135
        type_signal_request_tagset_merge signal_request_tagset_merge() throw ()
 
136
                { return _signal_request_tagset_merge; }
 
137
        type_signal_request_tagset_intersect signal_request_tagset_intersect() throw ()
 
138
                { return _signal_request_tagset_intersect; }
 
139
        type_signal_request_item_copy signal_request_item_copy() throw ()
 
140
                { return _signal_request_item_copy; }
 
141
        type_signal_request_item_move signal_request_item_move() throw ()
 
142
                { return _signal_request_item_move; }
 
143
        type_signal_select_tagset signal_select_tagset() throw ()
 
144
                { return _signal_select_tagset; }
 
145
        type_signal_select_tagset_other_panel signal_select_tagset_other_panel() throw ()
 
146
                { return _signal_select_tagset_other_panel; }
 
147
        */
 
148
};
 
149
 
 
150
// vim:set ts=4 sw=4:
 
151
#endif