kformula

kformula_doc.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
00003                   Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KFORMULA_DOC_H
00022 #define KFORMULA_DOC_H
00023 
00024 #include <qptrlist.h>
00025 #include <qpainter.h>
00026 
00027 #include <kcommand.h>
00028 #include <KoDocument.h>
00029 #include <KoCommandHistory.h>
00030 #include <kformuladefs.h>
00031 
00032 #include "kformula_view.h"
00033 
00034 class KoXmlWriter;
00035 
00036 KFORMULA_NAMESPACE_BEGIN
00037 
00038 class FormulaCursor;
00039 class Container;
00040 class Document;
00041 class DocumentWrapper;
00042 
00043 KFORMULA_NAMESPACE_END
00044 
00045 
00049 class KFormulaDoc : public KoDocument
00050 {
00051     Q_OBJECT
00052 
00053 public:
00054 
00055     KFormulaDoc(QWidget *parentWidget = 0,
00056                 const char *widgetName = 0,
00057                 QObject* parent = 0,
00058                 const char* name = 0,
00059                 bool singleViewMode = false);
00060     ~KFormulaDoc();
00061 
00062     virtual void paintContent( QPainter &painter, const QRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
00063 
00064     virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0);
00065     virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false);
00066     virtual bool showEmbedInitDialog(QWidget* parent);
00067     virtual bool loadOasis( const QDomDocument& doc, KoOasisStyles& oasisStyles, const QDomDocument& settings, KoStore* );
00068     virtual bool loadXML(QIODevice *, const QDomDocument& doc);
00069     virtual QDomDocument saveXML();
00070     virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
00071     
00077     virtual bool saveNativeFormat( const QString & file );
00078 
00079     KFormula::Container* getFormula() const { return formula; }
00080     KFormula::Document* getDocument() const { return document; }
00081 
00082 protected slots:
00083 
00084     void commandExecuted();
00085     void documentRestored();
00086 
00087 protected:
00088 
00089     virtual QString configFile() const;
00090     virtual KoView* createViewInstance(QWidget* parent, const char* name);
00091 
00092 private:
00093 
00097     KoCommandHistory* history;
00098 
00102     KFormula::Container* formula;
00103 
00108     KFormula::Document* document;
00109 
00110     KFormula::DocumentWrapper* wrapper;
00111 };
00112 
00113 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys