KDEUI
kpageview.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KPAGEVIEW_H
00023 #define KPAGEVIEW_H
00024
00025 #include <kdeui_export.h>
00026
00027 #include <QtGui/QWidget>
00028
00029 class KPageModel;
00030
00031 class QAbstractItemDelegate;
00032 class QAbstractItemView;
00033 class QModelIndex;
00034 class KPageViewPrivate;
00035 class QAbstractItemModel;
00036
00060 class KDEUI_EXPORT KPageView : public QWidget
00061 {
00062 Q_OBJECT
00063 Q_ENUMS( FaceType )
00064 Q_PROPERTY( FaceType faceType READ faceType WRITE setFaceType )
00065 Q_DECLARE_PRIVATE(KPageView)
00066
00067 public:
00085 enum FaceType
00086 {
00087 Auto,
00088 Plain,
00089 List,
00090 Tree,
00091 Tabbed
00092 };
00093
00097 explicit KPageView( QWidget *parent = 0 );
00098
00102 virtual ~KPageView();
00103
00109 void setModel(QAbstractItemModel *model);
00110
00114 QAbstractItemModel* model() const;
00115
00119 void setFaceType( FaceType faceType );
00120
00124 FaceType faceType() const;
00125
00130 void setCurrentPage( const QModelIndex &index );
00131
00136 QModelIndex currentPage() const;
00137
00142 void setItemDelegate( QAbstractItemDelegate *delegate );
00143
00147 QAbstractItemDelegate* itemDelegate() const;
00148
00153 void setDefaultWidget( QWidget *widget );
00154
00155 Q_SIGNALS:
00160 void currentPageChanged( const QModelIndex ¤t, const QModelIndex &previous );
00161
00162 protected:
00170 virtual QAbstractItemView* createView();
00171
00178 virtual bool showPageHeader() const;
00179
00187 virtual Qt::Alignment viewPosition() const;
00188
00189 KPageView(KPageViewPrivate &dd, QWidget *parent);
00190 KPageViewPrivate *const d_ptr;
00191
00192 private:
00193 Q_PRIVATE_SLOT(d_func(), void _k_rebuildGui())
00194 Q_PRIVATE_SLOT(d_func(), void _k_modelChanged())
00195 Q_PRIVATE_SLOT(d_func(), void _k_pageSelected(const QModelIndex &, const QModelIndex &))
00196 Q_PRIVATE_SLOT(d_func(), void _k_dataChanged(const QModelIndex &, const QModelIndex &))
00197 };
00198
00199 #endif