1 /* |
|
2 * Copyright (c) 2002-2004 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: Interface for recording new media files using platform |
|
15 applications |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CNEWFILESERVICEBASE_H |
|
22 #define CNEWFILESERVICEBASE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <AknServerApp.h> |
|
26 #include <badesca.h> |
|
27 #include <f32file.h> |
|
28 #include <NewFileService.hrh> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CAiwGenericParamList; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Observer interface to get notification from server application |
|
38 * |
|
39 * @lib NewService.lib |
|
40 * @since Series 60 3.0 |
|
41 */ |
|
42 class MNewFileServiceObserver |
|
43 { |
|
44 public: |
|
45 virtual void HandleCompletedNewServiceL( TBool aReturnValue ) = 0; |
|
46 }; |
|
47 |
|
48 /** |
|
49 * Base class for server applications |
|
50 * |
|
51 * @lib NewService.lib |
|
52 * @since Series 60 3.0 |
|
53 */ |
|
54 class CNewFileServiceBase : public CAknAppServiceBase, public MNewFileServiceObserver |
|
55 { |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 IMPORT_C virtual ~CNewFileServiceBase(); |
|
62 |
|
63 /** |
|
64 * return iErrorCode. |
|
65 */ |
|
66 IMPORT_C TInt GetErrorCode(); |
|
67 |
|
68 /** |
|
69 * set iErrorCode. |
|
70 */ |
|
71 IMPORT_C void SetErrorCode(TInt); |
|
72 |
|
73 |
|
74 protected: // New functions |
|
75 |
|
76 /** |
|
77 * From CAknAppServiceBase |
|
78 * @since Series 60 3.0 |
|
79 * @param aMessage The client message |
|
80 */ |
|
81 IMPORT_C void ServiceL( const RMessage2& aMessage ); |
|
82 |
|
83 /** |
|
84 * From MNewFileServiceObserver |
|
85 * @since Series 60 3.0 |
|
86 * @param aReturnValue ETrue if the media file was succesfully created |
|
87 */ |
|
88 IMPORT_C void HandleCompletedNewServiceL( TBool aReturnValue ); |
|
89 |
|
90 /** |
|
91 * Getter for member variable |
|
92 * @since Series 60 3.0 |
|
93 * @return Pointer to iGenericParams |
|
94 */ |
|
95 IMPORT_C CAiwGenericParamList* GenericParams(); |
|
96 |
|
97 /** |
|
98 * Create a new media file |
|
99 * @since Series 60 3.0 |
|
100 * @param aObserver Object that is notified when recording is ready |
|
101 * @param aFilenameArray Array for the filename(s) of the recorded files |
|
102 * @param aType Required media type |
|
103 * @param aMultiplefiles ETrue if multiples files can be recorded |
|
104 */ |
|
105 virtual void HandleNewFileL( MNewFileServiceObserver* aObserver, |
|
106 CDesCArray& aFilenameArray, |
|
107 TNewServiceFileType aType, |
|
108 TBool aMultipleFiles ) = 0; |
|
109 /** |
|
110 * Create a new media file |
|
111 * @since Series 60 3.0 |
|
112 * @param aObserver Object that is notified when recording is ready |
|
113 * @param aFile File handle that the media file is to be recorded |
|
114 * @param aType Required media type |
|
115 */ |
|
116 virtual void HandleNewFileL( MNewFileServiceObserver* aObserver, |
|
117 RFile& aFile, |
|
118 TNewServiceFileType aType ) = 0; |
|
119 |
|
120 /** |
|
121 * Notifies the server application that service is complete |
|
122 * and it may safely close |
|
123 * @since Series 60 3.0 |
|
124 */ |
|
125 virtual void ServiceCompleteL() = 0; |
|
126 |
|
127 private: |
|
128 |
|
129 void DeserializeGenericParamsL( const RMessage2& aMessage ); |
|
130 |
|
131 |
|
132 protected: |
|
133 |
|
134 /** |
|
135 * C++ default constructor. |
|
136 */ |
|
137 IMPORT_C CNewFileServiceBase(); |
|
138 |
|
139 private: // Data |
|
140 // Array for the filenames |
|
141 CDesCArrayFlat* iFilenameArray; |
|
142 |
|
143 // Last received message |
|
144 RMessage2 iPendingMessage; |
|
145 |
|
146 // Generic parameter array |
|
147 CAiwGenericParamList* iGenericParams; |
|
148 |
|
149 // Error code that send back to client |
|
150 TInt iError; |
|
151 |
|
152 }; |
|
153 |
|
154 #endif // CNewFileServiceBase_H |
|
155 |
|
156 // End of File |
|