00001
00023
#ifndef LIBOSSO_H_
00024
# define LIBOSSO_H_
00025
00026
# include <glib.h>
00027
# include <time.h>
00028
# include <syslog.h>
00029
00030
# include <dbus/dbus-protocol.h>
00031
00032 G_BEGIN_DECLS
00033
00034
00038 typedef enum {
00039
OSSO_OK = 0,
00040
OSSO_ERROR = -1,
00041
OSSO_INVALID = -2,
00042
OSSO_RPC_ERROR = -4,
00043
OSSO_ERROR_NAME = -3,
00044
OSSO_ERROR_NO_STATE = -5,
00045
OSSO_ERROR_STATE_SIZE = -6
00047 }
00048
osso_return_t;
00049
00050
00051
00059 typedef struct osso_af_context_t
osso_context_t;
00060
00081
osso_context_t *
osso_initialize(
const gchar *application,
00082
const gchar* version,
00083 gboolean activation,
00084 GMainContext *context);
00092
void osso_deinitialize(osso_context_t *osso);
00093
00094
00095
00101
00102
00107 typedef struct {
00108 int type;
00109
union {
00110 guint32 u;
00111 gint32 i;
00112 gboolean b;
00113 gdouble d;
00114 const gchar *s;
00115 } value;
00116 }
00117
osso_rpc_t;
00118
00133 typedef gint (
osso_rpc_cb_f)(
const gchar *interface,
const gchar *method,
00134 GArray *arguments, gpointer data,
00135
osso_rpc_t *retval);
00136
00145 typedef void (
osso_rpc_async_f)(
const gchar *interface,
00146
const gchar *method,
00147
osso_rpc_t *retval, gpointer data);
00148
00193
osso_return_t osso_rpc_run (osso_context_t * osso,
const gchar * service,
00194
const gchar * object_path,
00195
const gchar * interface,
const gchar * method,
00196
osso_rpc_t * retval,
int argument_type, ...);
00197
00224
osso_return_t osso_rpc_run_with_defaults (osso_context_t * osso,
00225
const gchar * application,
00226
const gchar * method,
00227
osso_rpc_t * retval,
00228
int argument_type, ...);
00229
00256
osso_return_t osso_rpc_async_run (osso_context_t * osso,
00257
const gchar * service,
00258
const gchar * object_path,
00259
const gchar * interface,
00260
const gchar * method,
00261 osso_rpc_async_f * async_cb, gpointer data,
00262
int argument_type, ...);
00263
00289
osso_return_t osso_rpc_async_run_with_defaults (osso_context_t * osso,
00290
const gchar * application,
00291
const gchar * method,
00292 osso_rpc_async_f * async_cb,
00293 gpointer data,
00294
int argument_type, ...);
00295
00310
osso_return_t osso_rpc_set_cb_f (osso_context_t * osso,
const gchar * service,
00311
const gchar * object_path,
00312
const gchar * interface, osso_rpc_cb_f * cb,
00313 gpointer data);
00314
00325
osso_return_t osso_rpc_set_default_cb_f (osso_context_t * osso,
00326 osso_rpc_cb_f * cb, gpointer data);
00327
00341
osso_return_t osso_rpc_unset_cb_f (osso_context_t * osso,
00342
const gchar * service,
00343
const gchar * object_path,
00344
const gchar * interface,
00345 osso_rpc_cb_f * cb, gpointer data);
00346
00356
osso_return_t osso_rpc_unset_default_cb_f (osso_context_t * osso,
00357 osso_rpc_cb_f * cb, gpointer data);
00358
00365
osso_return_t osso_rpc_get_timeout (osso_context_t * osso, gint * timeout);
00366
00373
osso_return_t osso_rpc_set_timeout(osso_context_t * osso, gint timeout);
00374
00375
00376
00390 typedef void (
osso_application_exit_cb)(gboolean die_now, gpointer data);
00391
00394
osso_return_t osso_application_set_exit_cb(osso_context_t *osso,
00395 osso_application_exit_cb *cb,
00396 gpointer data);
00397
00474
osso_return_t osso_application_top(osso_context_t *osso,
00475
const gchar *application,
00476
const gchar *arguments);
00477
00489 typedef void(
osso_application_top_cb_f)(
const gchar *arguments,
00490 gpointer data);
00491
00503
osso_return_t osso_application_set_top_cb(osso_context_t *osso,
00504 osso_application_top_cb_f *cb,
00505 gpointer data);
00506
00519
osso_return_t osso_application_unset_top_cb(osso_context_t *osso,
00520 osso_application_top_cb_f *cb,
00521 gpointer data);
00522
00523
00524
00556
00563 typedef void(
osso_application_autosave_cb_f)(gpointer data);
00564
00574
osso_return_t osso_application_set_autosave_cb(osso_context_t *osso,
00575 osso_application_autosave_cb_f *cb,
00576 gpointer data);
00577
00587
osso_return_t osso_application_unset_autosave_cb(osso_context_t *osso,
00588 osso_application_autosave_cb_f *cb,
00589 gpointer data);
00590
00601
osso_return_t osso_application_userdata_changed(osso_context_t *osso);
00602
00611
osso_return_t osso_application_autosave_force(osso_context_t *osso);
00612
00615
00619
00620
00638
osso_return_t osso_statusbar_send_event(osso_context_t *osso,
00639
const gchar *name,
00640 gint argument1, gint argument2,
00641
const gchar *argument3,
00642
osso_rpc_t *retval);
00643
00644
00648
00649
00654 typedef void(
osso_time_cb_f)(gpointer data);
00655
00665
osso_return_t osso_time_set_notification_cb(osso_context_t *osso,
00666 osso_time_cb_f *cb,
00667 gpointer data);
00676
osso_return_t osso_time_set(osso_context_t *osso, time_t new_time);
00677
00678
00682
00683
00688 typedef enum {
00689
OSSO_GN_WARNING = 0,
00690
OSSO_GN_ERROR,
00691
OSSO_GN_NOTICE
00692 }
00693
osso_system_note_type_t;
00694
00709
osso_return_t osso_system_note_dialog(osso_context_t *osso,
00710
const gchar *message,
00711 osso_system_note_type_t type,
00712
osso_rpc_t *retval);
00713
00727
osso_return_t osso_system_note_infoprint(osso_context_t *osso,
00728
const gchar *text,
00729
osso_rpc_t *retval);
00730
00731
00732
00767
00768
00772 typedef struct {
00773 guint32 state_size;
00774 gpointer state_data;
00775 }
osso_state_t;
00776
00787
osso_return_t osso_state_write(osso_context_t *osso,
osso_state_t *state);
00788
00821
osso_return_t osso_state_read(osso_context_t *osso,
osso_state_t *state);
00822
00832
int osso_state_open_write(osso_context_t *osso);
00833
00842
int osso_state_open_read(osso_context_t *osso);
00843
00852
void osso_state_close(osso_context_t *osso, gint fd);
00853
00854
00855
00859
00876
osso_return_t osso_cp_plugin_execute(osso_context_t *osso,
00877
const gchar *filename,
00878 gpointer data, gboolean user_activated);
00879
00890
osso_return_t osso_cp_plugin_save_state(osso_context_t *osso,
00891
const gchar *filename,
00892 gpointer data);
00893
00894
00907 typedef struct {
00908 gboolean shutdown_ind;
00909 gboolean save_unsaved_data_ind;
00910 gboolean memory_low_ind;
00911 gboolean system_inactivity_ind;
00912 gchar *sig_device_mode_ind;
00913 }
osso_hw_state_t;
00914
00915
00924
osso_return_t osso_display_state_on(osso_context_t *osso);
00925
00934
osso_return_t osso_display_blanking_pause(osso_context_t *osso);
00935
00943 typedef void (
osso_hw_cb_f)(
osso_hw_state_t *state, gpointer data);
00944
00960
osso_return_t osso_hw_set_event_cb(osso_context_t *osso,
00961
osso_hw_state_t *state,
00962 osso_hw_cb_f *cb, gpointer data);
00963
00973
osso_return_t osso_hw_unset_event_cb(osso_context_t *osso,
00974
osso_hw_state_t *state);
00975
00977
00982
00990 typedef void (
osso_mime_cb_f)(gpointer data,
int argc, gchar **argv);
00991
01003
osso_return_t osso_mime_set_cb(osso_context_t *osso, osso_mime_cb_f *cb,
01004 gpointer data);
01005
01014
osso_return_t osso_mime_unset_cb(osso_context_t *osso);
01017
01018
01019
01020
01021
01022
01023
01024
01034
01035
01049
osso_return_t osso_tasknav_mail_add(osso_context_t *osso, guint
id,
01050
const gchar *subject,
const gchar *sender,
01051 gboolean attachment,
const gchar *date);
01052
01063
osso_return_t osso_tasknav_mail_del(osso_context_t *osso, guint
id);
01064
01076
osso_return_t osso_tasknav_mail_set_outbox_count(osso_context_t *osso,
01077 guint count);
01078
01089
void osso_log(
int level,
const char *format, ...);
01090
01091 # define LOG_D __FILE__,__LINE__,LOG_DEBUG
01092
01112
inline void d_log(
const char *file,
int line,
int level,
01113
const char *format, ...);
01114
01124 gpointer
osso_get_dbus_connection(osso_context_t *osso);
01125
01126
01137 gpointer
osso_get_sys_dbus_connection(osso_context_t *osso);
01138
01139
01154
osso_context_t *
osso_application_initialize(
const gchar *application,
01155
const gchar *version,
01156 osso_application_top_cb_f *cb,
01157 gpointer callback_data);
01158
01159
01160 G_END_DECLS
01161
01162
#endif