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.
18 * @file FUiCtrl_TokenEdit.h
19 * @brief This is the header file for the _TokenEdit class.
21 * This header file contains the declarations of the %_TokenEdit class.
23 #ifndef _FUICTRL_INTERNAL_TOKEN_EDIT_H_
24 #define _FUICTRL_INTERNAL_TOKEN_EDIT_H_
26 #include <FUiCtrlExpandableEditArea.h>
27 #include "FUiCtrl_Edit.h"
28 #include "FUiCtrl_ITokenFilter.h"
30 namespace Tizen { namespace Ui
32 class _AccessibilityElement;
35 namespace Tizen { namespace Ui { namespace Controls
37 class _TokenEditPresenter;
39 const int TOKEN_COLOR_MAX = 2;
42 : virtual public Tizen::Base::Runtime::IEventListener
43 , virtual public Tizen::Ui::_IUiEventListener
44 , virtual public Tizen::Ui::_IUiEventPreviewer
45 , virtual public Tizen::Ui::_ITouchGestureEventListener
46 , public Tizen::Ui::Controls::_Edit
52 virtual ~_TokenEdit(void);
54 static _TokenEdit* CreateTokenEditN(void);
56 DECLARE_CLASS_BEGIN(_TokenEdit, _Edit);
57 DECLARE_PROPERTY("normalTokenColor", GetPropertyNormalTokenColor, SetPropertyNormalTokenColor);
58 DECLARE_PROPERTY("selectedTokenColor", GetPropertySelectedTokenColor, SetPropertySelectedTokenColor);
59 DECLARE_PROPERTY("tokenTextColor", GetPropertyTokenTextColor, SetPropertyTokenTextColor);
60 DECLARE_PROPERTY("selectedTokenTextColor", GetPropertySelectedTokenTextColor, SetPropertySelectedTokenTextColor);
61 DECLARE_PROPERTY("tokenEditModeEnabled", GetPropertyTokenEditModeEnabled, SetPropertyTokenEditModeEnabled);
65 result SetPropertyNormalTokenColor(const Variant& color);
66 Variant GetPropertyNormalTokenColor(void) const;
67 result SetPropertySelectedTokenColor(const Variant& color);
68 Variant GetPropertySelectedTokenColor(void) const;
69 result SetPropertyTokenTextColor(const Variant& color);
70 Variant GetPropertyTokenTextColor(void) const;
71 result SetPropertySelectedTokenTextColor(const Variant& color);
72 Variant GetPropertySelectedTokenTextColor(void) const;
73 result SetPropertyTokenEditModeEnabled(const Variant& enable);
74 Variant GetPropertyTokenEditModeEnabled(void) const;
76 virtual void OnDraw(void);
77 result SetTokenFilter(const _ITokenFilter* pFilter);
78 _ITokenFilter* GetTokenFilter(void) const;
79 result AppendToken(const Tizen::Base::String& token);
80 result InsertTokenAt(int index, const Tizen::Base::String& token);
81 Tizen::Base::String GetTokenAt(int index) const;
82 int GetTokenCount(void) const;
83 int GetSelectedTokenIndex(void) const;
84 bool IsTokenEditModeEnabled(void) const;
85 result RemoveTokenAt(int index);
86 result SetTokenSelected(int index, bool selected);
87 result SetTokenEditModeEnabled(bool enable);
88 Tizen::Graphics::Color GetTokenColor(ExpandableEditAreaTokenStatus status) const;
89 Tizen::Graphics::Color GetTokenTextColor(void) const;
90 result SetTokenColor(ExpandableEditAreaTokenStatus status, const Tizen::Graphics::Color& color);
91 result SetTokenTextColor(const Tizen::Graphics::Color& color);
92 Tizen::Graphics::Color GetSelectedTokenTextColor(void) const;
93 result SetSelectedTokenTextColor(const Tizen::Graphics::Color& color);
94 virtual result SetTitleText(const Tizen::Base::String& title);
95 virtual Tizen::Base::String GetTitleText(void) const;
96 void SetAutoShrinkModeEnabled(bool enable);
97 bool IsAutoShrinkModeEnabled(void) const;
98 result ProcessTokenFiltering(const Tizen::Base::String& inputString, Tizen::Base::String& replaceString, bool& enable);
101 virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
102 virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
103 virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
105 virtual result OnAttachedToMainTree(void);
108 _TokenEdit(const _TokenEdit& rhs);
109 _TokenEdit& operator =(const _TokenEdit& rhs);
111 virtual void OnBoundsChanged(void);
115 _TokenEditPresenter* __pTokenEditPresenter;
116 Tizen::Graphics::Color __tokenColor[TOKEN_COLOR_MAX];
118 Tizen::Graphics::Color __tokenTextColor[TOKEN_COLOR_MAX];
120 bool __isSelectedTokenTextColorSet;
122 _ITokenFilter* __pTokenFilter;
124 Tizen::Ui::_AccessibilityElement* __pDescriptionTextAccessibilityElement;
125 Tizen::Ui::_AccessibilityElement* __pHiddenTokenCountAccessibilityElement;
126 Tizen::Ui::_AccessibilityElement* __pExpandableButtonAccessibilityElement;
129 }}} // Tizen::Ui::Controls
131 #endif // _FUICTRL_INTERNAL_TOKEN_EDIT_H_