|
1 /* |
|
2 * Copyright (c) 2007 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: Class for file server service. |
|
15 * |
|
16 * Copyright © 2007 Nokia. All rights reserved. |
|
17 * This material, including documentation and any related computer |
|
18 * programs, is protected by copyright controlled by Nokia. All |
|
19 * rights are reserved. Copying, including reproducing, storing, |
|
20 * adapting or translating, any or all of this material requires the |
|
21 * prior written consent of Nokia. This material also contains |
|
22 * confidential information which may not be disclosed to others |
|
23 * without the prior written consent of Nokia. |
|
24 |
|
25 * |
|
26 * --------------------------------------------------------------------------- |
|
27 * |
|
28 */ |
|
29 |
|
30 |
|
31 #ifndef __CAMNEWFILESERVICE_H__ |
|
32 #define __CAMNEWFILESERVICE_H__ |
|
33 |
|
34 // INCLUDES |
|
35 #include <CNewFileServiceBase.h> |
|
36 |
|
37 // CONSTANTS |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * An observer class used to notify objects that embedded recording |
|
43 * was completed |
|
44 * @since 3.0 |
|
45 */ |
|
46 class MCamEmbeddedObserver |
|
47 { |
|
48 |
|
49 public: // new methods |
|
50 |
|
51 /** |
|
52 * This function is called when application wants to notify |
|
53 * the observer that embedded image or clip was recorded |
|
54 * @param aName The name of the file that was recorded |
|
55 */ |
|
56 virtual void FileCompleteL( const TDesC& aName ) = 0; |
|
57 |
|
58 /** |
|
59 * This function may be used to inform server to abort transfer. |
|
60 * If operation already has completed, nothing is done. |
|
61 */ |
|
62 virtual void AbortL() = 0; |
|
63 }; |
|
64 |
|
65 /** |
|
66 * Class for file server service. (embedding) |
|
67 * @since 3.0 |
|
68 */ |
|
69 class CCamNewFileService: public CNewFileServiceBase, |
|
70 public MCamEmbeddedObserver |
|
71 { |
|
72 |
|
73 public: |
|
74 /** |
|
75 * Constructor. |
|
76 * @since 3.0 |
|
77 */ |
|
78 static CCamNewFileService* NewL(); |
|
79 |
|
80 /** |
|
81 * Destructor. |
|
82 */ |
|
83 ~CCamNewFileService(); |
|
84 |
|
85 |
|
86 /* |
|
87 * Receive message from service to record new files |
|
88 * @since 3.0 |
|
89 * @param aObserver service observer |
|
90 * @param aFileNameArray array for filename |
|
91 * @param aType service type (image or video) |
|
92 * @param aMultipleFiles if False only one file possible |
|
93 */ |
|
94 void HandleNewFileL( MNewFileServiceObserver* aObserver, |
|
95 CDesCArray& aFilenameArray, |
|
96 TNewServiceFileType aType, |
|
97 TBool aMultipleFiles ); |
|
98 /* |
|
99 * Receive message from service to record new files |
|
100 * @since 3.0 |
|
101 * @param aObserver service observer |
|
102 * @param aFile file to record clip |
|
103 * @param aType service type (image or video) |
|
104 */ |
|
105 void HandleNewFileL( MNewFileServiceObserver* aObserver, |
|
106 RFile& aFile, |
|
107 TNewServiceFileType aType ); |
|
108 |
|
109 /* |
|
110 * Receive message from service that file service has completed |
|
111 * and can be closed |
|
112 * @since 3.0 |
|
113 */ |
|
114 void ServiceCompleteL(); |
|
115 |
|
116 public: // MCamEmbeddedObserver |
|
117 |
|
118 /* |
|
119 * Receive comand from application that file has been recorded |
|
120 * @since 3.0 |
|
121 * @param aName file name and location |
|
122 */ |
|
123 void FileCompleteL( const TDesC& aName ); |
|
124 |
|
125 /* |
|
126 * Receive command from application that file service must be aborted |
|
127 * @since 3.0 |
|
128 */ |
|
129 void AbortL(); |
|
130 |
|
131 private: // data |
|
132 MNewFileServiceObserver* iObserver; |
|
133 CDesCArray* iCamFilenameArray; // renamed from iFilenameArray to avoid Lint warning about |
|
134 // the same private member name used in the base class |
|
135 TBool iCompleted; |
|
136 CActiveSchedulerWait iActiveWait; |
|
137 |
|
138 }; |
|
139 |
|
140 |
|
141 #endif // __CAMNEWFILESERVICE_H__ |
|
142 |