|
1 /* |
|
2 * Copyright (c) 2008 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 the License "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* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CVCXMYVIDEOSTIMER_H__ |
|
21 #define __CVCXMYVIDEOSTIMER_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CVcxMyVideosTimer; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * This class specifies the function to be called when a timeout occurs. |
|
32 * Used in conjunction with CVcxTimer class. |
|
33 */ |
|
34 class MVcxMyVideosTimerObserver |
|
35 { |
|
36 public: // New functions |
|
37 |
|
38 /** |
|
39 * The function to be called when a timeout occurs. |
|
40 * |
|
41 * @param aTimer Pointer to timer which expired. |
|
42 */ |
|
43 virtual void TimerExpired(CVcxMyVideosTimer* aTimer) = 0; |
|
44 }; |
|
45 |
|
46 // CLASS DECLARATION |
|
47 /** |
|
48 * This class will notify an object after a specified timeout. |
|
49 */ |
|
50 NONSHARABLE_CLASS(CVcxMyVideosTimer) : public CTimer |
|
51 { |
|
52 public: // Constructors and destructors |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * Creates a CVcxMyVideosTimer object using two phase construction, |
|
57 * and returns a pointer to the created object. |
|
58 * |
|
59 * @param aPriority Priority to use for this timer. |
|
60 * @param aTimerObserver Object to notify of timeout event. |
|
61 * @return A pointer to the created instance of CVcxMyVideosTimer. |
|
62 */ |
|
63 static CVcxMyVideosTimer* NewL( const TInt aPriority, |
|
64 MVcxMyVideosTimerObserver& aTimerObserver ); |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 * Creates a CVcxMyVideosTimer object using two phase construction, |
|
69 * and returns a pointer to the created object. |
|
70 * |
|
71 * @param aPriority Priority to use for this timer. |
|
72 * @param aTimerObserver Object to notify of timeout event. |
|
73 * @return A pointer to the created instance of CVcxMyVideosTimer. |
|
74 */ |
|
75 static CVcxMyVideosTimer* NewLC( const TInt aPriority, |
|
76 MVcxMyVideosTimerObserver& aTimerObserver ); |
|
77 |
|
78 /** |
|
79 * Destructor. |
|
80 * Destroys the object and releases all memory objects. |
|
81 */ |
|
82 virtual ~CVcxMyVideosTimer(); |
|
83 |
|
84 protected: // Functions from base classes |
|
85 |
|
86 /** |
|
87 * From CActive, RunL. |
|
88 * Called when operation completes. |
|
89 */ |
|
90 void RunL(); |
|
91 |
|
92 private: // Constructors and destructors |
|
93 |
|
94 /** |
|
95 * C++ default constructor. |
|
96 * Performs the first phase of two phase construction. |
|
97 * |
|
98 * @param aPriority Priority to use for this timer. |
|
99 * @param aTimeOutNotify An observer to notify. |
|
100 */ |
|
101 CVcxMyVideosTimer( const TInt aPriority, |
|
102 MVcxMyVideosTimerObserver& aTimerObserver ); |
|
103 |
|
104 /** |
|
105 * ConstructL. |
|
106 * 2nd phase constructor. |
|
107 */ |
|
108 void ConstructL(); |
|
109 |
|
110 private: // Data |
|
111 |
|
112 /** |
|
113 * The observer for this objects events. |
|
114 */ |
|
115 MVcxMyVideosTimerObserver& iObserver; |
|
116 }; |
|
117 |
|
118 #endif // __CVCXMYVIDEOSTIMER_H__ |
|
119 |
|
120 // End of File |