F:/KPlato/koffice/libs/kofficecore/KoGenStyles.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004-2006 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 KOGENSTYLES_H
00020 #define KOGENSTYLES_H
00021 
00022 #include <QMap>
00023 #include <q3valuevector.h>
00024 //Added by qt3to4:
00025 #include <Q3ValueList>
00026 #include <QString>
00027 #include <koffice_export.h>
00028 #include "KoGenStyle.h"
00029 
00030 class KoXmlWriter;
00031 
00060 class KOFFICECORE_EXPORT KoGenStyles
00061 {
00062 public:
00063     KoGenStyles();
00064     ~KoGenStyles();
00065 
00075     enum Flags { // bitfield
00076         NoFlag = 0,
00077         ForceNumbering = 0, // it's the default anyway
00078         DontForceNumbering = 1
00079     };
00080     // KDE4 TODO: use QFlags and change the arg type in lookup
00081 
00098     QString lookup( const KoGenStyle& style, const QString& name = QString::null, int flags = NoFlag );
00099 
00100     typedef QMap<KoGenStyle, QString> StyleMap;
00105     const StyleMap& styles() const { return m_styleMap; }
00106 
00107     struct NamedStyle {
00108         const KoGenStyle* style; 
00109         QString name;
00110     };
00120     Q3ValueList<NamedStyle> styles( int type, bool markedForStylesXml = false ) const;
00121 
00125     const KoGenStyle* style( const QString& name ) const;
00126 
00134     KoGenStyle* styleForModification( const QString& name );
00135 
00148     void markStyleForStylesXml( const QString& name );
00149 
00153     void dump();
00154 
00155 private:
00156     QString makeUniqueName( const QString& base, int flags ) const;
00157 
00159     StyleMap m_styleMap;
00160 
00164     typedef QMap<QString, bool> NameMap; // KDE4: QSet
00165     NameMap m_styleNames;
00166     NameMap m_autoStylesInStylesDotXml;
00167 
00169     typedef Q3ValueVector<NamedStyle> StyleArray;
00170     StyleArray m_styleArray;
00171 
00172     class Private;
00173     Private *d;
00174 };
00175 
00176 #endif /* KOGENSTYLES_H */

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