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
00117 void setDropActionMenuEnabled( bool enabled );
00118
00125 bool isDropActionMenuEnabled() const;
00126
00127 Q_SIGNALS:
00134 void clicked( const Akonadi::Collection &collection );
00135
00142 void clicked( const Akonadi::Item &item );
00143
00150 void doubleClicked( const Akonadi::Collection &collection );
00151
00158 void doubleClicked( const Akonadi::Item &item );
00159
00166 void currentChanged( const Akonadi::Collection &collection );
00167
00174 void currentChanged( const Akonadi::Item &item );
00175
00176 protected:
00177 using QTreeView::currentChanged;
00178 virtual void dragMoveEvent( QDragMoveEvent *event );
00179 virtual void timerEvent( QTimerEvent *event );
00180 virtual void dropEvent( QDropEvent *event );
00181 virtual void contextMenuEvent( QContextMenuEvent *event );
00182 virtual void startDrag( Qt::DropActions supportedActions );
00183
00184 private:
00185
00186 class Private;
00187 Private * const d;
00188
00189 Q_PRIVATE_SLOT( d, void itemClicked( const QModelIndex& ) )
00190 Q_PRIVATE_SLOT( d, void itemDoubleClicked( const QModelIndex& ) )
00191 Q_PRIVATE_SLOT( d, void itemCurrentChanged( const QModelIndex& ) )
00192 Q_PRIVATE_SLOT( d, void slotSelectionChanged( const QItemSelection &, const QItemSelection & ) )
00193
00194 };
00195
00196 }
00197
00198 #endif