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