2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
\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
8 // http://floralicense.org/license/
\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
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
23 #ifndef _MF_SUB_BASE_SELECTION_FORM
\r
24 #define _MF_SUB_BASE_SELECTION_FORM
\r
27 #include <FTelephony.h>
\r
29 #include "MfBaseForm.h"
\r
30 #include "MfContentListItem.h"
\r
31 #include "MfFolderEntryEditorPresentationModel.h"
\r
33 class SubBaseSelection
\r
35 , public Tizen::Media::IPlayerEventListener
\r
36 , public Tizen::Telephony::ITelephonyCallEventListener
\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
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
52 ~SubBaseSelection(void);
\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
59 * @return ContentListItem
\r
61 ContentListItem* CreateDefaultContentItem(int index, int itemWidth);
\r
63 ContentListItem* CreateExportListViewItem(int listItemIndex, int listItemWidth);
\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
75 virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
\r
77 //ITelephonyCallEventListener
\r
78 virtual void OnTelephonyCallStatusChangedN(Tizen::Telephony::CallStatus callStatus, Tizen::Telephony::CallInfo * pCallInfo);
\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
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
91 virtual void OnListViewItemStateChangedNotify(ViewType viewType);
\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
99 virtual void OnThumbnailReceived(ThumbRequest* pThumbReq);
\r
101 virtual void OnSettingValueChanged(void);
\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
110 result CreateLabelControl(void);
\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
119 result InitializeAppRegistry(void);
\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
126 * @return no return value
\r
128 void InitializePlayer(void);
\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
137 void LoadMusicPlayer(const Tizen::Base::String& mediaFilepath, Tizen::Media::PlayerState PlayerCurrentState);
\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
146 void SubBaseOnActionPerformed(const Tizen::Ui::Control& source, int actionId);
\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
154 SubBaseSelection(const SubBaseSelection&);
\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
162 SubBaseSelection& operator =(const SubBaseSelection& pSubBaseSelection);
\r
164 void ClearSelectedItems(Tizen::Ui::Controls::ListView& listView);
\r
165 void ResetFooter(void);
\r
168 * A private member function taking and returning no arguments.
\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
175 void ShowHomeView(void);
\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
185 static const int IDS_ITEM_TITLE_STRING = 106;
\r
186 static const int ID_ITEM_IMAGE = 107;
\r
188 int _currentAudioPlayIndex;
\r
189 int _previousAudioSelected;
\r
190 int _storePreviousIndex;
\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
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
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
212 Tizen::Ui::Controls::Header* _pHeader;
\r
214 Tizen::Ui::Controls::Label* _pLabelNumberOfItems;
\r
215 Tizen::Ui::Controls::ListAnnexStyle _listAnnexStyle;
\r
216 Tizen::Ui::Controls::ListView* _pListView;
\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
225 Tizen::Media::Player* _pAudioPlayer;
\r
227 FolderEntryEditorPresentationModel* _pFileManager;
\r
228 FolderEntryPresentationModel* _pFolderEntryPM;
\r
229 ThumbnailManager* _pThumbnailManager;
\r
230 Tizen::Graphics::Rectangle _defaultListViewBounds;
\r
232 Tizen::Telephony::CallManager* _pCallManager;
\r