|
1 /* |
|
2 * Copyright (c) 2005-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 @internalTechnology |
|
24 */ |
|
25 |
|
26 #ifndef HWRMCLIENT_H |
|
27 #define HWRMCLIENT_H |
|
28 |
|
29 |
|
30 /** |
|
31 * Resource Type enumeration. |
|
32 */ |
|
33 enum THWRMResourceType |
|
34 { |
|
35 HWRMResourceTypeVibra = 0, |
|
36 HWRMResourceTypeLight, |
|
37 HWRMResourceTypePower, |
|
38 HWRMResourceTypeFmTx, |
|
39 HWRMResourceTypeFmTxWatcher |
|
40 }; |
|
41 |
|
42 class RSessionBase; |
|
43 |
|
44 |
|
45 /** |
|
46 * Base class of the client-side handle to a session with the HWRM Server. |
|
47 */ |
|
48 class RHWRMClient : public RSessionBase |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * C++ default constructor. |
|
54 * @param |
|
55 * @return |
|
56 */ |
|
57 //RHWRMClient(); |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Connects to server |
|
63 * |
|
64 * @param aType Resource type |
|
65 * @return KErrNone if connect succesfully, otherwise system wide error |
|
66 */ |
|
67 IMPORT_C TInt Connect(THWRMResourceType aType); |
|
68 |
|
69 /** |
|
70 * Send server a command. This method is just a public wrapper for |
|
71 * SendReceive. |
|
72 * |
|
73 * @param aCommand Command identifier. |
|
74 * @param aArgs Command arguments. |
|
75 * @return KErrNone if connect succesfully, otherwise system wide error |
|
76 */ |
|
77 IMPORT_C TInt ExecuteOperation(TInt aCommand, const TIpcArgs& aArgs) const; |
|
78 |
|
79 /** |
|
80 * Send server a command. This method is just a public wrapper for |
|
81 * asynchronous version of SendReceive. |
|
82 |
|
83 * @param aCommand Command identifier. |
|
84 * @param aArgs Command arguments. |
|
85 * @param aStatus Status object for async call |
|
86 * @return KErrNone if connect succesfully, otherwise system wide error |
|
87 */ |
|
88 IMPORT_C void ExecuteAsyncOperation(TInt aCommand, const TIpcArgs& aArgs, TRequestStatus& aStatus) const; |
|
89 |
|
90 public: // Functions from base classes |
|
91 |
|
92 protected: // New functions |
|
93 |
|
94 protected: // Functions from base classes |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * Return server location |
|
100 * @param |
|
101 * @return location of server |
|
102 */ |
|
103 TFullName ServerLocation() const; |
|
104 |
|
105 /** |
|
106 * Return version of server |
|
107 * @param |
|
108 * @return version of server |
|
109 */ |
|
110 TVersion ServerVersion() const; |
|
111 |
|
112 /** |
|
113 * Starts server |
|
114 * @return KErrNone if started succesfully, otherwise system wide error |
|
115 */ |
|
116 TInt StartServer() const; |
|
117 |
|
118 public: // Data |
|
119 |
|
120 protected: // Data |
|
121 |
|
122 private: // Data |
|
123 |
|
124 public: // Friend classes |
|
125 |
|
126 protected: // Friend classes |
|
127 |
|
128 private: // Friend classes |
|
129 |
|
130 }; |
|
131 |
|
132 #endif // HWRMCLIENT_H |
|
133 |
|
134 // End of File |