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>
31 #include <mm_attrs_private.h>
37 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
39 #define MMWFD_MAX_INT (2147483647)
42 * Enumeration for attribute values types.
45 MM_WFD_ATTRS_TYPE_INVALID = -1, /**< Type is invalid */
46 MM_WFD_ATTRS_TYPE_INT, /**< Integer type */
47 MM_WFD_ATTRS_TYPE_DOUBLE, /**< Double type */
48 MM_WFD_ATTRS_TYPE_STRING, /**< UTF-8 String type */
49 MM_WFD_ATTRS_TYPE_DATA, /**< Pointer type */
50 MM_WFD_ATTRS_TYPE_ARRAY, /**< Array type */
51 MM_WFD_ATTRS_TYPE_RANGE, /**< Range type */
52 MM_WFD_ATTRS_TYPE_NUM, /**< Number of attribute type */
56 * Enumeration for attribute validation type.
59 MM_WFD_ATTRS_VALID_TYPE_INVALID = -1, /**< Invalid validation type */
60 MM_WFD_ATTRS_VALID_TYPE_NONE, /**< Do not check validity */
61 MM_WFD_ATTRS_VALID_TYPE_INT_ARRAY, /**< validity checking type of integer array */
62 MM_WFD_ATTRS_VALID_TYPE_INT_RANGE, /**< validity checking type of integer range */
63 MM_WFD_ATTRS_VALID_TYPE_DOUBLE_ARRAY, /**< validity checking type of double array */
64 MM_WFD_ATTRS_VALID_TYPE_DOUBLE_RANGE, /**< validity checking type of double range */
65 } MMWfdAttrsValidType;
68 * Enumeration for attribute access flag.
71 MM_WFD_ATTRS_FLAG_NONE = 0, /**< None flag is set */
72 MM_WFD_ATTRS_FLAG_READABLE = 1 << 0, /**< Readable */
73 MM_WFD_ATTRS_FLAG_WRITABLE = 1 << 1, /**< Writable */
74 MM_WFD_ATTRS_FLAG_MODIFIED = 1 << 2, /**< Modified */
76 MM_WFD_ATTRS_FLAG_RW = MM_WFD_ATTRS_FLAG_READABLE | MM_WFD_ATTRS_FLAG_WRITABLE, /**< Readable and Writable */
80 * Attribute validity structure
84 MMWfdAttrsValidType validity_type;
87 * a union that describes validity of the attribute.
88 * Only when type is 'MM_ATTRS_TYPE_INT' or 'MM_ATTRS_TYPE_DOUBLE',
89 * the attribute can have validity.
93 * Validity structure for integer array.
96 int *array; /**< a pointer of array */
97 int count; /**< size of array */
101 * Validity structure for integer range.
104 int min; /**< minimum range */
105 int max; /**< maximum range */
109 * Validity structure for double array.
112 double *array; /**< a pointer of array */
113 int count; /**< size of array */
117 * Validity structure for double range.
120 double min; /**< minimum range */
121 double max; /**< maximum range */
127 MMHandleType _mmwfd_construct_attribute(MMHandleType hwfd);
128 void _mmwfd_deconstruct_attribute(MMHandleType hwfd);
129 int _mmwfd_set_attribute(MMHandleType hwfd, char **err_atr_name, const char *attribute_name, va_list args_list);
130 int _mmwfd_get_attributes_info(MMHandleType handle, const char *attribute_name, MMWfdAttrsInfo *dst_info);
131 int _mmwfd_get_attribute(MMHandleType handle, char **err_attr_name, const char *attribute_name, va_list args_list);
132 #endif /* __MM_WFD_ATTRS_H__ */