kmail

favoritefolderview.h
1/*
2 Copyright (c) 2007 Volker Krause <vkrause@kde.org>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KMAIL_FAVORITEFOLDERVIEW_H
20#define KMAIL_FAVORITEFOLDERVIEW_H
21
22#include "kmfoldertree.h"
23
24namespace KMail {
25
26class FavoriteFolderView;
27
28class FavoriteFolderViewItem : public KMFolderTreeItem
29{
30 TQ_OBJECT
31
32 public:
33 FavoriteFolderViewItem( FavoriteFolderView *parent, const TQString & name, KMFolder* folder );
34
35 protected:
36 bool useTopLevelIcon() const { return false; }
37 int iconSize() const { return 22; }
38
39 private slots:
40 void nameChanged();
41
42 private:
43 TQString mOldName;
44};
45
46class FavoriteFolderView : public FolderTreeBase
47{
48 TQ_OBJECT
49
50
51 public:
52 FavoriteFolderView( KMMainWidget *mainWidget, TQWidget *parent = 0 );
53 ~FavoriteFolderView();
54
55 void readConfig();
56 void writeConfig();
57
58 KMFolderTreeItem* addFolder( KMFolder *folder, const TQString &name = TQString(),
59 TQListViewItem *after = 0 );
60 void addFolder( KMFolderTreeItem *fti );
61
62 public slots:
63 void folderTreeSelectionChanged( KMFolder *folder );
64 void checkMail();
65
66 protected:
67 bool acceptDrag(TQDropEvent* e) const;
68 void contentsDragEnterEvent( TQDragEnterEvent *e );
69 void readColorConfig();
70
71 private:
72 static TQString prettyName( KMFolderTreeItem* fti );
73 KMFolderTreeItem* findFolderTreeItem( KMFolder* folder ) const;
74 void handleGroupwareFolder( KMFolderTreeItem *fti );
75
76 private slots:
77 void selectionChanged();
78 void itemClicked( TQListViewItem *item );
79 void folderRemoved( KMFolder *folder );
80 void dropped( TQDropEvent *e, TQListViewItem *after );
81 void contextMenu( TQListViewItem *item, const TQPoint &point );
82 void removeFolder();
83 void initializeFavorites();
84 void renameFolder();
85 void addFolder();
86 void notifyInstancesOnChange();
87 void refresh();
88
89 private:
90 KMFolderTreeItem* mContextMenuItem;
91 static TQValueList<FavoriteFolderView*> mInstances;
92 bool mReadingConfig;
93};
94
95}
96
97#endif
Mail folder.
Definition: kmfolder.h:69
folderdiaquotatab.h
Definition: aboutdata.cpp:40