Back to index

dbus-test-runner  12.10.0
service.h
Go to the documentation of this file.
00001 /*
00002 Copyright 2012 Canonical Ltd.
00003 
00004 Authors:
00005     Ted Gould <ted@canonical.com>
00006 
00007 This program is free software: you can redistribute it and/or modify it 
00008 under the terms of the GNU General Public License version 3, as published 
00009 by the Free Software Foundation.
00010 
00011 This program is distributed in the hope that it will be useful, but 
00012 WITHOUT ANY WARRANTY; without even the implied warranties of 
00013 MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
00014 PURPOSE.  See the GNU General Public License for more details.
00015 
00016 You should have received a copy of the GNU General Public License along 
00017 with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #ifndef __DBUS_TEST_SERVICE_H__
00021 #define __DBUS_TEST_SERVICE_H__
00022 
00023 #ifndef __DBUS_TEST_TOP_LEVEL__
00024 #error "Please include #include <libdbustest/dbus-test.h> only"
00025 #endif
00026 
00027 #include <glib-object.h>
00028 
00029 #include "task.h"
00030 
00031 G_BEGIN_DECLS
00032 
00033 #define DBUS_TEST_TYPE_SERVICE            (dbus_test_service_get_type ())
00034 #define DBUS_TEST_SERVICE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), DBUS_TEST_TYPE_SERVICE, DbusTestService))
00035 #define DBUS_TEST_SERVICE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TEST_TYPE_SERVICE, DbusTestServiceClass))
00036 #define DBUS_TEST_IS_SERVICE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DBUS_TEST_TYPE_SERVICE))
00037 #define DBUS_TEST_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TEST_TYPE_SERVICE))
00038 #define DBUS_TEST_SERVICE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TEST_TYPE_SERVICE, DbusTestServiceClass))
00039 
00040 typedef struct _DbusTestService         DbusTestService;
00041 typedef struct _DbusTestServiceClass    DbusTestServiceClass;
00042 typedef struct _DbusTestServicePrivate  DbusTestServicePrivate;
00043 
00044 struct _DbusTestServiceClass {
00045        GObjectClass parent_class;
00046 };
00047 
00048 struct _DbusTestService {
00049        GObject parent;
00050        DbusTestServicePrivate * priv;
00051 };
00052 
00053 typedef enum
00054 {
00055        DBUS_TEST_SERVICE_PRIORITY_FIRST,
00056        DBUS_TEST_SERVICE_PRIORITY_NORMAL,
00057        DBUS_TEST_SERVICE_PRIORITY_LAST
00058 } DbusTestServicePriority;
00059 
00060 GType dbus_test_service_get_type (void);
00061 DbusTestService * dbus_test_service_new (const gchar * address);
00062 void dbus_test_service_start_tasks (DbusTestService * service);
00063 int dbus_test_service_run (DbusTestService * service);
00064 void dbus_test_service_stop (DbusTestService * service);
00065 
00066 void dbus_test_service_add_task (DbusTestService * service, DbusTestTask * task);
00067 void dbus_test_service_add_task_with_priority (DbusTestService * service, DbusTestTask * task, DbusTestServicePriority prio);
00068 
00069 void dbus_test_service_set_daemon (DbusTestService * service, const gchar * daemon);
00070 void dbus_test_service_set_conf_file (DbusTestService * service, const gchar * conffile);
00071 
00072 G_END_DECLS
00073 
00074 #endif