fix Messages.sh after yesterday change in extract-messages.sh
[kdepim.git] / kmail / folderselectiondialog.h
blobdd3db100c4ddda5f45d38f337f0e6ebdd5e1007f
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>
23 #include <KDialog>
24 #include <akonadi/collection.h>
25 class KJob;
27 /**
28 * A dialog that lets the user select a folder.
29 * TODO: Move most of this to Akonadi::CollectionDialog
31 class FolderSelectionDialog : public KDialog
33 Q_OBJECT
34 public:
35 enum SelectionFolderOption
37 None = 0,
38 EnableCheck = 1,
39 ShowUnreadCount = 2,
40 HideVirtualFolder = 4,
41 NotAllowToCreateNewFolder = 8,
42 HideOutboxFolder = 16,
43 HideImapFolder = 32,
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;
59 private slots:
60 void slotSelectionChanged();
61 void slotAddChildFolder();
62 void collectionCreationResult(KJob*);
63 void rowsInserted( const QModelIndex& col, int, int );
65 protected:
66 void readConfig();
67 void writeConfig();
68 bool canCreateCollection( Akonadi::Collection & parentCol );
69 /*reimp*/ void hideEvent( QHideEvent* );
71 private:
72 class FolderSelectionDialogPrivate;
73 FolderSelectionDialogPrivate * const d;
77 #endif