3
* @brief internal GEIS back end base class public interface
5
* Copyright 2010, 2012 Canonical Ltd.
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
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
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
21
#ifndef GEIS_BACKEND_H_
22
#define GEIS_BACKEND_H_
24
#include "geis/geis.h"
25
#include "geis_backend_token.h"
28
* Provides a virtual "base class" for various GEIS back ends.
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?).
35
typedef struct GeisBackend *GeisBackend;
38
* Creates a back end by name.
40
* @param[in] name Names a back end.
42
GeisBackend geis_backend_by_name(Geis geis, GeisString name);
45
* Destroys the back end.
47
* @parameter[in] be The back end.
49
* This function behaves like a virtual destructor and chains through to the
50
* concrete destructor call.
52
void geis_backend_delete(GeisBackend be);
55
* Gets the name of the back end.
57
* @parameter[in] be The back end.
59
* This accessor is useful for diagnostics.
61
GeisString geis_backend_name(GeisBackend be);
64
* Creates a new back end token.
66
GeisBackendToken geis_backend_create_token(GeisBackend be,
67
GeisBackendTokenInitState);
70
* Marks a gesture as accepted by the back end.
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.
77
geis_backend_gesture_accept(GeisBackend be,
79
GeisGestureId gesture_id);
82
* Marks a gesture as rejected by the back end.
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.
89
geis_backend_gesture_reject(GeisBackend be,
91
GeisGestureId gesture_id);
94
* Gets a back end configuration value.
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.
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
108
* @retval GEIS_STATUS_UNKNOWN_ERROR The configuration item is supported but an
109
* error occurred when attempting to get the
113
geis_backend_get_configuration(GeisBackend be,
114
GeisSubscription subscription,
115
GeisString configuration_item_name,
116
GeisPointer configuration_item_value);
119
* Sets a back end configuration value.
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.
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
131
* @retval GEIS_STATUS_UNKNOWN_ERROR The configuration item is supported but an
132
* error occurred when attempting to set the
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_ */