|
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: Property class of Orientation SSY |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __SSYPROPERTY_H__ |
|
20 #define __SSYPROPERTY_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <sensrvproperty.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class TSSyChannelProperties; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * CSSYProperty class |
|
32 * |
|
33 * Property class for orientation ssy. |
|
34 * |
|
35 * @lib orientationssy.lib |
|
36 * @since S60 5.0 |
|
37 */ |
|
38 NONSHARABLE_CLASS( CSSYProperty ) : public CBase |
|
39 { |
|
40 public: |
|
41 |
|
42 /** |
|
43 * C++ constructor. |
|
44 * |
|
45 * @param aSensorNumber |
|
46 * @param aProperties Properties of this SSY |
|
47 * @param aNumberOfProperties Number of properties this SSY has |
|
48 */ |
|
49 CSSYProperty( const TInt aSensorNumber, |
|
50 const TSSyChannelProperties* aProperties, |
|
51 const TInt aNumberOfProperties ); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 virtual ~CSSYProperty(); |
|
57 |
|
58 /** |
|
59 * Registers a channel with ChannelId to the properties. |
|
60 * |
|
61 * @param aChannelID Channel identifier to register |
|
62 * @return KErrAlreadyExists if channel already exists |
|
63 */ |
|
64 TInt RegisterChannel( const TSensrvChannelId aChannelID ); |
|
65 |
|
66 /** |
|
67 * Get property. |
|
68 * |
|
69 * @param aProperty Contains property information to get |
|
70 * @return KErrNone if property get is successfull |
|
71 */ |
|
72 TInt GetProperty( TSensrvProperty& aProperty ); |
|
73 |
|
74 /** |
|
75 * Set property and return affectedchannels. |
|
76 * |
|
77 * @param aProperty Property to set |
|
78 * @param aAffectedChannels List of channels this property affects |
|
79 * @return KErrNone if property is set successfully |
|
80 */ |
|
81 TInt SetProperty( const TSensrvProperty& aProperty, |
|
82 RSensrvChannelList& aAffectedChannels ); |
|
83 |
|
84 /** |
|
85 * Finds property's index. |
|
86 * |
|
87 * @param aProperty Contains property to find |
|
88 * @return index of the found property |
|
89 */ |
|
90 TInt FindPropertyIndex( const TSensrvProperty& aProperty ); |
|
91 |
|
92 /** |
|
93 * Get all properties. |
|
94 * |
|
95 * @param aChannelPropertyList Contains all properties |
|
96 * @return KErrGeneral if property type is not known |
|
97 */ |
|
98 TInt GetAllProperties( RSensrvPropertyList& aChannelPropertyList ); |
|
99 |
|
100 /** |
|
101 * Get affected channels. |
|
102 * |
|
103 * @param aAffectedChannels Affected channels for properties |
|
104 */ |
|
105 void GetAffectedChannels( RSensrvChannelList& aAffectedChannels ); |
|
106 |
|
107 /** |
|
108 * Is data rate updated. |
|
109 * |
|
110 * @return Boolean indicating is data rate already got |
|
111 */ |
|
112 TBool DataRateUpdated(); |
|
113 |
|
114 private: |
|
115 |
|
116 /** |
|
117 * Array of channel property configurations. |
|
118 */ |
|
119 RArray<TSSyChannelProperties> iChannelProperties; |
|
120 |
|
121 /** |
|
122 * Array of channels registered to property. |
|
123 */ |
|
124 RSensrvChannelList iRegisteredChannels; |
|
125 |
|
126 /** |
|
127 * Indicates is data rate updated |
|
128 */ |
|
129 TBool iDataRateUpdate; |
|
130 }; |
|
131 |
|
132 |
|
133 #endif // __SSYPROPERTY_H__ |
|
134 |
|
135 // End of File |