|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef COBEXUTILSUILAYER_H |
|
20 #define COBEXUTILSUILAYER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <msvapi.h> |
|
25 #include <data_caging_path_literals.hrh> |
|
26 #include <AknsUtils.h> |
|
27 #include <eikdialg.h> |
|
28 #include <obexutils.rsg> |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 const TUid KUidMsgTypeBt = {0x10009ED5}; |
|
33 const TInt KObexUtilsMaxChar = 80; |
|
34 const TInt KObexUtilsMaxCharToFromField = 256; |
|
35 |
|
36 // Literals for resource location (drive, directory, file) |
|
37 _LIT( KObexUtilsFileDrive, "z:"); |
|
38 _LIT( KObexUtilsResourceFileName, "obexutils.rsc" ); |
|
39 |
|
40 // Icon file |
|
41 _LIT( KCommonUiBitmapFile, "MUIU.MBM" ); |
|
42 |
|
43 // Cover display |
|
44 const TInt KEnumStart = 1; // start of enumerations; start after ECmdNone |
|
45 const TInt KResourceNumberMask = 0x00000FFF; |
|
46 const TInt KFirstResourceOffset = (R_IR_CONNECTING & KResourceNumberMask); |
|
47 |
|
48 class CMsvOperation; |
|
49 |
|
50 // DATA TYPES |
|
51 |
|
52 enum TContextMedia |
|
53 { |
|
54 EBluetooth, |
|
55 EInfrared |
|
56 }; |
|
57 |
|
58 // CLASS DECLARATION |
|
59 |
|
60 /** |
|
61 * Utility methods for UI related functionality. |
|
62 * |
|
63 */ |
|
64 NONSHARABLE_CLASS( TObexUtilsUiLayer ) |
|
65 { |
|
66 public: // New functions |
|
67 |
|
68 typedef CArrayPtr<CFbsBitmap> CBitmapArray; |
|
69 |
|
70 /** |
|
71 * Launches an editor application for the given message. |
|
72 * @param aMessage The message to be launched in an application. |
|
73 * @param aSession A message server session. |
|
74 * @param aObserverRequestStatus Request status of the observer. |
|
75 * @return MSV operation |
|
76 */ |
|
77 IMPORT_C static CMsvOperation* LaunchEditorApplicationOperationL( |
|
78 CMsvSession& aMsvSession, |
|
79 CMsvEntry* aMessage, |
|
80 TRequestStatus& aObserverRequestStatus ); |
|
81 |
|
82 /** |
|
83 * Launches an editor application for the given message. |
|
84 * @param aMessage The message to be launched in an application. |
|
85 * @param aSession A message server session. |
|
86 * @return Symbian OS errorcode. |
|
87 */ |
|
88 IMPORT_C static TInt LaunchEditorApplicationL( CMsvEntry* aMessage, |
|
89 CMsvSession& aSession ); |
|
90 |
|
91 /** |
|
92 * LaunchFileManager by specific path and sort method |
|
93 * @Since S60 v5.0 |
|
94 * @param aPath The directory where file manager should open |
|
95 * @param aSortMethod sort method to sort the files in aPath |
|
96 * @param isEmbeddedMode indicates start mode for file manager or standalone mode |
|
97 * @return None |
|
98 */ |
|
99 IMPORT_C static void LaunchFileManagerL( TDesC& aPath, TInt aSortMethod, TBool isEmbeddedMode); |
|
100 |
|
101 |
|
102 /** |
|
103 * Open the file by Launching the suitable S60 application |
|
104 * @Since S60 v5.0 |
|
105 * @return None |
|
106 */ |
|
107 IMPORT_C static void LaunchEditorApplicationL (TMsvId& aMsvIdParent); |
|
108 |
|
109 /** |
|
110 * Shows an error note. |
|
111 * @param aResourceID A resource id for the note. |
|
112 * @return None. |
|
113 */ |
|
114 IMPORT_C static void ShowErrorNoteL( const TInt& aResourceID ); |
|
115 |
|
116 /** |
|
117 * Shows an information note. |
|
118 * @param aResourceID A resource id for the note. |
|
119 * @return None. |
|
120 */ |
|
121 IMPORT_C static void ShowInformationNoteL( const TInt& aResourceID ); |
|
122 |
|
123 /** |
|
124 * Reads contents of a resource into a buffer. |
|
125 * @parma aBuf The buffer. |
|
126 * @param aResourceID The id of the resource |
|
127 * @return None. |
|
128 */ |
|
129 IMPORT_C static void ReadResourceL( TDes& aBuf, |
|
130 const TInt& aResourceID ); |
|
131 |
|
132 /** |
|
133 * Shows an global information note. |
|
134 * @param aResourceID A resource id for the note. |
|
135 * @return None. |
|
136 */ |
|
137 IMPORT_C static void ShowGlobalConfirmationQueryL( const TInt& aResourceID ); |
|
138 |
|
139 /** |
|
140 * Show global conformation query without animations or tones. |
|
141 * @Since S60 5.0 |
|
142 * @aResourceID aREsourceID for loc string |
|
143 * @return TBool |
|
144 */ |
|
145 IMPORT_C static TBool ShowGlobalConfirmationQueryPlainL( const TInt& aResourceID); |
|
146 |
|
147 /** |
|
148 * Show global conformation query |
|
149 * @Since S60 5.0 |
|
150 * @aResourceID aREsourceID for loc string |
|
151 * @aFilePath location for those files received. |
|
152 * @return TBool |
|
153 */ |
|
154 IMPORT_C static TBool ShowGlobalFileOpenConfirmationQueryL( const TInt& aResourceID, const TDesC& aFilePath); |
|
155 |
|
156 |
|
157 |
|
158 /** |
|
159 * Returns a resource id for a not supported operation. |
|
160 * @return The resource id. |
|
161 */ |
|
162 IMPORT_C static TInt OperationNotSupported(); |
|
163 |
|
164 /** |
|
165 * Returns an icon for the given context. |
|
166 * @param aContext The context. |
|
167 * @param aMedia The used media. |
|
168 * @return The resource id of the icon. |
|
169 */ |
|
170 IMPORT_C static TInt ContextIcon( const TMsvEntry& aContext, |
|
171 TContextMedia aMedia ); |
|
172 |
|
173 /** |
|
174 * Updates bitmaps accoding to given media. |
|
175 * @param aMedia The used media. |
|
176 * @param aNumberOfZoomStates The media. |
|
177 * @param aBitmapFile The bitmap file. |
|
178 * @param aStartBitmap The resource id of the start bitmap. |
|
179 * @param aEndBitmap The resource id of the start bitmap. |
|
180 * @return None. |
|
181 */ |
|
182 IMPORT_C static void UpdateBitmaps( TUid aMedia, |
|
183 TInt& aNumberOfZoomStates, |
|
184 TFileName& aBitmapFile, |
|
185 TInt& aStartBitmap, |
|
186 TInt& aEndBitmap ); |
|
187 |
|
188 /** |
|
189 * Create icons according to given media |
|
190 * @param aMedia The used media. |
|
191 * @param aIconArray The IconArray used by the caller |
|
192 */ |
|
193 IMPORT_C static void CreateIconsL( TUid aMedia, CArrayPtr<CBitmapArray>* aIconArrays); |
|
194 |
|
195 |
|
196 /** |
|
197 * Prepares dialog for execution |
|
198 * @param aResourceID Resource ID of the dialog |
|
199 * @param aDialog Dialog |
|
200 */ |
|
201 void static PrepareDialogExecuteL( const TInt& aResourceID, CEikDialog* aDialog ); |
|
202 |
|
203 /** |
|
204 * Check if cover display is enabled |
|
205 * return True if enabled |
|
206 */ |
|
207 TBool static IsCoverDisplayL(); |
|
208 /** |
|
209 * A dummy class for opening CMsvSession. |
|
210 */ |
|
211 class CDummySessionObserver : public CBase , public MMsvSessionObserver |
|
212 { |
|
213 public: |
|
214 void HandleSessionEventL( TMsvSessionEvent/*aEvent*/, |
|
215 TAny* /*aArg1*/, |
|
216 TAny* /*aArg2*/, |
|
217 TAny* /*aArg3*/ ) {}; |
|
218 }; |
|
219 }; |
|
220 |
|
221 #endif // COBEXUTILSUILAYER_H |
|
222 |
|
223 // End of File |