2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 FWebCtrl_WebNotificationImpl.h
20 * @brief The file contains the declaration of _WebNotificationHandler class.
22 * The file contains the declaration of _WebNotificationHandler class.
24 #ifndef _FWEB_CTRL_INTERNAL_WEB_NOTIFCATION_Handler_H_
25 #define _FWEB_CTRL_INTERNAL_WEB_NOTIFCATION_Handler_H_
28 #include <FBaseString.h>
29 #include <FGrpDimension.h>
30 #include <FGrpRectangle.h>
31 #include <FUiControl.h>
32 #include <FUiIPropagatedTouchEventListener.h>
33 #include <FUiTouchEventInfo.h>
35 const Tizen::Graphics::Color NOTIFCATION_NORMAL_BLACKGROUND_COLOR = Tizen::Graphics::Color(255, 255, 255, 255);
36 const Tizen::Graphics::Color NOTIFCATION_NORMAL_FOREGROUND_COLOR = Tizen::Graphics::Color(0, 0, 0, 255);
37 const Tizen::Graphics::Rectangle NOTIFCATION_RECT_AREA = Tizen::Graphics::Rectangle(0,0,600,150);
38 const Tizen::Graphics::Rectangle NOTIFCATION_BUTTON_AREA = Tizen::Graphics::Rectangle(550,0,50,50);
40 const int NOTIFCATION_STATE_NORMAL = 0;
41 const int NOTIFCATION_STATE_PRESSED = 1;
42 const int NOTIFCATION_STATE_MAX = 2;
44 const int NOTIFCATION_COLOR_BG_NORMAL = 0;
45 const int NOTIFCATION_COLOR_FG_NORMAL = 1;
46 const int NOTIFCATION_COLOR_MAX = 2;
49 namespace Tizen { namespace Web { namespace Controls
51 // forward declaration
52 class _WebNotification;
53 class _WebNotificationHandler;
55 class _WebNotificationHandler
56 : public Tizen::Ui::IPropagatedTouchEventListener
60 _WebNotificationHandler(void);
61 virtual ~_WebNotificationHandler(void);
63 result Construct(_WebNotification* pnotification);
65 int GetState(void) const;
66 void SetState(int newState);
68 bool OnPreviewTouchMoved(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
69 bool OnPreviewTouchPressed(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
70 bool OnPreviewTouchReleased(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
71 bool OnTouchCanceled(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
72 bool OnTouchMoved(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
73 bool OnTouchPressed(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
74 bool OnTouchReleased(Tizen::Ui::Control &source, const Tizen::Ui::TouchEventInfo &touchEventInfo);
76 virtual result DrawNotification(Tizen::Graphics::Canvas& canvas);
77 void SetText(const Tizen::Base::String& text);
78 Tizen::Base::String GetText(void) const;
82 _WebNotification* __pNotification;
84 Tizen::Base::String __text;
85 Tizen::Graphics::Rectangle __bounds;
86 Tizen::Graphics::Color __pallete[NOTIFCATION_COLOR_MAX];
87 }; // _WebNotificationHandler
90 #endif // _FWEB_CTRL_INTERNAL_WEB_NOTIFCATION_Handler_H_