lib
KoMainWindow Class Reference
#include <KoMainWindow.h>
Inheritance diagram for KoMainWindow:

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.
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 () |
Signals | |
void | documentSaved () |
void | saveDialogShown () |
Public Member Functions | |
KoMainWindow (KInstance *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) |
QLabel * | 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 QString caption, bool mod) |
void | updateReloadFileAction (KoDocument *doc) |
void | updateVersionsFileAction (KoDocument *doc) |
Protected Slots | |
virtual void | slotActivePartChanged (KParts::Part *newPart) |
Protected Member Functions | |
void | chooseNewDocument (intinitDocFlags) |
void | setRootDocumentDirect (KoDocument *doc, const QPtrList< KoView > &views) |
virtual KoDocument * | createDoc () const |
virtual bool | saveDocument (bool saveas=false, bool silent=false) |
virtual void | closeEvent (QCloseEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual bool | queryClose () |
virtual bool | openDocumentInternal (const KURL &url, KoDocument *newdoc=0L) |
bool | isExporting () const |
bool | isImporting () const |
void | saveRecentFiles () |
KRecentFilesAction * | recentAction () const |
Constructor & Destructor Documentation
KoMainWindow::KoMainWindow | ( | KInstance * | 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 | ( | ) |
Member Function Documentation
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 345 of file KoMainWindow.cpp.
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 1682 of file KoMainWindow.cpp.
void KoMainWindow::updateCaption | ( | ) | [virtual] |
Update caption from document info - call when document info (title in the about page) changes.
Definition at line 490 of file KoMainWindow.cpp.
KoDocument * KoMainWindow::rootDocument | ( | ) | const [virtual] |
Retrieves the document that is displayed in the mainwindow.
Definition at line 525 of file KoMainWindow.cpp.
void KoMainWindow::print | ( | bool | quick | ) |
Prints the document.
- Parameters:
-
quick whether the print setup dialog is to be displayed
Definition at line 1181 of file KoMainWindow.cpp.
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 1316 of file KoMainWindow.cpp.
bool KoMainWindow::toolbarIsVisible | ( | const char * | tbName | ) |
QLabel * 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 QStatusBar::addWidget.
Definition at line 1544 of file KoMainWindow.cpp.
void KoMainWindow::setMaxRecentItems | ( | uint | _number | ) |
Sets the maximum number of recent documents entries.
Definition at line 1554 of file KoMainWindow.cpp.
void KoMainWindow::addRecentURL | ( | const KURL & | url | ) |
The document opened a URL -> store into recent documents list.
Definition at line 434 of file KoMainWindow.cpp.
bool KoMainWindow::openDocument | ( | const KURL & | url | ) | [virtual] |
Load the desired document and show it.
- Parameters:
-
url the URL to open
- Returns:
- TRUE on success.
Definition at line 542 of file KoMainWindow.cpp.
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 555 of file KoMainWindow.cpp.
void KoMainWindow::reloadRecentFileList | ( | ) |
void KoMainWindow::updateCaption | ( | const QString | caption, | |
bool | mod | |||
) | [virtual] |
Updates the window caption based on the document info and path.
Definition at line 519 of file KoMainWindow.cpp.
void KoMainWindow::documentSaved | ( | ) | [signal] |
This signal is emitted if the document has been saved successfully.
void KoMainWindow::saveDialogShown | ( | ) | [signal] |
This signals is emmitted before the save dialog is shown.
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 1569 of file KoMainWindow.cpp.
void KoMainWindow::slotFileNew | ( | ) | [virtual, slot] |
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 1095 of file KoMainWindow.cpp.
void KoMainWindow::slotFileOpen | ( | ) | [virtual, slot] |
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 1100 of file KoMainWindow.cpp.
void KoMainWindow::slotFileOpenRecent | ( | const KURL & | ) | [virtual, slot] |
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 1126 of file KoMainWindow.cpp.
void KoMainWindow::slotFileSave | ( | ) | [virtual, slot] |
void KoMainWindow::slotFileSaveAs | ( | ) | [virtual, slot] |
void KoMainWindow::slotFilePrint | ( | ) | [virtual, slot] |
void KoMainWindow::slotFilePrintPreview | ( | ) | [slot] |
void KoMainWindow::slotDocumentInfo | ( | ) | [virtual, slot] |
Show a dialog with author and document information.
Definition at line 1143 of file KoMainWindow.cpp.
void KoMainWindow::slotFileClose | ( | ) | [virtual, slot] |
void KoMainWindow::slotFileQuit | ( | ) | [virtual, slot] |
void KoMainWindow::slotConfigureKeys | ( | ) | [virtual, slot] |
void KoMainWindow::slotConfigureToolbars | ( | ) | [virtual, slot] |
void KoMainWindow::slotNewToolbarConfig | ( | ) | [virtual, slot] |
Post toolbar config.
(Plug action lists back in, etc.)
Definition at line 1270 of file KoMainWindow.cpp.
void KoMainWindow::slotToolbarToggled | ( | bool | toggle | ) | [virtual, slot] |
void KoMainWindow::slotSplitView | ( | ) | [virtual, slot] |
void KoMainWindow::slotCloseAllViews | ( | ) | [virtual, slot] |
void KoMainWindow::slotReloadFile | ( | ) | [slot] |
void KoMainWindow::slotVersionsFile | ( | ) | [slot] |
This will call a dialogbox to add version to list of files.
Definition at line 1622 of file KoMainWindow.cpp.
void KoMainWindow::slotImportFile | ( | ) | [slot] |
File --> Import.
This will call slotFileOpen(). To differentiate this from an ordinary call to slotFileOpen() call isImporting().
Definition at line 1654 of file KoMainWindow.cpp.
void KoMainWindow::slotExportFile | ( | ) | [slot] |
File --> Export.
This will call slotFileSaveAs(). To differentiate this from an ordinary call to slotFileSaveAs() call isExporting().
Definition at line 1663 of file KoMainWindow.cpp.
void KoMainWindow::chooseNewDocument | ( | intinitDocFlags | ) | [protected] |
void KoMainWindow::setRootDocumentDirect | ( | KoDocument * | doc, | |
const QPtrList< KoView > & | views | |||
) | [protected] |
Special method for KOShell, to allow switching the root document (and its views) among a set of them.
Definition at line 419 of file KoMainWindow.cpp.
KoDocument * KoMainWindow::createDoc | ( | ) | const [protected, virtual] |
bool KoMainWindow::saveDocument | ( | bool | saveas = false , |
|
bool | silent = false | |||
) | [protected, virtual] |
Saves the document, asking for a filename if necessary.
- Parameters:
-
saveas if set to TRUE the user is always prompted for a filename silent if 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 716 of file KoMainWindow.cpp.
bool KoMainWindow::queryClose | ( | ) | [protected, virtual] |
Ask user about saving changes to the document upon exit.
Reimplemented from KMainWindow.
Definition at line 1004 of file KoMainWindow.cpp.
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 1677 of file KoMainWindow.cpp.
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 1672 of file KoMainWindow.cpp.
void KoMainWindow::saveRecentFiles | ( | ) | [protected] |
The documentation for this class was generated from the following files: