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 186 of file KoMainWindow.cpp.

◆ ~KoMainWindow()

KoMainWindow::~KoMainWindow ( )

Destructor.

Definition at line 311 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 444 of file KoMainWindow.cpp.

◆ chooseNewDocument()

void KoMainWindow::chooseNewDocument ( int  initDocFlags)
protected

Helper method for slotFileNew and slotFileClose.

Definition at line 1082 of file KoMainWindow.cpp.

◆ closeEvent()

void KoMainWindow::closeEvent ( TQCloseEvent *  e)
protectedvirtual

Reimplemented from TDEMainWindow.

Definition at line 991 of file KoMainWindow.cpp.

◆ createDoc()

KoDocument * KoMainWindow::createDoc ( ) const
protectedvirtual

Create a new empty document.

Definition at line 494 of file KoMainWindow.cpp.

◆ dcopObject()

DCOPObject * KoMainWindow::dcopObject ( )
virtual

Definition at line 1582 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 1700 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 1695 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 552 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 565 of file KoMainWindow.cpp.

◆ openDocumentInternal()

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

Definition at line 589 of file KoMainWindow.cpp.

◆ partManager()

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

Definition at line 547 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 1199 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 1022 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 488 of file KoMainWindow.cpp.

◆ resizeEvent()

void KoMainWindow::resizeEvent ( TQResizeEvent *  e)
protectedvirtual

Definition at line 1016 of file KoMainWindow.cpp.

◆ rootDocument()

KoDocument * KoMainWindow::rootDocument ( ) const
virtual

Retrieves the document that is displayed in the mainwindow.

Definition at line 535 of file KoMainWindow.cpp.

◆ rootView()

KoView * KoMainWindow::rootView ( ) const
virtual

Definition at line 540 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 726 of file KoMainWindow.cpp.

◆ saveRecentFiles()

void KoMainWindow::saveRecentFiles ( )
protected

Save the list of recent files.

Definition at line 471 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 1705 of file KoMainWindow.cpp.

◆ setMaxRecentItems()

void KoMainWindow::setMaxRecentItems ( uint  _number)

Sets the maximum number of recent documents entries.

Definition at line 1577 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 355 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 429 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 1339 of file KoMainWindow.cpp.

◆ slotActivePartChanged

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

Definition at line 1473 of file KoMainWindow.cpp.

◆ slotCloseAllViews

void KoMainWindow::slotCloseAllViews ( )
virtualslot

Close all views.

Definition at line 1373 of file KoMainWindow.cpp.

◆ slotConfigureKeys

void KoMainWindow::slotConfigureKeys ( )
virtualslot

Configure key bindings.

Definition at line 1279 of file KoMainWindow.cpp.

◆ slotConfigureToolbars

void KoMainWindow::slotConfigureToolbars ( )
virtualslot

Configure toolbars.

Definition at line 1284 of file KoMainWindow.cpp.

◆ slotDocumentInfo

void KoMainWindow::slotDocumentInfo ( )
virtualslot

Show a dialog with author and document information.

Definition at line 1161 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 1592 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 1686 of file KoMainWindow.cpp.

◆ slotFileClose

void KoMainWindow::slotFileClose ( )
virtualslot

Closes the document.

Definition at line 1182 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 1113 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 1118 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 1144 of file KoMainWindow.cpp.

◆ slotFilePrint

void KoMainWindow::slotFilePrint ( )
virtualslot

Prints the actual document.

Definition at line 1239 of file KoMainWindow.cpp.

◆ slotFilePrintPreview

void KoMainWindow::slotFilePrintPreview ( )
slot

Show a print preview.

Definition at line 1244 of file KoMainWindow.cpp.

◆ slotFileQuit

void KoMainWindow::slotFileQuit ( )
virtualslot

Closes the shell.

Definition at line 1194 of file KoMainWindow.cpp.

◆ slotFileSave

void KoMainWindow::slotFileSave ( )
virtualslot

Saves the current document with the current name.

Definition at line 1149 of file KoMainWindow.cpp.

◆ slotFileSaveAs

void KoMainWindow::slotFileSaveAs ( )
virtualslot

Saves the current document with a new name.

Definition at line 1155 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 1677 of file KoMainWindow.cpp.

◆ slotNewToolbarConfig

void KoMainWindow::slotNewToolbarConfig ( )
virtualslot

Post toolbar config.

(Plug action lists back in, etc.)

Definition at line 1293 of file KoMainWindow.cpp.

◆ slotReloadFile

void KoMainWindow::slotReloadFile ( )
slot

Reload file.

Definition at line 1652 of file KoMainWindow.cpp.

◆ slotRemoveView

void KoMainWindow::slotRemoveView ( )
virtualslot

Definition at line 1398 of file KoMainWindow.cpp.

◆ slotSetOrientation

void KoMainWindow::slotSetOrientation ( )
virtualslot

Definition at line 1426 of file KoMainWindow.cpp.

◆ slotSplitView

void KoMainWindow::slotSplitView ( )
virtualslot

View splitting stuff.

Definition at line 1363 of file KoMainWindow.cpp.

◆ slotToolbarToggled

void KoMainWindow::slotToolbarToggled ( bool  toggle)
virtualslot

Shows or hides a toolbar.

Definition at line 1314 of file KoMainWindow.cpp.

◆ slotVersionsFile

void KoMainWindow::slotVersionsFile ( )
slot

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

Definition at line 1645 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 1567 of file KoMainWindow.cpp.

◆ toolbarIsVisible()

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

Definition at line 1333 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 500 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 529 of file KoMainWindow.cpp.

◆ updateReloadFileAction()

void KoMainWindow::updateReloadFileAction ( KoDocument *  doc)

Definition at line 417 of file KoMainWindow.cpp.

◆ updateVersionsFileAction()

void KoMainWindow::updateVersionsFileAction ( KoDocument *  doc)

Definition at line 422 of file KoMainWindow.cpp.


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