~vcs-imports/workrave/main

« back to all changes in this revision

Viewing changes to backend/src/DBus.hh

  • Committer: rcaelers
  • Date: 2006-09-18 21:10:27 UTC
  • Revision ID: vcs-imports@canonical.com-20060918211027-64176d79c6a355da
dbus and menus fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// DBus.hh --- The main controller
 
2
//
 
3
// Copyright (C) 2006 Rob Caelers
 
4
// All rights reserved.
 
5
//
 
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)
 
9
// any later version.
 
10
// 
 
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.
 
15
//
 
16
// $Id: DBus.hh,v 1.1 2006/09/18 21:10:27 rcaelers Exp $
 
17
//
 
18
 
 
19
#ifndef WRDBUS_H
 
20
#define WRDBUS_H
 
21
 
 
22
#define DBUS_SERVICE_WORKRAVE      "org.workrave.Workrave"
 
23
 
 
24
#include <glib/gerror.h>
 
25
#include <glib-object.h>
 
26
 
 
27
#include "CoreInterface.hh"
 
28
 
 
29
G_BEGIN_DECLS
 
30
 
 
31
#define WORKRAVE_DBUS_ERROR  g_quark_from_static_string ("workrave")
 
32
 
 
33
typedef struct _WorkraveService WorkraveService;
 
34
typedef struct _WorkraveServiceClass WorkraveServiceClass;
 
35
    
 
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))
 
42
 
 
43
struct _WorkraveService {
 
44
  GObject base;
 
45
    
 
46
  /* <public> */
 
47
};
 
48
 
 
49
struct _WorkraveServiceClass {
 
50
  GObjectClass base;
 
51
 
 
52
  void (*microbreak)(WorkraveService *svc, const gchar *progress);
 
53
  void (*restbreak)(WorkraveService *svc, const gchar *progress);
 
54
  void (*dailylimit)(WorkraveService *svc, const gchar *progress);
 
55
};
 
56
 
 
57
void workrave_dbus_server_init(CoreInterface *core);
 
58
GType workrave_service_get_type(void);
 
59
 
 
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);
 
63
 
 
64
void workrave_service_send_break_stage_signal(BreakId break_id, gchar *progress);
 
65
 
 
66
G_END_DECLS
 
67
 
 
68
#endif // WRDBUS_H