|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Service implementation class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef RNEWFILESERVICECLIENT_H |
|
21 #define RNEWFILESERVICECLIENT_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <AknServerApp.h> |
|
25 #include <e32base.h> |
|
26 #include <f32file.h> |
|
27 #include <badesca.h> |
|
28 #include <NewFileService.hrh> |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class CNewFileServiceServerObserver; |
|
32 class CNewFileServiceClient; |
|
33 |
|
34 |
|
35 class MNewFileServiceServerObserver |
|
36 { |
|
37 public: // New functions |
|
38 |
|
39 /** |
|
40 * This is a callback function which is called when a IHF mode changes. |
|
41 * User must derive his class from MVRIHFObserver |
|
42 * and implement this method if he is to use notify services. |
|
43 */ |
|
44 virtual void ServerRequestReady( TInt aError ) = 0; |
|
45 }; |
|
46 |
|
47 /** |
|
48 * Class that implements the actual client-server communication |
|
49 * |
|
50 * @lib NewService.lib |
|
51 * @since Series 60 3.0 |
|
52 */ |
|
53 class RNewFileServiceClient : public RAknAppServiceBase, |
|
54 public MNewFileServiceServerObserver |
|
55 { |
|
56 |
|
57 public: // Constructors and destructor |
|
58 |
|
59 /** |
|
60 * C++ default constructor. |
|
61 */ |
|
62 RNewFileServiceClient(); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~RNewFileServiceClient(); |
|
68 |
|
69 public: // New functions |
|
70 |
|
71 /** |
|
72 * Handles the communication between server application. |
|
73 * After this synchronic operation the new file service has completed |
|
74 * and the new file is available for the client |
|
75 * @since Series 60 3.0 |
|
76 * @param aFile File handle to media file |
|
77 * @param aGenericParams Parameters passed to server |
|
78 * @param aType Type of the media file |
|
79 * @param aMultipleFiles ETrue if multiple files can be created |
|
80 * @return Was the creation succesful |
|
81 */ |
|
82 TBool NewFileL( RFile& aFile, TDesC8* aGenericParams, TNewServiceFileType aType ); |
|
83 TBool NewFileL( CDesCArray& aFilenames, TDesC8* aGenericParams, TNewServiceFileType aType, TBool aMultipleFiles ); |
|
84 |
|
85 void SetFileServiceClient(CNewFileServiceClient*); |
|
86 |
|
87 CNewFileServiceClient* iNewFileServiceClient; |
|
88 |
|
89 TInt iError; |
|
90 |
|
91 public: // Functions from base classes |
|
92 |
|
93 /** |
|
94 * Returns the Uid of the service |
|
95 * @since Series 60 3.0 |
|
96 */ |
|
97 TUid ServiceUid() const; |
|
98 |
|
99 /** |
|
100 * From MNewFileServiceServerObserver |
|
101 */ |
|
102 void ServerRequestReady( TInt aError ); |
|
103 |
|
104 private: |
|
105 // Wait object used to synchronise asynchronic server request |
|
106 CActiveSchedulerWait iWait; |
|
107 |
|
108 // Active object observing server request completion. Owned. |
|
109 CNewFileServiceServerObserver* iObserver; |
|
110 }; |
|
111 |
|
112 #endif // RNEWFILESERVICECLIENT_H |
|
113 |
|
114 // End of File |