modify license, permission and remove ^M char
[platform/framework/native/uifw.git] / src / ui / FUi_DataBindingContext.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17 /**
18  * @file    FUi_DataBindingContext.h
19  * @brief   This is the header file for the _DataBindingContext class.
20  *
21  * This header file contains the declarations of the _DataBindingContext class.
22  */
23 #ifndef _FUI_INTERNAL_DATA_BINDING_CONTEXT_H_
24 #define _FUI_INTERNAL_DATA_BINDING_CONTEXT_H_
25
26 #include <FBaseColHashMapT.h>
27 #include <FUiDataBindingTypes.h>
28
29 namespace Tizen { namespace Base
30 {
31         class String;
32 }}
33
34 namespace Tizen { namespace Ui
35 {
36
37 class IDataBindingListener;
38 class IDataBindingDataValidator;
39 class IDataBindingDataTransformer;
40 class _Control;
41 class _DataBinding;
42
43 class _DataBindingContext
44 {
45 public:
46 // Life Cycle
47         _DataBindingContext(const _Control& control);
48         ~_DataBindingContext(void);
49
50 // Accessor
51         _Control* GetContextOwner(void) const;
52
53 // Operations
54         result Bind(_Control& control, const Tizen::Base::String& bindingId, const Tizen::Base::String& controlName, const Tizen::Base::String& propertyName, Tizen::Base::Object& dataSource, DataBindingDataType sourceType, DataBindingFlow flow, DataBindingTrigger trigger, const IDataBindingListener* pListener, const IDataBindingDataValidator* pValidator, const IDataBindingDataTransformer* pTransformer);
55
56         result SetDataBindingEventListener(const Tizen::Base::String& bindingId, const IDataBindingListener* pListener);
57
58         result UnbindAll(void);
59
60         result Unbind(const Tizen::Base::String& bindingId);
61
62         result UpdateAllBindings(DataBindingDestinationType destinationType);
63
64         result UpdateBinding(const Tizen::Base::String& bindingId, DataBindingDestinationType destinationType);
65 private:
66         _DataBindingContext(const _DataBindingContext& rhs);
67         _DataBindingContext& operator =(const _DataBindingContext& rhs);
68 private:
69 // Attributes
70         _Control* __pControl;
71         Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>* __pProvider;
72         Tizen::Base::Collection::IComparerT<Tizen::Base::String>* __pComparer;
73         Tizen::Base::Collection::HashMapT<Tizen::Base::String, _DataBinding*> __map;
74 }; //class _DataBindingContext
75
76 }} //Tizen::Ui
77 #endif // _FUI_INTERNAL_DATA_BINDING_CONTEXT_H_