NABI_SE issues resolved
[apps/osp/MyFiles.git] / inc / MfSubBaseSelectionForm.h
1 //\r
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
3 //\r
4 // Licensed under the Flora License, Version 1.1 (the License);\r
5 // you may not use this file except in compliance with the License.\r
6 // You may obtain a copy of the License at\r
7 //\r
8 //     http://floralicense.org/license/\r
9 //\r
10 // Unless required by applicable law or agreed to in writing, software\r
11 // distributed under the License is distributed on an AS IS BASIS,\r
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13 // See the License for the specific language governing permissions and\r
14 // limitations under the License.\r
15 //\r
16 \r
17 /**\r
18  * @file: MfSubBaseSelectionForm.h\r
19  * @brief: This file contains declaration of SubBaseSelection class, which acts as a view for traversing SubDirectories\r
20  * in the AppControl.\r
21  */\r
22 \r
23 #ifndef _MF_SUB_BASE_SELECTION_FORM\r
24 #define _MF_SUB_BASE_SELECTION_FORM\r
25 \r
26 #include <FMedia.h>\r
27 #include <FTelephony.h>\r
28 \r
29 #include "MfBaseForm.h"\r
30 #include "MfContentListItem.h"\r
31 #include "MfFolderEntryEditorPresentationModel.h"\r
32 \r
33 class SubBaseSelection\r
34         : public BaseForm\r
35         , public Tizen::Media::IPlayerEventListener\r
36         , public Tizen::Telephony::ITelephonyCallEventListener\r
37 {\r
38 public:\r
39         //! Constructor of the class.\r
40         /*!@fn SubBaseSelection()\r
41          * @brief A protected member taking no arguments which initializes the member variables of the class.\r
42          * @param Takes no parameters\r
43          * @return No value returned */\r
44         SubBaseSelection(void);\r
45 \r
46         //! Destructor of the class.\r
47         /*!@fn ~SubBaseSelection()\r
48          * @brief A protected virtual member taking no arguments, frees the memory allocated to the member variables.\r
49          * @param Takes no parameters\r
50          * @return No value returned\r
51          * */\r
52         ~SubBaseSelection(void);\r
53 \r
54         /*\r
55          * A public member function taking index and width as argument and returning a ContentListItem\r
56          * @fn CreateDefaultContentItem\r
57          * @brief Used to create the Custom Item in the listview when normal view is selected. This function creates CustomItem for import view\r
58          * @param int, int\r
59          * @return ContentListItem\r
60          */\r
61         ContentListItem* CreateDefaultContentItem(int index, int itemWidth);\r
62 \r
63         ContentListItem* CreateExportListViewItem(int listItemIndex, int listItemWidth);\r
64 \r
65         //IPlayerEventListener\r
66         virtual void OnPlayerOpened(result r);\r
67         virtual void OnPlayerEndOfClip(void);\r
68         virtual void OnPlayerBuffering(int percent);\r
69         virtual void OnPlayerErrorOccurred(Tizen::Media::PlayerErrorReason r);\r
70         virtual void OnPlayerInterrupted(void);\r
71         virtual void OnPlayerReleased(void);\r
72         virtual void OnPlayerSeekCompleted(result r);\r
73         virtual void OnPlayerAudioFocusChanged (void);\r
74 \r
75         virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);\r
76 \r
77         //ITelephonyCallEventListener\r
78         virtual void OnTelephonyCallStatusChangedN(Tizen::Telephony::CallStatus callStatus, Tizen::Telephony::CallInfo * pCallInfo);\r
79 \r
80         //IListViewItemProvider\r
81         virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);\r
82         virtual bool DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth);\r
83         virtual int GetItemCount(void);\r
84 \r
85         /*! A public virtual member function of IListViewStateChangeListener returning no arguments.\r
86          * @fn OnListViewItemStateChangedNotify(ViewType viewType)\r
87          * @brief Notifies the form if the view type is changed by the User and accordingly updates the lists.\r
88          * @param [ViewType] viewType, the enum indicating the selected view type: List, List and Details or Thumbnails.\r
89          * @return No Return Values.\r
90          */\r
91         virtual void OnListViewItemStateChangedNotify(ViewType viewType);\r
92 \r
93         /*! A public virtual member function of IListViewStateChangeListener returning a pointer to the FileListPresentationModel.\r
94          * @fn  OnThumbnailReceived(ThumbRequest* pThumbReq)\r
95          * @brief Used to refresh the image of the listitem from the default image to the generated thumbnail.\r
96          * @param [ThumbRequest] pThumbReq, the structure containing the thumbnail corresponding to a filepath.\r
97          * @return [FileListPresentationModel*] A pointer to the filelistpresentation model.\r
98          */\r
99         virtual void OnThumbnailReceived(ThumbRequest* pThumbReq);\r
100 \r
101         virtual void OnSettingValueChanged(void);\r
102 protected:\r
103         /*\r
104          * A private member function taking no argument and returning a result\r
105          * @fn CreateLabelControl\r
106          * @brief  Creates the display path label and number of file selected count label\r
107          * @param No parameters.\r
108          * @return result\r
109          */\r
110         result CreateLabelControl(void);\r
111 \r
112         /*\r
113          * A private member function taking no arguments and returning a result\r
114          * @fn InitializeAppRegistry\r
115          * @brief  Called within ShowParentDirectoryView() to change the path displayed on the display label.\r
116          * @param No parameters.\r
117          * @return result\r
118          */\r
119         result InitializeAppRegistry(void);\r
120 \r
121         /*\r
122          * A private which takes no arguments and returns nothing\r
123          * @fn InitializePlayer\r
124          * @brief Used to initialize the audio player when any audio file is opened\r
125          * @param void\r
126          * @return no return value\r
127          */\r
128         void InitializePlayer(void);\r
129 \r
130         /*\r
131          * A private member function taking mediaFilepath and PlayerCurrentState as argument and returning nothing\r
132          * @fn LoadMusicPlayer\r
133          * @brief used to load the music player for play, pause and stop of audio files\r
134          * @param String, PlayerState\r
135          * @return no return value\r
136          */\r
137         void LoadMusicPlayer(const Tizen::Base::String& mediaFilepath, Tizen::Media::PlayerState PlayerCurrentState);\r
138 \r
139         /*\r
140          * A private member function taking a string as parameter and returning an error code.\r
141          * @fn SubBaseOnActionPerformed(const Tizen::Ui::Control& source, int actionId).\r
142          * @brief Used to handle the common cases of the ActionPerformed of both forms.\r
143          * @param[Control, int] source, of the Event Trigger, actionId, associated with the control.\r
144          * @return An ErrorCode.\r
145          */\r
146         void SubBaseOnActionPerformed(const Tizen::Ui::Control& source, int actionId);\r
147 \r
148         // Copy Constructor of the class.\r
149         /*@fn SubBaseSelection(const SubBaseSelection&)\r
150          * @brief Copy Constructor\r
151          * @param Takes Reference of the class\r
152          * @return No value returned\r
153          * */\r
154         SubBaseSelection(const SubBaseSelection&);\r
155 \r
156         // Assignment operator of the class.\r
157         /*@fn SubBaseSelection& operator = (const SubBaseSelection& pSubBaseSelection)\r
158          * @brief Assignment operator of the class.\r
159          * @param Takes Reference of the class\r
160          * @return No value returned\r
161          * */\r
162         SubBaseSelection& operator =(const SubBaseSelection& pSubBaseSelection);\r
163 \r
164         void ClearSelectedItems(Tizen::Ui::Controls::ListView& listView);\r
165         void ResetFooter(void);\r
166 \r
167         /*\r
168          * A private member function taking and returning no arguments.\r
169          * @fn ShowHomeView\r
170          * @brief Called during OnActionPerformed() on Home HeaderItem, m__pHomeHeaderItem, refreshes the view to the Root Media Directory\r
171          * from anywhere within the form.\r
172          * @param No parameters\r
173          * @return Void return type\r
174          */\r
175         void ShowHomeView(void);\r
176 \r
177 protected:\r
178         static const int IDA_BTN_ATTACH = 202;\r
179         static const int IDA_BTN_CANCEL = 203;\r
180         static const int IDA_BTN_IMPORT = 204;\r
181         static const int IDA_BTN_EXPORT = 205;\r
182         static const int IDA_BTN_CREATE_FOLDER = 206;\r
183         static const int IDA_BTN_MORE = 207;\r
184 \r
185         static const int IDS_ITEM_TITLE_STRING = 106;\r
186         static const int ID_ITEM_IMAGE = 107;\r
187 \r
188         int _currentAudioPlayIndex;\r
189         int _previousAudioSelected;\r
190         int _storePreviousIndex;\r
191 \r
192         AnnexStyle _annexStyle;\r
193         AppControlView _currentViewStyle;\r
194         FileType _currentFileType;\r
195         ExportFileType _currentExportFileType;\r
196         MemoryType _storageType;\r
197         SelectionMode _selectionMode;\r
198         SortByType _storedSortStyle;\r
199 \r
200         Tizen::Base::Collection::ArrayList* _pFilenames;\r
201         Tizen::Base::String _itemSelectedCount;\r
202         Tizen::Base::String _rootMediaPath;\r
203         Tizen::Base::String _rootStoragePath;\r
204 \r
205         Tizen::Ui::Controls::Footer* _pFooter;\r
206         Tizen::Ui::Controls::FooterItem* _pAttach;\r
207         //Tizen::Ui::Controls::FooterItem* _pCancel;\r
208         Tizen::Ui::Controls::FooterItem* _pCreateFolder;\r
209         Tizen::Ui::Controls::FooterItem* _pExport;\r
210         Tizen::Ui::Controls::FooterItem* _pImport;\r
211 \r
212         Tizen::Ui::Controls::Header* _pHeader;\r
213 \r
214         Tizen::Ui::Controls::Label* _pLabelNumberOfItems;\r
215         Tizen::Ui::Controls::ListAnnexStyle _listAnnexStyle;\r
216         Tizen::Ui::Controls::ListView* _pListView;\r
217 \r
218 \r
219         Tizen::Graphics::Bitmap* _pAudioPause;\r
220         Tizen::Graphics::Bitmap* _pAudioPlay;\r
221         Tizen::Graphics::Bitmap* _pAudioPlayPressed;\r
222         Tizen::Graphics::Bitmap* _pDummyImage;\r
223         Tizen::Graphics::Bitmap* _pFolderBitmap;\r
224 \r
225         Tizen::Media::Player* _pAudioPlayer;\r
226 \r
227         FolderEntryEditorPresentationModel* _pFileManager;\r
228         FolderEntryPresentationModel* _pFolderEntryPM;\r
229         ThumbnailManager* _pThumbnailManager;\r
230         Tizen::Graphics::Rectangle _defaultListViewBounds;\r
231 \r
232          Tizen::Telephony::CallManager* _pCallManager;\r
233 };\r
234 \r
235 #endif\r