F:/KPlato/koffice/libs/kofficeui/KoDocumentSectionModel.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_MODEL_H
00021 #define KO_DOCUMENT_SECTION_MODEL_H
00022 
00023 #include <QAbstractItemModel>
00024 #include <QIcon>
00025 #include <QList>
00026 #include <QString>
00027 #include <QVariant>
00028 
00031 class KoDocumentSectionModel: public QAbstractItemModel
00032 {
00033     public:
00034 
00035     KoDocumentSectionModel( QObject *parent = 0 ): QAbstractItemModel( parent ) { }
00036 
00038     enum ItemDataRole
00039     {
00041         ActiveRole = 33,
00042 
00044         PropertiesRole,
00045 
00047         AspectRatioRole,
00048 
00050         BeginThumbnailRole
00051     };
00052 
00054     struct Property
00055     {
00057         QString name;
00058 
00060         bool isMutable;
00061 
00063         QIcon onIcon;
00064         QIcon offIcon;
00065 
00067         QVariant state;
00068 
00070         Property(): isMutable( false ) { }
00071 
00073         Property( const QString &n, const QIcon &on, const QIcon &off, bool isOn )
00074             : name( n ), isMutable( true ), onIcon( on ), offIcon( off ), state( isOn ) { }
00075 
00077         Property( const QString &n, const QString &s )
00078             : name( n ), isMutable( false ), state( s ) { }
00079     };
00080 
00082     typedef QList<Property> PropertyList;
00083 };
00084 
00085 Q_DECLARE_METATYPE( KoDocumentSectionModel::PropertyList )
00086 
00087 #endif

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