kpilot/lib
SyncAction Class Reference
Inheritance diagram for SyncAction:

Detailed Description
Definition at line 47 of file syncAction.h.
Public Types | |
Error = -1 | |
eUseGlobalSetting = -1 | |
eAskUser = 0 | |
eDoNothing | |
eHHOverrides | |
ePCOverrides | |
ePreviousSyncOverrides | |
eDuplicate | |
eDelete | |
eCROffset = -1 | |
enum | Status { Error = -1 } |
enum | ConflictResolution { eUseGlobalSetting = -1, eAskUser = 0, eDoNothing, eHHOverrides, ePCOverrides, ePreviousSyncOverrides, eDuplicate, eDelete, eCROffset = -1 } |
Public Slots | |
void | execConduit () |
Signals | |
void | syncDone (SyncAction *) |
void | logMessage (const QString &) |
void | logError (const QString &) |
void | logProgress (const QString &, int) |
void | timeout () |
Public Member Functions | |
SyncAction (KPilotDeviceLink *p, const char *name=0L) | |
SyncAction (KPilotDeviceLink *p, QWidget *visibleparent, const char *name=0L) | |
~SyncAction () | |
int | status () const |
virtual QString | statusString () const |
void | addSyncLogEntry (const QString &e, bool log=true) |
void | addLogMessage (const QString &msg) |
void | addLogError (const QString &msg) |
void | addLogProgress (const QString &msg, int prog) |
Protected Slots | |
void | delayedDoneSlot () |
Protected Member Functions | |
virtual bool | exec ()=0 |
bool | delayDone () |
KPilotDeviceLink * | deviceLink () const |
int | pilotSocket () const |
int | openConduit () |
void | startTickle (unsigned count=0) |
void | stopTickle () |
int | questionYesNo (const QString &question, const QString &caption=QString::null, const QString &key=QString::null, unsigned timeout=20, const QString &yes=QString::null, const QString &no=QString::null) |
int | questionYesNoCancel (const QString &question, const QString &caption=QString::null, const QString &key=QString::null, unsigned timeout=20, const QString &yes=QString::null, const QString &no=QString::null) |
Protected Attributes | |
KPilotDeviceLink * | fHandle |
int | fActionStatus |
QWidget * | fParent |
Classes | |
class | SyncMode |
This class encapsulates the different sync modes that can be used, and enforces a little discipline in changing the mode and messing around in general. More... |
Member Function Documentation
void SyncAction::delayedDoneSlot | ( | ) | [protected, slot] |
It might not be safe to emit syncDone() from exec().
So instead, call delayDone() to wait for the main event loop to return if you manage to do all processing immediately.
delayDone() returns true, so that return delayDone(); is a sensible final statement in exec().
Definition at line 116 of file syncAction.cc.
KPilotDeviceLink* SyncAction::deviceLink | ( | ) | const [inline, protected] |
virtual bool SyncAction::exec | ( | ) | [protected, pure virtual] |
This function starts the actual processing done by the conduit.
It should return false if the processing cannot be initiated, f.ex. because some parameters were not set or a needed library is missing. This will be reported to the user. It should return true if processing is started normally. If processing starts normally, it is the _conduit's_ responsibility to eventually emit syncDone(); if processing does not start normally (ie. exec() returns false) then the environment will deal with syncDone().
Implemented in RecordConduitBase.
void SyncAction::execConduit | ( | ) | [slot] |
int SyncAction::openConduit | ( | ) | [inline, protected] |
Tells the handheld device that someone is talking to it now.
Useful (repeatedly) to inform the user of what is going on. May return < 0 on error (or if there is no device attached).
Definition at line 132 of file syncAction.h.
int SyncAction::pilotSocket | ( | ) | const [inline, protected] |
Returns the file descriptor for the device link -- that is, the raw handle to the OS's connection to the device.
Use with care. May return -1 if there is no device.
Definition at line 126 of file syncAction.h.
int SyncAction::questionYesNo | ( | const QString & | question, | |
const QString & | caption = QString::null , |
|||
const QString & | key = QString::null , |
|||
unsigned | timeout = 20 , |
|||
const QString & | yes = QString::null , |
|||
const QString & | no = QString::null | |||
) | [protected] |
Ask a yes-no question of the user.
This has a timeout so that you don't wait forever for inattentive users. It's much like KMessageBox::questionYesNo(), but with this extra timeout-on- no-answer feature. Returns a KDialogBase::ButtonCode value - Yes,No or Cancel on timeout. If there is a key set and the user indicates not to ask again, the selected answer (Yes or No) is remembered for future reference.
caption
Message Box caption, uses "Question" if null. key
Key for the "Don't ask again" code. timeout
Timeout, in seconds.
Definition at line 305 of file syncAction.cc.
void SyncAction::startTickle | ( | unsigned | count = 0 |
) | [protected] |
Call startTickle() some time before showing a dialog to the user (we're assuming a local event loop here) so that while the dialog is up and the user is thinking, the pilot stays awake.
Afterwards, call stopTickle().
The parameter to startTickle indicates the timeout, in seconds, before signal timeout is emitted. You can connect to that, again, to take down the user interface part if the user isn't reacting.
Definition at line 275 of file syncAction.cc.
Member Data Documentation
KPilotDeviceLink* SyncAction::fHandle [protected] |
The documentation for this class was generated from the following files: