lib Library API Documentation

KoDocumentChild Class Reference

Holds an embedded object. More...

#include <koDocumentChild.h>

Inheritance diagram for KoDocumentChild:

KoChild QObject List of all members.

Public Member Functions

 KoDocumentChild (KoDocument *parent, KoDocument *doc, const QRect &geometry)
 KoDocumentChild (KoDocument *parent)
virtual void setDocument (KoDocument *doc, const QRect &geometry)
virtual KoDocumentdocument () const
virtual KoDocumentparentDocument () const
virtual KoDocumenthitTest (const QPoint &p, const QWMatrix &_matrix=QWMatrix())
virtual KURL url ()
virtual QDomElement save (QDomDocument &doc, bool uppercase=false)
virtual bool load (const QDomElement &element, bool uppercase=false)
virtual bool loadDocument (KoStore *)
virtual bool isStoredExtern ()
bool isDeleted () const
void setDeleted (bool on=true)

Protected Attributes

QString m_tmpURL
QRect m_tmpGeometry
QString m_tmpMimeType

Detailed Description

Holds an embedded object.

In addition to its base class KoChild it cares about the content of an embedded document. That means it supports operations like loading and saving.

If you need a representation for embedded documents in your KOffice component then you should inherit from this class.

Definition at line 42 of file koDocumentChild.h.


Constructor & Destructor Documentation

KoDocumentChild::KoDocumentChild KoDocument parent  ) 
 

When using this constructor you must call setDocument before you can call any other function of this class.

Definition at line 74 of file koDocumentChild.cc.


Member Function Documentation

void KoDocumentChild::setDocument KoDocument doc,
const QRect geometry
[virtual]
 

Call this function only directly after calling the constructor that takes only a parent as argument.

Definition at line 83 of file koDocumentChild.cc.

References setDocument().

Referenced by setDocument().

KoDocument * KoDocumentChild::document  )  const [virtual]
 

Returns:
document contained in this child
See also:
KoDocument

Definition at line 92 of file koDocumentChild.cc.

Referenced by KoView::hitTest(), KoDocument::insertChild(), KoDocument::paintChild(), KoView::partActivateEvent(), save(), KoDocument::saveExternalChildren(), and url().

KoDocument * KoDocumentChild::parentDocument  )  const [virtual]
 

Returns:
parent document of this child
See also:
KoDocument

Definition at line 97 of file koDocumentChild.cc.

KURL KoDocumentChild::url  )  [virtual]
 

Can be empty (which is why it doesn't return a const KURL &).

Definition at line 330 of file koDocumentChild.cc.

References document().

Referenced by save().

QDomElement KoDocumentChild::save QDomDocument doc,
bool  uppercase = false
[virtual]
 

Writes the "object" tag, but does NOT write the content of the embedded documents.

Saving the embedded documents themselves is done in KoDocument::saveChildren. This function just stores information about the position and id of the embedded document and should be called from within KoDocument::saveXML.

The "object" element is not added to the document. It is just created and returned.

Returns:
the element containing the "object" tag.

Definition at line 299 of file koDocumentChild.cc.

References document(), KoChild::geometry(), KoDocument::nativeFormatMimeType(), save(), and url().

Referenced by save().

bool KoDocumentChild::load const QDomElement element,
bool  uppercase = false
[virtual]
 

Parses the "object" tag.

This does NOT mean creating the child documents. AFTER the 'parser' has finished parsing, you must use loadDocument to actually load the embedded documents.

What you should have in mind is that this method is called from within KoDocument::loadXML while loadDocument is called from within KoDocument::loadChildren, respectively from your implementation of these methods.

Definition at line 114 of file koDocumentChild.cc.

References load(), m_tmpGeometry, m_tmpMimeType, and m_tmpURL.

Referenced by load().

bool KoDocumentChild::loadDocument KoStore  )  [virtual]
 

Actually loads the document from the disk/net or from the store, depending on url.

Definition at line 163 of file koDocumentChild.cc.

References KoDocumentEntry::isEmpty(), loadDocument(), m_tmpMimeType, and m_tmpURL.

Referenced by loadDocument().

bool KoDocumentChild::isDeleted  )  const
 

This document (child) is deleted.

Definition at line 344 of file koDocumentChild.cc.

Referenced by KoDocument::paintChild(), and KoDocument::saveExternalChildren().


Member Data Documentation

QString KoDocumentChild::m_tmpURL [protected]
 

Holds the source of this object, for example "file:/home/weis/image.gif" or "tar:/table1/2" if it is stored in a koffice store.

This variable is set after parsing the OBJECT tag in load and is reset after calling loadDocument.

Definition at line 132 of file koDocumentChild.h.

Referenced by load(), and loadDocument().

QRect KoDocumentChild::m_tmpGeometry [protected]
 

This variable is set after parsing the OBJECT tag in load and is reset after calling loadDocument.

Definition at line 139 of file koDocumentChild.h.

Referenced by load().

QString KoDocumentChild::m_tmpMimeType [protected]
 

This variable is set after parsing the OBJECT tag in load and is reset after calling loadDocument.

Definition at line 146 of file koDocumentChild.h.

Referenced by load(), and loadDocument().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Sep 24 18:22:31 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003