00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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