d0d17f82446980063badd57ba6fe33994b8bde3c
[apps/osp/Internet.git] / inc / IntSharePopup.h
1 //
2
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.1 (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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 // !Internet
19 /*@file:    IntSharePopUp.h
20  *@brief:       This header file contains the declarations of the SharePopup
21  *
22  */
23
24 #ifndef INTSHAREPOPUP_H_
25 #define INTSHAREPOPUP_H_
26
27 #include <FApp.h>
28 #include <FBase.h>
29 #include <FIo.h>
30 #include <FUi.h>
31
32
33 class ShareInfo : public Tizen::Base::Object
34
35 {
36 public:
37         /**
38          * @brief               The Default constructor
39          */
40         ShareInfo(void);
41
42         /**
43          * @brief               The Default destructor
44          */
45         ~ShareInfo(void);
46
47         /**
48          * @brief               The method used to get the Page title
49          * @param[in]   void
50          * @return              String          The Page title
51          */
52         Tizen::Base::String GetPageTitle(void);
53
54         /**
55          * @brief               The method used to get the Page URL
56          * @param[in]   void
57          * @return              String          The Page URL
58          */
59         Tizen::Base::String GetPageURL(void);
60
61         /**
62          * @brief               The method used to set the Page title
63          * @param[in]   aPageTitle
64          */
65         void SetPageTitle(Tizen::Base::String aPageTitle);
66
67         /**
68          * @brief               The method used to set the Page URL
69          * @param[in]   aPageURL
70          */
71         void SetPageUrl(Tizen::Base::String aPageURL);
72
73         void SetImageAttached(bool imageAttached);
74
75         bool GetImageAttached();
76
77         void SetImagePath(Tizen::Base::String aImagePath);
78
79         Tizen::Base::String GetImagePath(void);
80
81 private:
82         Tizen::Base::String __pageTitle;
83         Tizen::Base::String __pageURL;
84         Tizen::Base::String __imagePath;
85         bool isImageAttached;
86 };
87
88 class SharePopup
89   : public Tizen::App::IAppControlEventListener
90   , public Tizen::Base::Runtime::ITimerEventListener
91   , public Tizen::Ui::Controls::IListViewItemEventListener
92   , public Tizen::Ui::Controls::IListViewItemProvider
93   , public Tizen::Ui::Controls::Popup
94   , public Tizen::Ui::IActionEventListener
95   , public Tizen::Ui::IPropagatedKeyEventListener
96   , public Tizen::App::IAppControlResponseListener
97
98   {
99   public:
100         /**
101          * @brief The Default Constructor
102          */
103         SharePopup(void);
104
105         /**
106          * @brief The Default Destructor
107          */
108         ~SharePopup(void);
109
110         /**
111          * @brief Initializes this SettingForm Form.
112          *
113          * @return              An error code
114          * @exception   true                            The method is succeIOrientationEventListenerssful.
115          * @exception   false                           An error Occured.
116          */
117         bool Initialize(void);
118
119         virtual result OnTerminating(void);
120
121         /**
122          * This function adds the share info object in the array list
123          *
124          * @return      An Error Code
125          * @param               An Object of ShareInfo.
126          */
127         result AddShareInfo(ShareInfo* pShareInfo);
128
129         void RemoveAllShareInfo();
130
131         //ITimerEventListener
132         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
133
134         //IActionEventListener
135         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
136
137         // IAppControlListener
138         void OnAppControlCompleted(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::Collection::IList* pResultList);
139
140         //IListViewItemProvider
141         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
142         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
143         virtual int GetItemCount(void);
144
145         // IListViewItemEventListener
146         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
147         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
148         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
149         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
150
151         /**
152          * This function displays the Notification
153          *
154          * @return      No return type.
155          * @param               none.
156          */
157         void StartMessageAppControl(void);
158
159         /**
160          * This function Starts the EmailApp Control
161          *
162          * @return      No return type.
163          * @param               none.
164          */
165         void StartEmailAppControl(void);
166
167         void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
168
169         //IPropagatedKeyEventListener
170         virtual bool    OnKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;}
171         virtual bool    OnKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
172         virtual bool    OnPreviewKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;}
173         virtual bool    OnPreviewKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo){return false;}
174
175   protected:
176         static const int IDA_CANCEL_BUTTON;
177         static const int ID_FORMAT_MESSAGE_STRING;
178         static const int ID_FORMAT_EMAIL_STRING;
179         static const int ID_FORMAT_FACEBOOK_STRING;
180         static const int ID_FORMAT_TWITTER_STRING;
181
182   private:
183         Tizen::Ui::Controls::ListView*  __pList;
184         Tizen::Base::Collection::ArrayList* __pShareList;
185         bool __appControlOngoing;
186         Tizen::Base::Runtime::Timer* __pTimer;
187   };
188
189 #endif /* INTSHAREPOPUP_H_ */