Akonadi

collectionview.h
1 /*
2  SPDX-FileCopyrightText: 2006-2007 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_COLLECTION_VIEW
8 #define AKONADI_COLLECTION_VIEW
9 
10 #include "akonadiwidgets_export.h"
11 #include <QTreeView>
12 
13 class KXMLGUIClient;
14 class KXmlGuiWindow;
15 class QDragMoveEvent;
16 
17 namespace Akonadi
18 {
19 
20 class Collection;
21 
54 class AKONADIWIDGETS_DEPRECATED_EXPORT CollectionView : public QTreeView
55 {
56  Q_OBJECT
57 
58 public:
64  explicit CollectionView(QWidget *parent = nullptr);
65 
74  explicit CollectionView(KXMLGUIClient *xmlGuiClient, QWidget *parent = nullptr);
75 
79  ~CollectionView() override;
80 
88  void setXmlGuiClient(KXMLGUIClient *xmlGuiClient);
89 
90  void setModel(QAbstractItemModel *model) override;
91 
92 Q_SIGNALS:
99  void clicked(const Akonadi::Collection &collection);
100 
107  void currentChanged(const Akonadi::Collection &collection);
108 
109 protected:
111  void dragMoveEvent(QDragMoveEvent *event) override;
112  void dragLeaveEvent(QDragLeaveEvent *event) override;
113  void dropEvent(QDropEvent *event) override;
114  void contextMenuEvent(QContextMenuEvent *event) override;
115 
116 private:
117  //@cond PRIVATE
118  class Private;
119  Private *const d;
120 
121  Q_PRIVATE_SLOT(d, void itemClicked(const QModelIndex &))
122  Q_PRIVATE_SLOT(d, void itemCurrentChanged(const QModelIndex &))
123  //@endcond
124 };
125 
126 }
127 
128 #endif
virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
Represents a collection of PIM items.
Definition: collection.h:63
A view to show a collection tree provided by a EntityTreeModel.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Oct 22 2020 23:20:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.