diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kformula/kformula_doc.h | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kformula/kformula_doc.h')
-rw-r--r-- | kformula/kformula_doc.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/kformula/kformula_doc.h b/kformula/kformula_doc.h new file mode 100644 index 00000000..b139f922 --- /dev/null +++ b/kformula/kformula_doc.h @@ -0,0 +1,113 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Andrea Rizzi <[email protected]> + Ulrich Kuettler <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +#ifndef KFORMULA_DOC_H +#define KFORMULA_DOC_H + +#include <qptrlist.h> +#include <qpainter.h> + +#include <kcommand.h> +#include <KoDocument.h> +#include <KoCommandHistory.h> +#include <kformuladefs.h> + +#include "kformula_view.h" + +class KoXmlWriter; + +KFORMULA_NAMESPACE_BEGIN + +class FormulaCursor; +class Container; +class Document; +class DocumentWrapper; + +KFORMULA_NAMESPACE_END + + +/** + * The part's document. Forwards most of the requests. + */ +class KFormulaDoc : public KoDocument +{ + Q_OBJECT + +public: + + KFormulaDoc(QWidget *parentWidget = 0, + const char *widgetName = 0, + QObject* parent = 0, + const char* name = 0, + bool singleViewMode = false); + ~KFormulaDoc(); + + virtual void paintContent( QPainter &painter, const QRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 ); + + virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0); + virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false); + virtual bool showEmbedInitDialog(QWidget* parent); + virtual bool loadOasis( const QDomDocument& doc, KoOasisStyles& oasisStyles, const QDomDocument& settings, KoStore* ); + virtual bool loadXML(QIODevice *, const QDomDocument& doc); + virtual QDomDocument saveXML(); + virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter ); + + /** + * Saves the document in native format, to a given file. + * It is reimplemented to handle the special case of MathML, since it is + * a native format but not compressed. + */ + virtual bool saveNativeFormat( const QString & file ); + + KFormula::Container* getFormula() const { return formula; } + KFormula::Document* getDocument() const { return document; } + +protected slots: + + void commandExecuted(); + void documentRestored(); + +protected: + + virtual QString configFile() const; + virtual KoView* createViewInstance(QWidget* parent, const char* name); + +private: + + /** + * Our undo stack. + */ + KoCommandHistory* history; + + /** + * The place where all formula related work is done. + */ + KFormula::Container* formula; + + /** + * The document that contains all the formulas. + * Right now we only have one, but this might change. + */ + KFormula::Document* document; + + KFormula::DocumentWrapper* wrapper; +}; + +#endif |