akonadi
entitytreeview.h
00001 /* 00002 Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org> 00003 Copyright (c) 2008 Stephen Kelly <steveire@gmail.com> 00004 Copyright (c) 2012 Laurent Montel <montel@kde.org> 00005 00006 This library is free software; you can redistribute it and/or modify it 00007 under the terms of the GNU Library General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or (at your 00009 option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, but WITHOUT 00012 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00014 License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to the 00018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00019 02110-1301, USA. 00020 */ 00021 00022 #ifndef AKONADI_ENTITYTREEVIEW_H 00023 #define AKONADI_ENTITYTREEVIEW_H 00024 00025 #include "akonadi_export.h" 00026 00027 #include <QtGui/QTreeView> 00028 00029 class KXMLGUIClient; 00030 class QDragMoveEvent; 00031 00032 namespace Akonadi 00033 { 00034 00035 class Collection; 00036 class Item; 00037 00071 class AKONADI_EXPORT EntityTreeView : public QTreeView 00072 { 00073 Q_OBJECT 00074 00075 public: 00081 explicit EntityTreeView( QWidget *parent = 0 ); 00082 00091 explicit EntityTreeView( KXMLGUIClient *xmlGuiClient, QWidget *parent = 0 ); 00092 00096 virtual ~EntityTreeView(); 00097 00105 void setXmlGuiClient( KXMLGUIClient *xmlGuiClient ); 00106 00110 virtual void setModel( QAbstractItemModel * model ); 00111 00118 void setDropActionMenuEnabled( bool enabled ); 00119 00126 bool isDropActionMenuEnabled() const; 00127 00135 bool isManualSortingActive() const; 00136 00141 void setManualSortingActive(bool active); 00142 00143 Q_SIGNALS: 00150 void clicked( const Akonadi::Collection &collection ); 00151 00158 void clicked( const Akonadi::Item &item ); 00159 00166 void doubleClicked( const Akonadi::Collection &collection ); 00167 00174 void doubleClicked( const Akonadi::Item &item ); 00175 00182 void currentChanged( const Akonadi::Collection &collection ); 00183 00190 void currentChanged( const Akonadi::Item &item ); 00191 00192 protected: 00193 using QTreeView::currentChanged; 00194 #ifndef QT_NO_DRAGANDDROP 00195 virtual void startDrag( Qt::DropActions supportedActions ); 00196 virtual void dragMoveEvent( QDragMoveEvent *event ); 00197 virtual void dropEvent( QDropEvent *event ); 00198 #endif 00199 virtual void timerEvent( QTimerEvent *event ); 00200 #ifndef QT_NO_CONTEXTMENU 00201 virtual void contextMenuEvent( QContextMenuEvent *event ); 00202 #endif 00203 00204 00205 private: 00206 //@cond PRIVATE 00207 class Private; 00208 Private * const d; 00209 00210 Q_PRIVATE_SLOT( d, void itemClicked( const QModelIndex& ) ) 00211 Q_PRIVATE_SLOT( d, void itemDoubleClicked( const QModelIndex& ) ) 00212 Q_PRIVATE_SLOT( d, void itemCurrentChanged( const QModelIndex& ) ) 00213 Q_PRIVATE_SLOT( d, void slotSelectionChanged( const QItemSelection &, const QItemSelection & ) ) 00214 //@endcond 00215 }; 00216 00217 } 00218 00219 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:49:15 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Apr 30 2012 21:49:15 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.