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