kmail

foldertreebase.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_FOLDERTREEBASE_H
20#define KMAIL_FOLDERTREEBASE_H
21
22#include <libtdepim/kfoldertree.h>
23
24class KMFolder;
25class KMMainWidget;
26
27namespace KMail {
28
29class FolderTreeBase : public KFolderTree
30{
31 TQ_OBJECT
32
33 public:
34 FolderTreeBase( KMMainWidget *mainWidget, TQWidget *parent = 0, const char *name = 0 );
35
37 KMMainWidget* mainWidget() const { return mMainWidget; }
38
40 virtual TQListViewItem* indexOfFolder( const KMFolder* folder ) const
41 {
42 if ( mFolderToItem.contains( folder ) )
43 return mFolderToItem[ folder ];
44 else
45 return 0;
46 }
47
48 void insertIntoFolderToItemMap( const KMFolder *folder, TQListViewItem* item )
49 {
50 mFolderToItem.insert( folder, item );
51 }
52
53 void removeFromFolderToItemMap( const KMFolder *folder )
54 {
55 mFolderToItem.remove( folder );
56 }
57
58 signals:
60 void folderDrop(KMFolder*);
61
63 void folderDropCopy(KMFolder*);
64
65 void triggerRefresh();
66
67 public slots:
69 void slotUpdateCounts(KMFolder * folder, bool force = false );
70
71 protected:
72 enum {
73 DRAG_COPY = 0,
74 DRAG_MOVE = 1,
75 DRAG_CANCEL = 2
76 };
77 int dndMode( bool alwaysAsk = false );
78 void contentsDropEvent( TQDropEvent *e );
79
81 virtual bool event(TQEvent *e);
82
84 virtual void readColorConfig();
85
87 bool hideLocalInbox() const;
88
90 void handleMailListDrop( TQDropEvent *event, KMFolder *destination );
91
92 protected:
93 KMMainWidget *mMainWidget;
94 TQMap<const KMFolder*, TQListViewItem*> mFolderToItem;
95};
96
97}
98
99#endif
Mail folder.
Definition: kmfolder.h:69
folderdiaquotatab.h
Definition: aboutdata.cpp:40