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

« back to all changes in this revision

Viewing changes to libgeis/geis_backend_token.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_token.h
 
3
 * @brief internal GEIS back end token public interface
 
4
 *
 
5
 * Copyright 2011 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 General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
#ifndef GEIS_BACKEND_TOKEN_H_
 
21
#define GEIS_BACKEND_TOKEN_H_
 
22
 
 
23
#include "geis/geis.h"
 
24
 
 
25
/**
 
26
 * An opaque token representing a set of filter terms in a backend-specific way.
 
27
 */
 
28
typedef struct GeisBackendToken *GeisBackendToken;
 
29
 
 
30
/**
 
31
 * The states in which a backend token may be initialized.  The choices are:
 
32
 * all gestures or no gestures.
 
33
 */
 
34
typedef enum GeisBackendTokenInitState
 
35
{
 
36
  GEIS_BACKEND_TOKEN_INIT_NONE,
 
37
  GEIS_BACKEND_TOKEN_INIT_ALL
 
38
} GeisBackendTokenInitState;
 
39
 
 
40
 
 
41
/**
 
42
 * Creates a new backend token.
 
43
 *
 
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.
 
46
 *
 
47
 * @returns a new %GeisBackendToken initialized according to @p init_state or
 
48
 * NULL on failure.
 
49
 */
 
50
GeisBackendToken
 
51
geis_backend_token_new(Geis geis, GeisBackendTokenInitState init_state);
 
52
 
 
53
/**
 
54
 * Clones a new backend token from an existing one.
 
55
 * @param[in] token  The orignal backend token.
 
56
 *
 
57
 * @returns a new %GeisBackendToken that is an identical copy of @p token or
 
58
 * NULL on failure.  Failure is not really an option.
 
59
 */
 
60
GeisBackendToken
 
61
geis_backend_token_clone(GeisBackendToken token);
 
62
 
 
63
/**
 
64
 * Destroys a backend token.
 
65
 *
 
66
 * @param[in] token  The backend token.
 
67
 */
 
68
void
 
69
geis_backend_token_delete(GeisBackendToken token);
 
70
 
 
71
/**
 
72
 * Composes two backend tokens into a new backend token.
 
73
 *
 
74
 * @param[in] lhs  A backend token.
 
75
 * @param[in] rhs  Another backend token.
 
76
 *
 
77
 * Composed tokens are effectively ANDed.
 
78
 */
 
79
void
 
80
geis_backend_token_compose(GeisBackendToken lhs, GeisBackendToken rhs);
 
81
 
 
82
/**
 
83
 * Activates a token in the back end.
 
84
 *
 
85
 * @param[in] token         A backend token.
 
86
 * @param[in] subscription  The subscription under which the token will be
 
87
 *                          activated.
 
88
 */
 
89
GeisStatus
 
90
geis_backend_token_activate(GeisBackendToken token,
 
91
                            GeisSubscription subscription);
 
92
 
 
93
/**
 
94
 * Deactivates a token in the back end.
 
95
 *
 
96
 * @param[in] token          The backend token.
 
97
 * @param[in] subscription  The subscription for which the token will be
 
98
 *                          deactivated.
 
99
 */
 
100
GeisStatus
 
101
geis_backend_token_deactivate(GeisBackendToken token,
 
102
                              GeisSubscription subscription);
 
103
 
 
104
#endif /* GEIS_BACKEND_TOKEN_H_ */