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>
30 #include "IntIAddressbarEventListener.h"
34 ADDRESSBAR_MODE_INVALID = -1,
35 ADDRESSBAR_MODE_READER = 0,
36 ADDRESSBAR_MODE_LOADING,
37 ADDRESSBAR_MODE_LOADING_COMPLETE,
42 : public Tizen::Ui::Controls::Panel
43 , public Tizen::System::IDeviceEventListener
44 , public Tizen::Ui::IActionEventListener
45 , public Tizen::Ui::IKeypadEventListener
46 , public Tizen::Ui::IFocusEventListener
47 , public Tizen::Ui::ITextEventListener
52 * @brief This is the default constructor for this class.
57 * @brief This is the default destructor for this class.
59 virtual ~Addressbar(void);
61 // IActionEventListener
62 void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
64 //IKeypadActionEventListener
65 void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
66 void OnKeypadClosed(Tizen::Ui::Control& source);
67 void OnKeypadOpened(Tizen::Ui::Control& source);
68 void OnKeypadWillOpen(Tizen::Ui::Control& source);
69 void OnKeypadBoundsChanged(Tizen::Ui::Control &source);
71 void OnFocusGained(const Tizen::Ui::Control& source);
72 void OnFocusLost(const Tizen::Ui::Control& source);
74 virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
75 virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){}
77 virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String &state);
80 * @brief Initializes this instance of Addressbar with the specified parameters.
82 result Initialize(const Tizen::Graphics::Rectangle& rect);
85 * @brief Gets the current addressbar Mode.
87 //AddressBarMode GetAddressbarMode(void);
90 * brief To remove the Http from the Url editfield
92 Tizen::Graphics::Bitmap* GetLockedImageN(void);
95 * @brief Gets the current progress value Addressbar control in percentage
97 int GetProgress(void);
100 * @brief Gets the currently displayed Url for the Addressbar control.
102 Tizen::Base::String GetUrl(void);
105 * @brief Event when orientationChanged
107 void OrientationChanged(int& width);
110 * brief To remove the Http from the Url editfield
112 Tizen::Base::String RemoveHttpTextFromDisplayURL(void);
115 * @brief Save the text of address bar
117 void SaveAddressbarEditText();
120 * @brief Sets the specified Url for the Addressbar control.
123 void SetUrl(const Tizen::Base::String& url);
126 * @brief ReSets the Guide Text for the Addressbar control.
129 void ResetGuideText(void);
133 * @brief Sets the event listener for the Addressbar control.
136 void SetAddressbarEventListener(IAddressbarEventListener* pListener);
139 * @brief Sets the current addressbar Mode.
141 //void SetAddressbarMode(AddressBarMode addMode);
144 * brief Sets the backward Button enable or disable as per the input parameter isEnabled.
146 void SetBackButtonEnabled(bool isEnabled);
149 * @brief Sets the favicon bitmap.
151 void SetFaviconBitmap(const Tizen::Graphics::Bitmap& favicon);
154 * @brief Sets the Forward Button enable or disable as per the input parameter isEnabled.
156 void SetForwardButtonEnabled(bool isEnabled);
159 * @brief Updates the favicon bitmap/image depending on browsing mode.
161 void UpdateFaviconBitmap(bool isPrivateOn);
164 * @brief Updates the progressbar Value.
166 void UpdateProgress(const int percentage);
168 void SetAddressbarURLFocus();
170 Tizen::Base::String GetAddressbarURL();
173 * @brief Updates the progressbar Value.
175 void UpdateProgressBitmap(void);
178 static const int IDA_REFRESH_BTN_CLICKED;
179 static const int IDA_READER_BTN_CLICKED;
180 static const int IDA_STOP_BTN_CLICKED;
181 static const int IDA_GO_BACK;
182 static const int IDA_GO_FORWARD;
183 static const int IDA_CANCEL;
184 static const int IDA_CLEAR_URL;
187 //AddressBarMode __currentAddMode;
188 Tizen::Base::String __displayUrl;
189 Tizen::Base::String __editTextUrl;
191 bool __isLoadingData;
192 bool __isLoadingCompleted;
193 bool __isClipboardOpen;
194 bool __isKeyboardConnected;
195 bool __isCancelledClicked;
196 int __progressPercentage;
198 Tizen::Ui::Controls::Label* __pAddressbarBg;
199 Tizen::Ui::Controls::Panel* __pBgPanel;
200 //Tizen::Ui::Controls::Button* __pCancelBtn;
201 Tizen::Ui::Controls::Button* __pClearBtn;
202 Tizen::Graphics::Bitmap* __pFavIcon;
203 Tizen::Ui::Controls::Label* __pFaviconLabel;
204 //Tizen::Ui::Controls::Button* __pGoBackBtn;
205 // Tizen::Ui::Controls::Button* __pGoForwardBtn;
206 Tizen::Ui::Controls::Label* __pLabelPrivateOn;
207 IAddressbarEventListener* __pListener;
208 Tizen::Ui::Controls::Label* __pPrivateIconLabel;
209 Tizen::Ui::Controls::Label* __pProgressbarLabel;
210 // Tizen::Ui::Controls::Button* __pReaderBtn;
211 // Tizen::Ui::Controls::Button* __pRefreshBtn;
212 Tizen::Ui::Controls::Button* __pStopBtn;
213 Tizen::Ui::Controls::Label* __pSearchLabel;
214 Tizen::Ui::Controls::EditField* __pAddressbarUrlField;
215 Tizen::Ui::Controls::Label* __pToolBarLabel;
216 Tizen::Ui::Controls::Label* __pAddressbarURLLabel;
217 Tizen::Ui::Controls::Button* __pAddressBackBtn;
220 #endif /* _INT_ADDRESSBAR_H_ */