kpilot

PilotComponent Class Reference

#include <pilotComponent.h>

Inheritance diagram for PilotComponent:

List of all members.


Public Slots

void slotShowComponent ()

Signals

void showComponent (PilotComponent *)

Public Member Functions

virtual void hideComponent ()
 PilotComponent (QWidget *parent, const char *id, const QString &dbPath)
virtual void postHotSync ()
virtual bool preHotSync (QString &s)
virtual void showComponent ()
void showKPilotComponent (bool toShow)

Protected Member Functions

const QStringdbPath () const
int findSelectedCategory (QComboBox *, CategoryAppInfo *, bool AllIsUnfiled=false)
void markDBDirty (const QString db)
void populateCategories (QComboBox *, CategoryAppInfo *info=0)
void setDBPath (const QString &path)

Protected Attributes

bool shown

Detailed Description

Definition at line 41 of file pilotComponent.h.


Constructor & Destructor Documentation

PilotComponent::PilotComponent ( QWidget parent,
const char *  id,
const QString dbPath 
)

Definition at line 49 of file pilotComponent.cc.


Member Function Documentation

const QString& PilotComponent::dbPath (  )  const [inline, protected]

Definition at line 126 of file pilotComponent.h.

int PilotComponent::findSelectedCategory ( QComboBox fCatList,
CategoryAppInfo *  info,
bool  AllIsUnfiled = false 
) [protected]

Look up the selected category from the combo box in the Pilot's register of categories.

We need this functon because the combo box doesn't contain any reference to the category ID, and we need that ID to do anything with the Pilot.

If AllIsUnfiled is true, then when the user selects the category "All" in the combo box (always the first category), Unfiled (0) is returned. Otherwise if the category "All" is selected -1 is returned. For all other categories selected, their ID is returned. If nothing is selected, behave as if "All" is selected.

Definition at line 68 of file pilotComponent.cc.

virtual void PilotComponent::hideComponent (  )  [inline, virtual]

Called when the component is hidden in kpilot.

It should unload the databases and clean up to save memory. This method can be called even if the component is not visible. If there are some editing dlgs open, this needs to be deferred until they are all closed. Then, one can explicitly call hideComponent().

Reimplemented in AddressWidget, DatebookWidget, GenericDBWidget, MemoWidget, and TodoWidget.

Definition at line 63 of file pilotComponent.h.

void PilotComponent::markDBDirty ( const QString  db  )  [protected]

Definition at line 175 of file pilotComponent.cc.

void PilotComponent::populateCategories ( QComboBox c,
CategoryAppInfo *  info = 0 
) [protected]

Populate the combo box with the categories found in the Pilot's application categories block.

Erases combo box's contents first.

Always includes the category "All" as the first entry in the combo box.

If info is a NULL pointer, just put "All" in the combo box.

Definition at line 115 of file pilotComponent.cc.

virtual void PilotComponent::postHotSync (  )  [inline, virtual]

Reload data (possibly changed by the hotsync) etc.

etc.

Reimplemented in AddressWidget, FileInstallWidget, MemoWidget, and TodoWidget.

Definition at line 91 of file pilotComponent.h.

bool PilotComponent::preHotSync ( QString s  )  [virtual]

Get ready for a hotsync -- write any unflushed records to disk, close windows, whatever.

Returns false if it is impossible to go into a sync now (due to open windows or strange state.).

The default implementation returns true.

If the function returns false, it can also put a string stating the reason why into s. This string will be displayed to the user: "Can't start HotSync. %1" where 1 is replaced by s.

Reimplemented in AddressWidget, FileInstallWidget, MemoWidget, and TodoWidget.

Definition at line 168 of file pilotComponent.cc.

void PilotComponent::setDBPath ( const QString path  )  [inline, protected]

Definition at line 125 of file pilotComponent.h.

void PilotComponent::showComponent ( PilotComponent  )  [signal]

virtual void PilotComponent::showComponent (  )  [inline, virtual]

Called when the component is shown in kpilot.

It should load the database and populate the widgets.

Reimplemented in AddressWidget, DatebookWidget, GenericDBWidget, FileInstallWidget, MemoWidget, and TodoWidget.

Definition at line 55 of file pilotComponent.h.

void PilotComponent::showKPilotComponent ( bool  toShow  ) 

Set the shown variable to true or false, then call showComponent or hideComponent.

Definition at line 182 of file pilotComponent.cc.

void PilotComponent::slotShowComponent (  )  [slot]

Definition at line 157 of file pilotComponent.cc.


Member Data Documentation

bool PilotComponent::shown [protected]

Definition at line 138 of file pilotComponent.h.


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