~ubuntu-branches/ubuntu/trusty/geis/trusty

« back to all changes in this revision

Viewing changes to libgeis/geis_backend.h

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-07-30 08:51:42 UTC
  • Revision ID: package-import@ubuntu.com-20120730085142-jrc33ygjvt0ob1wl
Tags: upstream-2.2.11
ImportĀ upstreamĀ versionĀ 2.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file geis_backend.h
 
3
 * @brief internal GEIS back end base class public interface
 
4
 *
 
5
 * Copyright 2010, 2012 Canonical Ltd.
 
6
 *
 
7
 * This library is free software; you can redistribute it and/or modify it under
 
8
 * the terms of the GNU Lesser General Public License as published by the Free
 
9
 * Software Foundation; either version 3 of the License, or (at your option) any
 
10
 * later version.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful, but WITHOUT
 
13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
14
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 
15
 * details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public License
 
18
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 
19
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 
20
 */
 
21
#ifndef GEIS_BACKEND_H_
 
22
#define GEIS_BACKEND_H_
 
23
 
 
24
#include "geis/geis.h"
 
25
#include "geis_backend_token.h"
 
26
 
 
27
/**
 
28
 * Provides a virtual "base class" for various GEIS back ends.
 
29
 *
 
30
 * The GEIS is an API that implements the facade pattern over some number of
 
31
 * actual "back end" implementations.  Most internal operations of the API are
 
32
 * performed through this "virtual base class" interface rather than through the
 
33
 * concrete back ends (isn't object-oriented programming great?).
 
34
 */
 
35
typedef struct GeisBackend *GeisBackend;
 
36
 
 
37
/**
 
38
 * Creates a back end by name.
 
39
 *
 
40
 * @param[in] name  Names a back end.
 
41
 */
 
42
GeisBackend geis_backend_by_name(Geis geis, GeisString name);
 
43
 
 
44
/**
 
45
 * Destroys the back end.
 
46
 *
 
47
 * @parameter[in] be  The back end.
 
48
 *
 
49
 * This function behaves like a virtual destructor and chains through to the
 
50
 * concrete destructor call.
 
51
 */
 
52
void geis_backend_delete(GeisBackend be);
 
53
 
 
54
/**
 
55
 * Gets the name of the back end.
 
56
 *
 
57
 * @parameter[in] be  The back end.
 
58
 *
 
59
 * This accessor is useful for diagnostics.
 
60
 */
 
61
GeisString geis_backend_name(GeisBackend be);
 
62
 
 
63
/**
 
64
 * Creates a new back end token.
 
65
 */
 
66
GeisBackendToken geis_backend_create_token(GeisBackend be,
 
67
                                           GeisBackendTokenInitState);
 
68
 
 
69
/**
 
70
 * Marks a gesture as accepted by the back end.
 
71
 *
 
72
 * @param[in] be          The GEIS back end.
 
73
 * @param[in] group       The gesture group containing the accepted gesture.
 
74
 * @param[in] gesture_id  Identifies the gesture.
 
75
 */
 
76
GeisStatus
 
77
geis_backend_gesture_accept(GeisBackend   be,
 
78
                            GeisGroup     group,
 
79
                            GeisGestureId gesture_id);
 
80
 
 
81
/**
 
82
 * Marks a gesture as rejected by the back end.
 
83
 *
 
84
 * @param[in] be          The GEIS back end.
 
85
 * @param[in] group       The gesture group containing the rejected gesture.
 
86
 * @param[in] gesture_id  Identifies the gesture.
 
87
 */
 
88
GeisStatus
 
89
geis_backend_gesture_reject(GeisBackend   be,
 
90
                            GeisGroup     group,
 
91
                            GeisGestureId gesture_id);
 
92
 
 
93
/**
 
94
 * Gets a back end configuration value.
 
95
 *
 
96
 * @param[in]  be                       The back end.
 
97
 * @param[in]  subscription             A subscription from the back end (or NULL
 
98
 *                                      if a non-subscription configuration).
 
99
 * @param[in]  configuration_item_name  The name of a configuration item.
 
100
 * @param[out] configuration_item_value A pointer to a variable of the
 
101
 *                                      appropriate type to receive the
 
102
 *                                      configuration item value.
 
103
 *
 
104
 * @retval GEIS_STATUS_SUCCESS       The configuration item is supported and the
 
105
 *                                   item value has been successfully retrieved.
 
106
 * @retval GEIS_STATUS_NO_SUPPORTED  The configuration item is not supported on
 
107
 *                                   this backend.
 
108
 * @retval GEIS_STATUS_UNKNOWN_ERROR The configuration item is supported but an
 
109
 *                                   error occurred when attempting to get the
 
110
 *                                   item value.
 
111
 */
 
112
GeisStatus
 
113
geis_backend_get_configuration(GeisBackend      be,
 
114
                               GeisSubscription subscription,
 
115
                               GeisString       configuration_item_name,
 
116
                               GeisPointer      configuration_item_value);
 
117
 
 
118
/**
 
119
 * Sets a back end configuration value.
 
120
 *
 
121
 * @param[in] be                       The back end.
 
122
 * @param[in] subscription             A subscription from the back end (or NULL
 
123
 *                                     if a non-subscription configuration).
 
124
 * @param[in] configuration_item_name  The name of a configuration item.
 
125
 * @param[in] configuration_item_value A pointer to a value to set.
 
126
 *
 
127
 * @retval GEIS_STATUS_SUCCESS       The configuration item is supported and has
 
128
 *                                   been successfully set.
 
129
 * @retval GEIS_STATUS_NO_SUPPORTED  The configuration item is not supported on
 
130
 *                                   this backend.
 
131
 * @retval GEIS_STATUS_UNKNOWN_ERROR The configuration item is supported but an
 
132
 *                                   error occurred when attempting to set the
 
133
 *                                   item value.
 
134
 */
 
135
GeisStatus
 
136
geis_backend_set_configuration(GeisBackend      be,
 
137
                               GeisSubscription subscription,
 
138
                               GeisString       configuration_item_name,
 
139
                               GeisPointer      configuration_item_value);
 
140
#endif /* GEIS_BACKEND_H_ */