KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kformula_doc.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. * Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef KFORMULA_DOC_H
  18. #define KFORMULA_DOC_H
  19. #include <tqptrlist.h>
  20. #include <tqpainter.h>
  21. #include <kcommand.h>
  22. #include <KoDocument.h>
  23. #include <KoCommandHistory.h>
  24. #include <kformuladefs.h>
  25. #include "kformula_view.h"
  26. class KoXmlWriter;
  27. KFORMULA_NAMESPACE_BEGIN
  28. class FormulaCursor;
  29. class Container;
  30. class Document;
  31. class DocumentWrapper;
  32. KFORMULA_NAMESPACE_END
  33. /**
  34. * The part's document. Forwards most of the requests.
  35. */
  36. class KFormulaDoc : public KoDocument
  37. {
  38. Q_OBJECT
  39. public:
  40. KFormulaDoc(TQWidget *parentWidget = 0,
  41. const char *widgetName = 0,
  42. TQObject* parent = 0,
  43. const char* name = 0,
  44. bool singleViewMode = false);
  45. ~KFormulaDoc();
  46. virtual void paintContent( TQPainter &painter, const TQRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
  47. virtual bool initDoc(InitDocFlags flags, TQWidget* parentWidget=0);
  48. virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false);
  49. virtual bool showEmbedInitDialog(TQWidget* parent);
  50. virtual bool loadOasis( const TQDomDocument& doc, KoOasisStyles& oasisStyles, const TQDomDocument& settings, KoStore* );
  51. virtual bool loadXML(TQIODevice *, const TQDomDocument& doc);
  52. virtual TQDomDocument saveXML();
  53. virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
  54. /**
  55. * Saves the document in native format, to a given file.
  56. * It is reimplemented to handle the special case of MathML, since it is
  57. * a native format but not compressed.
  58. */
  59. virtual bool saveNativeFormat( const TQString & file );
  60. KFormula::Container* getFormula() const { return formula; }
  61. KFormula::Document* getDocument() const { return document; }
  62. protected slots:
  63. void commandExecuted();
  64. void documentRestored();
  65. protected:
  66. virtual TQString configFile() const;
  67. virtual KoView* createViewInstance(TQWidget* parent, const char* name);
  68. private:
  69. /**
  70. * Our undo stack.
  71. */
  72. KoCommandHistory* history;
  73. /**
  74. * The place where all formula related work is done.
  75. */
  76. KFormula::Container* formula;
  77. /**
  78. * The document that contains all the formulas.
  79. * Right now we only have one, but this might change.
  80. */
  81. KFormula::Document* document;
  82. KFormula::DocumentWrapper* wrapper;
  83. };
  84. #endif