lib

#include <KoMainWindow.h>

Inheritance diagram for KoMainWindow:
KParts::MainWindow TDEMainWindow KParts::PartBase KXMLGUIBuilder KXMLGUIClient KXMLGUIClient

Public Slots

void slotEmailFile ()
virtual void slotFileNew ()
virtual void slotFileOpen ()
virtual void slotFileOpenRecent (const KURL &)
virtual void slotFileSave ()
virtual void slotFileSaveAs ()
virtual void slotFilePrint ()
void slotFilePrintPreview ()
virtual void slotDocumentInfo ()
virtual void slotFileClose ()
virtual void slotFileQuit ()
virtual void slotConfigureKeys ()
virtual void slotConfigureToolbars ()
virtual void slotNewToolbarConfig ()
virtual void slotToolbarToggled (bool toggle)
virtual void slotSplitView ()
virtual void slotRemoveView ()
virtual void slotSetOrientation ()
virtual void slotCloseAllViews ()
void slotReloadFile ()
void slotVersionsFile ()
void slotImportFile ()
void slotExportFile ()
Public Slots inherited from TDEMainWindow
int configureToolbars ()
virtual void setCaption (const TQString &caption)
virtual void setCaption (const TQString &caption, bool modified)
virtual void setPlainCaption (const TQString &caption)
void appHelpActivated (void)
virtual void slotStateChanged (const TQString &newstate)
void slotStateChanged (const TQString &newstate, KXMLGUIClient::ReverseStateChange)
void setSettingsDirty ()

Signals

void documentSaved ()
void saveDialogShown ()

Public Member Functions

 KoMainWindow (TDEInstance *instance, const char *_name=0)
 ~KoMainWindow ()
virtual void setRootDocument (KoDocument *doc)
void setDocToOpen (KoDocument *doc)
virtual void updateCaption ()
virtual KoDocument * rootDocument () const
virtual KoView * rootView () const
virtual KParts::PartManager * partManager ()
void print (bool quick)
void showToolbar (const char *tbName, bool shown)
bool toolbarIsVisible (const char *tbName)
TQLabel * statusBarLabel ()
void setMaxRecentItems (uint _number)
void addRecentURL (const KURL &url)
virtual bool openDocument (const KURL &url)
bool openDocument (KoDocument *newdoc, const KURL &url)
virtual DCOPObject * dcopObject ()
void reloadRecentFileList ()
virtual void updateCaption (const TQString caption, bool mod)
void updateReloadFileAction (KoDocument *doc)
void updateVersionsFileAction (KoDocument *doc)
Public Member Functions inherited from KParts::MainWindow
 MainWindow (TQWidget *parent, const char *name=0L, WFlags f=(WFlags)(WType_TopLevel|WDestructiveClose))
 MainWindow (const char *name=0L, WFlags f=(WFlags) WDestructiveClose)
 MainWindow (int cflags, TQWidget *parent, const char *name=0L, WFlags f=(WFlags)(WType_TopLevel|WDestructiveClose))
Public Member Functions inherited from TDEMainWindow
 TDEMainWindow (TQWidget *parent=0, const char *name=0, WFlags f=(WFlags)(WType_TopLevel|WDestructiveClose))
 TDEMainWindow (int cflags, TQWidget *parent=0, const char *name=0, WFlags f=(WFlags)(WType_TopLevel|WDestructiveClose))
TDEPopupMenu * helpMenu (const TQString &aboutAppText=TQString::null, bool showWhatsThis=true)
TDEPopupMenu * customHelpMenu (bool showWhatsThis=true)
virtual void show ()
virtual void hide ()
bool restore (int number, bool show=true)
void createGUI (const TQString &xmlfile=TQString::null, bool _conserveMemory=true)
void setHelpMenuEnabled (bool showHelpMenu=true)
bool isHelpMenuEnabled ()
bool hasMenuBar ()
KMenuBar * menuBar ()
KStatusBar * statusBar ()
TDEToolBar * toolBar (const char *name=0)
TQPtrListIterator< TDEToolBar > toolBarIterator ()
TDEAccel * accel ()
void setAutoSaveSettings (const TQString &groupName=TQString::fromLatin1("MainWindow"), bool saveWindowSize=true)
void resetAutoSaveSettings ()
bool autoSaveSettings () const
TQString autoSaveGroup () const
void applyMainWindowSettings (TDEConfig *config, const TQString &groupName, bool force)
void saveMainWindowSettings (TDEConfig *config, const TQString &groupName=TQString::null)
void setStandardToolBarMenuEnabled (bool enable)
bool isStandardToolBarMenuEnabled () const
void createStandardStatusBarAction ()
void setupGUI (int options=ToolBar|Keys|StatusBar|Save|Create, const TQString &xmlfile=TQString::null)
void setupGUI (TQSize defaultSize, int options=ToolBar|Keys|StatusBar|Save|Create, const TQString &xmlfile=TQString::null)
TDEAction * toolBarMenuAction ()
void setupToolbarMenuActions ()
virtual void finalizeGUI (KXMLGUIClient *client)
void finalizeGUI (bool force)
bool initialGeometrySet () const
void ignoreInitialGeometry ()
TQSize sizeForCentralWidgetSize (TQSize size) TDE_DEPRECATED
virtual void setIcon (const TQPixmap &)
Public Member Functions inherited from KXMLGUIBuilder
virtual TQWidget * createContainer (TQWidget *parent, int index, const TQDomElement &element, int &id)
virtual void removeContainer (TQWidget *container, TQWidget *parent, TQDomElement &element, int id)
Public Member Functions inherited from KXMLGUIClient
 KXMLGUIClient (KXMLGUIClient *parent)
TDEAction * action (const char *name) const
virtual TDEAction * action (const TQDomElement &element) const
virtual TDEActionCollection * actionCollection () const
virtual TDEInstance * instance () const
virtual TQDomDocument domDocument () 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 *)
Public Member Functions inherited from KParts::PartBase
void setPartObject (TQObject *object)

Protected Slots

virtual void slotActivePartChanged (KParts::Part *newPart)
Protected Slots inherited from KParts::MainWindow
void createGUI (KParts::Part *part)
virtual void slotSetStatusBarText (const TQString &)
void saveNewToolbarConfig ()
Protected Slots inherited from TDEMainWindow
void saveNewToolbarConfig ()
virtual void showAboutApplication ()
void saveAutoSaveSettings ()

Protected Member Functions

void chooseNewDocument (int initDocFlags)
void setRootDocumentDirect (KoDocument *doc, const TQPtrList< KoView > &views)
virtual KoDocument * createDoc () const
virtual bool saveDocument (bool saveas=false, bool silent=false)
virtual void closeEvent (TQCloseEvent *e)
virtual void resizeEvent (TQResizeEvent *e)
virtual bool queryClose ()
virtual bool openDocumentInternal (const KURL &url, KoDocument *newdoc=0L)
bool isExporting () const
bool isImporting () const
void saveRecentFiles ()
TDERecentFilesAction * recentAction () const
Protected Member Functions inherited from TDEMainWindow
virtual bool queryExit ()
virtual void saveProperties (TDEConfig *)
virtual void readProperties (TDEConfig *)
virtual void saveGlobalProperties (TDEConfig *sessionConfig)
virtual void readGlobalProperties (TDEConfig *sessionConfig)
bool settingsDirty () const
TQString settingsGroup () const
void saveWindowSize (TDEConfig *config) const
void restoreWindowSize (TDEConfig *config)
void parseGeometry (bool parsewidth)
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 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)

Additional Inherited Members

Public Types inherited from TDEMainWindow
enum  CreationFlags
enum  StandardWindowOptions
Static Public Member Functions inherited from TDEMainWindow
static bool canBeRestored (int number)
static const TQString classNameOfToplevel (int number)
static TQPtrList< TDEMainWindow > * getMemberList ()
Public Attributes inherited from TDEMainWindow
 ToolBar
 Keys
 StatusBar
 Save
 Create
Static Public Attributes inherited from TDEMainWindow
static TQPtrList< TDEMainWindow > * memberList
Protected Types inherited from KParts::PartBase
enum  PluginLoadingMode
Protected Attributes inherited from KParts::PartBase
 DoNotLoadPlugins
 LoadPlugins
 LoadPluginsIfEnabled

Detailed Description

Main window for a KOffice application.

This class is used to represent a main window of a KOffice component. Each main window contains a menubar and some toolbars.

Note
This class does NOT need to be subclassed in your application.

Definition at line 51 of file KoMainWindow.h.

Constructor & Destructor Documentation

◆ KoMainWindow()

KoMainWindow::KoMainWindow ( TDEInstance * instance,
const char * _name = 0 )

Constructor.

Initializes a KOffice main window (with its basic GUI etc.).

Definition at line 185 of file KoMainWindow.cpp.

◆ ~KoMainWindow()

KoMainWindow::~KoMainWindow ( )

Destructor.

Definition at line 310 of file KoMainWindow.cpp.

Member Function Documentation

◆ addRecentURL()

void KoMainWindow::addRecentURL ( const KURL & url)

The document opened a URL -> store into recent documents list.

Definition at line 443 of file KoMainWindow.cpp.

◆ chooseNewDocument()

void KoMainWindow::chooseNewDocument ( int initDocFlags)
protected

Helper method for slotFileNew and slotFileClose.

Definition at line 1081 of file KoMainWindow.cpp.

◆ closeEvent()

void KoMainWindow::closeEvent ( TQCloseEvent * e)
protectedvirtual

Reimplemented from TDEMainWindow.

Definition at line 990 of file KoMainWindow.cpp.

◆ createDoc()

KoDocument * KoMainWindow::createDoc ( ) const
protectedvirtual

Create a new empty document.

Definition at line 493 of file KoMainWindow.cpp.

◆ dcopObject()

DCOPObject * KoMainWindow::dcopObject ( )
virtual

Definition at line 1581 of file KoMainWindow.cpp.

◆ documentSaved

void KoMainWindow::documentSaved ( )
signal

This signal is emitted if the document has been saved successfully.

◆ isExporting()

bool KoMainWindow::isExporting ( ) const
protected

Returns whether or not the current slotFileSave[As]() or saveDocument() call is actually an export operation (like File --> Export).

If this is true, you must call KoDocument::export() instead of KoDocument::save() or KoDocument::saveAs(), in any reimplementation of saveDocument().

Definition at line 1699 of file KoMainWindow.cpp.

◆ isImporting()

bool KoMainWindow::isImporting ( ) const
protected

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

If this is true, you must call KoDocument::import() instead of KoDocument::openURL(), in any reimplementation of openDocument() or openDocumentInternal().

Definition at line 1694 of file KoMainWindow.cpp.

◆ openDocument() [1/2]

bool KoMainWindow::openDocument ( const KURL & url)
virtual

Load the desired document and show it.

Parameters
urlthe URL to open
Returns
true on success.

Definition at line 551 of file KoMainWindow.cpp.

◆ openDocument() [2/2]

bool KoMainWindow::openDocument ( KoDocument * newdoc,
const KURL & url )

Load the URL into this document (and make it root doc after loading).

Special method for KoApplication::start, don't use.

Definition at line 564 of file KoMainWindow.cpp.

◆ openDocumentInternal()

bool KoMainWindow::openDocumentInternal ( const KURL & url,
KoDocument * newdoc = 0L )
protectedvirtual

Definition at line 588 of file KoMainWindow.cpp.

◆ partManager()

KParts::PartManager * KoMainWindow::partManager ( )
virtual

Definition at line 546 of file KoMainWindow.cpp.

◆ print()

void KoMainWindow::print ( bool quick)

Prints the document.

Parameters
quickwhether the print setup dialog is to be displayed

Definition at line 1198 of file KoMainWindow.cpp.

◆ queryClose()

bool KoMainWindow::queryClose ( )
protectedvirtual

Ask user about saving changes to the document upon exit.

Reimplemented from TDEMainWindow.

Definition at line 1021 of file KoMainWindow.cpp.

◆ recentAction()

TDERecentFilesAction * KoMainWindow::recentAction ( ) const
inlineprotected

Definition at line 357 of file KoMainWindow.h.

◆ reloadRecentFileList()

void KoMainWindow::reloadRecentFileList ( )

Reloads the recent documents list.

Definition at line 487 of file KoMainWindow.cpp.

◆ resizeEvent()

void KoMainWindow::resizeEvent ( TQResizeEvent * e)
protectedvirtual

Definition at line 1015 of file KoMainWindow.cpp.

◆ rootDocument()

KoDocument * KoMainWindow::rootDocument ( ) const
virtual

Retrieves the document that is displayed in the mainwindow.

Definition at line 534 of file KoMainWindow.cpp.

◆ rootView()

KoView * KoMainWindow::rootView ( ) const
virtual

Definition at line 539 of file KoMainWindow.cpp.

◆ saveDialogShown

void KoMainWindow::saveDialogShown ( )
signal

This signals is emmitted before the save dialog is shown.

◆ saveDocument()

bool KoMainWindow::saveDocument ( bool saveas = false,
bool silent = false )
protectedvirtual

Saves the document, asking for a filename if necessary.

Parameters
saveasif set to true the user is always prompted for a filename
silentif set to true rootDocument()->setTitleModified will not be called.
Returns
true on success, false on error or cancel (don't display anything in this case, the error dialog box is also implemented here but restore the original URL in slotFileSaveAs)

Definition at line 725 of file KoMainWindow.cpp.

◆ saveRecentFiles()

void KoMainWindow::saveRecentFiles ( )
protected

Save the list of recent files.

Definition at line 470 of file KoMainWindow.cpp.

◆ setDocToOpen()

void KoMainWindow::setDocToOpen ( KoDocument * doc)

This is used to handle the document used at start up before it actually added as root document.

Definition at line 1704 of file KoMainWindow.cpp.

◆ setMaxRecentItems()

void KoMainWindow::setMaxRecentItems ( uint _number)

Sets the maximum number of recent documents entries.

Definition at line 1576 of file KoMainWindow.cpp.

◆ setRootDocument()

void KoMainWindow::setRootDocument ( KoDocument * doc)
virtual

Called when a document is assigned to this mainwindow.

This creates a view for this document, makes it the active part, etc.

Definition at line 354 of file KoMainWindow.cpp.

◆ setRootDocumentDirect()

void KoMainWindow::setRootDocumentDirect ( KoDocument * doc,
const TQPtrList< KoView > & views )
protected

Special method for KOShell, to allow switching the root document (and its views) among a set of them.

Definition at line 428 of file KoMainWindow.cpp.

◆ showToolbar()

void KoMainWindow::showToolbar ( const char * tbName,
bool shown )

The application should call this to show or hide a toolbar.

It also takes care of the corresponding action in the settings menu.

Definition at line 1338 of file KoMainWindow.cpp.

◆ slotActivePartChanged

void KoMainWindow::slotActivePartChanged ( KParts::Part * newPart)
protectedvirtualslot

Definition at line 1472 of file KoMainWindow.cpp.

◆ slotCloseAllViews

void KoMainWindow::slotCloseAllViews ( )
virtualslot

Close all views.

Definition at line 1372 of file KoMainWindow.cpp.

◆ slotConfigureKeys

void KoMainWindow::slotConfigureKeys ( )
virtualslot

Configure key bindings.

Definition at line 1278 of file KoMainWindow.cpp.

◆ slotConfigureToolbars

void KoMainWindow::slotConfigureToolbars ( )
virtualslot

Configure toolbars.

Definition at line 1283 of file KoMainWindow.cpp.

◆ slotDocumentInfo

void KoMainWindow::slotDocumentInfo ( )
virtualslot

Show a dialog with author and document information.

Definition at line 1160 of file KoMainWindow.cpp.

◆ slotEmailFile

void KoMainWindow::slotEmailFile ( )
slot

Slot for eMailing the document using KMail.

This is a very simple extension that will allow any document that is currently being edited to be emailed using KMail.

Definition at line 1591 of file KoMainWindow.cpp.

◆ slotExportFile

void KoMainWindow::slotExportFile ( )
slot

File --> Export.

This will call slotFileSaveAs(). To differentiate this from an ordinary call to slotFileSaveAs() call isExporting().

Definition at line 1685 of file KoMainWindow.cpp.

◆ slotFileClose

void KoMainWindow::slotFileClose ( )
virtualslot

Closes the document.

Definition at line 1181 of file KoMainWindow.cpp.

◆ slotFileNew

void KoMainWindow::slotFileNew ( )
virtualslot

Slot for opening a new document.

If the current document is empty, the new document replaces it. If not, a new shell will be opened for showing the document.

Definition at line 1112 of file KoMainWindow.cpp.

◆ slotFileOpen

void KoMainWindow::slotFileOpen ( )
virtualslot

Slot for opening a saved file.

If the current document is empty, the opened document replaces it. If not a new shell will be opened for showing the opened file.

Definition at line 1117 of file KoMainWindow.cpp.

◆ slotFileOpenRecent

void KoMainWindow::slotFileOpenRecent ( const KURL & url)
virtualslot

Slot for opening a file among the recently opened files.

If the current document is empty, the opened document replaces it. If not a new shell will be opened for showing the opened file.

Definition at line 1143 of file KoMainWindow.cpp.

◆ slotFilePrint

void KoMainWindow::slotFilePrint ( )
virtualslot

Prints the actual document.

Definition at line 1238 of file KoMainWindow.cpp.

◆ slotFilePrintPreview

void KoMainWindow::slotFilePrintPreview ( )
slot

Show a print preview.

Definition at line 1243 of file KoMainWindow.cpp.

◆ slotFileQuit

void KoMainWindow::slotFileQuit ( )
virtualslot

Closes the shell.

Definition at line 1193 of file KoMainWindow.cpp.

◆ slotFileSave

void KoMainWindow::slotFileSave ( )
virtualslot

Saves the current document with the current name.

Definition at line 1148 of file KoMainWindow.cpp.

◆ slotFileSaveAs

void KoMainWindow::slotFileSaveAs ( )
virtualslot

Saves the current document with a new name.

Definition at line 1154 of file KoMainWindow.cpp.

◆ slotImportFile

void KoMainWindow::slotImportFile ( )
slot

File --> Import.

This will call slotFileOpen(). To differentiate this from an ordinary call to slotFileOpen() call isImporting().

Definition at line 1676 of file KoMainWindow.cpp.

◆ slotNewToolbarConfig

void KoMainWindow::slotNewToolbarConfig ( )
virtualslot

Post toolbar config.

(Plug action lists back in, etc.)

Definition at line 1292 of file KoMainWindow.cpp.

◆ slotReloadFile

void KoMainWindow::slotReloadFile ( )
slot

Reload file.

Definition at line 1651 of file KoMainWindow.cpp.

◆ slotRemoveView

void KoMainWindow::slotRemoveView ( )
virtualslot

Definition at line 1397 of file KoMainWindow.cpp.

◆ slotSetOrientation

void KoMainWindow::slotSetOrientation ( )
virtualslot

Definition at line 1425 of file KoMainWindow.cpp.

◆ slotSplitView

void KoMainWindow::slotSplitView ( )
virtualslot

View splitting stuff.

Definition at line 1362 of file KoMainWindow.cpp.

◆ slotToolbarToggled

void KoMainWindow::slotToolbarToggled ( bool toggle)
virtualslot

Shows or hides a toolbar.

Definition at line 1313 of file KoMainWindow.cpp.

◆ slotVersionsFile

void KoMainWindow::slotVersionsFile ( )
slot

This will call a dialogbox to add version to list of files.

Definition at line 1644 of file KoMainWindow.cpp.

◆ statusBarLabel()

TQLabel * KoMainWindow::statusBarLabel ( )

Get hold of the label in the statusbar, to write messages to it.

You can also insert other items in the status bar by using TQStatusBar::addWidget.

Definition at line 1566 of file KoMainWindow.cpp.

◆ toolbarIsVisible()

bool KoMainWindow::toolbarIsVisible ( const char * tbName)
Returns
true if the toolbar tbName is visible

Definition at line 1332 of file KoMainWindow.cpp.

◆ updateCaption() [1/2]

void KoMainWindow::updateCaption ( )
virtual

Update caption from document info - call when document info (title in the about page) changes.

Definition at line 499 of file KoMainWindow.cpp.

◆ updateCaption() [2/2]

void KoMainWindow::updateCaption ( const TQString caption,
bool mod )
virtual

Updates the window caption based on the document info and path.

Definition at line 528 of file KoMainWindow.cpp.

◆ updateReloadFileAction()

void KoMainWindow::updateReloadFileAction ( KoDocument * doc)

Definition at line 416 of file KoMainWindow.cpp.

◆ updateVersionsFileAction()

void KoMainWindow::updateVersionsFileAction ( KoDocument * doc)

Definition at line 421 of file KoMainWindow.cpp.


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