NABI_SE issues resolved
[apps/osp/MyFiles.git] / inc / MfSubBaseFileManageForm.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (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: MfSubBaseFileManageForm.h
19  *@brief: This file contains SubBaseFileManageForm class, which is responsible for
20  *Operations like copy, move, delete.
21  */
22
23 #ifndef _MF_SUB_BASE_FILE_MANAGE_FORM_H_
24 #define _MF_SUB_BASE_FILE_MANAGE_FORM_H_
25
26 #include <FGraphics.h>
27 #include <FShell.h>
28
29 #include "MfBaseForm.h"
30 #include "MfBaseItemProvider.h"
31 #include "MfContentListItem.h"
32 #include "MfCustomListViewForPopup.h"
33 #include "MfFolderEntryDetailPresentationModel.h"
34 #include "MfFolderEntryEditorPresentationModel.h"
35 #include "MfFolderEntryPresentationModel.h"
36 #include "MfFolderNavigationPresentationModel.h"
37 #include "MfIFileEventNotification.h"
38 #include "MfMediaMetaData.h"
39 #include "MfMyFilesApp.h"
40 #include "MfThumbnailManager.h"
41 #include "MfThumbnailItemProviderAndListener.h"
42 #include "MfTypes.h"
43 #include "MfUtility.h"
44
45 class SubBaseFileManageForm
46         : public BaseForm
47         , public Tizen::Io::IFileEventListener
48 /*      , public Tizen::Ui::Controls::IIconListViewItemEventListener
49         , public Tizen::Ui::Controls::IScrollEventListener*/
50 {
51 public:
52         //!This is the constructor for the class
53         /*!
54          * @fn SubBaseFileManageForm(void)
55          * @param Takes no parameters
56          * @return No value returned
57          */
58         SubBaseFileManageForm(void);
59
60         //!This is the Destructor for the class
61         /*!@fn  ~SubBaseFileManageForm(void)
62          * @param Takes no parameters
63          * @return No value returned
64          */
65         virtual ~SubBaseFileManageForm(void);
66
67 protected:
68         virtual void SubBaseOnActionPerformed(const Tizen::Ui::Control& source, int actionId);
69         virtual void SubBaseOnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
70         void SubBaseOnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView& iconListView, int index, Tizen::Ui::Controls::IconListViewItemStatus status);
71         void SubBaseOnNotificationReceived(Tizen::Base::Collection::ArrayList* pArgs);
72         void SubBaseOnThumbnailReceived(ThumbRequest* pThumbReq);
73         void OnAppControlCompleted(void);
74         void OnSettingValueChanged(void);
75         /*
76          * A private member function taking and returning no arguments.
77          * @fn CopyFile
78          * Used to copy the items selected in the Edit view
79          * @param An integer value
80          * @return Void return type
81          */
82         void CopyFile(void);
83
84         /*
85          * A private member function taking and returning no arguments.
86          * @fn CreateDeleteConfirmationPopUp()
87          * @brief Called OnContextItemStateChanged(), used to personalize the Delete Confirmation PopUp.
88          * @param No parameters taken.
89          * @return[result] An ErrorCode.
90          */
91         result CreateDeleteConfirmationPopUp(void);
92
93         /*
94          * A private member function which creates the FileProcessingPopUp
95          * @fn CreateFileProgressingPopup(void)
96          * @brief It creates the FileProcessingPopUp
97          * @param void
98          * @return result type
99          */
100         result CreateFileProgressingPopup(void);
101
102         /*
103          * A private member function taking and returning no arguments.
104          * @fn CreateFooterItems
105          * @brief Called during OnInitializing(), gets the form Footer, intializes FooterItems and
106          * adds them to the footer of the form.
107          * @param No parameters
108          * @return Void return type
109          */
110         void CreateFooterControls(void);
111
112         void RemoveFooter(void);
113         /*
114          * A private member function taking and returning no arguments.
115          * @fn CreateLabelControl
116          * Responsible for creating the label item in Edit form
117          * @param No parameters
118          * @return Void return type
119          */
120         void CreateLabelControl(void);
121         /*
122          * A private member function taking and returning no arguments.
123          * @fn CreateShareContextMenu()
124          * @brief Called OnInitializing(), used to personalize the Context Menu for Sharing files.
125          * @param No parameters taken.
126          * @return[result] An ErrorCode.
127          */
128         result CreateShareContextMenu(void);
129
130         /*
131          * A private member function taking and returning no arguments.
132          * @fn DeleteFile
133          * Used to delete the items selected in the Edit view
134          * @param An integer value
135          * @return Void return type
136          */
137         void DeleteFile(void);
138
139         /*
140          * A private member function which Hides the FileProcessingPopUp
141          * @fn HideFileProgressingPopup(void)
142          * @brief It HIdes the FileProcessingPopUp
143          * @param void
144          * @return void
145          */
146         void HideFileProgressingPopup(void);
147
148         /*
149          * A private member function taking and returning no arguments.
150          * @fn LoadRenameForm(int index)
151          * @brief Called OnActionPerformed on the ContextItem, initializes the Rename form.
152          * @param [int] index, of the element from where the context item was clicked.
153          * @return Void return type
154          */
155         void LoadRenameForm(int index);
156
157         /*
158          * A private member function taking and returning no arguments.
159          * @fn MoveFile()
160          * Used to move the items selected in the Edit view
161          * @param No Parameters Take.
162          * @return Void return type
163          */
164         void MoveFile(void);
165
166         /*
167          * A private member function taking and returning no arguments.
168          * @fn SetFooterVisibility
169          * Sets the Footer items in the footer
170          * @param No parameters
171          * @return Void return type
172          */
173         void SetFooterVisibility(int mode);
174
175         /*
176          * A private member function taking and returning no arguments.
177          * @fn ShareFile(ShareVia shareType)
178          * Used to move the items selected in the Edit view
179          * @param [int] ShareVia An enum value indicating the ShareType.
180          * @return Void return type
181          */
182         void ShareFile(ShareVia shareType);
183
184         /*
185          * A private member function which Show the FileProcessingPopUp
186          * @fn ShowFileProgressingPopup(void)
187          * @brief It Show the FileProcessingPopUp
188          * @param void
189          * @return void
190          */
191         void ShowFileProgressingPopup(void);
192
193         void SortArrayList(Tizen::Base::Collection::ArrayList* pArrList);
194
195         void ToggleFooter(void);
196
197         //IFileEventListener
198         virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String &  path, const unsigned int        eventId);
199
200 protected:
201         int _fileCount;
202         int _folderCount;
203
204         //ButtonPanel Controls
205         static const int IDA_BTN_DELETE = 101;
206         static const int IDA_BTN_SHARE = 102;
207         static const int IDA_BTN_MOVE = 103;
208         static const int IDA_BTN_COPY = 104;
209         static const int IDA_BTN_CANCEL = 105;
210         static const int IDA_BTN_CHECKED = 106;
211         static const int IDA_BTN_UNCHECKED = 107;
212         static const int IDA_BTN_SELECTED = 108;
213         static const int IDA_BTN_SHARE_MESSAGE = 109;
214         static const int IDA_BTN_SHARE_EMAIL = 110;
215         static const int IDA_BTN_SHARE_BLUETOOTH = 111;
216         static const int IDA_BTN_SHARE_WIFI_DIRECT = 112;
217         static const int IDA_BTN_MORE = 113;
218
219         static const int ID_ITEM_RENAME = 130;
220         static const int ID_ITEM_IMAGE = 107;
221
222         static const int IDA_BTN_POPUP_SHARE_CLOSE = 122;
223         static const int IDA_BTN_ANIMATION_POPUP_CANCEL = 136;
224
225         static const int IDA_CANCEL_DELETION = 203;
226         static const int IDA_DELETE_FILE = 204;
227
228         static FolderEntryPresentationModel* _pFolderEntryPM;
229
230         BaseItemProvider* _pBaseItemProvider;
231         CustomListViewForPopup* _pCustomListViewForPopup;
232         FolderEntryEditorPresentationModel* _pFileManager;
233         FolderEntryDetailPresentationModel _pMediaUtility;
234         MediaMetaData* _pMediaMetaData;
235         ThumbnailItemProviderAndListener* _pThumbnailItemProvider;
236         ThumbnailManager* _pThumbnailManager;
237
238         Tizen::Base::Collection::ArrayList* _pFilenames;
239         int _renameItemIndex;
240         int _viewType;
241         int _fileProcessedCount;
242         int _editOrShare;
243         Tizen::Base::String* _pStrItemSelectedCount;
244         Tizen::Base::String _currentDirectoryPath;
245         Tizen::Base::String _previousSceneId;
246         bool _isSelectAll;
247         Tizen::Ui::Controls::Button* _pCancelDeletion;
248         Tizen::Ui::Controls::Button* _pDeleteFile;
249         Tizen::Ui::Controls::Button* _pFileProgressingCancelButton;
250         Tizen::Ui::Controls::ButtonItem _pCheckButtonSelectAll;
251         Tizen::Ui::Controls::ButtonItem _pButtonItemMore;
252         Tizen::Ui::Controls::ContextMenu* _pShareContextMenu;
253         Tizen::Ui::Controls::ContextMenu* _pMoreContextMenu;
254         Tizen::Ui::Controls::Footer* _pFooter;
255         Tizen::Ui::Controls::FooterItem* _pDelete;
256         Tizen::Ui::Controls::FooterItem* _pShare;
257         Tizen::Ui::Controls::IconListView* _pEditIconListView;
258         Tizen::Ui::Controls::Label* _pFileProgressingLabel;
259         Tizen::Ui::Controls::Label* _pFileProgressingHeaderLabel;
260         Tizen::Ui::Controls::Label* _pLabelNumberOfItems;
261         Tizen::Ui::Controls::ListView* _pEditListView;
262         Tizen::Ui::Controls::ListContextItem* _pItemContext;
263         Tizen::Ui::Controls::Popup* _pDeleteConfirmationPopUp;
264         Tizen::Ui::Controls::Popup* _pFileProgressingPopup;
265         Tizen::Ui::Controls::Progress* _pAnimationProgress;
266         Tizen::Io::FileEventManager* _pFileEventManager;
267 };
268
269 #endif //_MF_FILE_MANAGE_FORM_H_