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: Engine to handle the vibration. Uses MDiagVibratePluginObserver |
|
15 * to inform the vibrate status changes to the client. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __DIAGVIBRATEPLUGINENGINE_H__ |
|
21 #define __DIAGVIBRATEPLUGINENGINE_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <hwrmvibra.h> |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // MACROS |
|
29 |
|
30 // DATA TYPES |
|
31 |
|
32 // FUNCTION PROTOTYPES |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 |
|
36 class MDiagVibratePluginObserver; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 class CDiagVibratePluginEngine : public CBase, |
|
40 public MHWRMVibraObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * Symbian OS two-phased constructor |
|
45 * @return CDiagVibratePluginEngine* |
|
46 */ |
|
47 static CDiagVibratePluginEngine* NewL( MDiagVibratePluginObserver& aObserver ); |
|
48 |
|
49 /** |
|
50 * Symbian OS two-phased constructor |
|
51 * @return CDiagVibratePluginEngine* |
|
52 */ |
|
53 static CDiagVibratePluginEngine* NewLC( MDiagVibratePluginObserver& aObserver ); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 virtual ~CDiagVibratePluginEngine(); |
|
59 |
|
60 |
|
61 public: |
|
62 |
|
63 /** |
|
64 * Starts the vibration |
|
65 * aVibrationTime Vibration time in seconds |
|
66 */ |
|
67 void StartVibraL( TInt aVibrationTime ); |
|
68 |
|
69 /** |
|
70 * Stops the vibration |
|
71 */ |
|
72 void StopVibra(); |
|
73 |
|
74 |
|
75 private: // From MHWRMVibraObserver |
|
76 |
|
77 /** |
|
78 * @see MHWRMVibraObserver::VibraStatusChanged |
|
79 */ |
|
80 virtual void VibraStatusChanged( CHWRMVibra::TVibraStatus aStatus ); |
|
81 |
|
82 /** |
|
83 * @see MHWRMVibraObserver::VibraModeChanged |
|
84 */ |
|
85 virtual void VibraModeChanged( CHWRMVibra::TVibraModeState aStatus ); |
|
86 |
|
87 |
|
88 private: // Constructors |
|
89 |
|
90 /** |
|
91 * Private first phase constructor used by NewL and NewLC |
|
92 */ |
|
93 CDiagVibratePluginEngine( MDiagVibratePluginObserver& aObserver ); |
|
94 |
|
95 /** |
|
96 * Second phase constructor. |
|
97 */ |
|
98 void ConstructL(); |
|
99 |
|
100 private: //data members |
|
101 |
|
102 /** |
|
103 * Observer for the vibration events |
|
104 */ |
|
105 MDiagVibratePluginObserver& iObserver; |
|
106 |
|
107 /** |
|
108 * Vibra hw resource manager |
|
109 * own. |
|
110 */ |
|
111 CHWRMVibra* iVibra; |
|
112 |
|
113 }; |
|
114 |
|
115 #endif // __DIAGVIBRATEPLUGINENGINE_H__ |
|
116 |
|
117 // End of File |
|