|
1 /* |
|
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Header class for fetcher application plugin |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef GLXFETCHER_H_ |
|
22 #define GLXFETCHER_H_ |
|
23 |
|
24 |
|
25 // INCLUDES |
|
26 #include <badesca.h> |
|
27 #include <mediafetchimplementation.h> |
|
28 #include <MMGFetchCanceler.h> // MMGFetchCanceler |
|
29 |
|
30 #include <glxfilterfactory.h> // CMPXFilter |
|
31 |
|
32 // CLASS FWD DECLARATION |
|
33 class CGlxFetcherDialog; |
|
34 // CLASS DECLARATION |
|
35 NONSHARABLE_CLASS( CGlxFetcher ) : public CMediaFetchImplementation, |
|
36 public MMGFetchCanceler |
|
37 |
|
38 { |
|
39 public: //constructor and desctructor |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * |
|
43 * @since 3.2 |
|
44 * @return Pointer to newly created object. |
|
45 */ |
|
46 static CGlxFetcher* NewL(); |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 virtual ~CGlxFetcher(); |
|
52 |
|
53 protected: // from CMediaFetchImplementation |
|
54 /** |
|
55 * By default fetcher is single selection fetcher. |
|
56 * If multi-selection is enabled then plug-in should display a |
|
57 * multi-selection fetcher and allow user to select several items. |
|
58 * @param aMultiSelect if ETrue then multiselection fetcher is enabled |
|
59 */ |
|
60 void SetMultiSelectionL( TBool aMultiSelect ); |
|
61 |
|
62 /** |
|
63 * Not in requirement |
|
64 * @param aMimeTypes plug-in should show only files with given Mime types |
|
65 */ |
|
66 void SetMimeTypesL( const MDesCArray& aMimeTypes ); |
|
67 |
|
68 /** |
|
69 * Plug-in should use given text as selection key (SK1) label |
|
70 * @param aSelectionSoftkey Custom selection softkey label |
|
71 */ |
|
72 void SetSelectionSoftkeyL( const TDesC& aSelectionSoftkey ); |
|
73 |
|
74 /** |
|
75 * Plug-in should use given text as heading |
|
76 * @param aTitle Custom title text for fetcher |
|
77 */ |
|
78 void SetHeadingL( const TDesC& aTitle ); |
|
79 |
|
80 /** |
|
81 * Plug-in should call this interface before selection is done. |
|
82 * if MMGFetchVerifier::VerifySelectionL() returns ETrue |
|
83 * then the user's selection should be accepted and the fetcher |
|
84 * closed. If EFalse is returned then user should change the current |
|
85 * selection before it can be accepted and the fetcher closed. |
|
86 * @param aVerifier See MMGFetchVerifier.h |
|
87 */ |
|
88 void SetVerifierL( MMGFetchVerifier& aVerifier ); |
|
89 |
|
90 /** |
|
91 * Plug-in should return canceler interface. |
|
92 * @param aCanceler See MMGFetchCanceler.h |
|
93 */ |
|
94 void GetCancelerL( MMGFetchCanceler*& aCanceler ); |
|
95 |
|
96 /** |
|
97 * Plug-in should launch fetcher popup for given media type. |
|
98 * @param aSelectedFiles plug-in appends selected files to this array |
|
99 * @param aMediaType plug-in should display only files with this media type |
|
100 * return ETrue if user selected file(s), EFalse if use cancelled. |
|
101 */ |
|
102 TBool LaunchL( CDesCArray& aSelectedFiles, TMediaFileType aMediaType ); |
|
103 |
|
104 |
|
105 private : //constructor and desctructor |
|
106 /** |
|
107 * C++ default constructor. |
|
108 */ |
|
109 CGlxFetcher(); |
|
110 |
|
111 /** |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 */ |
|
114 void ConstructL(); |
|
115 |
|
116 /** @return view title when fetcher is opened for selecting images */ |
|
117 HBufC* TitleForImageFetcherL() const; |
|
118 |
|
119 /** @return view title when fetcher is opened for selecting videos */ |
|
120 HBufC* TitleForVideoFetcherL() const; |
|
121 |
|
122 /** |
|
123 * @param aSingleSelectionTitleResourceId Resource id for view title when |
|
124 * single selection is active |
|
125 * @param aMultiSelectionTitleResourceId Resource id for view title when |
|
126 * multiselection is active |
|
127 * @return view title depending whether fetcher is in multiselection or |
|
128 * single selection mode, and whether client has defined the title |
|
129 */ |
|
130 HBufC* TitleL( TInt aSingleSelectionTitleResourceId, |
|
131 TInt aMultiSelectionTitleResourceId ) const; |
|
132 |
|
133 // From MMgFetchCanceler |
|
134 void CancelFetcherL(); |
|
135 |
|
136 private: |
|
137 /// Resource offset |
|
138 TInt iResourceOffset; |
|
139 |
|
140 /// media type |
|
141 TMediaFileType iMediaType; |
|
142 |
|
143 /// Is multiselection active or not |
|
144 /// ETrue multiselection |
|
145 /// EFalse single selection |
|
146 TBool iIsMultiSelection; |
|
147 |
|
148 /** |
|
149 * Left softkey label |
|
150 * Own. |
|
151 */ |
|
152 HBufC* iSelectionSoftkey; |
|
153 |
|
154 /** |
|
155 * Popup heading text |
|
156 * Own. |
|
157 */ |
|
158 HBufC* iTitle; |
|
159 |
|
160 /** |
|
161 * Verifier |
|
162 */ |
|
163 MMGFetchVerifier* iVerifier; |
|
164 |
|
165 TGlxFilterItemType iFilterType; |
|
166 |
|
167 /** |
|
168 * Fetcher dialog |
|
169 */ |
|
170 CGlxFetcherDialog* iDialog; |
|
171 }; |
|
172 |
|
173 #endif //GLXFETCHER_H_ |