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
26typedef struct _NContext NContext;
27
28#include <ngf/value.h>
29
31typedef void (*NContextValueChangeFunc) (NContext *context,
32 const char *key,
33 const NValue *old_value,
34 const NValue *new_value,
35 void *userdata);
36
44void n_context_set_value (NContext *context, const char *key,
45 NValue *value);
46
54const NValue* n_context_get_value (NContext *context, const char *key);
55
66int n_context_subscribe_value_change (NContext *context, const char *key,
68 void *userdata);
69
77void n_context_unsubscribe_value_change (NContext *context, const char *key,
79
80#endif /* N_CONTEXT_H */
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
struct _NContext NContext
Internal context structure.
Definition context.h:26
void n_context_unsubscribe_value_change(NContext *context, const char *key, NContextValueChangeFunc callback)
Unsubscribe value change callback.
int n_context_subscribe_value_change(NContext *context, const char *key, NContextValueChangeFunc callback, void *userdata)
Subscribe callback function to key in context structure.
void n_context_set_value(NContext *context, const char *key, NValue *value)
Change or add key/value pair to context.
const NValue * n_context_get_value(NContext *context, const char *key)
Get value by key from context.
struct _NValue NValue
Internal NValue structure.
Definition value.h:44