kformula

kformula_doc.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
3 Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KFORMULA_DOC_H
22#define KFORMULA_DOC_H
23
24#include <tqptrlist.h>
25#include <tqpainter.h>
26
27#include <kcommand.h>
28#include <KoDocument.h>
29#include <KoCommandHistory.h>
30#include <kformuladefs.h>
31
32#include "kformula_view.h"
33
34class KoXmlWriter;
35
36KFORMULA_NAMESPACE_BEGIN
37
38class FormulaCursor;
39class Container;
40class Document;
41class DocumentWrapper;
42
43KFORMULA_NAMESPACE_END
44
45
49class KFormulaDoc : public KoDocument
50{
51 TQ_OBJECT
52
53
54public:
55
56 KFormulaDoc(TQWidget *parentWidget = 0,
57 const char *widgetName = 0,
58 TQObject* parent = 0,
59 const char* name = 0,
60 bool singleViewMode = false);
61 ~KFormulaDoc();
62
63 virtual void paintContent( TQPainter &painter, const TQRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
64
65 virtual bool initDoc(InitDocFlags flags, TQWidget* parentWidget=0);
66 virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false);
67 virtual bool showEmbedInitDialog(TQWidget* parent);
68 virtual bool loadOasis( const TQDomDocument& doc, KoOasisStyles& oasisStyles, const TQDomDocument& settings, KoStore* );
69 virtual bool loadXML(TQIODevice *, const TQDomDocument& doc);
70 virtual TQDomDocument saveXML();
71 virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
72
78 virtual bool saveNativeFormat( const TQString & file );
79
80 KFormula::Container* getFormula() const { return formula; }
81 KFormula::Document* getDocument() const { return document; }
82
83protected slots:
84
85 void commandExecuted();
86 void documentRestored();
87
88protected:
89
90 virtual TQString configFile() const;
91 virtual KoView* createViewInstance(TQWidget* parent, const char* name);
92
93private:
94
98 KoCommandHistory* history;
99
103 KFormula::Container* formula;
104
109 KFormula::Document* document;
110
111 KFormula::DocumentWrapper* wrapper;
112};
113
114#endif
virtual bool saveNativeFormat(const TQString &file)
Saves the document in native format, to a given file.