1
// DBus.hh --- The main controller
3
// Copyright (C) 2006 Rob Caelers
4
// All rights reserved.
6
// This program is free software; you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation; either version 2, or (at your option)
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// $Id: DBus.hh,v 1.1 2006/09/18 21:10:27 rcaelers Exp $
22
#define DBUS_SERVICE_WORKRAVE "org.workrave.Workrave"
24
#include <glib/gerror.h>
25
#include <glib-object.h>
27
#include "CoreInterface.hh"
31
#define WORKRAVE_DBUS_ERROR g_quark_from_static_string ("workrave")
33
typedef struct _WorkraveService WorkraveService;
34
typedef struct _WorkraveServiceClass WorkraveServiceClass;
36
#define WORKRAVE_TYPE_SERVICE (workrave_service_get_type ())
37
#define WORKRAVE_SERVICE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), WORKRAVE_TYPE_SERVICE, WorkraveService))
38
#define WORKRAVE_SERVICE_CLASS(klass) (G_TYPE_CHACK_CLASS_CAST((klass), WORKRAVE_TYPE_SERVICE, WorkraveServiceClass))
39
#define WORKRAVE_IS_SERVICE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), WORKRAVE_TYPE_SERVICE))
40
#define WORKRAVE_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WORKRAVE_TYPE_SERVICE))
41
#define WORKRAVE_SERVICE_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), WORKRAVE_TYPE_SERVICE, WorkraveServiceClass))
43
struct _WorkraveService {
49
struct _WorkraveServiceClass {
52
void (*microbreak)(WorkraveService *svc, const gchar *progress);
53
void (*restbreak)(WorkraveService *svc, const gchar *progress);
54
void (*dailylimit)(WorkraveService *svc, const gchar *progress);
57
void workrave_dbus_server_init(CoreInterface *core);
58
GType workrave_service_get_type(void);
60
gboolean workrave_service_set_operation_mode(WorkraveService *svc, gchar *mode, GError **error);
61
gboolean workrave_service_get_operation_mode(WorkraveService *svc, gchar **mode, GError **error);
62
gboolean workrave_service_report_activity(WorkraveService *svc, gchar *who, gchar *act, GError **error);
64
void workrave_service_send_break_stage_signal(BreakId break_id, gchar *progress);