1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
3
* unity-webapps-application-repository.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/>.";
23
#ifndef __UNITY_WEBAPPS_APPLICATION_REPOSITORY_H
24
#define __UNITY_WEBAPPS_APPLICATION_REPOSITORY_H
27
#define UNITY_WEBAPPS_TYPE_APPLICATION_REPOSITORY (unity_webapps_application_repository_get_type())
28
#define UNITY_WEBAPPS_APPLICATION_REPOSITORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), UNITY_WEBAPPS_TYPE_APPLICATION_REPOSITORY, UnityWebappsApplicationRepository))
29
#define UNITY_WEBAPPS_APPLICATION_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), UNITY_WEBAPPS_TYPE_APPLICATION_REPOSITORY, UnityWebappsApplicationRepositoryClass))
30
#define UNITY_WEBAPPS_IS_APPLICATION_REPOSITORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), UNITY_WEBAPPS_TYPE_APPLICATION_REPOSITORY))
31
#define UNITY_WEBAPPS_IS_APPLICATION_REPOSITORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_WEBAPPS_TYPE_APPLICATION_REPOSITORY))
32
#define UNITY_WEBAPPS_APPLICATION_REPOSITORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), UNITY_WEBAPPS_TYPE_APPLICATION_REPOSITORY, UnityWebappsApplicationRepositoryClass))
34
#include "unity-webapps-available-application.h"
36
typedef struct _UnityWebappsApplicationRepositoryPrivate UnityWebappsApplicationRepositoryPrivate;
38
typedef struct _UnityWebappsApplicationRepository UnityWebappsApplicationRepository;
40
struct _UnityWebappsApplicationRepository {
43
UnityWebappsApplicationRepositoryPrivate *priv;
46
typedef struct _UnityWebappsApplicationRepositoryClass UnityWebappsApplicationRepositoryClass;
48
struct _UnityWebappsApplicationRepositoryClass
50
GObjectClass parent_class;
54
UNITY_WEBAPPS_APPLICATION_STATUS_AVAILABLE,
55
UNITY_WEBAPPS_APPLICATION_STATUS_INSTALLED,
56
UNITY_WEBAPPS_APPLICATION_STATUS_UNRESOLVED
57
} UnityWebappsApplicationStatus;
59
GType unity_webapps_application_repository_get_type (void) G_GNUC_CONST;
61
UnityWebappsApplicationRepository *unity_webapps_application_repository_new_default ();
64
unity_webapps_application_repository_prepare (UnityWebappsApplicationRepository *repository);
66
const gchar * unity_webapps_application_repository_resolve_url (UnityWebappsApplicationRepository *repository, const gchar *url);
68
UnityWebappsApplicationStatus
69
unity_webapps_application_repository_get_resolved_application_status (UnityWebappsApplicationRepository *repository, const gchar *application);
71
typedef void (*UnityWebappsApplicationRepositoryInstallCallback) (UnityWebappsApplicationRepository *repository, const gchar *name, UnityWebappsApplicationStatus status, gpointer user_data);
74
unity_webapps_application_repository_install_application (UnityWebappsApplicationRepository *repository, const gchar *name,
75
UnityWebappsApplicationRepositoryInstallCallback callback, gpointer user_data);
78
unity_webapps_application_repository_get_userscript_contents (UnityWebappsApplicationRepository *repository, const gchar *name);