lib

KoDocumentChild.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
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 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19#ifndef __koDocumentChild_h__
20#define __koDocumentChild_h__
21
22#include <KoChild.h>
23#include <koffice_export.h>
24class TQDomDocument;
25class TQDomElement;
26class KURL;
27class KoStore;
28class KoDocument;
29class KoDocumentChildPrivate;
30class KoDocumentEntry;
31class KoXmlWriter;
32
43class KOFFICECORE_EXPORT KoDocumentChild : public KoChild
44{
45 TQ_OBJECT
46
47public:
48 KoDocumentChild( KoDocument* parent, KoDocument* doc, const TQRect& geometry );
49
54 KoDocumentChild( KoDocument* parent );
55
56 virtual ~KoDocumentChild();
57
62 virtual void setDocument( KoDocument *doc, const TQRect &geometry );
63
69 KoDocument *document() const;
70
76 virtual KoDocument *parentDocument() const; // TODO: remove virtual, makes no sense
77
78 virtual KoDocument* hitTest( const TQPoint& p, const TQWMatrix& _matrix = TQWMatrix() );
79
83 KURL url() const;
84
97 virtual TQDomElement save( TQDomDocument& doc, bool uppercase=false );
98
106 void saveOasisAttributes( KoXmlWriter &xmlWriter, const TQString& name );
107
112 virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
113
124 virtual bool load( const TQDomElement& element, bool uppercase=false );
125
126 void loadOasis( const TQDomElement &frameElement, const TQDomElement& objectElement );
127
132 virtual bool loadDocument( KoStore* );
133
138 virtual bool loadOasisDocument( KoStore* store, const TQDomDocument& manifestDoc );
139
140 virtual bool isStoredExtern() const;
141
145 bool isDeleted() const;
146 void setDeleted( bool on = true );
147
148protected: // Should be private, but KWord needs access to the variables
149 // because it reimplements load/save (for uppercase tags)
150
157 TQString m_tmpURL;
158
165
172
173private:
174 bool createUnavailDocument( KoStore* store, bool doOpenURL, const TQString& mimeType );
175 bool loadDocumentInternal( KoStore* _store, const KoDocumentEntry& e, bool doOpenURL, bool oasis );
176
177private:
178 KoDocumentChildPrivate *d;
179};
180
181#endif
TQRect geometry() const
Definition KoChild.cpp:92
TQRect m_tmpGeometry
This variable is set after parsing the OBJECT tag in load and is reset after calling loadDocument.
virtual bool saveOasis(KoStore *store, KoXmlWriter *manifestWriter)
Save an embedded object to an OASIS store.
virtual bool load(const TQDomElement &element, bool uppercase=false)
Parses the "object" tag.
KoDocument * document() const
virtual bool loadDocument(KoStore *)
Actually loads the document from the disk/net or from the store, depending on url.
void saveOasisAttributes(KoXmlWriter &xmlWriter, const TQString &name)
Save an embedded object to OASIS.
bool isDeleted() const
This document (child) is deleted.
virtual TQDomElement save(TQDomDocument &doc, bool uppercase=false)
Writes the "object" tag, but does NOT write the content of the embedded documents.
virtual void setDocument(KoDocument *doc, const TQRect &geometry)
Call this function only directly after calling the constructor that takes only a parent as argument.
TQString m_tmpMimeType
This variable is set after parsing the OBJECT tag in load and is reset after calling loadDocument.
TQString m_tmpURL
Holds the source of this object, for example "file:/home/weis/image.gif" or "tar:/table1/2" if it is ...
virtual KoDocument * parentDocument() const
virtual bool loadOasisDocument(KoStore *store, const TQDomDocument &manifestDoc)
Actually loads the document from the disk/net or from the store depending on the document's url.
Represents an available KOffice component that supports the document interface.
The KOffice document class.
Definition KoDocument.h:61
Saves and loads KOffice documents using various backends.
Definition KoStore.h:40
A class for writing out XML (to any TQIODevice), with a special attention on performance.
Definition KoXmlWriter.h:37