|
1 /* |
|
2 * Copyright (c) 2008 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: File sharing dialog class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef UPNPAPPFILESHARINGDIALOG_H |
|
24 #define UPNPAPPFILESHARINGDIALOG_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <AknDialog.h> // base class |
|
28 #include "upnpfilesharingengineobserver.h" // base class |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CUPnPFileSharingEngine; |
|
32 class CEikMenuPane; |
|
33 class CUPnPAppFileSharingList; |
|
34 class CAknTitlePane; |
|
35 class CEikStatusPane; |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * File Sharing dialog class. |
|
41 * Declares file sharing dialog |
|
42 * @since S60 3.1 |
|
43 */ |
|
44 class CUPnPAppFileSharingDialog |
|
45 : public CAknDialog |
|
46 , private MUPnPFileSharingEngineObserver |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 IMPORT_C static CUPnPAppFileSharingDialog* NewL( |
|
54 TInt aMenuResource, |
|
55 CUPnPFileSharingEngine& aEng ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CUPnPAppFileSharingDialog(); |
|
61 |
|
62 public: // Services |
|
63 |
|
64 /** |
|
65 * Executes the dialog. |
|
66 */ |
|
67 IMPORT_C TInt ExecuteSharingDialogLD(); |
|
68 |
|
69 /** |
|
70 * Get the pointer of iFileSharingList and update list |
|
71 */ |
|
72 IMPORT_C void UpdateFileSharingListL() ; |
|
73 |
|
74 protected: // Functions from base classes |
|
75 |
|
76 /** |
|
77 * From CAknDialog, handles menu commands |
|
78 * @since S60 3.1 |
|
79 * @param aCommandId, command to be handled |
|
80 */ |
|
81 void ProcessCommandL( TInt aCommandId ); |
|
82 |
|
83 /** |
|
84 * From CAknDialog, handles key events. |
|
85 * @since S60 3.1 |
|
86 * @param aKeyEvent, Event to handled. |
|
87 * @param aType, Type of the key event. |
|
88 * @return TKeyResponse, response code |
|
89 * (EKeyWasConsumed, EKeyWasNotConsumed). |
|
90 */ |
|
91 TKeyResponse OfferKeyEventL( const TKeyEvent &aKeyEvent, |
|
92 TEventCode aType ); |
|
93 |
|
94 /** |
|
95 * From CoeControl |
|
96 * @since S60 3.1 |
|
97 * @param aContext, context of desired help |
|
98 */ |
|
99 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
100 |
|
101 protected: // for own use |
|
102 |
|
103 /** |
|
104 * Opens album selection dialog and starts sharing |
|
105 * @since S60 3.1 |
|
106 */ |
|
107 void RunMultiselectionDialogL(); |
|
108 |
|
109 private: //From MUPnPFileSharingEngineObserver |
|
110 /** |
|
111 * Function informs when file sharing was enabled or disabled |
|
112 * @since S60 3.1 |
|
113 * @param aEngine File sharing engine |
|
114 * @param aError, error code |
|
115 * @param aPhase ETrue if current phase is sharing activation, |
|
116 * otherwise EFalse |
|
117 */ |
|
118 void HandleSharingStatus( |
|
119 CUPnPFileSharingEngine& aEngine, |
|
120 TInt aError, |
|
121 TBool aPhase ); |
|
122 |
|
123 /** |
|
124 * Informs about status of the sharing progress |
|
125 * @since S60 3.1 |
|
126 * @param aEngine File sharing engine |
|
127 * @param aProgress Data information about sharing progress |
|
128 */ |
|
129 void HandleSharingProgress( |
|
130 CUPnPFileSharingEngine& aEngine, |
|
131 const RArray<TUpnpProgressInfo>& aProgress ); |
|
132 |
|
133 /** |
|
134 * Function informs when file sharing is done |
|
135 * @param aEngine File sharing engine |
|
136 * @param aError, error code |
|
137 */ |
|
138 void HandleSharingDone( |
|
139 CUPnPFileSharingEngine& aEngine, TInt aError ); |
|
140 |
|
141 /** |
|
142 * Callback to inform if connection has been lost |
|
143 * @since S60 3.1 |
|
144 * @param aEngine File sharing engine |
|
145 */ |
|
146 void HandleSharingConnectionLost( |
|
147 CUPnPFileSharingEngine& aEngine ); |
|
148 |
|
149 protected: // Functions from base classes |
|
150 |
|
151 /** |
|
152 * From CAknDialog, This is called in CAknDialog::ExecuteLD() |
|
153 * before a form is drawn. |
|
154 * @since S60 3.1 |
|
155 */ |
|
156 void PreLayoutDynInitL(); |
|
157 |
|
158 /** |
|
159 * From CAknDialog : This is called by the dialog framework |
|
160 * when softkey is pressed, returns true if the |
|
161 * @since S60 3.1 |
|
162 * @param aButtonId, ID of the pressed button |
|
163 * @return TBool, returns ETrue if ready to close dialog, |
|
164 * EFalse otherwise. |
|
165 */ |
|
166 TBool OkToExitL( TInt aButtonId ); |
|
167 |
|
168 /** |
|
169 * From MEikMenuObserver |
|
170 * @since S60 3.1 |
|
171 */ |
|
172 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
173 |
|
174 private: |
|
175 |
|
176 /** |
|
177 * By default Symbian 2nd phase constructor is private. |
|
178 * @since S60 3.1 |
|
179 * @param aMenuResource, menu resource of the dialog |
|
180 */ |
|
181 void ConstructL(TInt aMenuResource); |
|
182 |
|
183 /** |
|
184 * Creates custom control |
|
185 */ |
|
186 SEikControlInfo CreateCustomControlL(TInt aControlType); |
|
187 |
|
188 /** |
|
189 * Display information note after starting sharing |
|
190 * @since S60 3.1 |
|
191 * @param aMessageResourceId Resource id for message text |
|
192 * @param aDialogResourceId Resource id for the dialog |
|
193 */ |
|
194 void DisplayInfoL( TInt aHeaderResourceId, |
|
195 TInt aMessageResourceId, |
|
196 TInt aDialogResourceId ); |
|
197 /** |
|
198 * Default constructor |
|
199 */ |
|
200 CUPnPAppFileSharingDialog( CUPnPFileSharingEngine& aEng ); |
|
201 |
|
202 private: // Data |
|
203 |
|
204 // File sharing engine pointer |
|
205 CUPnPFileSharingEngine& iFileSharingEngine; //not owned |
|
206 |
|
207 // Pointer to file sharing list for dialog data |
|
208 CUPnPAppFileSharingList* iFileSharingList; //owned |
|
209 // pointer to title pane |
|
210 CAknTitlePane* iTitlePane; // not owned |
|
211 // pointer to status pane |
|
212 CEikStatusPane* iStatusPane; // not owned |
|
213 |
|
214 // UI environment |
|
215 CEikonEnv* iCoeEnv; //not owned |
|
216 // offset in resource file |
|
217 TInt iResFileOffset; |
|
218 /** |
|
219 *Flag to keep in mind has FeatureManager been initialized or not |
|
220 */ |
|
221 TBool iFeatureManagerInitialized; |
|
222 |
|
223 }; |
|
224 |
|
225 #endif // UPNPAPPFILESHARINGDIALOG_H |
|
226 |
|
227 // End of File |