lib

#include <KoDocument.h>

Inheritance diagram for KoDocument:
KParts::ReadWritePart KParts::ReadOnlyPart KParts::Part KParts::PartBase KXMLGUIClient

Public Types

enum  { SaveAsDirectoryStore = 2 , SaveAsFlatXML = 4 }
enum  InitDocFlags {
  InitDocAppStarting , InitDocFileNew , InitDocFileClose , InitDocEmbedded ,
  InitDocEmpty
}

Public Slots

virtual void initEmpty ()
Public Slots inherited from KParts::ReadWritePart
virtual bool save ()
bool waitSaveComplete ()

Signals

void unitChanged (KoUnit::Unit)
void childChanged (KoDocumentChild *child)
void sigProgress (int value)
void sigStatusBarMessage (const TQString &text)
void sigClearStatusBarMessage ()
void sigBeginOperation ()
void sigEndOperation ()
void modified (bool)
void closeEmbedInitDialog ()
Signals inherited from KParts::ReadWritePart
void sigQueryClose (bool *handled, bool *abortClosing)
Signals inherited from KParts::ReadOnlyPart
void started (TDEIO::Job *)
void completed ()
void completed (bool pendingAction)
void canceled (const TQString &errMsg)
Signals inherited from KParts::Part
void setWindowCaption (const TQString &caption)
void setStatusBarText (const TQString &text)

Public Member Functions

 KoDocument (TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, bool singleViewMode=false)
virtual ~KoDocument ()
bool isSingleViewMode () const
bool isEmbedded () const
virtual TDEAction * action (const TQDomElement &element) const
virtual TQDomDocument domDocument () const
virtual void setManager (KParts::PartManager *manager)
virtual bool openURL (const KURL &url)
bool import (const KURL &url)
bool exp0rt (const KURL &url)
virtual void setReadWrite (bool readwrite=true)
virtual TQCString nativeFormatMimeType () const
TQCString nativeOasisMimeType () const
bool isNativeFormat (const TQCString &mimetype) const
virtual TQStringList extraNativeMimeTypes () const
virtual int supportedSpecialFormats () const
TQCString mimeType () const
void setMimeType (const TQCString &mimeType)
void setOutputMimeType (const TQCString &mimeType, int specialOutputFlag=0)
TQCString outputMimeType () const
int specialOutputFlag () const
bool confirmNonNativeSave (const bool exporting) const
void setConfirmNonNativeSave (const bool exporting, const bool on)
virtual bool wantExportConfirmation () const
void setErrorMessage (const TQString &errMsg)
TQString errorMessage () const
void showSavingErrorDialog ()
void showLoadingErrorDialog ()
KoView * createView (TQWidget *parent=0, const char *name=0)
virtual void addView (KoView *view)
virtual void removeView (KoView *view)
const TQPtrList< KoView > & views () const
int viewCount () const
virtual KParts::Part * hitTest (TQWidget *widget, const TQPoint &globalPos)
virtual KoDocument * hitTest (const TQPoint &pos, const TQWMatrix &matrix=TQWMatrix())
KoView * hitTestView ()
virtual void paintEverything (TQPainter &painter, const TQRect &rect, bool transparent=false, KoView *view=0L, double zoomX=1.0, double zoomY=1.0)
virtual TQPixmap generatePreview (const TQSize &size)
virtual void paintChildren (TQPainter &painter, const TQRect &rect, KoView *view, double zoomX=1.0, double zoomY=1.0)
virtual void paintChild (KoDocumentChild *child, TQPainter &painter, KoView *view, double zoomX=1.0, double zoomY=1.0)
virtual void paintContent (TQPainter &painter, const TQRect &rect, bool transparent=false, double zoomX=1.0, double zoomY=1.0)=0
bool checkAutoSaveFile ()
virtual bool initDoc (InitDocFlags flags, TQWidget *parentWidget=0)=0
virtual void showStartUpWidget (KoMainWindow *parent, bool alwaysShow=false)
virtual void setModified (bool _mod)
virtual void setTitleModified ()
virtual bool isEmpty () const
virtual void setEmpty ()
virtual bool loadFromStore (KoStore *store, const TQString &url)
virtual bool loadOasisFromStore (KoStore *store)
virtual bool saveToStore (KoStore *store, const TQString &path)
virtual bool loadXML (TQIODevice *, const TQDomDocument &doc)=0
virtual bool loadOasis (const TQDomDocument &doc, KoOasisStyles &oasisStyles, const TQDomDocument &settings, KoStore *store)=0
virtual bool saveOasis (KoStore *store, KoXmlWriter *manifestWriter)=0
virtual TQDomDocument saveXML ()
TQDomDocument createDomDocument (const TQString &tagName, const TQString &version) const
virtual bool saveToStream (TQIODevice *dev)
virtual bool loadNativeFormat (const TQString &file)
virtual bool saveNativeFormat (const TQString &file)
void setAutoSave (int delay)
bool isAutosaving () const
void setCheckAutoSaveFile (bool b)
void setAutoErrorHandlingEnabled (bool b)
bool isAutoErrorHandlingEnabled () const
const TQPtrList< KoDocumentChild > & children () const
KoDocumentChild * child (KoDocument *doc)
KoDocumentInfo * documentInfo () const
void setViewBuildDocument (KoView *view, const TQDomDocument &doc)
TQDomDocument viewBuildDocument (KoView *view)
virtual void addShell (KoMainWindow *shell)
virtual void removeShell (KoMainWindow *shell)
const TQPtrList< KoMainWindow > & shells () const
int shellCount () const
virtual DCOPObject * dcopObject ()
TQCString dcopObjectId () const
void emitProgress (int value)
bool isInOperation () const
virtual void emitBeginOperation ()
virtual void emitEndOperation ()
virtual bool isStoredExtern () const
virtual KoPageLayout pageLayout (int pageNumber=0) const
void removeAutoSaveFiles ()
void setBackupFile (bool _b)
bool backupFile () const
bool isModified () const
bool isLoading () const
int queryCloseExternalChildren ()
int queryCloseDia ()
void setDoNotSaveExtDoc (bool on=true)
void setBackupPath (const TQString &_path)
TQString backupPath () const
void setCurrent (bool on=true)
void forceCurrent (bool on)
bool isCurrent () const
void setTitleModified (const TQString caption, bool mod)
void resetURL ()
void setStoreInternal (bool i)
bool storeInternal () const
bool hasExternURL () const
void setURL (const KURL &url)
TQString & file ()
void setFile (const TQString &file)
void setMimeTypeAfterLoading (const TQString &mimeType)
virtual int pageCount () const
virtual TQValueList< KoTextDocument * > allTextDocuments () const
KoUnit::Unit unit () const
void setUnit (KoUnit::Unit u)
TQString unitName () const
void setTemplateType (const TQString &_templateType)
TQString templateType () const
virtual bool showEmbedInitDialog (TQWidget *parent)
Public Member Functions inherited from KParts::ReadWritePart
 ReadWritePart (TQObject *parent=0, const char *name=0)
bool isReadWrite () const
bool isModified () const
bool queryClose ()
virtual bool closeURL ()
bool closeURL (bool promptToSave)
virtual bool saveAs (const KURL &url)
Public Member Functions inherited from KParts::ReadOnlyPart
 ReadOnlyPart (TQObject *parent=0, const char *name=0)
void setProgressInfoEnabled (bool show)
bool isProgressInfoEnabled () const
KURL url () const
bool openStream (const TQString &mimeType, const KURL &url)
bool writeStream (const TQByteArray &data)
bool closeStream ()
Public Member Functions inherited from KParts::Part
 Part (TQObject *parent=0, const char *name=0)
virtual void embed (TQWidget *parentWidget)
virtual TQWidget * widget ()
PartManager * manager () const
virtual void setSelectable (bool selectable)
bool isSelectable () const
Public Member Functions inherited from KParts::PartBase
void setPartObject (TQObject *object)
Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient (KXMLGUIClient *parent)
TDEAction * action (const char *name) const
virtual TDEActionCollection * actionCollection () const
virtual TDEInstance * instance () const
virtual TQString xmlFile () const
void setXMLGUIBuildDocument (const TQDomDocument &doc)
TQDomDocument xmlguiBuildDocument () const
void setFactory (KXMLGUIFactory *factory)
KXMLGUIFactory * factory () const
KXMLGUIClient * parentClient () const
void insertChildClient (KXMLGUIClient *child)
void removeChildClient (KXMLGUIClient *child)
const TQPtrList< KXMLGUIClient > * childClients ()
void setClientBuilder (KXMLGUIBuilder *builder)
KXMLGUIBuilder * clientBuilder () const
void reloadXML ()
void plugActionList (const TQString &name, const TQPtrList< TDEAction > &actionList)
void unplugActionList (const TQString &name)
void beginXMLPlug (TQWidget *)
void endXMLPlug ()
void prepareXMLUnplug (TQWidget *)

Static Public Member Functions

static TQCString readNativeFormatMimeType (TDEInstance *instance=0)
static TQStringList readExtraNativeMimeTypes (TDEInstance *instance=0)
static KService::Ptr readNativeService (TDEInstance *instance=0)
static void setupXmlReader (TQXmlSimpleReader &reader, bool namespaceProcessing=false)
static KoXmlWriter * createOasisXmlWriter (TQIODevice *dev, const char *rootElementName)
static TQDomDocument createDomDocument (const TQString &appName, const TQString &tagName, const TQString &version)
static TQString tagNameToDocumentType (const TQString &localName)
static int defaultAutoSave ()
static TQPtrList< KoDocument > * documentList ()

Protected Slots

virtual void openExistingFile (const TQString &file)
virtual void openTemplate (const TQString &file)
void deleteOpenPaneDelayed ()

Protected Member Functions

TQString autoSaveFile (const TQString &path) const
virtual KoView * createViewInstance (TQWidget *parent, const char *name)=0
virtual bool openFile ()
virtual bool saveFile ()
virtual TQWidget * createCustomDocumentWidget (TQWidget *parent)
virtual bool loadChildren (KoStore *)
virtual bool saveChildren (KoStore *store)
virtual bool saveChildrenOasis (KoStore *store, KoXmlWriter *manifestWriter)
virtual bool completeLoading (KoStore *store)
virtual bool completeSaving (KoStore *store)
virtual void insertChild (KoDocumentChild *child)
virtual void setModified ()
virtual void insertChild (TQObject *o)
virtual bool saveExternalChildren ()
bool isImporting () const
bool isExporting () const
KoOpenPane * createOpenPane (TQWidget *parent, TDEInstance *instance, const TQString &templateType=TQString())
Protected Member Functions inherited from KParts::ReadWritePart
virtual bool saveToURL ()
Protected Member Functions inherited from KParts::ReadOnlyPart
virtual void guiActivateEvent (GUIActivateEvent *event)
Protected Member Functions inherited from KParts::Part
virtual void setWidget (TQWidget *widget)
virtual void partActivateEvent (PartActivateEvent *event)
virtual void partSelectEvent (PartSelectEvent *event)
TQWidget * hostContainer (const TQString &containerName)
Protected Member Functions inherited from KParts::PartBase
virtual void setInstance (TDEInstance *instance)
virtual void setInstance (TDEInstance *instance, bool loadPlugins)
void loadPlugins (TQObject *parent, KXMLGUIClient *parentGUIClient, TDEInstance *instance)
void setPluginLoadingMode (PluginLoadingMode loadingMode)
Protected Member Functions inherited from KXMLGUIClient
virtual void setXMLFile (const TQString &file, bool merge=false, bool setXMLDoc=true)
virtual void setXML (const TQString &document, bool merge=false)
virtual void setDOMDocument (const TQDomDocument &document, bool merge=false)
virtual void conserveMemory ()
virtual void stateChanged (const TQString &newstate, ReverseStateChange reverse=StateNoReverse)

Protected Attributes

KoPageLayout m_pageLayout
Protected Attributes inherited from KParts::ReadOnlyPart
KURL m_url
TQString m_file
bool m_bTemp
Protected Attributes inherited from KParts::PartBase
 DoNotLoadPlugins
 LoadPlugins
 LoadPluginsIfEnabled

Additional Inherited Members

Protected Types inherited from KParts::PartBase
enum  PluginLoadingMode

Detailed Description

The KOffice document class.

This class provides some functionality each KOffice document should have.

The KOffice document class

Definition at line 60 of file KoDocument.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Enum values used by specialOutputFlag - note that it's a bitfield for supportedSpecialFormats.

Definition at line 239 of file KoDocument.h.

◆ InitDocFlags

This setting indicates who is calling initDoc.

Usually the app will want to

  • show the template dialog with 'everything' if InitDocAppStarting, InitDocFileClose or InitDocEmbedded
  • show the template dialog with 'templates only' if InitDocFileNew
  • create an empty document with default settings if InitDocEmpty

Definition at line 455 of file KoDocument.h.

Constructor & Destructor Documentation

◆ KoDocument()

KoDocument::KoDocument ( TQWidget * parentWidget,
const char * widgetName,
TQObject * parent,
const char * name,
bool singleViewMode = false )

Constructor.

The first 4 arguments are the same as the ones passed to KParts::Factory::createPart.

Parameters
parentWidgetthe parent widget, in case we create a wrapper widget (in single view mode). Usually the first argument passed by KParts::Factory::createPart.
widgetNamename of the widget.
parentmay be another KoDocument, or anything else. Usually the third argument of KParts::Factory::createPart.
nameis used to identify this document via DCOP so you may want to pass a meaningful name here which matches the pattern [A-Za-z_][A-Za-z_0-9]*.
singleViewModedetermines whether the document may only have one view. In this case the parent must be a TQWidget derived class. KoDocument will then create a wrapper widget (KoViewWrapperWidget) which is a child of parentWidget. This widget can be retrieved by calling widget().
Todo
explain what the purpose of widgetName is.

Definition at line 224 of file KoDocument.cpp.

◆ ~KoDocument()

KoDocument::~KoDocument ( )
virtual

Destructor.

The destructor does not delete any attached KoView objects and it does not delete the attached widget as returned by widget().

Definition at line 269 of file KoDocument.cpp.

Member Function Documentation

◆ action()

TDEAction * KoDocument::action ( const TQDomElement & element) const
virtual

Returns the action described action object.

In fact only the "name" attribute of element is of interest here. The method searches first in the TDEActionCollection of the first view and then in the TDEActionCollection of this document. This allows KOffice applications to define actions in both the view and the document. They should only define view-actions (like zooming and stuff) in the view. Every action which changes the document should be defined in the document.

Please notice that KoDocument indirectly inherits KXMLGUIClient.

See also
KXMLGUIClient
KXMLGUIClient::actionCollection
KoView::action

Reimplemented from KXMLGUIClient.

Definition at line 563 of file KoDocument.cpp.

◆ addShell()

void KoDocument::addShell ( KoMainWindow * shell)
virtual

Appends the shell to the list of shells which show this document as their root document.

This method is automatically called from KoMainWindow::setRootDocument, so you dont need to call it.

Definition at line 2319 of file KoDocument.cpp.

◆ addView()

void KoDocument::addView ( KoView * view)
virtual

Adds a view to the document.

This calls KoView::updateReadWrite to tell the new view whether the document is readonly or not.

Definition at line 629 of file KoDocument.cpp.

◆ allTextDocuments()

TQValueList< KoTextDocument * > KoDocument::allTextDocuments ( ) const
virtual
Returns
all kotext-based text objects in the document This is used by some text-analyzer plugins.
Since
1.5

Definition at line 2519 of file KoDocument.cpp.

◆ autoSaveFile()

TQString KoDocument::autoSaveFile ( const TQString & path) const
protected

Definition at line 1265 of file KoDocument.cpp.

◆ backupFile()

bool KoDocument::backupFile ( ) const

Definition at line 2416 of file KoDocument.cpp.

◆ backupPath()

TQString KoDocument::backupPath ( ) const
Returns
path to the backup document

Definition at line 2427 of file KoDocument.cpp.

◆ checkAutoSaveFile()

bool KoDocument::checkAutoSaveFile ( )

Called by koApplication to check for an autosave file in $HOME.

Definition at line 1293 of file KoDocument.cpp.

◆ child()

KoDocumentChild * KoDocument::child ( KoDocument * doc)
Returns
the KoDocumentChild associated with the given Document, but only if doc is a direct child of this document.

This is a convenience function. You could get the same result by traversing the list returned by children().

Definition at line 736 of file KoDocument.cpp.

◆ childChanged

void KoDocument::childChanged ( KoDocumentChild * child)
signal

This signal is emitted when a direct or indirect child document changes and needs to be updated in all views.

If one of your child documents emits the childChanged signal, then you may usually just want to redraw this child. In this case you can ignore the parameter passed by the signal.

◆ children()

const TQPtrList< KoDocumentChild > & KoDocument::children ( ) const
Returns
the list of all children. Do not modify the returned list.

Definition at line 690 of file KoDocument.cpp.

◆ completeLoading()

bool KoDocument::completeLoading ( KoStore * store)
protectedvirtual

Overload this function if you have to load additional files from a store.

This function is called after loadXML() and after loadChildren() have been called.

Definition at line 2120 of file KoDocument.cpp.

◆ completeSaving()

bool KoDocument::completeSaving ( KoStore * store)
protectedvirtual

If you want to write additional files to a store, then you must do it here.

In the implementation, you should prepend the document url (using url().url()) before the filename, so that everything is kept relative to this document. For instance it will produce urls such as tar:/1/pictures/picture0.png, if the doc url is tar:/1 But do this ONLY if the document is not stored extern (see isStoredExtern() ). If it is, then the pictures should be saved to tar:/pictures.

Definition at line 2125 of file KoDocument.cpp.

◆ confirmNonNativeSave()

bool KoDocument::confirmNonNativeSave ( const bool exporting) const

Returns true if this document was the result of opening a foreign file format and if the user hasn't yet saved the document (in any format).

Used by KoMainWindow to warn the user when s/he lazily presses CTRL+S to save in the same foreign format, putting all his/her formatting at risk (normally an export confirmation only comes up with Save As).

Parameters
exportingspecifies whether this is the setting for a File --> Export or File --> Save/Save As operation.

Definition at line 500 of file KoDocument.cpp.

◆ createCustomDocumentWidget()

TQWidget * KoDocument::createCustomDocumentWidget ( TQWidget * parent)
protectedvirtual

Override this method in your derived class to show a widget in the startup 'dialog'.

This widget should allow the user to set settings for a custom document (i.e. one not based on a template). The returned widget should provide its own button (preferrably 'Create') and implement the logic to implement the document instance correctly. After initializing the widget should emit a signal called 'documentSelected()' which will remove the startupWidget and show the document.

Parameters
parentthe parent of the to be created widget.

Definition at line 2654 of file KoDocument.cpp.

◆ createDomDocument() [1/2]

TQDomDocument KoDocument::createDomDocument ( const TQString & appName,
const TQString & tagName,
const TQString & version )
static

Return a correctly created TQDomDocument for an old (1.3-style) KOffice document, including processing instruction, complete DOCTYPE tag (with systemId and publicId), and root element.

This static method can be used e.g. by filters.

Parameters
appNamethe app's instance name, e.g. kword, kspread, kpresenter etc.
tagNamethe name of the tag for the root element, e.g. DOC for kword/kpresenter.
versionthe DTD version (usually the application's version).

Definition at line 2136 of file KoDocument.cpp.

◆ createDomDocument() [2/2]

TQDomDocument KoDocument::createDomDocument ( const TQString & tagName,
const TQString & version ) const

Return a correctly created TQDomDocument for this KoDocument, including processing instruction, complete DOCTYPE tag (with systemId and publicId), and root element.

Parameters
tagNamethe name of the tag for the root element
versionthe DTD version (usually the application's version).
Deprecated
use createOasisXmlWriter instead

Definition at line 2130 of file KoDocument.cpp.

◆ createOasisXmlWriter()

KoXmlWriter * KoDocument::createOasisXmlWriter ( TQIODevice * dev,
const char * rootElementName )
static

Return an XML writer for saving Oasis XML into the device dev, including the XML processing instruction, and the root element with all its namespaces.

You can add more namespaces afterwards with addAttribute.

Parameters
devthe device into which the XML will be written.
rootElementNamethe tag name of the root element. This is either office:document, office:document-content, office:document-styles, office:document-meta or office:document-settings
Returns
the KoXmlWriter instance. It becomes owned by the caller, which must delete it at some point.

Once done with writing the contents of the root element, you will need to call endElement(); endDocument(); before destroying the KoXmlWriter.

Note
OASIS-specific

Definition at line 2150 of file KoDocument.cpp.

◆ createOpenPane()

KoOpenPane * KoDocument::createOpenPane ( TQWidget * parent,
TDEInstance * instance,
const TQString & templateType = TQString() )
protected

Creates the open widget showed at application start up.

Parameters
parentthe parent widget
instancethe TDEInstance to be used for TDEConfig data
templateTypethe template-type (group) that should be selected on creation.
Since
1.5

Definition at line 2606 of file KoDocument.cpp.

◆ createView()

KoView * KoDocument::createView ( TQWidget * parent = 0,
const char * name = 0 )

Create a new view for the document.

Definition at line 318 of file KoDocument.cpp.

◆ dcopObject()

DCOPObject * KoDocument::dcopObject ( )
virtual

Return a DCOP interface for this document.

KOffice parts are strongly recommended to reimplement this method, so that their DCOP interface provides more functionality than the basic KoDocumentIface

Definition at line 2344 of file KoDocument.cpp.

◆ dcopObjectId()

TQCString KoDocument::dcopObjectId ( ) const
Returns
the ID of the DCOP interface for this document.

Definition at line 2351 of file KoDocument.cpp.

◆ defaultAutoSave()

int KoDocument::defaultAutoSave ( )
inlinestatic

Retrieve the default value for autosave in seconds.

Called by the applications to use the correct default in their config

Definition at line 658 of file KoDocument.h.

◆ deleteOpenPaneDelayed

void KoDocument::deleteOpenPaneDelayed ( )
protectedslot

Definition at line 2648 of file KoDocument.cpp.

◆ documentInfo()

KoDocumentInfo * KoDocument::documentInfo ( ) const
Returns
the information concerning this document.
See also
KoDocumentInfo

Definition at line 746 of file KoDocument.cpp.

◆ documentList()

TQPtrList< KoDocument > * KoDocument::documentList ( )
inlinestatic
Returns
the list of all the currently opened documents

Definition at line 712 of file KoDocument.h.

◆ domDocument()

TQDomDocument KoDocument::domDocument ( ) const
virtual

Returns the DOM document which describes the GUI of the first view.

Reimplemented from KXMLGUIClient.

Definition at line 578 of file KoDocument.cpp.

◆ emitBeginOperation()

void KoDocument::emitBeginOperation ( )
virtual

Definition at line 1923 of file KoDocument.cpp.

◆ emitEndOperation()

void KoDocument::emitEndOperation ( )
virtual

Definition at line 1932 of file KoDocument.cpp.

◆ emitProgress()

void KoDocument::emitProgress ( int value)
inline

Signal the progress of operations such as loading or saving.

Definition at line 730 of file KoDocument.h.

◆ errorMessage()

TQString KoDocument::errorMessage ( ) const

Return the last error message.

Usually KoDocument takes care of showing it; this method is mostly provided for non-interactive use.

Since
1.4

Definition at line 2361 of file KoDocument.cpp.

◆ exp0rt()

bool KoDocument::exp0rt ( const KURL & url)

Saves the document as url without changing the state of the KoDocument (URL, modified flag etc.).

Call this instead of KParts::ReadWritePart::saveAs() to implement KoMainWindow's File --> Export feature.

Note
This will call KoDocument::saveAs(). To differentiate this from an ordinary Save operation (in any reimplementation of saveFile()) call isExporting().

Definition at line 325 of file KoDocument.cpp.

◆ extraNativeMimeTypes()

TQStringList KoDocument::extraNativeMimeTypes ( ) const
virtual

Returns a list of the mimetypes considered "native", i.e.

which can be saved by KoDocument without a filter, in addition to the main one

Definition at line 2299 of file KoDocument.cpp.

◆ file()

TQString & KoDocument::file ( )
inline

Only use these functions to restore m_file (in KoMainWindow) after a failed save (remember to use setURL() to restore the URL as well).

Warning
Do not use these functions for any other purpose.

Definition at line 846 of file KoDocument.h.

◆ forceCurrent()

void KoDocument::forceCurrent ( bool on)

Sets current flag for this document and all its parents.

Definition at line 2459 of file KoDocument.cpp.

◆ generatePreview()

TQPixmap KoDocument::generatePreview ( const TQSize & size)
virtual

Generates a preview picture of the document.

Note
The preview is used in the File Dialog and also to create the Thumbnail

Definition at line 1218 of file KoDocument.cpp.

◆ hasExternURL()

bool KoDocument::hasExternURL ( ) const

Definition at line 2486 of file KoDocument.cpp.

◆ hitTest() [1/2]

KoDocument * KoDocument::hitTest ( const TQPoint & pos,
const TQWMatrix & matrix = TQWMatrix() )
virtual

Find the most nested child document which contains the requested point.

The point is in the coordinate system of this part. If no child document contains this point, then a pointer to this document is returned.

This function has to be overloaded if the document features child documents.

Parameters
posis in (unzoomed) document coordinates
matrixtransforms points from the documents coordinate system to the coordinate system of the requested point. This is used by transformed child documents, see KoDocumentChild/KoChild.
Returns
Pointer to the document under the mouse at that position

Definition at line 721 of file KoDocument.cpp.

◆ hitTest() [2/2]

KParts::Part * KoDocument::hitTest ( TQWidget * widget,
const TQPoint & globalPos )
virtual

Reimplemented from KParts::Part.

Reimplemented from KParts::Part.

Definition at line 695 of file KoDocument.cpp.

◆ hitTestView()

KoView * KoDocument::hitTestView ( )

Temporary API for accessing the view that calls hitTest.

Will be passed to hitTest() in 2.x. Only call this from within hitTest()!

Definition at line 716 of file KoDocument.cpp.

◆ import()

bool KoDocument::import ( const KURL & url)

Opens the document given by url, without storing the URL in the KoDocument.

Call this instead of openURL() to implement KoMainWindow's File --> Import feature.

Note
This will call openURL(). To differentiate this from an ordinary Open operation (in any reimplementation of openURL() or openFile()) call isImporting().

Definition at line 1323 of file KoDocument.cpp.

◆ initDoc()

virtual bool KoDocument::initDoc ( InitDocFlags flags,
TQWidget * parentWidget = 0 )
pure virtual

Initializes an empty document (display the template dialog!).

You have to overload this method to initialize all your document variables.

Parameters
flagssee InitDocFlags
parentWidgetthe widget this document belongs with

◆ initEmpty

void KoDocument::initEmpty ( )
virtualslot

Initialize an empty document using default values.

Since
1.5

Definition at line 2596 of file KoDocument.cpp.

◆ insertChild() [1/2]

void KoDocument::insertChild ( KoDocumentChild * child)
protectedvirtual

Inserts the new child in the list of children and emits the childChanged() signal.

At the same time this method marks this document as modified.

To remove a child, just delete it. KoDocument will detect this and remove the child from its lists.

See also
isModified

Definition at line 653 of file KoDocument.cpp.

◆ insertChild() [2/2]

virtual void KoDocument::insertChild ( TQObject * o)
inlineprotectedvirtual

Definition at line 1095 of file KoDocument.h.

◆ isAutoErrorHandlingEnabled()

bool KoDocument::isAutoErrorHandlingEnabled ( ) const

Checks whether error message boxes should be shown.

Since
1.3.1

Definition at line 537 of file KoDocument.cpp.

◆ isAutosaving()

bool KoDocument::isAutosaving ( ) const

Checks whether the document is currently in the process of autosaving.

Definition at line 2390 of file KoDocument.cpp.

◆ isCurrent()

bool KoDocument::isCurrent ( ) const

Definition at line 2470 of file KoDocument.cpp.

◆ isEmbedded()

bool KoDocument::isEmbedded ( ) const

Is the document embedded?

Definition at line 313 of file KoDocument.cpp.

◆ isEmpty()

virtual bool KoDocument::isEmpty ( ) const
inlinevirtual
Returns
true if the document is empty.

Definition at line 489 of file KoDocument.h.

◆ isExporting()

bool KoDocument::isExporting ( ) const
protected

Returns whether or not the current saveFile() call is actually an export operation (like File --> Export).

If this function returns true during saveFile() and you are changing some sort of state, you must restore it before the end of saveFile(); otherwise, File --> Export will not work properly.

Definition at line 522 of file KoDocument.cpp.

◆ isImporting()

bool KoDocument::isImporting ( ) const
protected

Returns whether or not the current openURL() or openFile() call is actually an import operation (like File --> Import).

This is for informational purposes only.

Definition at line 517 of file KoDocument.cpp.

◆ isInOperation()

bool KoDocument::isInOperation ( ) const

Definition at line 1918 of file KoDocument.cpp.

◆ isLoading()

bool KoDocument::isLoading ( ) const

Returns true during loading (openURL can be asynchronous).

Definition at line 2395 of file KoDocument.cpp.

◆ isModified()

bool KoDocument::isModified ( ) const

Returns true if this document or any of its internal child documents are modified.

Definition at line 862 of file KoDocument.cpp.

◆ isNativeFormat()

bool KoDocument::isNativeFormat ( const TQCString & mimetype) const

Checks whether a given mimetype can be handled natively.

Definition at line 2292 of file KoDocument.cpp.

◆ isSingleViewMode()

bool KoDocument::isSingleViewMode ( ) const

Tells whether this document is in singleview mode.

This mode can only be set in the constructor.

Definition at line 308 of file KoDocument.cpp.

◆ isStoredExtern()

bool KoDocument::isStoredExtern ( ) const
virtual

Return true if url() is a real filename, false if url() is an internal url in the store, like "tar:/...".

Definition at line 1945 of file KoDocument.cpp.

◆ loadChildren()

bool KoDocument::loadChildren ( KoStore * )
protectedvirtual

OLD XML method.

For OASIS just call KoDocumentChild::loadOasisDocument after KoDocumentChild::loadOasis.

You need to overload this function if your document may contain embedded documents. This function is called to load embedded documents.

An example implementation may look like this:

TQPtrListIterator<KoDocumentChild> it( children() );
for( ; it.current(); ++it )
{
if ( !it.current()->loadDocument( _store ) )
{
return false;
}
}
return true;
const TQPtrList< KoDocumentChild > & children() const

Definition at line 2115 of file KoDocument.cpp.

◆ loadFromStore()

bool KoDocument::loadFromStore ( KoStore * store,
const TQString & url )
virtual

Loads a document from a store.

You should never have to reimplement.

Parameters
storeThe store to load from
urlAn internal url, like tar:/1/2

Definition at line 1844 of file KoDocument.cpp.

◆ loadNativeFormat()

bool KoDocument::loadNativeFormat ( const TQString & file)
virtual

Loads a document in the native format from a given URL.

Reimplement if your native format isn't XML.

Parameters
filethe file to load - usually KReadOnlyPart::m_file or the result of a filter

Definition at line 1651 of file KoDocument.cpp.

◆ loadOasis()

virtual bool KoDocument::loadOasis ( const TQDomDocument & doc,
KoOasisStyles & oasisStyles,
const TQDomDocument & settings,
KoStore * store )
pure virtual

Reimplement this method to load the contents of your KOffice document, from the XML document ("content.xml").

The styles have been parsed already, you can find them in the oasisStyles parameter. The store can be used to load images and embedded documents.

◆ loadOasisFromStore()

bool KoDocument::loadOasisFromStore ( KoStore * store)
virtual

Loads an OASIS document from a store.

This is used for both the main document and embedded objects.

Definition at line 1885 of file KoDocument.cpp.

◆ loadXML()

virtual bool KoDocument::loadXML ( TQIODevice * ,
const TQDomDocument & doc )
pure virtual

Reimplement this method to load the contents of your KOffice document, from the XML document.

This is for the pre-Oasis file format (maindoc.xml).

You are supposed to use the TQDomDocument. The TQIODevice is provided only for the cases where some pre-processing is needed, like kpresenter's kprconverter. Note that the TQIODevice could be 0L, when called from an import filter.

◆ mimeType()

TQCString KoDocument::mimeType ( ) const

Returns the actual mimetype of the document.

Definition at line 474 of file KoDocument.cpp.

◆ modified

void KoDocument::modified ( bool )
signal

Emitted when the document is modified.

◆ nativeFormatMimeType()

TQCString KoDocument::nativeFormatMimeType ( ) const
virtual

To be preferred when a document exists.

It is fast when calling it multiple times since it caches the result that readNativeFormatMimeType() delivers. This comes from the X-TDE-NativeMimeType key in the .desktop file You do NOT have to reimplement this (it is only virtual for kounavail).

Definition at line 2197 of file KoDocument.cpp.

◆ nativeOasisMimeType()

TQCString KoDocument::nativeOasisMimeType ( ) const

Returns the OASIS OpenDocument mimetype of the document, if supported This comes from the X-TDE-NativeOasisMimeType key in the .desktop file.

Definition at line 2213 of file KoDocument.cpp.

◆ openExistingFile

void KoDocument::openExistingFile ( const TQString & file)
protectedvirtualslot

This slot loads an existing file and deletes the start up widget.

Parameters
filethe file to load (including path)
Since
1.5

Definition at line 2571 of file KoDocument.cpp.

◆ openFile()

bool KoDocument::openFile ( )
protectedvirtual

Loads a document from KReadOnlyPart::m_file (KParts takes care of downloading remote documents).

Applies a filter if necessary, and calls loadNativeFormat in any case You should not have to reimplement, except for very special cases.

This method is called from the KReadOnlyPart::openURL method.

Implements KParts::ReadOnlyPart.

Definition at line 1406 of file KoDocument.cpp.

◆ openTemplate

void KoDocument::openTemplate ( const TQString & file)
protectedvirtualslot

This slot loads a template and deletes the start up widget.

Parameters
filethe template to load
Since
1.5

Definition at line 2581 of file KoDocument.cpp.

◆ openURL()

bool KoDocument::openURL ( const KURL & url)
virtual

Reimplemented from KParts::ReadWritePart for internal reasons (for the autosave functionality).

Reimplemented from KParts::ReadOnlyPart.

Definition at line 1347 of file KoDocument.cpp.

◆ outputMimeType()

TQCString KoDocument::outputMimeType ( ) const

Definition at line 490 of file KoDocument.cpp.

◆ pageCount()

virtual int KoDocument::pageCount ( ) const
inlinevirtual
Returns
returns the number of pages in the document.

Definition at line 866 of file KoDocument.h.

◆ pageLayout()

KoPageLayout KoDocument::pageLayout ( int pageNumber = 0) const
virtual
Returns
the page layout associated with this document (margins, pageSize, etc). Override this if you want to provide different sized pages.
See also
KoPageLayout

Definition at line 2524 of file KoDocument.cpp.

◆ paintChild()

void KoDocument::paintChild ( KoDocumentChild * child,
TQPainter & painter,
KoView * view,
double zoomX = 1.0,
double zoomY = 1.0 )
virtual

Paint a given child.

Normally called by paintChildren().

Parameters
childThe child to be painted.
painterThe painter object onto which will be drawn.
viewThe KoView is needed to fiddle about with the active widget.
zoomXThe zoom value to be applied to X coordinates when painting.
zoomYThe zoom value to be applied to Y coordinates when painting.
See also
paintEverything paintChildren paintContent

Definition at line 802 of file KoDocument.cpp.

◆ paintChildren()

void KoDocument::paintChildren ( TQPainter & painter,
const TQRect & rect,
KoView * view,
double zoomX = 1.0,
double zoomY = 1.0 )
virtual

Paints all of the documents children into the given painter object.

Parameters
painterThe painter object onto which will be drawn.
rectThe rect that should be used in the painter object.
viewThe KoView is needed to fiddle about with the active widget.
zoomXThe zoom value to be applied to X coordinates when painting.
zoomYThe zoom value to be applied to Y coordinates when painting.
See also
paintChild paintEverything paintContent

Definition at line 790 of file KoDocument.cpp.

◆ paintContent()

virtual void KoDocument::paintContent ( TQPainter & painter,
const TQRect & rect,
bool transparent = false,
double zoomX = 1.0,
double zoomY = 1.0 )
pure virtual

Paints the data itself.

Normally called by paintEverything(). It does not paint the children. It's this method that KOffice Parts have to implement.

Parameters
painterThe painter object onto which will be drawn.
rectThe rect that should be used in the painter object.
transparentIf false the implementing method should fill the background.
zoomXThe zoom value to be applied to X coordinates when painting.
zoomYThe zoom value to be applied to Y coordinates when painting.
See also
paintEverything

◆ paintEverything()

void KoDocument::paintEverything ( TQPainter & painter,
const TQRect & rect,
bool transparent = false,
KoView * view = 0L,
double zoomX = 1.0,
double zoomY = 1.0 )
virtual

Paints the whole document into the given painter object.

Parameters
painterThe painter object onto which will be drawn.
rectThe rect that should be used in the painter object.
transparentIf true then the entire rectangle is erased before painting.
viewThe KoView is needed to fiddle about with the active widget, when painting children.
zoomXThe zoom value to be applied to X coordinates when painting.
zoomYThe zoom value to be applied to Y coordinates when painting.

Definition at line 784 of file KoDocument.cpp.

◆ queryCloseDia()

int KoDocument::queryCloseDia ( )

Definition at line 1992 of file KoDocument.cpp.

◆ queryCloseExternalChildren()

int KoDocument::queryCloseExternalChildren ( )

Definition at line 2027 of file KoDocument.cpp.

◆ readExtraNativeMimeTypes()

TQStringList KoDocument::readExtraNativeMimeTypes ( TDEInstance * instance = 0)
static

Used by KoMainWindow, when no document exists yet.

With the help of instance or TDEApplication::instance() this method figures out which .desktop file matches this application. In this file it searches for the "X-TDE-ExtraNativeMimeTypes" entry and returns it.

See also
KService
KDesktopFile

Definition at line 2268 of file KoDocument.cpp.

◆ readNativeFormatMimeType()

TQCString KoDocument::readNativeFormatMimeType ( TDEInstance * instance = 0)
static

Used by KoApplication, and by KoMainWindow, when no document exists yet.

With the help of instance or TDEApplication::instance() this method figures out which .desktop file matches this application. In this file it searches for the "X-TDE-NativeMimeType" entry and returns it.

See also
KService
KDesktopFile

Definition at line 2247 of file KoDocument.cpp.

◆ readNativeService()

KService::Ptr KoDocument::readNativeService ( TDEInstance * instance = 0)
static

With the help of instance or TDEApplication::instance() this method figures out which .desktop file matches this application, and returns the KService instance for it.

Definition at line 2223 of file KoDocument.cpp.

◆ removeAutoSaveFiles()

void KoDocument::removeAutoSaveFiles ( )

Performs a cleanup of unneeded backup files.

Definition at line 2400 of file KoDocument.cpp.

◆ removeShell()

void KoDocument::removeShell ( KoMainWindow * shell)
virtual

Removes the shell from the list.

That happens automatically if the shell changes its root document. Usually you dont need to call this method.

Definition at line 2328 of file KoDocument.cpp.

◆ removeView()

void KoDocument::removeView ( KoView * view)
virtual

Removes a view of the document.

Definition at line 638 of file KoDocument.cpp.

◆ resetURL()

void KoDocument::resetURL ( )
inline

Sets the document URL to empty URL KParts doesn't allow this, but KOffice apps have e.g.

templates After using loadNativeFormat on a template, one wants to set the url to KURL()

Definition at line 818 of file KoDocument.h.

◆ saveChildren()

bool KoDocument::saveChildren ( KoStore * store)
protectedvirtual

Saves all internal children (only!).

See also
saveExternalChildren if you have external children. Returns true on success.

Definition at line 880 of file KoDocument.cpp.

◆ saveChildrenOasis()

bool KoDocument::saveChildrenOasis ( KoStore * store,
KoXmlWriter * manifestWriter )
protectedvirtual

Saves all internal children (only!), to the store, using the OASIS format.

This is called automatically during saveNativeFormat.

See also
saveExternalChildren if you have external children. Returns true on success.

Definition at line 904 of file KoDocument.cpp.

◆ saveExternalChildren()

bool KoDocument::saveExternalChildren ( )
protectedvirtual

Saves all externally stored children.

Returns true on success.

See also
saveChildren for internal children

Definition at line 921 of file KoDocument.cpp.

◆ saveFile()

bool KoDocument::saveFile ( )
protectedvirtual

Saves a document to KReadOnlyPart::m_file (KParts takes care of uploading remote documents) Applies a filter if necessary, and calls saveNativeFormat in any case You should not have to reimplement, except for very special cases.

Implements KParts::ReadWritePart.

Definition at line 375 of file KoDocument.cpp.

◆ saveNativeFormat()

bool KoDocument::saveNativeFormat ( const TQString & file)
virtual

Saves the document in native format, to a given file You should never have to reimplement.

Made public for writing templates.

Definition at line 954 of file KoDocument.cpp.

◆ saveOasis()

virtual bool KoDocument::saveOasis ( KoStore * store,
KoXmlWriter * manifestWriter )
pure virtual

Reimplement this method to save the contents of your KOffice document, using the OASIS format.

◆ saveToStore()

bool KoDocument::saveToStore ( KoStore * store,
const TQString & path )
virtual

Saves a document to a store.

You should not have to reimplement this - but call it in saveChildren().

Definition at line 1142 of file KoDocument.cpp.

◆ saveToStream()

bool KoDocument::saveToStream ( TQIODevice * dev)
virtual

Save the document.

The default implementation is to call saveXML(). This method exists only for applications that don't use TQDomDocument for saving, i.e. kword and kpresenter.

Definition at line 1128 of file KoDocument.cpp.

◆ saveXML()

TQDomDocument KoDocument::saveXML ( )
virtual

Reimplement this to save the contents of the KOffice document into a TQDomDocument.

The framework takes care of saving it to the store.

Definition at line 2182 of file KoDocument.cpp.

◆ setAutoErrorHandlingEnabled()

void KoDocument::setAutoErrorHandlingEnabled ( bool b)

Set whether the next openURL call should show error message boxes in case of errors.

This is usually the case, but e.g. not when generating thumbnail previews.

Definition at line 532 of file KoDocument.cpp.

◆ setAutoSave()

void KoDocument::setAutoSave ( int delay)

Activate/deactivate/configure the autosave feature.

Parameters
delayin seconds, 0 to disable

Definition at line 620 of file KoDocument.cpp.

◆ setBackupFile()

void KoDocument::setBackupFile ( bool _b)

Definition at line 2411 of file KoDocument.cpp.

◆ setBackupPath()

void KoDocument::setBackupPath ( const TQString & _path)

Sets the backup path of the document.

Definition at line 2422 of file KoDocument.cpp.

◆ setCheckAutoSaveFile()

void KoDocument::setCheckAutoSaveFile ( bool b)

Set whether the next openURL call should check for an auto-saved file and offer to open it.

This is usually true, but can be turned off (e.g. for the preview module).

Definition at line 527 of file KoDocument.cpp.

◆ setConfirmNonNativeSave()

void KoDocument::setConfirmNonNativeSave ( const bool exporting,
const bool on )

Definition at line 507 of file KoDocument.cpp.

◆ setCurrent()

void KoDocument::setCurrent ( bool on = true)

Indicates that this document is currently viewed and thus should control the title caption.

Also resets current flag for all parents.

Definition at line 2432 of file KoDocument.cpp.

◆ setDoNotSaveExtDoc()

void KoDocument::setDoNotSaveExtDoc ( bool on = true)

Set when we do not want to save external children when saving our 'main' doc.

This makes it possible to save 'main' doc + all its internal children first, then go on to save external children. Typically used by query close. Use:

doc->setDoNotSaveExtDoc();
doc->save(); // saves doc and its internal children,
//also calls saveExternalChildren() which sets setDoNotSaveExtDoc(false)
doc->saveExternalChildren();

Definition at line 1987 of file KoDocument.cpp.

◆ setEmpty()

virtual void KoDocument::setEmpty ( )
inlinevirtual

Sets the document to empty.

Used after loading a template (which is not empty, but not the user's input).

See also
isEmpty()

Definition at line 499 of file KoDocument.h.

◆ setErrorMessage()

void KoDocument::setErrorMessage ( const TQString & errMsg)

Sets the error message to be shown to the user (use i18n()!) when loading or saving fails.

If you asked the user about something and he chose "Cancel", set the message to the magic string "USER_CANCELED", to skip the error dialog.

Definition at line 2356 of file KoDocument.cpp.

◆ setFile()

void KoDocument::setFile ( const TQString & file)
inline

Only use these functions to restore m_file (in KoMainWindow) after a failed save (remember to use setURL() to restore the URL as well).

Warning
Do not use these functions for any other purpose.

Definition at line 856 of file KoDocument.h.

◆ setManager()

void KoDocument::setManager ( KParts::PartManager * manager)
virtual

Definition at line 589 of file KoDocument.cpp.

◆ setMimeType()

void KoDocument::setMimeType ( const TQCString & mimeType)

Sets the mime type for the document.

When choosing "save as" this is also the mime type selected by default.

Definition at line 479 of file KoDocument.cpp.

◆ setMimeTypeAfterLoading()

void KoDocument::setMimeTypeAfterLoading ( const TQString & mimeType)

Definition at line 1610 of file KoDocument.cpp.

◆ setModified() [1/2]

virtual void KoDocument::setModified ( )
inlineprotectedvirtual

Reimplemented from KParts::ReadWritePart.

Definition at line 1092 of file KoDocument.h.

◆ setModified() [2/2]

void KoDocument::setModified ( bool _mod)
virtual

Sets the modified flag on the document.

This means that it has to be saved or not before deleting it.

Reimplemented from KParts::ReadWritePart.

Definition at line 1950 of file KoDocument.cpp.

◆ setOutputMimeType()

void KoDocument::setOutputMimeType ( const TQCString & mimeType,
int specialOutputFlag = 0 )

Set the format in which the document should be saved.

This is called on loading, and in "save as", so you shouldn't have to call it.

Parameters
mimeTypethe mime type (format) to use.
specialOutputFlagis for "save as older version" etc.

Definition at line 484 of file KoDocument.cpp.

◆ setReadWrite()

void KoDocument::setReadWrite ( bool readwrite = true)
virtual

Sets whether the document can be edited or is read only.

This recursively applied to all child documents and KoView::updateReadWrite is called for every attached view.

Reimplemented from KParts::ReadWritePart.

Definition at line 604 of file KoDocument.cpp.

◆ setStoreInternal()

void KoDocument::setStoreInternal ( bool i)

Set when you want an external embedded document to be stored internally.

Definition at line 2480 of file KoDocument.cpp.

◆ setTemplateType()

void KoDocument::setTemplateType ( const TQString & _templateType)

Set the template type used.

This is used by the start up widget to show the correct templates.

Since
1.5

Definition at line 2625 of file KoDocument.cpp.

◆ setTitleModified() [1/2]

void KoDocument::setTitleModified ( )
virtual

Tells the document that its title has been modified, either because the modified status changes (this is done by setModified() ) or because the URL or the document-info's title changed.

Definition at line 2078 of file KoDocument.cpp.

◆ setTitleModified() [2/2]

void KoDocument::setTitleModified ( const TQString caption,
bool mod )

Definition at line 2059 of file KoDocument.cpp.

◆ setUnit()

void KoDocument::setUnit ( KoUnit::Unit u)

Sets the unit used to display all measures/distances.

Since
1.5

Definition at line 2534 of file KoDocument.cpp.

◆ setupXmlReader()

void KoDocument::setupXmlReader ( TQXmlSimpleReader & reader,
bool namespaceProcessing = false )
static

setup the XML reader, so that we don't have to duplicate the code.

Definition at line 2276 of file KoDocument.cpp.

◆ setURL()

void KoDocument::setURL ( const KURL & url)
inline

Sets the document URL to url KParts doesn't really allow this, but it is needed for undo of setStoreInternal().

Definition at line 836 of file KoDocument.h.

◆ setViewBuildDocument()

void KoDocument::setViewBuildDocument ( KoView * view,
const TQDomDocument & doc )

Definition at line 751 of file KoDocument.cpp.

◆ shellCount()

int KoDocument::shellCount ( ) const
Returns
the number of shells for the main window

Definition at line 2339 of file KoDocument.cpp.

◆ shells()

const TQPtrList< KoMainWindow > & KoDocument::shells ( ) const
Returns
the list of shells for the main window

Definition at line 2334 of file KoDocument.cpp.

◆ showEmbedInitDialog()

bool KoDocument::showEmbedInitDialog ( TQWidget * parent)
virtual

Shows the init dialog when embeding.

Parameters
parentthe parent widget
Since
1.5

Definition at line 2658 of file KoDocument.cpp.

◆ showLoadingErrorDialog()

void KoDocument::showLoadingErrorDialog ( )

Show the last error message in a message box.

The dialog box will mention a loading problem. openURL/openFile takes care of doing it, but not loadNativeFormat itself, so this is often called after loadNativeFormat returned false.

Since
1.4

Definition at line 2378 of file KoDocument.cpp.

◆ showSavingErrorDialog()

void KoDocument::showSavingErrorDialog ( )

Show the last error message in a message box.

The dialog box will mention a saving problem. Note that save/saveFile takes care of doing it.

Since
1.4

Definition at line 2366 of file KoDocument.cpp.

◆ showStartUpWidget()

void KoDocument::showStartUpWidget ( KoMainWindow * parent,
bool alwaysShow = false )
virtual

Creates and shows the start up widget.

Parameters
parentthe KoMainWindow used as parent for the widget.
alwaysShowalways show the widget even if the user has configured it to not show.
Since
1.5

Definition at line 2548 of file KoDocument.cpp.

◆ sigClearStatusBarMessage

void KoDocument::sigClearStatusBarMessage ( )
signal

Emitted e.g.

at the end of a save operation This is emitted by KoDocument and used by KoView to clear the statusbar message

◆ sigProgress

void KoDocument::sigProgress ( int value)
signal

Progress info while loading or saving.

The value is in percents (i.e. a number between 0 and 100) Your KoDocument-derived class should emit the signal now and then during load/save. KoMainWindow will take care of displaying a progress bar automatically.

◆ sigStatusBarMessage

void KoDocument::sigStatusBarMessage ( const TQString & text)
signal

Emitted e.g.

at the beginning of a save operation This is emitted by KoDocument and used by KoView to display a statusbar message

◆ specialOutputFlag()

int KoDocument::specialOutputFlag ( ) const

Definition at line 495 of file KoDocument.cpp.

◆ storeInternal()

bool KoDocument::storeInternal ( ) const
Returns
true when external embedded documents are stored internally

Definition at line 2475 of file KoDocument.cpp.

◆ supportedSpecialFormats()

int KoDocument::supportedSpecialFormats ( ) const
virtual

Return the set of SupportedSpecialFormats that the application wants to offer in the "Save" file dialog.

Definition at line 2311 of file KoDocument.cpp.

◆ tagNameToDocumentType()

TQString KoDocument::tagNameToDocumentType ( const TQString & localName)
static

The first thing to do in loadOasis is get hold of the office:body tag, then its child.

If the child isn't the expected one, the error message can indicate what it is instead. This method returns a translated name for the type of document, e.g. i18n("Word Processing") for office:text.

Definition at line 2511 of file KoDocument.cpp.

◆ templateType()

TQString KoDocument::templateType ( ) const

Template type used.

This is used by the start up widget to show the correct templates.

Since
1.5

Definition at line 2630 of file KoDocument.cpp.

◆ unit()

KoUnit::Unit KoDocument::unit ( ) const

Returns the unit used to display all measures/distances.

Since
1.5

Definition at line 2529 of file KoDocument.cpp.

◆ unitChanged

void KoDocument::unitChanged ( KoUnit::Unit )
signal

This signal is emitted when the unit is changed by setUnit() It is common to connect views to it, in order to change the displayed units (e.g.

in the rulers)

◆ unitName()

TQString KoDocument::unitName ( ) const

Returns the name of the unit used to display all measures/distances.

Use this method for displaying it in the user interface, but use unit() for everything else (conversions etc.)

Since
1.5

Definition at line 2543 of file KoDocument.cpp.

◆ viewBuildDocument()

TQDomDocument KoDocument::viewBuildDocument ( KoView * view)

Definition at line 764 of file KoDocument.cpp.

◆ viewCount()

int KoDocument::viewCount ( ) const
Returns
number of views this document is displayed in

Definition at line 648 of file KoDocument.cpp.

◆ views()

const TQPtrList< KoView > & KoDocument::views ( ) const
Returns
a list of views this document is displayed in

Definition at line 643 of file KoDocument.cpp.

◆ wantExportConfirmation()

bool KoDocument::wantExportConfirmation ( ) const
virtual

Definition at line 512 of file KoDocument.cpp.

Member Data Documentation

◆ m_pageLayout

KoPageLayout KoDocument::m_pageLayout
protected

Definition at line 1097 of file KoDocument.h.


The documentation for this class was generated from the following files: