|
1 /* |
|
2 * Copyright (c) 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: File Audio Output |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CFAOASYNCHHANDLER_H |
|
21 #define CFAOASYNCHHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // CONSTANTS |
|
27 const TInt KIOError = 1; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Interface class to be implemented by observer of the File Audio Output events generator. |
|
33 * @since 3.0 |
|
34 */ |
|
35 class MFAOEventGeneratorObserver |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Indicates the type of error if any. |
|
41 * @since 3.0 |
|
42 * @param aResult A system-wide error code. |
|
43 * @return none |
|
44 */ |
|
45 virtual void IOError(TInt aResult) = 0; |
|
46 }; |
|
47 |
|
48 /** |
|
49 * CFAOEventGenerator |
|
50 * |
|
51 * @lib FileAudioOutput.lib |
|
52 * @since 3.0 |
|
53 */ |
|
54 class CFAOEventGenerator : public CActive |
|
55 { |
|
56 public: |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 static CFAOEventGenerator* NewL(MFAOEventGeneratorObserver& aObserver); |
|
61 |
|
62 /** |
|
63 * Request to generate event |
|
64 * @aEvent The event to generate |
|
65 * @aError The error to report with the event |
|
66 * @since 3.0 |
|
67 */ |
|
68 void GenerateEvent(TInt aEvent, TInt aError); |
|
69 |
|
70 virtual ~CFAOEventGenerator(); |
|
71 |
|
72 private: |
|
73 |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 CFAOEventGenerator(MFAOEventGeneratorObserver& aObserver); |
|
78 |
|
79 /** |
|
80 * By default Symbian 2nd phase constructor is private. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 void RunL(); |
|
85 |
|
86 void DoCancel(); |
|
87 |
|
88 /** |
|
89 * Used to complete a request |
|
90 */ |
|
91 void Ready(const TInt aStatus); |
|
92 |
|
93 private: |
|
94 |
|
95 // The requested event |
|
96 TInt iEvent; |
|
97 |
|
98 // Error indicator |
|
99 TInt iError; |
|
100 |
|
101 // Pointer to observer object |
|
102 MFAOEventGeneratorObserver* iObserver; |
|
103 }; |
|
104 |
|
105 #endif // CFAOASYNCHHANDLER_H |