27 // External Includes |
27 // External Includes |
28 #include <e32base.h> // for CActive |
28 #include <e32base.h> // for CActive |
29 #include <AknWsEventObserver.h> // for MAknWsEventObserver |
29 #include <AknWsEventObserver.h> // for MAknWsEventObserver |
30 #include <AccessoryServer.h> // for RAccessoryServer |
30 #include <AccessoryServer.h> // for RAccessoryServer |
31 #include <AccessoryMode.h> // for RAccessoryMode |
31 #include <AccessoryMode.h> // for RAccessoryMode |
|
32 #include <AccessoryConnection.h> // for RAccessoryConnection |
|
33 #include <AccPolGenericIDArray.h> |
32 |
34 |
33 |
35 |
34 // Forward Declarations |
36 // Forward Declarations |
35 class MGlxTvConnectionObserver; |
37 class MGlxTvConnectionObserver; |
36 |
38 |
37 |
39 |
38 /** |
40 /** |
39 * Class Description |
41 * Class Description |
40 * An Active object derived class is used to monitor the TV out connection |
42 * An Active object derived class is used to monitor the TV out connection |
41 * @author Loughlin |
43 * @author Loughlin |
42 */ |
44 */ |
43 NONSHARABLE_CLASS(CGlxTvConnectionMonitor) : public CActive |
45 NONSHARABLE_CLASS(CGlxTvConnectionMonitor) : public CActive |
44 { |
46 { |
45 public: |
47 public: |
46 |
48 |
47 /** |
49 /** |
48 * Static Symbian 2 stage constructor. |
50 * Static Symbian 2 stage constructor. |
49 */ |
51 */ |
50 static CGlxTvConnectionMonitor* NewL( |
52 static CGlxTvConnectionMonitor* NewL( |
51 MGlxTvConnectionObserver& aConnectionObserver); |
53 MGlxTvConnectionObserver& aConnectionObserver); |
52 |
54 |
53 /** |
55 /** |
54 * Destructor. |
56 * Destructor. |
55 */ |
57 */ |
56 ~CGlxTvConnectionMonitor(); |
58 ~CGlxTvConnectionMonitor(); |
57 |
59 |
58 private: |
60 private: |
59 |
61 |
60 /** |
62 /** |
61 * Standard C++ constructor |
63 * Standard C++ constructor |
62 */ |
64 */ |
63 CGlxTvConnectionMonitor( |
65 CGlxTvConnectionMonitor( |
64 MGlxTvConnectionObserver& aConnectionObserver); |
66 MGlxTvConnectionObserver& aConnectionObserver); |
65 |
67 |
66 /* |
68 /* |
67 * Symbian second stage construction |
69 * Symbian second stage construction |
68 */ |
70 */ |
69 void ConstructL(); |
71 void ConstructL(); |
70 |
72 |
71 public: // class member functions |
73 public: // class member functions |
72 |
74 |
73 /* |
75 /* |
74 * Provides the caller with the current TV connetion state |
76 * Provides the caller with the current TV connetion state |
84 |
86 |
85 |
87 |
86 private: // From CActive |
88 private: // From CActive |
87 /** |
89 /** |
88 * @ref CActive::RunL |
90 * @ref CActive::RunL |
89 */ |
91 */ |
90 void RunL(); |
92 void RunL(); |
91 |
93 |
92 /** |
94 /** |
93 * @ref CActive::DoCancel |
95 * @ref CActive::DoCancel |
94 */ |
96 */ |
95 void DoCancel(); |
97 void DoCancel(); |
96 |
98 |
97 /** |
99 /** |
98 * @ref CActive::RunError |
100 * @ref CActive::RunError |
99 */ |
101 */ |
100 TInt RunError( TInt aError ); |
102 TInt RunError( TInt aError ); |
101 |
103 |
102 |
104 |
103 private: |
105 private: |
104 |
106 |
105 /** |
107 /** |
106 * Requests TV on/off events |
108 * Requests TV on/off events |
107 */ |
109 */ |
108 void IssueRequest(); |
110 void IssueRequest(); |
109 |
111 |
110 /** |
112 /** |
111 * Sends notification to observers when TV Out cable is connected |
113 * Sends notification to observers when TV Out cable is connected |
112 */ |
114 */ |
113 void IssueNotificationL(); |
115 void IssueNotificationL(); |
114 |
116 |
115 |
117 |
116 private: // class member data |
118 private: // class member data |
117 |
119 |
118 // Not owned: TV connection observer |
120 // Not owned: TV connection observer |
119 MGlxTvConnectionObserver& iConnectionObserver; |
121 MGlxTvConnectionObserver& iConnectionObserver; |
120 |
122 |
121 // TVout The Connection state |
123 // TVout The Connection state |
122 TBool iTvOutConnectionState; |
124 TBool iTvOutConnectionState; |
123 |
125 |
124 // TVout The Connection state |
126 // TVout The Connection state |
125 TBool iHDMIConnectionState; |
127 TBool iHDMIConnectionState; |
126 |
128 |
127 // The (external device) Accessory Server |
129 // The (external device) Accessory Server |
128 RAccessoryServer iTvAccServer; |
130 RAccessoryServer iTvAccServer; |
129 |
131 |
130 // Accessory mode |
132 // Accessory mode |
131 RAccessoryMode iTvAccMode; |
133 RAccessoryMode iTvAccMode; |
132 |
|
133 // Accessory Mode structure - details the type of accessory |
|
134 TAccPolAccessoryMode iCurrentAccMode; |
|
135 |
134 |
|
135 // Accessory Connection - details the type of accessory |
|
136 RAccessoryConnection iTvAccCon; |
|
137 |
|
138 //Class gives Generic ID |
|
139 TAccPolGenericIDArray iCurrentAccArray; |
136 }; |
140 }; |
137 |
141 |
138 |
142 |
139 #endif // __GLX_WNDWCONNECTION_MONITOR_H__ |
143 #endif // __GLX_WNDWCONNECTION_MONITOR_H__ |