2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 /*@file: IntAddressbar
19 *@brief: This class defines common behaviour of Addressbar control.
23 #ifndef _INT_ADDRESSBAR_H_
24 #define _INT_ADDRESSBAR_H_
27 #include <FGraphics.h>
29 #include "IntIAddressbarEventListener.h"
33 ADDRESSBAR_MODE_INVALID = -1,
34 ADDRESSBAR_MODE_READER = 0,
35 ADDRESSBAR_MODE_LOADING,
36 ADDRESSBAR_MODE_LOADING_COMPLETE,
41 : public Tizen::Ui::Controls::Panel
42 , public Tizen::Ui::IActionEventListener
43 , public Tizen::Ui::IKeypadEventListener
44 , public Tizen::Ui::IFocusEventListener
45 , public Tizen::Ui::ITextEventListener
49 * @brief This is the default constructor for this class.
54 * @brief This is the default destructor for this class.
56 virtual ~Addressbar(void);
58 // IActionEventListener
59 void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
61 //IKeypadActionEventListener
62 void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
63 void OnKeypadClosed(Tizen::Ui::Control& source);
64 void OnKeypadOpened(Tizen::Ui::Control& source);
65 void OnKeypadWillOpen(Tizen::Ui::Control& source);
66 void OnKeypadBoundsChanged(Tizen::Ui::Control &source);
68 void OnFocusGained(const Tizen::Ui::Control& source);
69 void OnFocusLost(const Tizen::Ui::Control& source){}
71 virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
72 virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){}
75 * @brief Initializes this instance of Addressbar with the specified parameters.
77 result Initialize(const Tizen::Graphics::Rectangle& rect);
80 * @brief Gets the current addressbar Mode.
82 //AddressBarMode GetAddressbarMode(void);
85 * brief To remove the Http from the Url editfield
87 Tizen::Graphics::Bitmap* GetLockedImageN(void);
90 * @brief Gets the current progress value Addressbar control in percentage
92 int GetProgress(void);
95 * @brief Gets the currently displayed Url for the Addressbar control.
97 Tizen::Base::String GetUrl(void);
100 * @brief Event when orientationChanged
102 void OrientationChanged(void);
105 * brief To remove the Http from the Url editfield
107 Tizen::Base::String RemoveHttpTextFromDisplayURL(void);
110 * @brief Save the text of address bar
112 void SaveAddressbarEditText();
115 * @brief Sets the specified Url for the Addressbar control.
118 void SetUrl(const Tizen::Base::String& url);
121 * @brief Sets the event listener for the Addressbar control.
124 void SetAddressbarEventListener(IAddressbarEventListener* pListener);
127 * @brief Sets the current addressbar Mode.
129 //void SetAddressbarMode(AddressBarMode addMode);
132 * brief Sets the backward Button enable or disable as per the input parameter isEnabled.
134 void SetBackButtonEnabled(bool isEnabled);
137 * @brief Sets the favicon bitmap.
139 void SetFaviconBitmap(const Tizen::Graphics::Bitmap& favicon);
142 * @brief Sets the Forward Button enable or disable as per the input parameter isEnabled.
144 void SetForwardButtonEnabled(bool isEnabled);
147 * @brief Updates the favicon bitmap/image depending on browsing mode.
149 void UpdateFaviconBitmap(bool isPrivateOn);
152 * @brief Updates the progressbar Value.
154 void UpdateProgress(const int percentage);
156 void SetAddressbarURLFocus();
158 Tizen::Base::String GetAddressbarURL();
161 * @brief Updates the progressbar Value.
163 void UpdateProgressBitmap(void);
166 static const int IDA_REFRESH_BTN_CLICKED;
167 static const int IDA_READER_BTN_CLICKED;
168 static const int IDA_STOP_BTN_CLICKED;
169 static const int IDA_GO_BACK;
170 static const int IDA_GO_FORWARD;
171 static const int IDA_CANCEL;
172 static const int IDA_CLEAR_URL;
175 //AddressBarMode __currentAddMode;
176 Tizen::Base::String __displayUrl;
177 Tizen::Base::String __editTextUrl;
179 bool __isLoadingData;
180 bool __isLoadingCompleted;
181 int __progressPercentage;
183 Tizen::Ui::Controls::Label* __pAddressbarBg;
184 Tizen::Ui::Controls::Panel* __pBgPanel;
185 //Tizen::Ui::Controls::Button* __pCancelBtn;
186 Tizen::Ui::Controls::Button* __pClearBtn;
187 Tizen::Graphics::Bitmap* __pFavIcon;
188 Tizen::Ui::Controls::Label* __pFaviconLabel;
189 //Tizen::Ui::Controls::Button* __pGoBackBtn;
190 // Tizen::Ui::Controls::Button* __pGoForwardBtn;
191 Tizen::Ui::Controls::Label* __pLabelPrivateOn;
192 IAddressbarEventListener* __pListener;
193 Tizen::Ui::Controls::Label* __pPrivateIconLabel;
194 Tizen::Ui::Controls::Label* __pProgressbarLabel;
195 // Tizen::Ui::Controls::Button* __pReaderBtn;
196 // Tizen::Ui::Controls::Button* __pRefreshBtn;
197 Tizen::Ui::Controls::Button* __pStopBtn;
198 Tizen::Ui::Controls::Label* __pSearchLabel;
199 Tizen::Ui::Controls::EditField* __pAddressbarUrlField;
200 Tizen::Ui::Controls::Label* __pToolBarLabel;
201 Tizen::Ui::Controls::Label* __pAddressbarURLLabel;
202 Tizen::Ui::Controls::Button* __pAddressBackBtn;
205 #endif /* _INT_ADDRESSBAR_H_ */