be1d738c79f6b5be4e175d5f8186e50c7946d591
[src/app-framework-main.git] / src / wgt-info.h
1 /*
2  Copyright 2015, 2016, 2017 IoT.bzh
3
4  author: José Bollo <jose.bollo@iot.bzh>
5
6  Licensed under the Apache License, Version 2.0 (the "License");
7  you may not use this file except in compliance with the License.
8  You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 */
18
19
20 struct wgt_desc_icon {
21         struct wgt_desc_icon *next;
22         char *src;
23         int width;
24         int height;
25 };
26
27 struct wgt_desc_param {
28         struct wgt_desc_param *next;
29         char *name;
30         char *value;    
31 };
32
33 struct wgt_desc_feature {
34         struct wgt_desc_feature *next;
35         char *name;
36         int required;
37         struct wgt_desc_param *params;
38 };
39
40 struct wgt_desc_preference {
41         struct wgt_desc_preference *next;
42         char *name;
43         char *value;
44         int readonly;
45 };
46
47 struct wgt_desc {
48         int refcount;
49         char *id;
50         char *version;
51         char *ver;
52         char *idaver;
53         int width;
54         int height;
55         char *viewmodes;
56         char *defaultlocale;
57         char *name;
58         char *name_short;
59         char *description;
60         char *author;
61         char *author_href;
62         char *author_email;
63         char *license;
64         char *license_href;
65         char *content_src;
66         char *content_type;
67         char *content_encoding;
68         struct wgt_desc_icon *icons;
69         struct wgt_desc_feature *features;
70         struct wgt_desc_preference *preferences;
71 };
72
73 struct wgt;
74 struct wgt_info;
75 extern struct wgt_info *wgt_info_create(struct wgt *wgt, int icons, int features, int preferences);
76 extern struct wgt_info *wgt_info_createat(int dirfd, const char *pathname, int icons, int features, int preferences);
77 extern const struct wgt_desc *wgt_info_desc(struct wgt_info *ifo);
78 extern struct wgt *wgt_info_wgt(struct wgt_info *ifo);
79 extern void wgt_info_addref(struct wgt_info *ifo);
80 extern void wgt_info_unref(struct wgt_info *ifo);
81 extern void wgt_info_dump(struct wgt_info *ifo, int fd, const char *prefix);
82 extern const struct wgt_desc_feature *wgt_info_feature(struct wgt_info *ifo, const char *name);
83 extern const char *wgt_info_param(const struct wgt_desc_feature *feature, const char *name);
84