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
25 extern "C" {
26 #endif
27 
28 #include <stdint.h>
29 #include <libngf/proplist.h>
30 
31 typedef enum _NgfTransport
32 {
35 
39 
40 typedef enum _NgfEventState
41 {
44 
47 
50 
53 
55 
57 typedef struct _NgfClient NgfClient;
58 
60 typedef void (*NgfCallback) (NgfClient *client, uint32_t id, NgfEventState state, void *userdata);
61 
81 
89 
99  NgfCallback callback,
100  void *userdata);
101 
127  const char *event,
128  NgfProplist *proplist);
129 
138  uint32_t id);
139 
148  uint32_t id);
149 
158  uint32_t id);
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif /* NGF_CLIENT_H */
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
void ngf_client_stop_event(NgfClient *client, uint32_t id)
Stop an active event.
uint32_t ngf_client_play_event(NgfClient *client, const char *event, NgfProplist *proplist)
Play event with optional properties.
void ngf_client_resume_event(NgfClient *client, uint32_t id)
Resume paused event.
void ngf_client_pause_event(NgfClient *client, uint32_t id)
Pause active event.
void ngf_client_set_callback(NgfClient *client, NgfCallback callback, void *userdata)
Set a callback to receive event completion updates.
void ngf_client_destroy(NgfClient *client)
Free the clients resources.
enum _NgfEventState NgfEventState
_NgfEventState
Definition: client.h:41
@ 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
Event is completed when the event has been played or cancelled by higher priority event.
Definition: client.h:46
@ NGF_EVENT_PLAYING
Event is in playing state when playback is successfully started or continued.
Definition: client.h:49
@ NGF_EVENT_PAUSED
Event is in paused state when pause is called.
Definition: client.h:52
struct _NgfClient NgfClient
Internal client structure.
Definition: client.h:57
enum _NgfTransport NgfTransport
NgfClient * ngf_client_create(NgfTransport transport,...)
Create a client instance to play events.
_NgfTransport
Definition: client.h:32
@ NGF_TRANSPORT_INTERNAL
Reserved for internal use.
Definition: client.h:37
@ NGF_TRANSPORT_DBUS
DBus transport is the only supported transport currently.
Definition: client.h:34
struct _NgfProplist NgfProplist
Internal property list instance.
Definition: proplist.h:39