ngfd-plugin: /build/ngfd/src/ngfd-1.4.1/src/include/ngf/context.h Source File

ngfd-plugin

context.h
Go to the documentation of this file.
1/*
2 * ngfd - Non-graphic feedback daemon
3 *
4 * Copyright (C) 2010 Nokia Corporation.
5 * Contact: Xun Chen <xun.chen@nokia.com>
6 *
7 * This work is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This work is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this work; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef N_CONTEXT_H
23#define N_CONTEXT_H
24
26 typedef struct _NContext NContext;
27
28#include <ngf/value.h>
29
31 typedef void (*NContextValueChangeFunc) (NContext *context,
32 const char *key,
33 const NValue *old_value,
34 const NValue *new_value,
35 void *userdata);
36
44 void n_context_set_value (NContext *context, const char *key,
45 NValue *value);
46
54 const NValue* n_context_get_value (NContext *context, const char *key);
55
66 int n_context_subscribe_value_change (NContext *context, const char *key,
67 NContextValueChangeFunc callback,
68 void *userdata);
69
77 void n_context_unsubscribe_value_change (NContext *context, const char *key,
78 NContextValueChangeFunc callback);
79
80#endif /* N_CONTEXT_H */
NContextValueChangeFunc
void(* NContextValueChangeFunc)(NContext *context, const char *key, const NValue *old_value, const NValue *new_value, void *userdata)
Context value change callback function.
Definition context.h:31
NContext
struct _NContext NContext
Internal context structure.
Definition context.h:26
n_context_unsubscribe_value_change
void n_context_unsubscribe_value_change(NContext *context, const char *key, NContextValueChangeFunc callback)
Unsubscribe value change callback.
n_context_subscribe_value_change
int n_context_subscribe_value_change(NContext *context, const char *key, NContextValueChangeFunc callback, void *userdata)
Subscribe callback function to key in context structure.
n_context_set_value
void n_context_set_value(NContext *context, const char *key, NValue *value)
Change or add key/value pair to context.
n_context_get_value
const NValue * n_context_get_value(NContext *context, const char *key)
Get value by key from context.
value.h
NValue
struct _NValue NValue
Internal NValue structure.
Definition value.h:44