1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
3
* unity-webapps-service.h
4
* Copyright (C) Canonical LTD 2011
6
* Author: Robert Carr <racarr@canonical.com>
8
unity-webapps is free software: you can redistribute it and/or modify it
9
* under the terms of the GNU Lesser General Public License as published
10
* by the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* unity-webapps is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
* See the GNU Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.";
22
#ifndef __UNITY_WEBAPPS_SERVICE_H
23
#define __UNITY_WEBAPPS_SERVICE_H
26
#include <glib-object.h>
30
#include "unity-webapps-dbus-defs.h"
33
#define UNITY_WEBAPPS_TYPE_SERVICE (unity_webapps_service_get_type())
34
#define UNITY_WEBAPPS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), UNITY_WEBAPPS_TYPE_SERVICE, UnityWebappsService))
35
#define UNITY_WEBAPPS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), UNITY_WEBAPPS_TYPE_SERVICE, UnityWebappsServiceClass))
36
#define UNITY_WEBAPPS_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), UNITY_WEBAPPS_TYPE_SERVICE))
37
#define UNITY_WEBAPPS_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_WEBAPPS_TYPE_SERVICE))
38
#define UNITY_WEBAPPS_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), UNITY_WEBAPPS_TYPE_SERVICE, UnityWebappsServiceClass))
40
typedef struct _UnityWebappsServicePrivate UnityWebappsServicePrivate;
42
typedef struct _UnityWebappsService UnityWebappsService;
45
struct _UnityWebappsService {
48
UnityWebappsServicePrivate *priv;
49
// UnityWebappsGenService *service_proxy;
50
// GDBusConnection *session_bus;
53
typedef struct _UnityWebappsServiceClass UnityWebappsServiceClass;
55
struct _UnityWebappsServiceClass
57
GObjectClass parent_class;
60
typedef void (*UnityWebappsServiceContextNotifyCallback) (UnityWebappsService *service, const gchar *name, gpointer user_data);
62
GType unity_webapps_service_get_type (void) G_GNUC_CONST;
64
UnityWebappsService *unity_webapps_service_new ();
66
GDBusConnection *unity_webapps_service_get_connection (UnityWebappsService *service);
67
GDBusProxy *unity_webapps_service_get_proxy (UnityWebappsService *service);
69
void unity_webapps_service_activate_application (UnityWebappsService *service, const gchar *name, const gchar *domain);
70
void unity_webapps_service_on_context_appeared (UnityWebappsService *service, UnityWebappsServiceContextNotifyCallback callback, gpointer user_data);
71
void unity_webapps_service_on_context_vanished (UnityWebappsService *service, UnityWebappsServiceContextNotifyCallback callback, gpointer user_data);
72
gchar **unity_webapps_service_list_contexts (UnityWebappsService *service);