Akonadi

collectiondialog.h
1 /*
2  SPDX-FileCopyrightText: 2008 Ingo Klöcker <[email protected]>
3  SPDX-FileCopyrightText: 2010-2020 Laurent Montel <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef AKONADI_COLLECTIONDIALOG_H
9 #define AKONADI_COLLECTIONDIALOG_H
10 
11 #include "akonadiwidgets_export.h"
12 #include "collection.h"
13 
14 #include <QDialog>
15 #include <QAbstractItemView>
16 
17 namespace Akonadi
18 {
19 
53 class AKONADIWIDGETS_EXPORT CollectionDialog : public QDialog
54 {
55  Q_OBJECT
56  Q_DISABLE_COPY(CollectionDialog)
57 
58 public:
59  /* @since 4.6
60  */
61  enum CollectionDialogOption {
62  None = 0,
63  AllowToCreateNewChildCollection = 1,
64  KeepTreeExpanded = 2
65  };
66 
67  Q_DECLARE_FLAGS(CollectionDialogOptions, CollectionDialogOption)
68 
69 
74  explicit CollectionDialog(QWidget *parent = nullptr);
75 
87  explicit CollectionDialog(QAbstractItemModel *model, QWidget *parent = nullptr);
88 
102  explicit CollectionDialog(CollectionDialogOptions options, QAbstractItemModel *model = nullptr, QWidget *parent = nullptr);
103 
107  ~CollectionDialog();
108 
114  void setMimeTypeFilter(const QStringList &mimeTypes);
115 
119  Q_REQUIRED_RESULT QStringList mimeTypeFilter() const;
120 
126  void setAccessRightsFilter(Collection::Rights rights);
127 
133  Q_REQUIRED_RESULT Collection::Rights accessRightsFilter() const;
134 
140  void setDescription(const QString &text);
141 
147  void setDefaultCollection(const Collection &collection);
148 
155  void setSelectionMode(QAbstractItemView::SelectionMode mode);
156 
161  Q_REQUIRED_RESULT QAbstractItemView::SelectionMode selectionMode() const;
162 
168  Q_REQUIRED_RESULT Akonadi::Collection selectedCollection() const;
169 
173  Q_REQUIRED_RESULT Akonadi::Collection::List selectedCollections() const;
174 
180  void changeCollectionDialogOptions(CollectionDialogOptions options);
181 
185  void setUseFolderByDefault(bool b);
189  Q_REQUIRED_RESULT bool useFolderByDefault() const;
194  void setContentMimeTypes(const QStringList &mimetypes);
195 
196 private:
197  //@cond PRIVATE
198  class Private;
199  Private *const d;
200  //@endcond
201 };
202 
203 } // namespace Akonadi
204 
205 #endif // AKONADI_COLLECTIONDIALOG_H
A collection selection dialog.
Represents a collection of PIM items.
Definition: collection.h:63
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 6 2020 23:15:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.