akonadi
entitytreeview.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AKONADI_ENTITYTREEVIEW_H
00022 #define AKONADI_ENTITYTREEVIEW_H
00023
00024 #include "akonadi_export.h"
00025
00026 #include <QtGui/QTreeView>
00027
00028 class KXMLGUIClient;
00029 class QDragMoveEvent;
00030
00031 namespace Akonadi
00032 {
00033
00034 class Collection;
00035 class Item;
00036
00070 class AKONADI_EXPORT EntityTreeView : public QTreeView
00071 {
00072 Q_OBJECT
00073
00074 public:
00080 explicit EntityTreeView( QWidget *parent = 0 );
00081
00090 explicit EntityTreeView( KXMLGUIClient *xmlGuiClient, QWidget *parent = 0 );
00091
00095 virtual ~EntityTreeView();
00096
00104 void setXmlGuiClient( KXMLGUIClient *xmlGuiClient );
00105
00109 virtual void setModel( QAbstractItemModel * model );
00110
00111 Q_SIGNALS:
00118 void clicked( const Akonadi::Collection &collection );
00119
00126 void clicked( const Akonadi::Item &item );
00127
00134 void doubleClicked( const Akonadi::Collection &collection );
00135
00142 void doubleClicked( const Akonadi::Item &item );
00143
00150 void currentChanged( const Akonadi::Collection &collection );
00151
00158 void currentChanged( const Akonadi::Item &item );
00159
00160 protected:
00161 using QTreeView::currentChanged;
00162 virtual void dragMoveEvent( QDragMoveEvent *event );
00163 virtual void timerEvent( QTimerEvent *event );
00164 virtual void dropEvent( QDropEvent *event );
00165 virtual void contextMenuEvent( QContextMenuEvent *event );
00166 virtual void startDrag( Qt::DropActions supportedActions );
00167
00168 private:
00169
00170 class Private;
00171 Private * const d;
00172
00173 Q_PRIVATE_SLOT( d, void itemClicked( const QModelIndex& ) )
00174 Q_PRIVATE_SLOT( d, void itemDoubleClicked( const QModelIndex& ) )
00175 Q_PRIVATE_SLOT( d, void itemCurrentChanged( const QModelIndex& ) )
00176 Q_PRIVATE_SLOT( d, void slotSelectionChanged( const QItemSelection &, const QItemSelection & ) )
00177
00178 };
00179
00180 }
00181
00182 #endif