2
The way for apps to interact with the Sync Indicator
4
Copyright 2012 Canonical Ltd.
7
Charles Kerr <charles.kerr@canonical.com>
9
This program is free software: you can redistribute it and/or modify it
10
under the terms of the GNU General Public License version 3,
11
as published by the Free Software Foundation.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranties of
15
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
16
See the GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License along
19
with this program. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef __SYNC_CLIENT_H__
23
#define __SYNC_CLIENT_H__
26
#include <glib-object.h>
27
#include <libdbusmenu-glib/dbusmenu-glib.h>
28
#include <indicator-sync/sync-enum.h>
33
**** GObject boilerplate
36
GType sync_client_get_type (void) G_GNUC_CONST;
38
typedef struct _SyncMenuClient SyncMenuClient;
40
#define SYNC_CLIENT_TYPE (sync_client_get_type ())
41
#define SYNC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYNC_CLIENT_TYPE, SyncClient))
42
#define SYNC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYNC_CLIENT_TYPE, SyncClientClass))
43
#define IS_SYNC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYNC_CLIENT_TYPE))
44
#define IS_SYNC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYNC_CLIENT_TYPE))
45
#define SYNC_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYNC_CLIENT_TYPE, SyncClientClass))
47
#define SYNC_CLIENT_PROP_DESKTOP_ID "desktop-id"
48
#define SYNC_CLIENT_PROP_STATE "state"
49
#define SYNC_CLIENT_PROP_PAUSED "paused"
50
#define SYNC_CLIENT_PROP_DBUSMENU "dbusmenu"
52
typedef struct _SyncClientClass SyncClientClass;
53
typedef struct _SyncClient SyncClient;
54
typedef struct _SyncClientPriv SyncClientPriv;
56
struct _SyncClientClass
61
/* reserved for future use */
62
void (*sync_client_reserved1)(void);
63
void (*sync_client_reserved2)(void);
64
void (*sync_client_reserved3)(void);
65
void (*sync_client_reserved4)(void);
72
SyncClientPriv * priv;
79
SyncClient * sync_client_new (const char * desktop_id);
81
void sync_client_set_state (SyncClient * client, SyncState state);
83
void sync_client_set_paused (SyncClient * client, gboolean paused);
85
void sync_client_set_menu (SyncClient * client, DbusmenuServer * menu_server);
87
SyncState sync_client_get_state (SyncClient * client);
89
gboolean sync_client_get_paused (SyncClient * client);
91
DbusmenuServer * sync_client_get_menu (SyncClient * client);
93
const gchar * sync_client_get_desktop_id (SyncClient * client);
96
* SYNC_PROGRESS_MENUITEM_TYPE:
98
* A value for %DBUSMENU_MENUITEM_PROP_TYPE to create a #DbusmenuMenuitem
99
* that represents some task that has a progress state associated with it.
100
* For example, this could be used for showing a file while it's in the
101
* process of being synchronized.
103
#define SYNC_PROGRESS_MENUITEM_TYPE "sync-progress-item"
106
* SYNC_PROGRESS_MENUITEM_PROP_PERCENT_DONE:
108
* #DbusmenuMenuitem property that says what percent done this item is.
109
* Should be an integer in the range [0..100]
110
* Type: %G_VARIANT_TYPE_INT32
112
#define SYNC_PROGRESS_MENUITEM_PROP_PERCENT_DONE "percent-done"