ksync Library API Documentation

KSync Class Reference

The base class for KSync application windows. More...

#include <ksync.h>

List of all members.

Public Slots

void slotFileNewWindow ()
void slotFileNew ()
void slotFileOpen ()
void slotFileOpenRecent (const KURL &url)
void slotFileSave ()
void slotFileSaveAs ()
void slotFileClose ()
void slotFilePrint ()
void slotFileQuit ()
void slotEditCut ()
void slotEditCopy ()
void slotEditPaste ()
void slotStatusMsg (const QString &text)

Public Methods

 KSync (QWidget *parent=0, const char *name=0)
void openDocumentFile (const KURL &url=KURL())

Protected Methods

void saveOptions ()
void readOptions ()
void initActions ()
void initStatusBar ()
void initView ()
virtual bool queryClose ()
virtual bool queryExit ()
virtual void saveProperties (KConfig *_cfg)
virtual void readProperties (KConfig *_cfg)


Detailed Description

The base class for KSync application windows.

It sets up the main window and reads the config file as well as providing a menubar, toolbar and statusbar. An instance of KSyncView creates your center view, which is connected to the window's Doc object. KSyncApp reimplements the methods that KMainWindow provides for main window handling and supports full session management as well as using KActions.

See also:
KMainWindow , KApplication , KConfig
Author:
Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
Version:
KDevelop version 1.2 code generation

Definition at line 45 of file ksync.h.


Constructor & Destructor Documentation

KSync::KSync QWidget   parent = 0,
const char *    name = 0
 

construtor of KSyncApp, calls all init functions to create the application.

Definition at line 41 of file ksync.cpp.

References initActions(), initStatusBar(), initView(), and readOptions().

Referenced by slotFileNewWindow().


Member Function Documentation

void KSync::openDocumentFile const KURL &    url = KURL()
 

opens a file specified by commandline option.

Definition at line 109 of file ksync.cpp.

References slotStatusMsg().

void KSync::saveOptions   [protected]
 

save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration file.

Definition at line 119 of file ksync.cpp.

References KSyncView::writeConfig().

Referenced by queryExit(), and slotFileQuit().

void KSync::readOptions   [protected]
 

read general Options again and initialize all variables like the recent file list.

Definition at line 128 of file ksync.cpp.

References KSyncView::readConfig().

Referenced by KSync().

void KSync::initActions   [protected]
 

initializes the KActions of the application.

Definition at line 61 of file ksync.cpp.

References slotEditCopy(), slotEditCut(), slotEditPaste(), slotFileClose(), slotFileNew(), slotFileNewWindow(), slotFileOpen(), slotFileOpenRecent(), slotFilePrint(), slotFileQuit(), slotFileSave(), and slotFileSaveAs().

Referenced by KSync().

void KSync::initStatusBar   [protected]
 

sets up the statusbar for the main window by initialzing a statuslabel.

Definition at line 97 of file ksync.cpp.

Referenced by KSync().

void KSync::initView   [protected]
 

creates the centerwidget of the KTMainWindow instance and sets it as the view.

Definition at line 102 of file ksync.cpp.

Referenced by KSync().

bool KSync::queryClose   [protected, virtual]
 

queryClose is called by KTMainWindow on each closeEvent of a window.

Against the default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall be saved if Modified; on cancel the closeEvent is rejected.

See also:
KTMainWindow::queryClose , KTMainWindow::closeEvent

Definition at line 190 of file ksync.cpp.

bool KSync::queryExit   [protected, virtual]
 

queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent().

Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's properties.

See also:
KTMainWindow::queryExit , KTMainWindow::closeEvent

Definition at line 196 of file ksync.cpp.

References saveOptions().

void KSync::saveProperties KConfig *    _cfg [protected, virtual]
 

saves the window properties for each open window during session end to the session config file, including saving the currently opened file by a temporary filename provided by KApplication.

See also:
KTMainWindow::saveProperties

Definition at line 137 of file ksync.cpp.

void KSync::readProperties KConfig *    _cfg [protected, virtual]
 

reads the session config file and restores the application's state including the last opened files and documents by reading the temporary files saved by saveProperties().

See also:
KTMainWindow::readProperties

Definition at line 159 of file ksync.cpp.

References QString::isEmpty(), and QFile::remove().

void KSync::slotFileNewWindow   [slot]
 

open a new application window by creating a new instance of KSyncApp.

Definition at line 202 of file ksync.cpp.

References KSync(), and slotStatusMsg().

Referenced by initActions().

void KSync::slotFileNew   [slot]
 

clears the document in the actual view to reuse it as the new document.

Definition at line 212 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotFileOpen   [slot]
 

open a file and load it into the document.

Definition at line 232 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotFileOpenRecent const KURL &    url [slot]
 

opens a file from the recent files menu.

Definition at line 258 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotFileSave   [slot]
 

save a document.

Definition at line 277 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotFileSaveAs   [slot]
 

save a document by a new filename.

Definition at line 286 of file ksync.cpp.

References QDir::currentDirPath(), and slotStatusMsg().

Referenced by initActions().

void KSync::slotFileClose   [slot]
 

asks for saving if the file is modified, then closes the actual file and window.

Definition at line 302 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotFilePrint   [slot]
 

print the actual file.

Definition at line 311 of file ksync.cpp.

References KSyncView::print(), QPrinter::setup(), and slotStatusMsg().

Referenced by initActions().

void KSync::slotFileQuit   [slot]
 

closes all open windows by calling close() on each memberList item until the list is empty, then quits the application.

If queryClose() returns false because the user canceled the saveModified() dialog, the closing breaks.

Definition at line 324 of file ksync.cpp.

References saveOptions(), and slotStatusMsg().

Referenced by initActions().

void KSync::slotEditCut   [slot]
 

put the marked text/object into the clipboard and remove it from the document.

Definition at line 344 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotEditCopy   [slot]
 

put the marked text/object into the clipboard.

Definition at line 351 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotEditPaste   [slot]
 

paste the clipboard into the document.

Definition at line 358 of file ksync.cpp.

References slotStatusMsg().

Referenced by initActions().

void KSync::slotStatusMsg const QString   text [slot]
 

changes the statusbar contents for the standard label permanently, used to indicate current actions.

Parameters:
text  the text that is displayed in the statusbar

Definition at line 365 of file ksync.cpp.

Referenced by openDocumentFile(), slotEditCopy(), slotEditCut(), slotEditPaste(), slotFileClose(), slotFileNew(), slotFileNewWindow(), slotFileOpen(), slotFileOpenRecent(), slotFilePrint(), slotFileQuit(), slotFileSave(), and slotFileSaveAs().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for ksync Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:37 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003