Tizen 2.1 base
[apps/osp/Home.git] / inc / HmCustomPageMarker.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file        HmCustomPageMarker.h
19  * @brief       Keeps declaration of the CustomPageMarker
20  * declares CustomPageMarker class, which contains the top bubble's bar which indicates the page number
21  */
22
23 #ifndef _HM_CUSTOM_PAGE_MARKER_H_
24 #define _HM_CUSTOM_PAGE_MARKER_H_
25
26 #include <FUi.h>
27 #include "HmICustomPageMarkerEventListener.h"
28
29 /**
30  * @class       CustomPageMarker
31  * @brief       The control which keeps the bubbles and current state of the bubbles
32  */
33 class CustomPageMarker
34         : public Tizen::Ui::Controls::Panel
35         , public Tizen::Ui::ITouchEventListener
36 {
37 public:
38         /**
39          * Constructor
40          */
41         CustomPageMarker(void);
42
43         /**
44          * Destructor, this destructor overrides ~Tizen::Ui::Controls::Panel().
45          */
46         virtual ~CustomPageMarker(void);
47
48         /**
49          * Constructs the object completely
50          *
51          * @param[in]   controlRect, position of the control.
52          * @param[in]   noOfPages, total no of bubbles to be initialized with.
53          * @param[in]   markPos, position of the marker within the form.
54          */
55         result Construct(const Tizen::Graphics::Rectangle& controlRect, int bubbleCount = 1);
56
57         /**
58          * Adds a new bubble in the marker control
59          *
60          * @return    result, E_SUCCESS if successfully created the control else Error Code.
61          */
62         result AddBubble(void);
63
64         /**
65          * returns the total no. of bubbles in the control
66          *
67          * @return      the no of bubbles in the control
68          */
69         const int GetBubbleCount(void);
70
71         /**
72          * Deletes a bubble from the marker control
73          *
74          * @return              result, E_SUCCESS if successfully created the control else Error Code.
75          * @param[in]   index, bubble number to be deleted.
76          */
77         result RemoveBubble(int index);
78
79         /**
80          * Sets the listener to intercept events on the marker control.
81          *
82          * @param[in]   pListener, Listener object to be notified.
83          */
84         void SetPageMarkerEventListener(ICustomPageMarkerEventListener* pListner);
85
86         /**
87          * Sets the specified bubble as a current bubble, and highlights it
88          *
89          * @return              result, E_SUCCESS if successfully created the control else Error Code.
90          * @param[in]   index, bubble number to be highlighted.
91          */
92         void SetSelectedBubble(int index);
93
94         // From ITouchEventListener
95         virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
96         virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
97         virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
98         virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
99         virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
100         virtual void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
101
102 private:
103         /**
104          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
105          */
106         CustomPageMarker(const CustomPageMarker&);
107
108         /**
109          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
110          */
111         CustomPageMarker& operator =(const CustomPageMarker&);
112
113 private:
114         ICustomPageMarkerEventListener* __pMarkerListener; // listener to the marker events
115         int __bubbleCount; // total number of bubbles in marker control
116         int __selectedBubble;  // currently highlighted bubble in the marker
117         Tizen::Base::Collection::ArrayList* __pBubbleLabels; // list of labels in the marker control
118         Tizen::Base::Collection::ArrayList* __pBubbleBitmaps; // the bitmaps to be shown as bubble
119 };
120
121 #endif //_HM_CUSTOM_PAGE_MARKER_H_