4 * Copyright (c) 2011 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JongHyuk Choi <jhchoi.choi@samsung.com>, ByungWook Jang <bw.jang@samsung.com>,
7 * Manoj Kumar K <manojkumar.k@samsung.com>, Hyunil Park <hyunil46.park@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 #ifndef __MM_WFD_ATTRS_H__
24 #define __MM_WFD_ATTRS_H__
28 #include <mm_message.h>
36 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
38 #define MMWFD_MAX_INT (2147483647)
41 * Enumeration for attribute values types.
44 MM_WFD_ATTRS_TYPE_INVALID = -1, /**< Type is invalid */
45 MM_WFD_ATTRS_TYPE_INT, /**< Integer type */
46 MM_WFD_ATTRS_TYPE_DOUBLE, /**< Double type */
47 MM_WFD_ATTRS_TYPE_STRING, /**< UTF-8 String type */
48 MM_WFD_ATTRS_TYPE_DATA, /**< Pointer type */
49 MM_WFD_ATTRS_TYPE_ARRAY, /**< Array type */
50 MM_WFD_ATTRS_TYPE_RANGE, /**< Range type */
51 MM_WFD_ATTRS_TYPE_NUM, /**< Number of attribute type */
55 * Enumeration for attribute validation type.
58 MM_WFD_ATTRS_VALID_TYPE_INVALID = -1, /**< Invalid validation type */
59 MM_WFD_ATTRS_VALID_TYPE_NONE, /**< Do not check validity */
60 MM_WFD_ATTRS_VALID_TYPE_INT_ARRAY, /**< validity checking type of integer array */
61 MM_WFD_ATTRS_VALID_TYPE_INT_RANGE, /**< validity checking type of integer range */
62 MM_WFD_ATTRS_VALID_TYPE_DOUBLE_ARRAY, /**< validity checking type of double array */
63 MM_WFD_ATTRS_VALID_TYPE_DOUBLE_RANGE, /**< validity checking type of double range */
64 } MMWfdAttrsValidType;
67 * Enumeration for attribute access flag.
70 MM_WFD_ATTRS_FLAG_NONE = 0, /**< None flag is set */
71 MM_WFD_ATTRS_FLAG_READABLE = 1 << 0, /**< Readable */
72 MM_WFD_ATTRS_FLAG_WRITABLE = 1 << 1, /**< Writable */
73 MM_WFD_ATTRS_FLAG_MODIFIED = 1 << 2, /**< Modified */
75 MM_WFD_ATTRS_FLAG_RW = MM_WFD_ATTRS_FLAG_READABLE | MM_WFD_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
79 * Attribute validity structure
83 MMWfdAttrsValidType validity_type;
86 * a union that describes validity of the attribute.
87 * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
88 * the attribute can have validity.
92 * Validity structure for integer array.
95 int *array; /**< a pointer of array */
96 int count; /**< size of array */
100 * Validity structure for integer range.
103 int min; /**< minimum range */
104 int max; /**< maximum range */
108 * Validity structure for double array.
111 double *array; /**< a pointer of array */
112 int count; /**< size of array */
116 * Validity structure for double range.
119 double min; /**< minimum range */
120 double max; /**< maximum range */
126 MMHandleType _mmwfd_construct_attribute(MMHandleType hwfd);
127 void _mmwfd_deconstruct_attribute(MMHandleType hwfd);
128 int _mmwfd_set_attribute(MMHandleType hwfd, char **err_atr_name, const char *attribute_name, va_list args_list);
129 int _mmwfd_get_attributes_info(MMHandleType handle, const char *attribute_name, MMWfdAttrsInfo *dst_info);
130 int _mmwfd_get_attribute(MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list args_list);
131 #endif /* __MM_WFD_ATTRS_H__ */