00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KOUSERSTYLECOLLECTION_H
00020 #define KOUSERSTYLECOLLECTION_H
00021
00022 class KoUserStyle;
00023 #include <koffice_export.h>
00024 #include <QStringList>
00025
00032 class KOTEXT_EXPORT KoUserStyleCollection
00033 {
00034 public:
00040 KoUserStyleCollection( const QString& prefix );
00041
00046 ~KoUserStyleCollection();
00047
00051 void clear();
00052
00056 bool isEmpty() const { return m_styleList.isEmpty(); }
00060 int count() const { return m_styleList.count(); }
00064 int indexOf( KoUserStyle* style ) const { return m_styleList.indexOf( style ); }
00065
00069 QList<KoUserStyle *> styleList() const { return m_styleList; }
00070
00076 QString generateUniqueName() const;
00077
00081 QStringList displayNameList() const;
00082
00089 KoUserStyle* findStyle( const QString & name, const QString& defaultStyleName ) const;
00090
00098 KoUserStyle* findStyleByDisplayName( const QString& displayName ) const;
00099
00104 void removeStyle( KoUserStyle *style );
00105
00111 void updateStyleListOrder( const QStringList& list );
00112
00123 KoUserStyle* addStyle( KoUserStyle* sty );
00124
00129 bool isDefault() const { return m_default; }
00133 void setDefault( bool d ) { m_default = d; }
00134
00135 protected:
00136 KoUserStyleCollection( const KoUserStyleCollection& rhs );
00137 void operator=( const KoUserStyleCollection& rhs );
00138
00139 QList<KoUserStyle *> m_styleList;
00140
00141 private:
00142 QList<KoUserStyle *> m_deletedStyles;
00143 const QString m_prefix;
00144
00145 mutable KoUserStyle *m_lastStyle;
00146 bool m_default;
00147 bool m_unused1;
00148 bool m_unused2;
00149 bool m_unused3;
00150 };
00151
00152
00153 #endif
00154