94
|
1 |
/*
|
|
2 |
* Copyright (c) 2000 - 2001 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef NW_HED_CONTEXT_H
|
|
19 |
#define NW_HED_CONTEXT_H
|
|
20 |
|
|
21 |
#include "nw_object_dynamic.h"
|
|
22 |
#include "nw_adt_dynamicvector.h"
|
|
23 |
#include <nw_string_string.h>
|
|
24 |
#include "NW_HED_EXPORT.h"
|
|
25 |
#include "BrsrStatusCodes.h"
|
|
26 |
|
|
27 |
#ifdef __cplusplus
|
|
28 |
extern "C" {
|
|
29 |
#endif /* __cplusplus */
|
|
30 |
|
|
31 |
/* ------------------------------------------------------------------------- *
|
|
32 |
forward declarations
|
|
33 |
* ------------------------------------------------------------------------- */
|
|
34 |
typedef struct NW_HED_Context_Class_s NW_HED_Context_Class_t;
|
|
35 |
typedef struct NW_HED_Context_s NW_HED_Context_t;
|
|
36 |
|
|
37 |
/* ------------------------------------------------------------------------- *
|
|
38 |
class definition
|
|
39 |
* ------------------------------------------------------------------------- */
|
|
40 |
typedef struct NW_HED_Context_ClassPart_s {
|
|
41 |
void** unused;
|
|
42 |
} NW_HED_Context_ClassPart_t;
|
|
43 |
|
|
44 |
struct NW_HED_Context_Class_s {
|
|
45 |
NW_Object_Core_ClassPart_t NW_Object_Core;
|
|
46 |
NW_Object_Base_ClassPart_t NW_Object_Base;
|
|
47 |
NW_Object_Dynamic_ClassPart_t NW_Object_Dynamic;
|
|
48 |
NW_HED_Context_ClassPart_t NW_HED_Context;
|
|
49 |
};
|
|
50 |
|
|
51 |
/* ------------------------------------------------------------------------- *
|
|
52 |
object definiton
|
|
53 |
* ------------------------------------------------------------------------- */
|
|
54 |
struct NW_HED_Context_s {
|
|
55 |
NW_Object_Dynamic_t super;
|
|
56 |
|
|
57 |
/* member variables */
|
|
58 |
NW_ADT_DynamicVector_t *vars;
|
|
59 |
};
|
|
60 |
|
|
61 |
/* ------------------------------------------------------------------------- *
|
|
62 |
public types
|
|
63 |
* ------------------------------------------------------------------------- */
|
|
64 |
typedef struct {
|
|
65 |
NW_String_t name;
|
|
66 |
NW_String_t value;
|
|
67 |
} NW_HED_Context_Variable_t;
|
|
68 |
|
|
69 |
|
|
70 |
/* ------------------------------------------------------------------------- *
|
|
71 |
convenience macros
|
|
72 |
* ------------------------------------------------------------------------- */
|
|
73 |
#define NW_HED_Context_GetClassPart(_object) \
|
|
74 |
(NW_Object_GetClassPart (_object, NW_HED_Context))
|
|
75 |
|
|
76 |
#define NW_HED_ContextOf(_object) \
|
|
77 |
(NW_Object_Cast (_object, NW_HED_Context))
|
|
78 |
|
|
79 |
/* ------------------------------------------------------------------------- *
|
|
80 |
global static data
|
|
81 |
* ------------------------------------------------------------------------- */
|
|
82 |
NW_HED_EXPORT const NW_HED_Context_Class_t NW_HED_Context_Class;
|
|
83 |
|
|
84 |
/* ------------------------------------------------------------------------- *
|
|
85 |
public methods
|
|
86 |
* ------------------------------------------------------------------------- */
|
|
87 |
|
|
88 |
/* ------------------------------------------------------------------------- *
|
|
89 |
convenience functions
|
|
90 |
* ------------------------------------------------------------------------- */
|
|
91 |
NW_HED_EXPORT
|
|
92 |
NW_HED_Context_t*
|
|
93 |
NW_HED_Context_New (void);
|
|
94 |
|
|
95 |
NW_HED_EXPORT
|
|
96 |
TBrowserStatusCode
|
|
97 |
NW_HED_Context_Reset (NW_HED_Context_t *thisObj);
|
|
98 |
|
|
99 |
NW_HED_EXPORT
|
|
100 |
TBrowserStatusCode
|
|
101 |
NW_HED_Context_SetOrAddVariable (NW_HED_Context_t *thisObj,
|
|
102 |
const NW_String_t *name,
|
|
103 |
const NW_String_t *value);
|
|
104 |
|
|
105 |
NW_HED_EXPORT
|
|
106 |
const NW_String_t *
|
|
107 |
NW_HED_Context_GetVariable (const NW_HED_Context_t *thisObj,
|
|
108 |
const NW_String_t *name);
|
|
109 |
|
|
110 |
NW_HED_EXPORT
|
|
111 |
const NW_HED_Context_Variable_t *
|
|
112 |
NW_HED_Context_GetEntry (const NW_HED_Context_t *thisObj,
|
|
113 |
NW_Uint32 index);
|
|
114 |
|
|
115 |
NW_HED_EXPORT
|
|
116 |
TBrowserStatusCode
|
|
117 |
NW_HED_Context_RemoveEntry (NW_HED_Context_t *thisObj,
|
|
118 |
NW_Uint32 index);
|
|
119 |
|
|
120 |
|
|
121 |
#ifdef __cplusplus
|
|
122 |
} // extern "C" {
|
|
123 |
#endif /* __cplusplus */
|
|
124 |
|
|
125 |
#endif /* NW_HED_CONTEXT_H */
|