This repository has been archived on 2024-03-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
kpasman/kpasman/api/KpasmanApp.html

264 lines
20 KiB
HTML

<HTML>
<HEAD>
<TITLE>class KpasmanApp</TITLE>
<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
<TABLE BORDER="0">
<TR><TD valign="top" align="left" cellspacing="10">
<h1>class KpasmanApp</h1>
</TD>
<TD valign="top" align="right" colspan="1">
The base class for Kpasman application windows. <small><A HREF="#longdesc">More...</A></small></TD></TR>
</TABLE>
<HR>
<TABLE BORDER="0">
<TR><TH>Definition</TH><TD><code>#include &lt;<A HREF="kpasmandoc_h.html">kpasmandoc.h</A>&gt;</code></TD></TR>
<TR><TH>Inherits</TH><TD>KTMainWindow</TD></TR>
<TR><TH><A HREF="full-list-KpasmanApp.html">List of all Methods</A></TH></TR>
</TABLE>
</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</small></TD></TR>
</TABLE></TD></TR></TABLE>
<H2>Public Members</H2>
<UL>
<LI> <b><A HREF="#ref2">KpasmanApp</A></b> ()
</LI>
<LI> <b>~KpasmanApp</b> ()
</LI>
<LI>void <b><A HREF="#ref4">enableCommand</A></b> (int id_)
</LI>
<LI>void <b><A HREF="#ref5">disableCommand</A></b> (int id_)
</LI>
<LI>void <b><A HREF="#ref6">addRecentFile</A></b> (const char* file)
</LI>
<LI>void <b><A HREF="#ref7">openDocumentFile</A></b> (const char* _cmdl)
</LI>
<LI>KpasmanDoc* <b><A HREF="#ref8">getDocument</A></b> () const
</LI>
<LI>void <b><A HREF="#ref9">setModified</A></b> (bool modified = true)
</LI>
</UL>
<H2>Public Slots</H2>
<UL>
<LI>void <b><A HREF="#ref22">commandCallback</A></b> (int id_)
</LI>
<LI>void <b><A HREF="#ref23">statusCallback</A></b> (int id_)
</LI>
<LI>void <b><A HREF="#ref24">slotFileNewWindow</A></b> ()
</LI>
<LI>void <b><A HREF="#ref25">slotFileNew</A></b> ()
</LI>
<LI>void <b><A HREF="#ref26">slotFileOpen</A></b> ()
</LI>
<LI>void <b><A HREF="#ref27">slotFileOpenRecent</A></b> (int id_)
</LI>
<LI>void <b><A HREF="#ref28">slotFileSave</A></b> ()
</LI>
<LI>void <b><A HREF="#ref29">slotFileSaveAs</A></b> ()
</LI>
<LI>void <b><A HREF="#ref30">slotFileClose</A></b> ()
</LI>
<LI>void <b><A HREF="#ref31">slotFileQuit</A></b> ()
</LI>
<LI>void <b><A HREF="#ref32">slotEditAdd</A></b> ()
</LI>
<LI>void <b><A HREF="#ref33">slotEditEdit</A></b> ()
</LI>
<LI>void <b><A HREF="#ref34">slotEditDelete</A></b> ()
</LI>
<LI>void <b><A HREF="#ref35">slotEditPassword</A></b> ()
</LI>
<LI>void <b><A HREF="#ref36">slotUpdateDocMenu</A></b> (bool bdirty)
</LI>
<LI>void <b><A HREF="#ref37">slotUpdateViewMenu</A></b> (QListViewItem* item)
</LI>
<LI>void <b><A HREF="#ref38">slotViewToolBar</A></b> ()
</LI>
<LI>void <b><A HREF="#ref39">slotViewStatusBar</A></b> ()
</LI>
<LI>void <b><A HREF="#ref40">slotViewPasswords</A></b> ()
</LI>
<LI>void <b><A HREF="#ref41">slotLockWindow</A></b> ()
</LI>
<LI>void <b><A HREF="#ref42">slotStatusMsg</A></b> (const char *text)
</LI>
<LI>void <b><A HREF="#ref43">slotStatusHelpMsg</A></b> (const char *text)
</LI>
</UL>
<H2>Protected Members</H2>
<UL>
<LI>void <b><A HREF="#ref10">saveOptions</A></b> ()
</LI>
<LI>void <b><A HREF="#ref11">readOptions</A></b> ()
</LI>
<LI>void <b><A HREF="#ref12">initKeyAccel</A></b> ()
</LI>
<LI>void <b><A HREF="#ref13">initMenuBar</A></b> ()
</LI>
<LI>void <b><A HREF="#ref14">initToolBar</A></b> ()
</LI>
<LI>void <b><A HREF="#ref15">initStatusBar</A></b> ()
</LI>
<LI>void <b><A HREF="#ref16">initDocument</A></b> ()
</LI>
<LI>void <b><A HREF="#ref17">initView</A></b> ()
</LI>
<LI>virtual bool <b><A HREF="#ref18">queryClose</A></b> ()
</LI>
<LI>virtual bool <b><A HREF="#ref19">queryExit</A></b> ()
</LI>
<LI>virtual void <b><A HREF="#ref20">saveProperties</A></b> (KConfig* )
</LI>
<LI>virtual void <b><A HREF="#ref21">readProperties</A></b> (KConfig* )
</LI>
</UL>
<H2>Private Members</H2>
<UL>
<LI> friend class <b>KpasmanView</b>
</LI>
<LI> KConfig* <b><A HREF="#ref44">config</A></b>
</LI>
<LI> KAccel* <b><A HREF="#ref45">key_accel</A></b>
</LI>
<LI> QPopupMenu * <b><A HREF="#ref46">file_menu</A></b>
</LI>
<LI> QPopupMenu * <b><A HREF="#ref47">recent_files_menu</A></b>
</LI>
<LI> QStrList <b><A HREF="#ref48">recent_files</A></b>
</LI>
<LI> QPopupMenu * <b><A HREF="#ref49">edit_menu</A></b>
</LI>
<LI> QPopupMenu * <b><A HREF="#ref50">view_menu</A></b>
</LI>
<LI> QPopupMenu * <b><A HREF="#ref51">window_menu</A></b>
</LI>
<LI> QPopupMenu * <b><A HREF="#ref52">help_menu</A></b>
</LI>
<LI> KpasmanView * <b><A HREF="#ref53">view</A></b>
</LI>
<LI> KpasmanDoc * <b><A HREF="#ref54">doc</A></b>
</LI>
</UL>
<HR><A NAME="longdesc"><H2>Detailed Description</H2><p>
The base class for Kpasman 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 KpasmanView creates your center view, which is connected
to the window's Doc object.
KpasmanApp reimplements the methods that KTMainWindow provides for main window handling and supports
full session management as well as keyboard accelerator configuration by using KAccel.
</p><p></p><p><b>See also</b>: KTMainWindow, KApplication, KConfig, KAccel</p>
<A NAME=KpasmanApp></A><A NAME=ref2></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> <b>KpasmanApp</b> ()
</strong></td></tr></table></p><p> construtor of KpasmanApp, calls all init functions to create the application.
</p><p><b>See also</b>: initMenuBar, initToolBar</p>
<A NAME=enableCommand></A><A NAME=ref4></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>enableCommand</b> (int id_)
</strong></td></tr></table></p><p> enables menuentries/toolbar items
</p><A NAME=disableCommand></A><A NAME=ref5></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>disableCommand</b> (int id_)
</strong></td></tr></table></p><p> disables menuentries/toolbar items
</p><A NAME=addRecentFile></A><A NAME=ref6></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>addRecentFile</b> (const char* file)
</strong></td></tr></table></p><p> add a opened file to the recent file list and update recent_file_menu
</p><A NAME=openDocumentFile></A><A NAME=ref7></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>openDocumentFile</b> (const char* _cmdl)
</strong></td></tr></table></p><p> opens a file specified by commandline option
</p><A NAME=getDocument></A><A NAME=ref8></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong><A HREF="KpasmanDoc.html">KpasmanDoc</A>* <b>getDocument</b> ()
</strong></td></tr></table> <small>[const]</small></p><p> returns a pointer to the current document connected to the KTMainWindow instance and is used by
the View class to access the document object's methods
</p><A NAME=setModified></A><A NAME=ref9></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>setModified</b> (bool modified = true)
</strong></td></tr></table></p><p> handy way to flip all the flags at once </p><A NAME=saveOptions></A><A NAME=ref10></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>saveOptions</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
file
</p><A NAME=readOptions></A><A NAME=ref11></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>readOptions</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> read general Options again and initialize all variables like the recent file list
</p><A NAME=initKeyAccel></A><A NAME=ref12></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>initKeyAccel</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> initKeyAccel creates the keyboard accelerator items for the available slots and changes the menu accelerators.
</p><p><b>See also</b>: KAccel</p>
<A NAME=initMenuBar></A><A NAME=ref13></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>initMenuBar</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> initMenuBar creates the menubar and inserts the menupopups as well as creating the helpMenu.
</p><p><b>See also</b>: KApplication#getHelpMenu</p>
<A NAME=initToolBar></A><A NAME=ref14></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>initToolBar</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> this creates the toolbars.
</p><A NAME=initStatusBar></A><A NAME=ref15></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>initStatusBar</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> sets up the statusbar for the main window by initialzing a statuslabel.
</p><A NAME=initDocument></A><A NAME=ref16></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>initDocument</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> initializes the document object of the main window that is connected to the view in initView().
</p><p><b>See also</b>: initView();</p>
<A NAME=initView></A><A NAME=ref17></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>initView</b> ()
</strong></td></tr></table> <small>[protected]</small></p><p> creates the centerwidget of the KTMainWindow instance and sets it as the view
</p><A NAME=queryClose></A><A NAME=ref18></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> bool <b>queryClose</b> ()
</strong></td></tr></table> <small>[protected virtual]</small></p><p> 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.
</p><p><b>See also</b>: KTMainWindow#queryClose, KTMainWindow#closeEvent</p>
<A NAME=queryExit></A><A NAME=ref19></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> bool <b>queryExit</b> ()
</strong></td></tr></table> <small>[protected virtual]</small></p><p> 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.
</p><p><b>See also</b>: KTMainWindow#queryExit, KTMainWindow#closeEvent</p>
<A NAME=saveProperties></A><A NAME=ref20></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> void <b>saveProperties</b> (KConfig* )
</strong></td></tr></table> <small>[protected virtual]</small></p><p> 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.
</p><p><b>See also</b>: KTMainWindow#saveProperties</p>
<A NAME=readProperties></A><A NAME=ref21></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> void <b>readProperties</b> (KConfig* )
</strong></td></tr></table> <small>[protected virtual]</small></p><p> 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()
</p><p><b>See also</b>: KTMainWindow#readProperties</p>
<A NAME=commandCallback></A><A NAME=ref22></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>commandCallback</b> (int id_)
</strong></td></tr></table> <small>[slot]</small></p><p> switch argument for slot selection by menu or toolbar ID </p><A NAME=statusCallback></A><A NAME=ref23></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>statusCallback</b> (int id_)
</strong></td></tr></table> <small>[slot]</small></p><p> switch argument for Statusbar help entries on slot selection. Add your ID's help here for toolbars and menubar entries. </p><A NAME=slotFileNewWindow></A><A NAME=ref24></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileNewWindow</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> open a new application window by creating a new instance of KpasmanApp </p><A NAME=slotFileNew></A><A NAME=ref25></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileNew</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> clears the document in the actual view to reuse it as the new document </p><A NAME=slotFileOpen></A><A NAME=ref26></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileOpen</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> open a file and load it into the document</p><A NAME=slotFileOpenRecent></A><A NAME=ref27></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileOpenRecent</b> (int id_)
</strong></td></tr></table> <small>[slot]</small></p><p> opens a file from the recent files menu </p><A NAME=slotFileSave></A><A NAME=ref28></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileSave</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> save a document </p><A NAME=slotFileSaveAs></A><A NAME=ref29></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileSaveAs</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> save a document by a new filename</p><A NAME=slotFileClose></A><A NAME=ref30></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileClose</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> asks for saving if the file is modified, then closes the actual file and window</p><A NAME=slotFileQuit></A><A NAME=ref31></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotFileQuit</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> 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.
</p><A NAME=slotEditAdd></A><A NAME=ref32></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotEditAdd</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> adds a new entry </p><A NAME=slotEditEdit></A><A NAME=ref33></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotEditEdit</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> edits current entry </p><A NAME=slotEditDelete></A><A NAME=ref34></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotEditDelete</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> deletes current entry </p><A NAME=slotEditPassword></A><A NAME=ref35></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotEditPassword</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> changes master password </p><A NAME=slotUpdateDocMenu></A><A NAME=ref36></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotUpdateDocMenu</b> (bool bdirty)
</strong></td></tr></table> <small>[slot]</small></p><p> changes menus based on doc status </p><A NAME=slotUpdateViewMenu></A><A NAME=ref37></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotUpdateViewMenu</b> (QListViewItem* item)
</strong></td></tr></table> <small>[slot]</small></p><p> changes menus based on item selection status </p><A NAME=slotViewToolBar></A><A NAME=ref38></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotViewToolBar</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> toggles the toolbar </p><A NAME=slotViewStatusBar></A><A NAME=ref39></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotViewStatusBar</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> toggles the statusbar </p><A NAME=slotViewPasswords></A><A NAME=ref40></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotViewPasswords</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> toggles the passwords </p><A NAME=slotLockWindow></A><A NAME=ref41></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotLockWindow</b> ()
</strong></td></tr></table> <small>[slot]</small></p><p> locks / unlocks the window </p><A NAME=slotStatusMsg></A><A NAME=ref42></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotStatusMsg</b> (const char *text)
</strong></td></tr></table> <small>[slot]</small></p><p> changes the statusbar contents for the standard label permanently, used to indicate current actions.
</p><p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>text</i></TD><TD align="left" valign="top">the text that is displayed in the statusbar
</TD></TR>
</TABLE></P>
<A NAME=slotStatusHelpMsg></A><A NAME=ref43></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong>void <b>slotStatusHelpMsg</b> (const char *text)
</strong></td></tr></table> <small>[slot]</small></p><p> changes the status message of the whole statusbar for two seconds, then restores the last status. This is used to display
statusbar messages that give information about actions for toolbar icons and menuentries.
</p><p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>text</i></TD><TD align="left" valign="top">the text that is displayed in the statusbar
</TD></TR>
</TABLE></P>
<A NAME=config></A><A NAME=ref44></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> KConfig* <b>config</b>
</strong></td></tr></table> <small>[private]</small></p><p> the configuration object of the application </p><A NAME=key_accel></A><A NAME=ref45></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> KAccel* <b>key_accel</b>
</strong></td></tr></table> <small>[private]</small></p><p> the key accelerator container </p><A NAME=file_menu></A><A NAME=ref46></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QPopupMenu * <b>file_menu</b>
</strong></td></tr></table> <small>[private]</small></p><p> file_menu contains all items of the menubar entry "File" </p><A NAME=recent_files_menu></A><A NAME=ref47></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QPopupMenu * <b>recent_files_menu</b>
</strong></td></tr></table> <small>[private]</small></p><p> the recent file menu containing the last five opened files </p><A NAME=recent_files></A><A NAME=ref48></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QStrList <b>recent_files</b>
</strong></td></tr></table> <small>[private]</small></p><p> contains the recently used filenames </p><A NAME=edit_menu></A><A NAME=ref49></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QPopupMenu * <b>edit_menu</b>
</strong></td></tr></table> <small>[private]</small></p><p> edit_menu contains all items of the menubar entry "Edit" </p><A NAME=view_menu></A><A NAME=ref50></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QPopupMenu * <b>view_menu</b>
</strong></td></tr></table> <small>[private]</small></p><p> view_menu contains all items of the menubar entry "View" </p><A NAME=window_menu></A><A NAME=ref51></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QPopupMenu * <b>window_menu</b>
</strong></td></tr></table> <small>[private]</small></p><p> window_menu contains all items of the menubar entry "Window" </p><A NAME=help_menu></A><A NAME=ref52></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> QPopupMenu * <b>help_menu</b>
</strong></td></tr></table> <small>[private]</small></p><p> help_menu contains all items of the menubar entry "Help" </p><A NAME=view></A><A NAME=ref53></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> <A HREF="KpasmanView.html">KpasmanView</A> * <b>view</b>
</strong></td></tr></table> <small>[private]</small></p><p> view is the main widget which represents your working area. The View
class should handle all events of the view widget. It is kept empty so
you can create your view according to your application's needs by
changing the view class. </p><A NAME=doc></A><A NAME=ref54></A><table width="100%"><tr bgcolor="#eeeeee"><td><strong> <A HREF="KpasmanDoc.html">KpasmanDoc</A> * <b>doc</b>
</strong></td></tr></table> <small>[private]</small></p><p> doc represents your actual document and is created only once. It keeps
information such as filename and does the serialization of your files.
</p><HR><UL><LI><i>Version</i>: KDevelop version 0.4 code generation
</LI><LI><i>Author</i>: Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
</LI><LI><i>Generated</i>: tengel@bugsy on Thu Nov 18 10:33:52 199.</LI></UL></BODY></HTML>