akonadi
entitylistview.h
00001 /* 00002 Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org> 00003 Copyright (c) 2008 Stephen Kelly <steveire@gmail.com> 00004 Copyright (c) 2009 Kevin Ottens <ervin@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_ENTITYLISTVIEW_H 00023 #define AKONADI_ENTITYLISTVIEW_H 00024 00025 #include "akonadi_export.h" 00026 00027 #include <QtGui/QListView> 00028 00029 class KXMLGUIClient; 00030 class QDragMoveEvent; 00031 00032 namespace Akonadi 00033 { 00034 00035 class Collection; 00036 class Item; 00037 00075 class AKONADI_EXPORT EntityListView : public QListView 00076 { 00077 Q_OBJECT 00078 00079 public: 00085 explicit EntityListView( QWidget *parent = 0 ); 00086 00095 explicit EntityListView( KXMLGUIClient *xmlGuiClient, QWidget *parent = 0 ); 00096 00100 virtual ~EntityListView(); 00101 00109 void setXmlGuiClient( KXMLGUIClient *xmlGuiClient ); 00110 00114 virtual void setModel( QAbstractItemModel * model ); 00115 00122 void setDropActionMenuEnabled( bool enabled ); 00123 00130 bool isDropActionMenuEnabled() const; 00131 00132 Q_SIGNALS: 00139 void clicked( const Akonadi::Collection &collection ); 00140 00147 void clicked( const Akonadi::Item &item ); 00148 00155 void doubleClicked( const Akonadi::Collection &collection ); 00156 00163 void doubleClicked( const Akonadi::Item &item ); 00164 00171 void currentChanged( const Akonadi::Collection &collection ); 00172 00179 void currentChanged( const Akonadi::Item &item ); 00180 00181 protected: 00182 using QListView::currentChanged; 00183 #ifndef QT_NO_DRAGANDDROP 00184 virtual void startDrag( Qt::DropActions supportedActions ); 00185 virtual void dropEvent( QDropEvent *event ); 00186 virtual void dragMoveEvent( QDragMoveEvent *event ); 00187 #endif 00188 00189 #ifndef QT_NO_CONTEXTMENU 00190 virtual void contextMenuEvent( QContextMenuEvent *event ); 00191 #endif 00192 00193 private: 00194 //@cond PRIVATE 00195 class Private; 00196 Private * const d; 00197 00198 Q_PRIVATE_SLOT( d, void itemClicked( const QModelIndex& ) ) 00199 Q_PRIVATE_SLOT( d, void itemDoubleClicked( const QModelIndex& ) ) 00200 Q_PRIVATE_SLOT( d, void itemCurrentChanged( const QModelIndex& ) ) 00201 //@endcond 00202 }; 00203 00204 } 00205 00206 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:18 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:18 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.