libkcal Library API Documentation

KCal::ResourceRemote Class Reference

This class provides a calendar stored as a remote file. More...

#include <resourceremote.h>

Inheritance diagram for KCal::ResourceRemote:

KCal::ResourceCached KCal::ResourceCalendar List of all members.

Public Types

enum  { ReloadNever, ReloadOnStartup, ReloadOnceADay, ReloadAlways }

Public Methods

 ResourceRemote (const KConfig *)
 ResourceRemote (const KURL &downloadUrl, const KURL &uploadUrl=KURL())
virtual ~ResourceRemote ()
void readConfig (const KConfig *config)
void writeConfig (KConfig *config)
void setDownloadUrl (const KURL &)
KURL downloadUrl () const
void setUploadUrl (const KURL &)
KURL uploadUrl () const
void setReloadPolicy (int policy)
int reloadPolicy () const
QString cacheFile ()
bool load ()
bool save ()
KABC::Lock * lock ()
bool isSaving ()
void dump () const

Protected Slots

void slotLoadJobResult (KIO::Job *)
void slotSaveJobResult (KIO::Job *)

Protected Methods

bool doOpen ()
void doClose ()
virtual void update (IncidenceBase *incidence)

Detailed Description

This class provides a calendar stored as a remote file.

Definition at line 48 of file resourceremote.h.


Member Enumeration Documentation

anonymous enum
 

Reload policy.

See also:
setReloadPolicy(), reloadPolicy()

Definition at line 60 of file resourceremote.h.


Constructor & Destructor Documentation

ResourceRemote::ResourceRemote const KConfig *   
 

Create resource from configuration information stored in KConfig object.

Definition at line 55 of file resourceremote.cpp.

ResourceRemote::ResourceRemote const KURL &    downloadUrl,
const KURL &    uploadUrl = KURL()
 

Create remote resource.

Parameters:
downloadUrl  URL used to download iCalendar file
uploadUrl  URL used to upload iCalendar file

Definition at line 65 of file resourceremote.cpp.


Member Function Documentation

void ResourceRemote::setReloadPolicy int    policy
 

Set reload policy.

This controls when the remote file is downloaded.

ReloadNever never reload ReloadOnStartup reload when resource is loaded ReloadOnceADay reload once a day ReloadAlways reload whenever the resource is accessed

Definition at line 144 of file resourceremote.cpp.

int ResourceRemote::reloadPolicy   const
 

Return reload policy.

See also:
setReloadPolicy()

Definition at line 149 of file resourceremote.cpp.

QString ResourceRemote::cacheFile  
 

Return name of file used as cache for remote file.

Definition at line 154 of file resourceremote.cpp.

Referenced by load(), and save().

bool ResourceRemote::load   [virtual]
 

Load resource data.

After calling this function all data is accessible by calling the incidence/event/todo/etc. accessor functions.

If data is actually loaded within this function or the loading is delayed until it is accessed by another function depends on the implementation of the resource.

If loading the data takes significant time, the resource should return cached values, if available and return the results via the resourceChanged signal. When the resource has finished loading the resourceLoaded() signal is emitted.

Calling this function multiple times should have the same effect as calling it once, given that the data isn't changed between calls.

Implements KCal::ResourceCalendar.

Definition at line 170 of file resourceremote.cpp.

References cacheFile(), KCal::CalendarLocal::close(), and KCal::CalendarLocal::load().

bool ResourceRemote::save   [virtual]
 

Save resource data.

After calling this function it is save to close the resource without losing data.

If data is actually saved within this function or saving is delayed depends on the implementation of the resource.

If saving the data takes significant time, the resource should return from the function, do the saving in the background and notify the end of the save by emitting the signal resourceSaved().

Implements KCal::ResourceCalendar.

Definition at line 216 of file resourceremote.cpp.

References cacheFile(), KCal::ResourceCalendar::resourceSaved(), and KCal::CalendarLocal::save().

KABC::Lock * ResourceRemote::lock   [virtual]
 

Return object for locking the resource.

Implements KCal::ResourceCalendar.

Definition at line 273 of file resourceremote.cpp.

bool ResourceRemote::isSaving   [virtual]
 

Return true if a save operation is still in progress, otherwise return false.

Reimplemented from KCal::ResourceCalendar.

Definition at line 247 of file resourceremote.cpp.

void ResourceRemote::doClose   [protected]
 

clears out the current calendar, freeing all used memory etc.

etc.

Definition at line 265 of file resourceremote.cpp.

References KCal::CalendarLocal::close().

void ResourceRemote::update IncidenceBase   incidence [protected, virtual]
 

this method should be called whenever a Event is modified directly via it's pointer.

It makes sure that the calendar is internally consistent.

Implements KCal::ResourceCalendar.

Definition at line 278 of file resourceremote.cpp.


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