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 FUiCtrl_SearchBarPresenter.h
20 * @brief This is the header file for the _SearchBarPresenter class.
22 * This header file contains the declarations of the %_SearchBarPresenter class.
25 #ifndef _FUI_CTRL_INTERNAL_SEARCH_BAR_PRESENTER_H_
26 #define _FUI_CTRL_INTERNAL_SEARCH_BAR_PRESENTER_H_
28 #include <FBaseObject.h>
29 #include "FUiCtrl_SearchBar.h"
31 namespace Tizen { namespace Ui { namespace Animations
34 }}} // Tizen::Ui::Animations
36 namespace Tizen { namespace Ui { namespace Controls
40 class _SearchBarModel;
43 * @class _SearchBarPresenter
47 class _SearchBarPresenter
48 : public Tizen::Base::Object
52 * This is default constructor for this class.
56 _SearchBarPresenter(void);
59 * This is the destructor for this class.
63 virtual ~_SearchBarPresenter(void);
66 result Construct(const _SearchBar& searchBar);
70 * Updates the content area of the SearchBar control.
73 * @return An error code
74 * @param[in] show A Boolean flag indicating whether to perform show on the content area.
75 * @exception E_SUCCESS The method was successful.
76 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation @n
77 * -- the current mode of SearchBar prohibits the execution of the method. @n
78 * @exception E_SYSTEM A system error occurred.
79 * @remarks The method performs Invalidate() on the content area.
81 result UpdateContentArea(bool invalidate = true);
84 * Sets the visibility state of the content area.
87 * @return An error code
88 * @param[in] visible The visibility state of the content area.
89 * @exception E_SUCCESS The method was successful.
90 * @exception E_SYSTEM A system error occurred.
91 * @see IsContentAreaVisible()
93 result SetContentAreaVisible(bool visible);
96 * Checks whether the content area is visible.
99 * @return The visibility state of the content area.
100 * @exception E_SUCCESS The method was successful.
101 * @see SetContentAreaVisible()
103 bool IsContentAreaVisible(void) const;
106 * Gets the search bar mode.
109 * @return The search bar mode
110 * @exception E_SUCCESS The method was successful.
111 * @exception E_SYSTEM A system error occurred.
112 * @remarks The specific error code can be accessed using the GetLastResult() method.
115 SearchBarMode GetMode(void) const;
118 * Determines whether the search bar mode is locked.
121 * @return @c true if the mode is locked, @n
123 * @exception E_SUCCESS The method was successful.
124 * @exception E_SYSTEM A system error occurred.
125 * @remarks The specific error code can be accessed using the GetLastResult() method.
128 bool IsModeLocked(void) const;
131 * Sets the search bar mode.
134 * @return An error code
135 * @exception E_SUCCESS The method was successful.
136 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation, or the mode is locked.
137 * @exception E_SYSTEM A system error occurred.
141 result SetMode(SearchBarMode mode);
144 * Locks or unlocks the search bar mode.
147 * @return An error code
148 * @param[in] modeLocked The mode lock
149 * @exception E_SUCCESS The method was successful.
150 * @exception E_SYSTEM A system error occurred.
153 result SetModeLocked(bool modeLocked);
156 * Sets the visibility state of the header.
159 * @param[in] visible The visibility state of the the header.
161 void SetHeaderVisibleState(bool visible);
166 void OnBoundsChanged(void);
169 _SearchBarPresenter(const _SearchBarPresenter&);
171 _SearchBarPresenter& operator =(const _SearchBarPresenter&);
173 void SetCancelButtonVisible(bool visible);
174 void SetContainerVisible(bool visible);
175 result DrawIcon(void);
177 result ChangeMode(SearchBarMode mode);
178 void InitializeInputModeLayout(void);
179 void InitializeViewModeLayout(void);
180 result LoadSearchFieldIcon(void);
182 _SearchBar* __pSearchBar;
183 _SearchBarModel* __pSearchBarModel;
185 _Button* __pCancelButton;
187 _Control* __pContainer;
189 Tizen::Graphics::Rectangle __searchFieldBounds;
191 Tizen::Ui::Animations::_VisualElement* __pIconElement;
193 Tizen::Graphics::Bitmap* __pReplacedSearchFieldNormalBitmap;
194 Tizen::Graphics::Bitmap* __pReplacedSearchFieldDisabledBitmap;
195 Tizen::Graphics::Bitmap* __pSearchFieldEffectBitmap;
198 }; // _SearchBarPresenter
200 }}} // Tizen::Ui::Controls
202 #endif // _FUI_CTRL_INTERNAL_SEARCH_BAR_PRESENTER_H_