kspread Library API Documentation

kspread_map.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@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 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 #ifndef __kspread_map_h__
00021 #define __kspread_map_h__
00022 
00023 class KSpreadChanges;
00024 class KSpreadMap;
00025 class KSpreadDoc;
00026 
00027 class KoStore;
00028 
00029 class DCOPObject;
00030 
00031 class QDomElement;
00032 class QDomDocument;
00033 class KoXmlWriter;
00034 class KoGenStyles;
00035 class KoOasisSettings;
00036 
00037 #include <qcstring.h>
00038 #include <qptrlist.h>
00039 #include <qstring.h>
00040 #include <qstringlist.h>
00041 #include <qintdict.h>
00042 #include <qobject.h>
00043 
00044 #include "kspread_sheet.h"
00045 
00050 class KSPREAD_EXPORT KSpreadMap : public QObject
00051 {
00052 Q_OBJECT
00053 public:
00057   KSpreadMap ( KSpreadDoc* doc, const char* name = 0);
00061   virtual ~KSpreadMap();
00062   
00063   KSpreadDoc* doc();
00064 
00065   QDomElement save( QDomDocument& doc );
00066 
00067     void saveOasisSettings( KoXmlWriter &settingsWriter );
00068     void loadOasisSettings( KoOasisSettings &settings );
00069 
00070     bool saveOasis( KoXmlWriter & xmlWriter, KoGenStyles & mainStyles );
00071 
00072     bool loadOasis( const QDomElement& mymap, KoOasisStyles& oasisStyles );
00073   bool loadXML( const QDomElement& mymap );
00074   bool loadChildren( KoStore* _store );
00075 
00076   bool saveChildren( KoStore* _store );
00077 
00078   void password( QCString & passwd ) const { passwd = m_strPassword; }
00079   bool isProtected() const { return !m_strPassword.isNull(); }
00080   void setProtected( QCString const & passwd );
00081   bool checkPassword( QCString const & passwd ) const { return ( passwd == m_strPassword ); }
00082 
00087   void moveSheet( const QString & _from, const QString & _to, bool _before = true );
00088 
00089   KSpreadSheet* findSheet( const QString & _name );
00090   KSpreadSheet* nextSheet( KSpreadSheet* );
00091   KSpreadSheet* previousSheet( KSpreadSheet* );
00092 
00093   KSpreadSheet* initialActiveSheet()const { return m_initialActiveSheet; }
00094   int initialMarkerColumn()const { return m_initialMarkerColumn; }
00095   int initialMarkerRow()const { return m_initialMarkerRow; }
00096 
00101   KSpreadSheet * createSheet();
00103   void addSheet( KSpreadSheet *_sheet );
00104 
00106   KSpreadSheet *addNewSheet ();
00107   
00114   KSpreadSheet* firstSheet() { return m_lstSheets.first();  }
00115 
00122   KSpreadSheet* lastSheet() { return m_lstSheets.last();  }
00123 
00130   KSpreadSheet* nextSheet() { return m_lstSheets.next();  }
00131 
00132   QPtrList<KSpreadSheet>& sheetList() { return m_lstSheets; }
00133 
00137   int count()const { return m_lstSheets.count(); }
00138 
00139   void update();
00140 
00144     // void draw( QPaintDevice* _dev, long int _width, long int _height,
00145     // float _scale );
00146 
00147   virtual DCOPObject* dcopObject();
00148 
00149   void takeSheet( KSpreadSheet * sheet );
00150   void insertSheet( KSpreadSheet * sheet );
00151 
00152   QStringList visibleSheets() const;
00153   QStringList hiddenSheets() const;
00154 
00155     static bool respectCase;
00156 
00157 signals:
00158 
00162   void sig_addSheet( KSpreadSheet *_table );
00163 private:
00164 
00165   KSpreadDoc* m_doc;
00166 
00170   QPtrList<KSpreadSheet> m_lstSheets;
00171   QPtrList<KSpreadSheet> m_lstDeletedSheets;
00172 
00176   QCString m_strPassword;
00180   KSpreadSheet * m_initialActiveSheet;
00181   int m_initialMarkerColumn;
00182   int m_initialMarkerRow;
00183   
00184   // used to give every KSpreadSheet a unique default name.
00185   int tableId;
00186 
00187   DCOPObject* m_dcop;
00188 };
00189 
00190 #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:13 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003