kspread Library API Documentation

kspread_style_manager.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Norbert Andres, nandres@web.de
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., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 
00021 #ifndef __kspread_style_manager__
00022 #define __kspread_style_manager__
00023 
00024 #include <qmap.h>
00025 #include <koffice_export.h>
00026 class KSpreadCustomStyle;
00027 class KSpreadStyleDlg;
00028 class KSpreadView;
00029 
00030 class QDomElement;
00031 class QDomDocument;
00032 class QStringList;
00033 
00034 class KoGenStyles;
00035 class KoOasisStyles;
00036 
00037 class KSPREAD_EXPORT KSpreadStyleManager
00038 {
00039  public:
00040   KSpreadStyleManager();
00041   ~KSpreadStyleManager();
00042 
00043   QDomElement save( QDomDocument & doc );
00044   bool loadXML( QDomElement const & styles );
00045 
00046     void saveOasis( KoGenStyles &mainStyles );
00047     void loadOasisStyleTemplate(  KoOasisStyles& oasisStyles );
00048 
00049   KSpreadCustomStyle * defaultStyle() const { return m_defaultStyle; }
00050   KSpreadCustomStyle * style( QString const & name ) const;
00051 
00052   bool checkCircle( QString const & name, QString const & parent );
00053   bool validateStyleName( QString const & name, KSpreadCustomStyle * style );
00054   void changeName( QString const & oldName, QString const & newName );
00055 
00056   void takeStyle( KSpreadCustomStyle * style );
00057   void createBuiltinStyles();
00058 
00059   QStringList styleNames() const;
00060   int count() const { return m_styles.count(); }
00061 
00062  private:
00063   friend class KSpreadStyleDlg;
00064   friend class KSpreadView;
00065   class Styles : public QMap<QString, KSpreadCustomStyle *> {};
00066 
00067   KSpreadCustomStyle * m_defaultStyle;
00068   Styles               m_styles; // builtin and custom made styles
00069 };
00070 
00071 #endif
KDE Logo
This file is part of the documentation for kspread Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:43:25 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003