2
* @file geis_backend_token.h
3
* @brief internal GEIS back end token public interface
5
* Copyright 2011 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 General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef GEIS_BACKEND_TOKEN_H_
21
#define GEIS_BACKEND_TOKEN_H_
23
#include "geis/geis.h"
26
* An opaque token representing a set of filter terms in a backend-specific way.
28
typedef struct GeisBackendToken *GeisBackendToken;
31
* The states in which a backend token may be initialized. The choices are:
32
* all gestures or no gestures.
34
typedef enum GeisBackendTokenInitState
36
GEIS_BACKEND_TOKEN_INIT_NONE,
37
GEIS_BACKEND_TOKEN_INIT_ALL
38
} GeisBackendTokenInitState;
42
* Creates a new backend token.
44
* @param[in] geis The API instance for which the token is created.
45
* @param[in] init_state The initial state the token should be in.
47
* @returns a new %GeisBackendToken initialized according to @p init_state or
51
geis_backend_token_new(Geis geis, GeisBackendTokenInitState init_state);
54
* Clones a new backend token from an existing one.
55
* @param[in] token The orignal backend token.
57
* @returns a new %GeisBackendToken that is an identical copy of @p token or
58
* NULL on failure. Failure is not really an option.
61
geis_backend_token_clone(GeisBackendToken token);
64
* Destroys a backend token.
66
* @param[in] token The backend token.
69
geis_backend_token_delete(GeisBackendToken token);
72
* Composes two backend tokens into a new backend token.
74
* @param[in] lhs A backend token.
75
* @param[in] rhs Another backend token.
77
* Composed tokens are effectively ANDed.
80
geis_backend_token_compose(GeisBackendToken lhs, GeisBackendToken rhs);
83
* Activates a token in the back end.
85
* @param[in] token A backend token.
86
* @param[in] subscription The subscription under which the token will be
90
geis_backend_token_activate(GeisBackendToken token,
91
GeisSubscription subscription);
94
* Deactivates a token in the back end.
96
* @param[in] token The backend token.
97
* @param[in] subscription The subscription for which the token will be
101
geis_backend_token_deactivate(GeisBackendToken token,
102
GeisSubscription subscription);
104
#endif /* GEIS_BACKEND_TOKEN_H_ */