• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kpilot

SyncAction Class Reference

#include <syncAction.h>

Inheritance diagram for SyncAction:
Inheritance graph
[legend]

List of all members.

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...

Public Types

enum  BackupFrequency { eEveryHotSync = 0, eOnRequestOnly }
enum  ConflictResolution {
  eUseGlobalSetting = -1, eAskUser = 0, eDoNothing, eHHOverrides,
  ePCOverrides, ePreviousSyncOverrides, eDuplicate, eDelete,
  eCROffset = -1
}
enum  Status { Error = -1 }

Public Slots

void execConduit ()

Signals

void logError (const QString &)
void logMessage (const QString &)
void logProgress (const QString &, int)
void syncDone (SyncAction *)
void timeout ()

Public Member Functions

 SyncAction (KPilotLink *p, QWidget *visibleparent, const char *name)
 SyncAction (KPilotLink *p, const char *name)
virtual ~SyncAction ()
void addLogError (const QString &msg)
void addLogMessage (const QString &msg)
void addLogProgress (const QString &msg, int prog)
void addSyncLogEntry (const QString &e, bool log=true)
int status () const
virtual QString statusString () const

Protected Slots

void delayedDoneSlot ()

Protected Member Functions

bool delayDone ()
KPilotLink * deviceLink () const
virtual bool exec ()=0
int openConduit ()
int pilotSocket () const
int questionYesNo (const QString &question, const QString &caption=QString(), const QString &key=QString(), unsigned timeout=20, const QString &yes=QString(), const QString &no=QString())
int questionYesNoCancel (const QString &question, const QString &caption=QString(), const QString &key=QString(), unsigned timeout=20, const QString &yes=QString(), const QString &no=QString())
void startTickle (unsigned count=0)
void stopTickle ()

Protected Attributes

int fActionStatus
KPilotLink * fHandle
QWidget * fParent

Detailed Description

Definition at line 50 of file syncAction.h.


Member Enumeration Documentation

enum SyncAction::BackupFrequency

This MUST stay in sync with the combobox in kpilotConfigDialog_backup.ui.

If it does not, you need to either change this enum or the combobox.

Enumerator:
eEveryHotSync 
eOnRequestOnly 

Definition at line 359 of file syncAction.h.

enum SyncAction::ConflictResolution
Enumerator:
eUseGlobalSetting 
eAskUser 
eDoNothing 
eHHOverrides 
ePCOverrides 
ePreviousSyncOverrides 
eDuplicate 
eDelete 
eCROffset 

Definition at line 341 of file syncAction.h.

enum SyncAction::Status
Enumerator:
Error 

Reimplemented in BackupAction, and RestoreAction.

Definition at line 60 of file syncAction.h.


Constructor & Destructor Documentation

SyncAction::SyncAction ( KPilotLink *  p,
const char *  name 
)

Definition at line 56 of file syncAction.cc.

SyncAction::SyncAction ( KPilotLink *  p,
QWidget *  visibleparent,
const char *  name 
)

Definition at line 66 of file syncAction.cc.

SyncAction::~SyncAction (  )  [virtual]

Definition at line 77 of file syncAction.cc.


Member Function Documentation

void SyncAction::addLogError ( const QString &  msg  )  [inline]

Log an error message in KPilot (the PC side of things).

Definition at line 144 of file syncAction.h.

void SyncAction::addLogMessage ( const QString &  msg  )  [inline]

Public API for adding a message to the log in KPilot.

Adds msg to the synclog maintained on the PC.

Definition at line 139 of file syncAction.h.

void SyncAction::addLogProgress ( const QString &  msg,
int  prog 
) [inline]

Log progress in KPilot (the PC side of things).

Definition at line 149 of file syncAction.h.

void SyncAction::addSyncLogEntry ( const QString &  e,
bool  log = true 
) [inline]

Public API for adding a sync log entry, see the implementation in KPilotLink::addSyncLogEntry().

Parameters:
e Message to add to the sync log
log If true, also add the entry to the log in KPilot
Note:
Having messages appear on the handheld but not in KPilot should be a very rare occurrence.

Definition at line 129 of file syncAction.h.

bool SyncAction::delayDone (  )  [protected]

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 113 of file syncAction.cc.

void SyncAction::delayedDoneSlot (  )  [protected, slot]

This slot emits syncDone(), and does nothing else.

This is safe, since the method returns immediately after the emit -- even if syncDone() causes the SyncAction to be deleted.

Definition at line 108 of file syncAction.cc.

KPilotLink* SyncAction::deviceLink (  )  const [inline, protected]

Returns a pointer to the connection to the device.

Definition at line 159 of file syncAction.h.

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 RecordConduit, DOCConduit, MALConduit, MemofileConduit, NotepadConduit, NullConduit, PopMailConduit, SysInfoConduit, TimeConduit, CheckUser, BackupAction, FileInstallAction, RestoreAction, ActionQueue, WelcomeAction, SorryAction, CleanupAction, TestLink, and ConduitProxy.

void SyncAction::execConduit (  )  [slot]

This just calls exec() and deals with the return code.

Definition at line 91 of file syncAction.cc.

void SyncAction::logError ( const QString &   )  [signal]
void SyncAction::logMessage ( const QString &   )  [signal]
void SyncAction::logProgress ( const QString &  ,
int   
) [signal]
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 177 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 168 of file syncAction.h.

int SyncAction::questionYesNo ( const QString &  question,
const QString &  caption = QString(),
const QString &  key = QString(),
unsigned  timeout = 20,
const QString &  yes = QString(),
const QString &  no = QString() 
) [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 KDialog::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 326 of file syncAction.cc.

int SyncAction::questionYesNoCancel ( const QString &  question,
const QString &  caption = QString(),
const QString &  key = QString(),
unsigned  timeout = 20,
const QString &  yes = QString(),
const QString &  no = QString() 
) [protected]

Definition at line 393 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 296 of file syncAction.cc.

int SyncAction::status (  )  const [inline]

A syncaction has a status, which can be expressed as an integer.

Subclasses are expected to define their own status values as needed.

Definition at line 66 of file syncAction.h.

QString SyncAction::statusString (  )  const [virtual]

Return a human-readable representation of the status.

Reimplemented in BackupAction, FileInstallAction, and RestoreAction.

Definition at line 82 of file syncAction.cc.

void SyncAction::stopTickle (  )  [protected]

Definition at line 311 of file syncAction.cc.

void SyncAction::syncDone ( SyncAction *   )  [signal]
void SyncAction::timeout (  )  [signal]

Member Data Documentation

int SyncAction::fActionStatus [protected]

Definition at line 156 of file syncAction.h.

KPilotLink* SyncAction::fHandle [protected]

Connection to the device.

Todo:
make private.

Definition at line 155 of file syncAction.h.

QWidget* SyncAction::fParent [protected]

Definition at line 386 of file syncAction.h.


The documentation for this class was generated from the following files:
  • syncAction.h
  • syncAction.cc

kpilot

Skip menu "kpilot"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   akonadi_next
  •   clients
  •   kcal
  •   kcm
  •       libmaildir
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
Generated for kdepim by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal