2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiIDataBindingDataTransformer.h
20 * @brief This is the header file for the %IDataBindingDataTransformer interface.
22 * This header file contains the declarations of the %IDataBindingDataTransformer interface.
25 #ifndef _FUI_IDATA_BINDING_DATA_TRANSFORMER_H_
26 #define _FUI_IDATA_BINDING_DATA_TRANSFORMER_H_
28 #include <FUiDataBindingTypes.h>
30 namespace Tizen { namespace Base
36 namespace Tizen { namespace Ui
40 * @interface IDataBindingDataTransformer
41 * @brief This interface defines methods for transforming the value of the data that will be updated to the binding target or source.
45 * The %IDataBindingDataTransformer interface defines methods for transforming the value of source type to the value of destination type.
47 class _OSP_EXPORT_ IDataBindingDataTransformer
51 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
55 virtual ~IDataBindingDataTransformer(void) {};
58 * Transforms the value of the data of source type to value of target type.
60 * @return @c true if it is successful to convert source to target @n
62 * @param[in] bindingId The specified binding ID
63 * @param[in] sourceType The source data type
64 * @param[in] sourceData The data source
65 * @param[in] targetType The target data type
66 * @param[out] targetData The data target
68 virtual bool TransformSourceToTarget(const Tizen::Base::String& bindingId, DataBindingDataType sourceType, const Tizen::Base::Object& sourceData, DataBindingDataType targetType, Tizen::Base::Object& targetData) = 0;
71 * Transforms the value of the data of target type to value of source type.
73 * @return @c true if it is successful to convert target to source @n
75 * @param[in] bindingId The specified binding ID
76 * @param[in] targetType The target data type
77 * @param[in] targetData The data target
78 * @param[in] sourceType The source data type
79 * @param[out] sourceData The data source
81 virtual bool TransformTargetToSource(const Tizen::Base::String& bindingId, DataBindingDataType targetType, const Tizen::Base::Object& targetData, DataBindingDataType sourceType, Tizen::Base::Object& sourceData) = 0;
84 * Checks whether the this transformer can convert the source type to target type.
87 * @return @c true if it is possible to transform source type to target type, @n
89 * @param[in] bindingId The specified binding ID
90 * @param[in] sourceType The source data type
91 * @param[in] targetType The target data type
93 virtual bool IsSourceToTargetTransformable(const Tizen::Base::String& bindingId, DataBindingDataType sourceType, DataBindingDataType targetType) = 0;
96 * Checks whether the this transformer can convert the target type to source type.
99 * @return @c true if it is possible to transform target type to source type, @n
101 * @param[in] bindingId The specified binding ID
102 * @param[in] targetType The target data type
103 * @param[in] sourceType The source data type
105 virtual bool IsTargetToSourceTransformable(const Tizen::Base::String& bindingId, DataBindingDataType targetType, DataBindingDataType sourceType) = 0;
109 // This method is for internal use only. Using this method can cause behavioral, security-related,
110 // and consistency-related issues in the application.
112 // This method is reserved and may change its name at any time without
115 virtual void IDataBingingDataTransformer_Reserved1(void) {}
118 // This method is for internal use only. Using this method can cause behavioral, security-related,
119 // and consistency-related issues in the application.
121 // This method is reserved and may change its name at any time without
124 virtual void IDataBingingDataTransformer_Reserved2(void) {}
127 // This method is for internal use only. Using this method can cause behavioral, security-related,
128 // and consistency-related issues in the application.
130 // This method is reserved and may change its name at any time without
133 virtual void IDataBingingDataTransformer_Reserved3(void) {}
135 }; // IDataBindingDataTransformer
138 #endif // _FUI_IDATA_BINDING_DATA_TRANSFORMER_H_