|
1 /* |
|
2 * Copyright (c) 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: The channel basic information with knowledge of which implementation |
|
15 * this channel belongs to. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef SENSRVRESOURCECHANNELINFO_H |
|
21 #define SENSRVRESOURCECHANNELINFO_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include <sensrvtypes.h> |
|
25 #include <sensrvchannelinfo.h> |
|
26 |
|
27 #include "sensrvmessage.h" |
|
28 #include "sensrvtrace.h" |
|
29 |
|
30 /** |
|
31 * The channel info contains channel basic information with knowledge of |
|
32 * which implementation this channel belongs to. |
|
33 * |
|
34 * @lib None. |
|
35 * @since S60 5.0 |
|
36 */ |
|
37 class TSensrvResourceChannelInfo : public TSensrvChannelInfo |
|
38 { |
|
39 public: |
|
40 |
|
41 /** |
|
42 * Channel group. |
|
43 */ |
|
44 enum TSensrvChannelGroup |
|
45 { |
|
46 ESensrvChannelGroupNotSolved = -1, ///< Channel group is not solved yet |
|
47 ESensrvChannelGroupNotDefined, ///< Channel does not belong to any group |
|
48 ESensrvChannelGroupData, ///< Channel belongs to group of data channels |
|
49 ESensrvChannelGroupEvent, ///< Channel belongs to group of event channels |
|
50 ESensrvChannelGroupState ///< Channel belongs to group of state channels |
|
51 }; |
|
52 |
|
53 /** |
|
54 * Constructor of the TSensrvResourceChannelInfo |
|
55 */ |
|
56 TSensrvResourceChannelInfo(); |
|
57 |
|
58 /** |
|
59 * Copy constructor of the TSensrvResourceChannelInfo. |
|
60 * |
|
61 * @param[in] aChannelInfo Object to be copied to constructed object |
|
62 */ |
|
63 TSensrvResourceChannelInfo( const TSensrvResourceChannelInfo& aChannelInfo ); |
|
64 |
|
65 /** |
|
66 * Copy constructor of the TSensrvResourceChannelInfo. |
|
67 * |
|
68 * @param[in] aChannelInfo Object to be copied to constructed object |
|
69 */ |
|
70 TSensrvResourceChannelInfo( const TSensrvChannelInfo& aChannelInfo ); |
|
71 |
|
72 /** |
|
73 * Checks if parameter info matches the old info. |
|
74 * Channel Id and any value that is zero in aInfo are ignored. |
|
75 * |
|
76 * @param[in] aInfo Object to be matched agains this object. |
|
77 * @return ETrue if specified info is a match. |
|
78 */ |
|
79 TBool IsMatch( const TSensrvResourceChannelInfo &aInfo ) const; |
|
80 |
|
81 /** |
|
82 * Checks if parameter info matches the old info. |
|
83 * Channel Id and any value that is zero in aInfo are ignored. |
|
84 * |
|
85 * @param[in] aInfo Object to be matched agains this object. |
|
86 * @param[in] aMessage The message containing the client request. |
|
87 * @return ETrue if specified info is a match. |
|
88 */ |
|
89 TBool IsMatch( const TSensrvResourceChannelInfo &aInfo, const RMessage2& aMessage ) const; |
|
90 |
|
91 /** |
|
92 * Checks that channel info is complete, i.e. no zero/empty fields, except |
|
93 * channel Id, channel visibility and reserved member, which are ignored. |
|
94 * |
|
95 * @return ETrue if this info is complete. |
|
96 */ |
|
97 TBool IsComplete() const; |
|
98 |
|
99 /** |
|
100 * Compare function for match functionality |
|
101 * |
|
102 * @param[in] aChannelInfoToMatchFrom Channel info to match from. Cannot be NULL. |
|
103 * @param[in] aChannelInfoToMatchWith Channel info to match with. |
|
104 * @return Comparison result. |
|
105 */ |
|
106 static TInt CompareFindMatch( const TSensrvChannelInfo* aChannelInfoToMatchFrom, |
|
107 const TSensrvResourceChannelInfo& aChannelInfoToMatchWith ); |
|
108 |
|
109 /** |
|
110 * Compare function for match functionality |
|
111 * |
|
112 * @param[in] aChannelInfoToMatchWith Channel info to match with. Cannot be NULL. |
|
113 * @param[in] aChannelInfoToMatchFrom Channel info to match from. |
|
114 * @return Comparison result. |
|
115 */ |
|
116 static TInt CompareFindMatchReverse( const TSensrvChannelInfo* aChannelInfoToMatchWith, |
|
117 const TSensrvChannelInfo& aChannelInfoToMatchFrom ); |
|
118 |
|
119 private: |
|
120 #ifdef COMPONENT_TRACE_DEBUG |
|
121 |
|
122 /** |
|
123 * Prints client capabilities |
|
124 * |
|
125 */ |
|
126 void TraceCapabilities( const RMessage2& aMessage ) const; |
|
127 |
|
128 #endif //COMPONENT_TRACE_DEBUG |
|
129 public: |
|
130 /** |
|
131 * UID of the SSY implementation which this channel belongs to. |
|
132 */ |
|
133 TUid iSsyImplementationUid; |
|
134 |
|
135 /** |
|
136 * Security policy of the channel. |
|
137 */ |
|
138 TSecurityPolicy iPolicy; |
|
139 |
|
140 /** |
|
141 * Indicates if channel is a dynamic channel or a static channel. |
|
142 */ |
|
143 TBool iDynamic; |
|
144 |
|
145 /** |
|
146 * Channel group of this channel. |
|
147 */ |
|
148 TSensrvChannelGroup iChannelGroup; |
|
149 |
|
150 }; |
|
151 |
|
152 typedef RArray<TSensrvResourceChannelInfo> RSensrvResourceChannelInfoList; |
|
153 |
|
154 |
|
155 |
|
156 #endif // SENSRVRESOURCECHANNELINFO_H |