2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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 virtual result OnTerminating(void);
63 // IActionEventListener
64 void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
66 //IKeypadActionEventListener
67 void OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction);
68 void OnKeypadClosed(Tizen::Ui::Control& source);
69 void OnKeypadOpened(Tizen::Ui::Control& source);
70 void OnKeypadWillOpen(Tizen::Ui::Control& source);
71 void OnKeypadBoundsChanged(Tizen::Ui::Control &source);
73 void OnFocusGained(const Tizen::Ui::Control& source);
74 void OnFocusLost(const Tizen::Ui::Control& source);
76 virtual void OnTextValueChanged(const Tizen::Ui::Control& source);
77 virtual void OnTextValueChangeCanceled(const Tizen::Ui::Control& source){}
79 virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String &state);
82 * @brief Initializes this instance of Addressbar with the specified parameters.
84 result Initialize(const Tizen::Graphics::Rectangle& rect);
87 * @brief Gets the current addressbar Mode.
89 //AddressBarMode GetAddressbarMode(void);
92 * brief To remove the Http from the Url editfield
94 Tizen::Graphics::Bitmap* GetLockedImageN(void);
97 * @brief Gets the current progress value Addressbar control in percentage
99 int GetProgress(void);
102 * @brief Gets the currently displayed Url for the Addressbar control.
104 Tizen::Base::String GetUrl(void);
107 * @brief Event when orientationChanged
109 void OrientationChanged(int& width);
112 * brief To remove the Http from the Url editfield
114 Tizen::Base::String RemoveHttpTextFromDisplayURL(void);
117 * @brief Save the text of address bar
119 void SaveAddressbarEditText();
122 * @brief Sets the specified Url for the Addressbar control.
125 void SetUrl(const Tizen::Base::String& url);
128 * @brief ReSets the Guide Text for the Addressbar control.
131 void ResetGuideText(void);
135 * @brief Sets the event listener for the Addressbar control.
138 void SetAddressbarEventListener(IAddressbarEventListener* pListener);
141 * @brief Sets the current addressbar Mode.
143 //void SetAddressbarMode(AddressBarMode addMode);
146 * brief Sets the backward Button enable or disable as per the input parameter isEnabled.
148 void SetBackButtonEnabled(bool isEnabled);
151 * @brief Sets the favicon bitmap.
153 void SetFaviconBitmap(const Tizen::Graphics::Bitmap& favicon);
156 * @brief Sets the Forward Button enable or disable as per the input parameter isEnabled.
158 void SetForwardButtonEnabled(bool isEnabled);
161 * @brief Updates the favicon bitmap/image depending on browsing mode.
163 void UpdateFaviconBitmap(bool isPrivateOn);
166 * @brief Updates the progressbar Value.
168 void UpdateProgress(const int percentage);
170 void SetAddressbarURLFocus();
172 Tizen::Base::String GetAddressbarURL();
174 bool HasCurrentFocus(void);
175 void HideKeypad(void);
176 void OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs);
179 * @brief Updates the progressbar Value.
181 void UpdateProgressBitmap(void);
184 static const int IDA_REFRESH_BTN_CLICKED;
185 static const int IDA_READER_BTN_CLICKED;
186 static const int IDA_STOP_BTN_CLICKED;
187 static const int IDA_GO_BACK;
188 static const int IDA_GO_FORWARD;
189 static const int IDA_CANCEL;
190 static const int IDA_CLEAR_URL;
194 Tizen::Base::String __displayUrl;
195 Tizen::Base::String __editTextUrl;
197 bool __isLoadingData;
198 bool __isLoadingCompleted;
199 bool __isClipboardOpen;
200 bool __isKeyboardConnected;
201 bool __isKeyPadOpened;
202 int __progressPercentage;
204 Tizen::Ui::Controls::Label* __pAddressbarBg;
205 Tizen::Ui::Controls::Panel* __pBgPanel;
206 Tizen::Ui::Controls::Button* __pClearBtn;
207 Tizen::Graphics::Bitmap* __pFavIcon;
208 Tizen::Ui::Controls::Label* __pFaviconLabel;
209 Tizen::Ui::Controls::Label* __pLabelPrivateOn;
210 IAddressbarEventListener* __pListener;
211 Tizen::Ui::Controls::Label* __pPrivateIconLabel;
212 Tizen::Ui::Controls::Label* __pProgressbarLabel;
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;
218 bool __isAppBackGround;
221 #endif /* _INT_ADDRESSBAR_H_ */