Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

Autosaving


Typedefs

typedef void( osso_application_autosave_cb_f )(gpointer data)

Functions

osso_return_t osso_application_set_autosave_cb (osso_context_t *osso, osso_application_autosave_cb_f *cb, gpointer data)
osso_return_t osso_application_unset_autosave_cb (osso_context_t *osso, osso_application_autosave_cb_f *cb, gpointer data)
osso_return_t osso_application_userdata_changed (osso_context_t *osso)
osso_return_t osso_application_autosave_force (osso_context_t *osso)

Detailed Description

How to use autosave:<br /> The application tells LibOSSO that its user data state has changed, by calling osso_application_userdata_changed. LibOSSO will then call the user data state save callback (along with UI state save) when:
  1. a timer set in LibOSSO (when the application informed that it's state has changed) expires (this is currently hardcoded to 2 minutes). This timer is defined in <libosso>/src/osso-application-autosave.c
  2. application goes to background (is untopped)
  3. LibOSSO gets message from the system that state should be saved (e.g. at shutdown) [NOT IMPLEMENTED]
After the data/UI state save callbacks are called, the timer is removed and the application needs to tell again that it has a "dirty" user data state.

It is up to the application to optimize whether it calls the "dirty state" function each time each user data changes or only the first time after the state has been loaded or saved.

Todo:
Add code that will react to the shutdown system signal, to call the autosave callback functions.

Typedef Documentation

typedef void( osso_application_autosave_cb_f)(gpointer data)
 

This is the type for the autosave callback function.

Parameters:
data The data that was set with the osso_application_set_autosave_cb function.


Function Documentation

osso_return_t osso_application_autosave_force osso_context_t osso  ) 
 

This function forces a call to the save function, and resets the timeout.

Parameters:
osso The library context as returned by osso_initialize.
Returns:
OSSO_OK if all goes well, OSSO_ERROR if an error occurred or OSSO_INVALID if some parameter is invalid.

osso_return_t osso_application_set_autosave_cb osso_context_t osso,
osso_application_autosave_cb_f cb,
gpointer  data
 

This function registers an autosave user data event handler.

Parameters:
osso The library context as returned by osso_initialize.
cb The callback function.
data An arbitrary pointer to some application specific data.
Returns:
OSSO_OK if all goes well, OSSO_ERROR if an error occurred or OSSO_INVALID if some parameter is invalid.

osso_return_t osso_application_unset_autosave_cb osso_context_t osso,
osso_application_autosave_cb_f cb,
gpointer  data
 

This function unregisters an autosave user data event handler.

Parameters:
osso The library context as returned by osso_initialize.
cb The callback function.
data An arbitrary pointer to some application specific data.
Returns:
OSSO_OK if all goes well, OSSO_ERROR if an error occurred or OSSO_INVALID if some parameter is invalid.

osso_return_t osso_application_userdata_changed osso_context_t osso  ) 
 

This function is called by the application when the user data has been changed, so that autosaving can take place. The dirty-state will be cleared every time the autosave callback is called.

Parameters:
osso The library context as returned by osso_initialize.
Returns:
OSSO_OK if all goes well, OSSO_ERROR if an error occurred or OSSO_INVALID if some parameter is invalid.


Generated on Mon May 23 03:17:49 2005 for LibOSSO by doxygen 1.3.7