itemview.h
00001 /* 00002 Copyright (c) 2007 Tobias Koenig <tokoe@kde.org> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #ifndef AKONADI_ITEM_VIEW 00021 #define AKONADI_ITEM_VIEW 00022 00023 #include "akonadi_export.h" 00024 #include <QtGui/QTreeView> 00025 00026 class KXmlGuiWindow; 00027 class KXMLGUIClient; 00028 namespace Akonadi { 00029 00030 class Item; 00031 00060 class AKONADI_EXPORT ItemView : public QTreeView 00061 { 00062 Q_OBJECT 00063 00064 public: 00070 explicit ItemView( QWidget *parent = 0 ); 00071 00080 explicit KDE_DEPRECATED ItemView( KXmlGuiWindow *xmlGuiWindow, QWidget *parent = 0 ); 00081 00091 explicit ItemView( KXMLGUIClient *xmlGuiClient, QWidget *parent = 0 ); 00092 00096 virtual ~ItemView(); 00097 00104 KDE_DEPRECATED void setXmlGuiWindow( KXmlGuiWindow *xmlGuiWindow ); 00105 00112 void setXmlGuiClient( KXMLGUIClient *xmlGuiClient ); 00113 00114 00115 virtual void setModel( QAbstractItemModel * model ); 00116 00117 Q_SIGNALS: 00124 void activated( const Akonadi::Item &item ); 00125 00132 void currentChanged( const Akonadi::Item &item ); 00133 00141 void clicked( const Akonadi::Item &item ); 00142 00150 void doubleClicked( const Akonadi::Item &item ); 00151 00152 protected: 00153 using QTreeView::currentChanged; 00154 void contextMenuEvent( QContextMenuEvent *event ); 00155 00156 private: 00157 //@cond PRIVATE 00158 class Private; 00159 Private * const d; 00160 00161 Q_PRIVATE_SLOT( d, void itemActivated( const QModelIndex& ) ) 00162 Q_PRIVATE_SLOT( d, void itemCurrentChanged( const QModelIndex& ) ) 00163 Q_PRIVATE_SLOT( d, void itemClicked( const QModelIndex& ) ) 00164 Q_PRIVATE_SLOT( d, void itemDoubleClicked( const QModelIndex& ) ) 00165 //@endcond 00166 }; 00167 00168 } 00169 00170 #endif