F:/KPlato/koffice/libs/kotext/KoUserStyleCollection.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 David Faure <faure@kde.org>
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 version 2 as published by the Free Software Foundation.
00007 
00008    This library is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011    Library General Public License for more details.
00012 
00013    You should have received a copy of the GNU Library General Public License
00014    along with this library; see the file COPYING.LIB.  If not, write to
00015    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016    Boston, MA 02110-1301, USA.
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     // can become d pointer if needed
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 /* KOUSERSTYLECOLLECTION_H */
00154 

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