|
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: Control class of Orientation SSY |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __SSYCONTROLORIENTATION_H__ |
|
21 #define __SSYCONTROLORIENTATION_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <ssycontrol.h> |
|
26 #include "SsyChannel.h" |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class TSSsyChannelInfo; |
|
30 class MSsyCallback; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * CSSYControlOrientation control class |
|
37 * |
|
38 * Controller class for orientation ssy. |
|
39 * |
|
40 * @lib orientationssy.lib |
|
41 * @since S60 5.0 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CSSYControlOrientation ) : public CSsyControl |
|
44 { |
|
45 public: |
|
46 |
|
47 /** |
|
48 * Two phase constructor. |
|
49 * |
|
50 * @param aSsyCallback Callback class from sensor server |
|
51 */ |
|
52 static CSSYControlOrientation* NewL( MSsyCallback* aSsyCallback ); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 virtual ~CSSYControlOrientation(); |
|
58 |
|
59 /** |
|
60 * From CSsyControl. Request for SSY to open a channel asynchronously. |
|
61 * |
|
62 * @param aChannelID Identifies channel to open |
|
63 */ |
|
64 void OpenChannelL( TSensrvChannelId aChannelID ); |
|
65 |
|
66 /** |
|
67 * From CSsyControl. Request for SSY to close a channel asynchronously. |
|
68 * |
|
69 * @param aChannelID Identifies channel to close |
|
70 */ |
|
71 void CloseChannelL( TSensrvChannelId aChannelID ); |
|
72 |
|
73 protected: |
|
74 |
|
75 /** |
|
76 * C++ constructor. |
|
77 * |
|
78 * @param aSsyCallback Callback class from sensor server |
|
79 */ |
|
80 CSSYControlOrientation( MSsyCallback* aSsyCallback ); |
|
81 |
|
82 /** |
|
83 * Symbian 2nd phase constructor. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 private: |
|
88 |
|
89 /** |
|
90 * Checks whether a specific channel is supported or not. Used internally. |
|
91 * |
|
92 * @param aChannelID Identifies channel to check is supported |
|
93 * @param aIndex Contains the index of the channel if supported |
|
94 * @return TBool True if channel is supported |
|
95 */ |
|
96 TBool IsChannelSupported( const TSensrvChannelId aChannelID, TInt& aIndex ); |
|
97 |
|
98 /** |
|
99 * Creates and registers channels from configuration file. Used internally. |
|
100 * |
|
101 * @param aChannelConfigurations Channel definitions this SSY provides |
|
102 * @param aNumberofConfigurations Number of channels this SSY provides |
|
103 */ |
|
104 void CreateAndRegisterChannelsL( const TSSsyChannelInfo* aChannelConfigurations, |
|
105 const TUint aNumberofConfigurations ); |
|
106 private: |
|
107 |
|
108 /** |
|
109 * Sensor specific properties common for all the channels. |
|
110 */ |
|
111 CSSYProperty* iSensorProperties; |
|
112 |
|
113 /** |
|
114 * Ssy callback class. |
|
115 */ |
|
116 MSsyCallback* iCallback; |
|
117 |
|
118 /** |
|
119 * Array of pointers containing the channels for orientation ssy. |
|
120 */ |
|
121 RPointerArray<CSSYChannel> iChannelArray; |
|
122 }; |
|
123 |
|
124 |
|
125 #endif // __SSYCONTROLORIENTATION_H__ |
|
126 |
|
127 // End of File |