|
1 /* |
|
2 * Copyright (c) 2003 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: Header file of the vibra control API implementation that |
|
15 * uses HWRM Vibra API instead of DOS. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef VIBRACTRLWRAPPERIMPL_H |
|
21 #define VIBRACTRLWRAPPERIMPL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "vibractrl.h" |
|
25 #include <hwrmvibra.h> |
|
26 |
|
27 class CVibraControlImpl : public CVibraControl, |
|
28 public MHWRMVibraObserver |
|
29 { |
|
30 public: // Constructors and destructor |
|
31 CVibraControlImpl(MVibraControlObserver* aCallback); |
|
32 void ConstructL(); |
|
33 virtual ~CVibraControlImpl(); |
|
34 |
|
35 public: |
|
36 // From MHWRMVibraObserver |
|
37 void VibraModeChanged(CHWRMVibra::TVibraModeState aStatus); |
|
38 void VibraStatusChanged(CHWRMVibra::TVibraStatus aStatus); |
|
39 |
|
40 //From CVibraControl |
|
41 // Note - It is not actually necessary to import these as they are virtual in API, |
|
42 // but since these are SDK methods, not really feasible to change them either. |
|
43 IMPORT_C void StartVibraL(TUint16 aDuration); |
|
44 IMPORT_C void StopVibraL(); |
|
45 IMPORT_C TVibraModeState VibraSettings() const; |
|
46 IMPORT_C void StartVibraL(TUint16 aDuration, TInt aIntensity); |
|
47 |
|
48 private: |
|
49 /** |
|
50 * Client of the Vibra Control is notified about the status |
|
51 * of the request, |
|
52 * i.e. MVibraControlObserver::VibraRequestStatus method is called. |
|
53 * |
|
54 * @param aStatus Indicates vibra request status. |
|
55 * @see MVibraControlObserver |
|
56 */ |
|
57 void NotifyRequestStatus(TVibraRequestStatus aStatus); |
|
58 void StartVibraL(TUint16 aDuration, TInt aIntensity, TBool aUseDefaultIntensity); |
|
59 void HandleErrorL(TInt aError); |
|
60 |
|
61 private: //Data |
|
62 MVibraControlObserver* iCallback; // Client listening events. Not owned. |
|
63 CHWRMVibra* iVibra; // HWRM Vibra client. Owned. |
|
64 TBool iVibraRouteEvents; // If ETrue, vibra events are propagated to client |
|
65 TBool iExpectingStop; // If ETrue, expecting vibra stopped notification from HWRM |
|
66 }; |
|
67 |
|
68 #endif // VIBRACTRLWRAPPERIMPL_H |