1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 This file is part of KMail, the KDE mail client.
3 Copyright (c) 2009 Montel Laurent <montel@kde.org>
5 KMail is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License, version 2, as
7 published by the Free Software Foundation.
9 KMail is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef FOLDERSELECTIONDIALOG_H
20 #define FOLDERSELECTIONDIALOG_H
22 #include <QAbstractItemView>
24 #include <akonadi/collection.h>
28 * A dialog that lets the user select a folder.
29 * TODO: Move most of this to Akonadi::CollectionDialog
31 class FolderSelectionDialog
: public KDialog
35 enum SelectionFolderOption
40 HideVirtualFolder
= 4,
41 NotAllowToCreateNewFolder
= 8,
42 HideOutboxFolder
= 16,
44 NotUseGlobalSettings
= 64
46 Q_DECLARE_FLAGS( SelectionFolderOptions
, SelectionFolderOption
)
48 FolderSelectionDialog( QWidget
*parent
, SelectionFolderOptions options
);
49 ~FolderSelectionDialog();
51 void setSelectionMode( QAbstractItemView::SelectionMode mode
);
52 QAbstractItemView::SelectionMode
selectionMode() const;
54 Akonadi::Collection
selectedCollection() const;
55 void setSelectedCollection( const Akonadi::Collection
&collection
);
57 Akonadi::Collection::List
selectedCollections() const;
60 void slotSelectionChanged();
61 void slotAddChildFolder();
62 void collectionCreationResult(KJob
*);
63 void rowsInserted( const QModelIndex
& col
, int, int );
68 bool canCreateCollection( Akonadi::Collection
& parentCol
);
69 /*reimp*/ void hideEvent( QHideEvent
* );
72 class FolderSelectionDialogPrivate
;
73 FolderSelectionDialogPrivate
* const d
;