1 /* |
|
2 * Copyright (c) 2006-2008 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: Reference implementation of SSY Property Provider interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SSYREFERENCEPROPERTYPROVIDER_H |
|
20 #define SSYREFERENCEPROPERTYPROVIDER_H |
|
21 |
|
22 #include <ssypropertyprovider.h> |
|
23 |
|
24 class CSsyReferenceChannel; |
|
25 |
|
26 /** |
|
27 * Channel property provider implementation. |
|
28 * |
|
29 * @lib ssyreferenceplugin.lib |
|
30 * @since S60 5.0 |
|
31 */ |
|
32 class CSsyReferencePropertyProvider : public CBase, public MSsyPropertyProvider |
|
33 { |
|
34 |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Two-phase constructor |
|
39 * |
|
40 * @since S60 5.0 |
|
41 * @param[in] aChannel Reference to channel this provider belongs to |
|
42 * @return CSsyReferenceChannelDataProvider* Pointer to created CSsyReferenceControl object |
|
43 */ |
|
44 static CSsyReferencePropertyProvider* NewL( CSsyReferenceChannel& aChannel ); |
|
45 |
|
46 /** |
|
47 * Virtual destructor |
|
48 * |
|
49 * @since S60 5.0 |
|
50 */ |
|
51 virtual ~CSsyReferencePropertyProvider(); |
|
52 |
|
53 // from base class MSsyPropertyProvider |
|
54 |
|
55 /** |
|
56 * From MSsyPropertyProvider |
|
57 * Check if property value affects other sensor channels already open. |
|
58 * If the new property value is legal but affects somehow other channels' properties, |
|
59 * SSY must return list of the affected channels so that the sensor server can |
|
60 * check if the client allowed to set this property. If the SSY value |
|
61 * is not legal SSY must leave with KErrArgument-value. |
|
62 * |
|
63 * @since S60 5.0 |
|
64 * @param[in] aProperty Property to be checked. |
|
65 * @param[out] aAffectedChannels Return list of the channel which will be affected if the property |
|
66 * value will be set. |
|
67 * @leave KErrArgument If the property value is illegal. |
|
68 */ |
|
69 void CheckPropertyDependenciesL( const TSensrvChannelId aChannelId, |
|
70 const TSensrvProperty& aProperty, |
|
71 RSensrvChannelList& aAffectedChannels ); |
|
72 |
|
73 /** |
|
74 * From MSsyPropertyProvider |
|
75 * Set property for the channel. Before the sensor server sets the property value, |
|
76 * it is checked with CheckPropertyDependenciesL()-function. |
|
77 * This means a property value should always be valid for the SSY. |
|
78 * |
|
79 * @since S60 5.0 |
|
80 * @param[in] aProperty Rereference to a property object to be set |
|
81 */ |
|
82 void SetPropertyL( const TSensrvChannelId aChannelId, |
|
83 const TSensrvProperty& aProperty ); |
|
84 |
|
85 /** |
|
86 * From MSsyPropertyProvider |
|
87 * Get channel property value. The property parameter contains channel id and |
|
88 * item index. SSY fills values and attributes to the property object. |
|
89 * |
|
90 * @since S60 5.0 |
|
91 * @param[in, out] aProperty Reference to a property object to be filled |
|
92 * with property values and attributes. |
|
93 */ |
|
94 void GetPropertyL( const TSensrvChannelId aChannelId, |
|
95 TSensrvProperty& aProperty ); |
|
96 |
|
97 /** |
|
98 * From MSsyPropertyProvider |
|
99 * Get all channel properties. Returns all properties which are related to this channel. |
|
100 * |
|
101 * @since S60 5.0 |
|
102 * @param[out] aChannelPropertyList List of the all properties of the channel. |
|
103 */ |
|
104 void GetAllPropertiesL( const TSensrvChannelId aChannelId, |
|
105 RSensrvPropertyList& aChannelPropertyList ); |
|
106 |
|
107 /** |
|
108 * Returns a pointer to a specified interface - to allow future extension |
|
109 * of this class without breaking binary compatibility |
|
110 * |
|
111 * @since S60 5.0 |
|
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 |
|
140 #endif // SSYREFERENCEPROPERTYPROVIDER_H |
|