Merge "Add package signature files generation code in spec file" into tizen_2.2
[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 public:
36         /**
37          * @brief               The Default constructor
38          */
39         ShareInfo(void);
40
41         /**
42          * @brief               The Default destructor
43          */
44         ~ShareInfo(void);
45
46         /**
47          * @brief               The method used to get the Page title
48          * @param[in]   void
49          * @return              String          The Page title
50          */
51         Tizen::Base::String GetPageTitle(void);
52
53         /**
54          * @brief               The method used to get the Page URL
55          * @param[in]   void
56          * @return              String          The Page URL
57          */
58         Tizen::Base::String GetPageURL(void);
59
60         /**
61          * @brief               The method used to set the Page title
62          * @param[in]   aPageTitle
63          */
64         void SetPageTitle(Tizen::Base::String aPageTitle);
65
66         /**
67          * @brief               The method used to set the Page URL
68          * @param[in]   aPageURL
69          */
70         void SetPageUrl(Tizen::Base::String aPageURL);
71
72         void SetImageAttached(bool imageAttached);
73
74         bool GetImageAttached();
75
76         void SetImagePath(Tizen::Base::String aImagePath);
77
78         Tizen::Base::String GetImagePath(void);
79
80 private:
81         Tizen::Base::String __pageTitle;
82         Tizen::Base::String __pageURL;
83         Tizen::Base::String __imagePath;
84         bool isImageAttached;
85 };
86
87 class SharePopup
88   : public Tizen::App::IAppControlEventListener
89   , public Tizen::Base::Runtime::ITimerEventListener
90   , public Tizen::Ui::Controls::IListViewItemEventListener
91   , public Tizen::Ui::Controls::IListViewItemProvider
92   , public Tizen::Ui::Controls::Popup
93   , public Tizen::Ui::IActionEventListener
94   , public Tizen::App::IAppControlResponseListener
95   {
96   public:
97         /**
98          * @brief The Default Constructor
99          */
100         SharePopup(void);
101
102         /**
103          * @brief The Default Destructor
104          */
105         ~SharePopup(void);
106
107         /**
108          * @brief Initializes this SettingForm Form.
109          *
110          * @return              An error code
111          * @exception   true                            The method is succeIOrientationEventListenerssful.
112          * @exception   false                           An error Occured.
113          */
114         bool Initialize(void);
115
116         virtual result OnTerminating(void);
117
118         /**
119          * This function adds the share info object in the array list
120          *
121          * @return      An Error Code
122          * @param               An Object of ShareInfo.
123          */
124         result AddShareInfo(ShareInfo* pShareInfo);
125
126         void RemoveAllShareInfo();
127
128         //ITimerEventListener
129         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
130
131         //IActionEventListener
132         virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
133
134         // IAppControlListener
135         void OnAppControlCompleted(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId, const Tizen::Base::Collection::IList* pResultList);
136
137         //IListViewItemProvider
138         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
139         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);
140         virtual int GetItemCount(void);
141
142         // IListViewItemEventListener
143         virtual void OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state);
144         virtual void OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
145         virtual void OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction);
146         virtual void OnListViewItemLongPressed(Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool& invokeListViewItemCallback);
147
148         /**
149          * This function displays the Notification
150          *
151          * @return      No return type.
152          * @param               none.
153          */
154         void StartMessageAppControl(void);
155
156         /**
157          * This function Starts the EmailApp Control
158          *
159          * @return      No return type.
160          * @param               none.
161          */
162         void StartEmailAppControl(void);
163
164         void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
165
166   protected:
167         static const int IDA_CANCEL_BUTTON;
168         static const int ID_FORMAT_MESSAGE_STRING;
169         static const int ID_FORMAT_EMAIL_STRING;
170         static const int ID_FORMAT_FACEBOOK_STRING;
171         static const int ID_FORMAT_TWITTER_STRING;
172
173   private:
174         Tizen::Ui::Controls::ListView*  __pList;
175         Tizen::Base::Collection::ArrayList* __pShareList;
176         bool __appControlOngoing;
177         Tizen::Base::Runtime::Timer* __pTimer;
178   };
179
180 #endif /* INTSHAREPOPUP_H_ */