1 // ssyreferencepropertyprovider.h |
|
2 |
|
3 /* |
|
4 * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
5 * All rights reserved. |
|
6 * This component and the accompanying materials are made available |
|
7 * under the terms of "Eclipse Public License v1.0" |
|
8 * which accompanies this distribution, and is available |
|
9 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
10 * |
|
11 * Initial Contributors: |
|
12 * Nokia Corporation - initial contribution. |
|
13 * |
|
14 * Contributors: |
|
15 * |
|
16 * Description: |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 /** |
|
24 @file |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef SSYREFERENCEPROPERTYPROVIDER_H |
|
30 #define SSYREFERENCEPROPERTYPROVIDER_H |
|
31 |
|
32 #include <sensors/spi/ssypropertyprovider.h> |
|
33 |
|
34 |
|
35 class CSsyReferenceChannel; |
|
36 |
|
37 /** |
|
38 * Channel property provider implementation. |
|
39 */ |
|
40 class CSsyReferencePropertyProvider : public CBase, public MSsyPropertyProvider |
|
41 { |
|
42 |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Two-phase constructor |
|
47 * |
|
48 * @param[in] aChannel Reference to channel this provider belongs to |
|
49 * @return Pointer to created CSsyReferenceControl object |
|
50 */ |
|
51 static CSsyReferencePropertyProvider* NewL( CSsyReferenceChannel& aChannel ); |
|
52 |
|
53 /** |
|
54 * Virtual destructor |
|
55 */ |
|
56 virtual ~CSsyReferencePropertyProvider(); |
|
57 |
|
58 // from base class MSsyPropertyProvider |
|
59 |
|
60 /** |
|
61 * From MSsyPropertyProvider |
|
62 * Check if property value affects other sensor channels already open. |
|
63 * If the new property value is legal but affects somehow other channels' properties, |
|
64 * SSY must return list of the affected channels so that the sensor server can |
|
65 * check if the client allowed to set this property. If the SSY value |
|
66 * is not legal SSY must leave with KErrArgument-value. |
|
67 * |
|
68 * @param[in] aProperty Property to be checked. |
|
69 * @param[out] aAffectedChannels Return list of the channel which will be affected if the property |
|
70 * value will be set. |
|
71 * @leave KErrArgument If the property value is illegal. |
|
72 */ |
|
73 void CheckPropertyDependenciesL( const TSensrvChannelId aChannelId, |
|
74 const TSensrvProperty& aProperty, |
|
75 RSensrvChannelList& aAffectedChannels ); |
|
76 |
|
77 /** |
|
78 * From MSsyPropertyProvider |
|
79 * Set property for the channel. Before the sensor server sets the property value, |
|
80 * it is checked with CheckPropertyDependenciesL()-function. |
|
81 * This means a property value should always be valid for the SSY. |
|
82 * |
|
83 * @param[in] aProperty Rereference to a property object to be set |
|
84 */ |
|
85 void SetPropertyL( const TSensrvChannelId aChannelId, |
|
86 const TSensrvProperty& aProperty ); |
|
87 |
|
88 /** |
|
89 * From MSsyPropertyProvider |
|
90 * Get channel property value. The property parameter contains channel id and |
|
91 * item index. SSY fills values and attributes to the property object. |
|
92 * |
|
93 * @param[in, out] aProperty Reference to a property object to be filled |
|
94 * with property values and attributes. |
|
95 */ |
|
96 void GetPropertyL( const TSensrvChannelId aChannelId, |
|
97 TSensrvProperty& aProperty ); |
|
98 |
|
99 /** |
|
100 * From MSsyPropertyProvider |
|
101 * Get all channel properties. Returns all properties which are related to this channel. |
|
102 * |
|
103 * @param[out] aChannelPropertyList List of the all properties of the channel. |
|
104 */ |
|
105 void GetAllPropertiesL( const TSensrvChannelId aChannelId, |
|
106 RSensrvPropertyList& aChannelPropertyList ); |
|
107 |
|
108 /** |
|
109 * Returns a pointer to a specified interface - to allow future extension |
|
110 * of this class without breaking binary compatibility |
|
111 * |
|
112 * @param aInterfaceUid Identifier of the interface to be retrieved |
|
113 * @param aInterface A reference to a pointer that retrieves the specified interface. |
|
114 */ |
|
115 void GetPropertyProviderInterfaceL( TUid aInterfaceUid, |
|
116 TAny*& aInterface ); |
|
117 |
|
118 private: |
|
119 |
|
120 /** |
|
121 * C++ constructor. |
|
122 * @param[in] aChannel Reference to channel this provider belongs to |
|
123 */ |
|
124 CSsyReferencePropertyProvider( CSsyReferenceChannel& aChannel ); |
|
125 |
|
126 /** |
|
127 * Symbian 2nd phase constructor. |
|
128 */ |
|
129 void ConstructL(); |
|
130 |
|
131 private: // data |
|
132 |
|
133 /** |
|
134 * Reference to channel for which this provider belongs to |
|
135 */ |
|
136 CSsyReferenceChannel& iChannel; |
|
137 }; |
|
138 |
|
139 #endif // SSYREFERENCEPROPERTYPROVIDER_H |
|