libngf: libngf/client.h Source File

libngf

client.h
Go to the documentation of this file.
1/*
2 * libngf - Non-graphical feedback library
3 *
4 * Copyright (C) 2010 Nokia Corporation. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library 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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef NGF_CLIENT_H
22#define NGF_CLIENT_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <stdint.h>
29#include <libngf/proplist.h>
30
31 typedef enum _NgfTransport
32{
34 NGF_TRANSPORT_DBUS,
35
37 NGF_TRANSPORT_INTERNAL
38} NgfTransport;
39
40 typedef enum _NgfEventState
41{
43 NGF_EVENT_FAILED = 0,
44
46 NGF_EVENT_COMPLETED = 1,
47
49 NGF_EVENT_PLAYING = 2,
50
52 NGF_EVENT_PAUSED = 3,
53
54} NgfEventState;
55
57 typedef struct _NgfClient NgfClient;
58
60 typedef void (*NgfCallback) (NgfClient *client, uint32_t id, NgfEventState state, void *userdata);
61
80 NgfClient* ngf_client_create (NgfTransport transport, ...);
81
88 void ngf_client_destroy (NgfClient *client);
89
98 void ngf_client_set_callback (NgfClient *client,
99 NgfCallback callback,
100 void *userdata);
101
126uint32_t ngf_client_play_event (NgfClient *client,
127 const char *event,
128 NgfProplist *proplist);
129
137 void ngf_client_stop_event (NgfClient *client,
138 uint32_t id);
139
147 void ngf_client_pause_event (NgfClient *client,
148 uint32_t id);
149
157 void ngf_client_resume_event (NgfClient *client,
158 uint32_t id);
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif /* NGF_CLIENT_H */
NgfCallback
void(* NgfCallback)(NgfClient *client, uint32_t id, NgfEventState state, void *userdata)
Event state callback for receiving event completion status (failed, completed)
Definition: client.h:60
ngf_client_stop_event
void ngf_client_stop_event(NgfClient *client, uint32_t id)
Stop an active event.
ngf_client_play_event
uint32_t ngf_client_play_event(NgfClient *client, const char *event, NgfProplist *proplist)
Play event with optional properties.
ngf_client_resume_event
void ngf_client_resume_event(NgfClient *client, uint32_t id)
Resume paused event.
ngf_client_create
NgfClient * ngf_client_create(NgfTransport transport,...)
Create a client instance to play events.
ngf_client_pause_event
void ngf_client_pause_event(NgfClient *client, uint32_t id)
Pause active event.
ngf_client_set_callback
void ngf_client_set_callback(NgfClient *client, NgfCallback callback, void *userdata)
Set a callback to receive event completion updates.
ngf_client_destroy
void ngf_client_destroy(NgfClient *client)
Free the clients resources.
NgfEventState
enum _NgfEventState NgfEventState
_NgfEventState
_NgfEventState
Definition: client.h:41
NGF_EVENT_FAILED
@ NGF_EVENT_FAILED
Event fails when we are unable to get resources for it or we just can't play it.
Definition: client.h:43
NGF_EVENT_COMPLETED
@ NGF_EVENT_COMPLETED
Event is completed when the event has been played or cancelled by higher priority event.
Definition: client.h:46
NGF_EVENT_PLAYING
@ NGF_EVENT_PLAYING
Event is in playing state when playback is successfully started or continued.
Definition: client.h:49
NGF_EVENT_PAUSED
@ NGF_EVENT_PAUSED
Event is in paused state when pause is called.
Definition: client.h:52
NgfClient
struct _NgfClient NgfClient
Internal client structure.
Definition: client.h:57
NgfTransport
enum _NgfTransport NgfTransport
_NgfTransport
_NgfTransport
Definition: client.h:32
NGF_TRANSPORT_INTERNAL
@ NGF_TRANSPORT_INTERNAL
Reserved for internal use.
Definition: client.h:37
NGF_TRANSPORT_DBUS
@ NGF_TRANSPORT_DBUS
DBus transport is the only supported transport currently.
Definition: client.h:34
proplist.h
NgfProplist
struct _NgfProplist NgfProplist
Internal property list instance.
Definition: proplist.h:39