F:/KPlato/koffice/libs/kofficeui/KoDocumentSectionView.h

Aller à la documentation de ce fichier.
00001 /*
00002   Copyright (c) 2006 Gábor Lehel <illissius@gmail.com>
00003 
00004   This library is free software; you can redistribute it and/or
00005   modify it under the terms of the GNU Library General Public
00006   License as published by the Free Software Foundation; either
00007   version 2 of the License, or (at your option) any later version.
00008 
00009   This library is distributed in the hope that it will be useful,
00010   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012   Library General Public 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
00016   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017   Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KO_DOCUMENT_SECTION_VIEW_H
00021 #define KO_DOCUMENT_SECTION_VIEW_H
00022 
00023 #include <QTreeView>
00024 #include <koffice_export.h>
00025 
00026 class QStyleOptionViewItem;
00027 class KoDocumentSectionModel;
00028 
00029 class KOFFICEUI_EXPORT KoDocumentSectionView: public QTreeView
00030 {
00031     typedef QTreeView super;
00032     Q_OBJECT
00033 
00034     signals:
00035         void contextMenuRequested( const QPoint &globalPos, const QModelIndex &index );
00036 
00037     public:
00038         KoDocumentSectionView( QWidget *parent = 0 );
00039         virtual ~KoDocumentSectionView();
00040 
00042         enum DisplayMode
00043         {
00045             ThumbnailMode,
00046 
00048             DetailedMode,
00049 
00051             MinimalMode
00052         };
00053 
00054         void setDisplayMode( DisplayMode mode );
00055 
00056         DisplayMode displayMode() const;
00057 
00058         void addPropertyActions( QMenu *menu, const QModelIndex &index );
00059 
00060     protected:
00061         virtual bool viewportEvent( QEvent *event );
00062         virtual void contextMenuEvent( QContextMenuEvent *event );
00063         virtual void showContextMenu( const QPoint &globalPos, const QModelIndex &index );
00064 
00065     protected slots:
00066         virtual void currentChanged( const QModelIndex &current, const QModelIndex &previous );
00067         virtual void dataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight );
00068 
00069     private slots:
00070         void slotActionToggled( bool on, const QPersistentModelIndex &index, int property );
00071 
00072     private:
00073         QStyleOptionViewItem optionForIndex( const QModelIndex &index ) const;
00074         typedef KoDocumentSectionModel Model;
00075         class PropertyAction;
00076         class Private;
00077         Private* const d;
00078 };
00079 
00080 #endif

Généré le Wed Nov 22 23:41:04 2006 pour KPlato par  doxygen 1.5.1-p1