|
1 /* |
|
2 * Copyright (c) 2005 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: Timer for reading 3D pattern data. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C3DAUDIOTIMEOUTTIMER_H |
|
20 #define C3DAUDIOTIMEOUTTIMER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> // CTimer |
|
24 |
|
25 |
|
26 // CLASS DECLARATIONS |
|
27 |
|
28 |
|
29 /** |
|
30 * This class specifies the function to be called when a timeout occurs. |
|
31 * Used in conjunction with C3DAudioTimeOutTimer class. |
|
32 * |
|
33 * @lib RingingTone3DPlugin.dll |
|
34 * @since 5.0 |
|
35 */ |
|
36 NONSHARABLE_CLASS (M3DAudioTimeOutNotifier) |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * The function to be called when a timeout occurs. |
|
42 */ |
|
43 virtual void TimerExpiredL() = 0; |
|
44 }; |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 /** |
|
50 * This class will notify an object after a specified timeout. |
|
51 * |
|
52 * @lib RingingTone3DPlugin.dll |
|
53 * @since 5.0 |
|
54 */ |
|
55 NONSHARABLE_CLASS (C3DAudioTimeOutTimer) : public CTimer |
|
56 { |
|
57 public: |
|
58 |
|
59 /** |
|
60 * Two-phased constructor. |
|
61 * @param aPriority Priority to use for this timer. |
|
62 * @param aTimeOutNotify Object to notify of timeout event. |
|
63 * @return A pointer to the created instance of C3DAudioTimeOutTimer. |
|
64 */ |
|
65 static C3DAudioTimeOutTimer* NewL( const TInt aPriority, |
|
66 M3DAudioTimeOutNotifier* aTimeOutNotify ); |
|
67 |
|
68 /** |
|
69 * Two-phased constructor. Leaves pointer to object to cleanup stack. |
|
70 * @param aPriority Priority to use for this timer. |
|
71 * @param aTimeOutNotify Object to notify of timeout event. |
|
72 * @return A pointer to the created instance of C3DAudioTimeOutTimer. |
|
73 */ |
|
74 static C3DAudioTimeOutTimer* NewLC( const TInt aPriority, |
|
75 M3DAudioTimeOutNotifier* aTimeOutNotify ); |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 virtual ~C3DAudioTimeOutTimer(); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * C++ default constructor. |
|
86 */ |
|
87 C3DAudioTimeOutTimer( const TInt aPriority, |
|
88 M3DAudioTimeOutNotifier* aTimeOutNotify ); |
|
89 |
|
90 /** |
|
91 * 2nd phase constructor. |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 protected: // from CActive |
|
96 |
|
97 /** |
|
98 * From CActive Called when RunL() leaves. |
|
99 */ |
|
100 TInt RunError( TInt aError ); |
|
101 |
|
102 /** |
|
103 * From CActive Called when operation completes. |
|
104 */ |
|
105 void RunL(); |
|
106 |
|
107 |
|
108 private: // Data |
|
109 |
|
110 // The observer for this objects events. |
|
111 M3DAudioTimeOutNotifier* iNotify; |
|
112 }; |
|
113 |
|
114 #endif // C3DAUDIOTIMEOUTTIMER_H |
|
115 |
|
116 // End of File |