|
1 /* |
|
2 * Copyright (c) 2002-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: This class deliveres PoC related operations from accessories |
|
15 * to client that listens to them. It also provides methods for |
|
16 * client to respond to PoC operations. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CREMCONPOCTARGET_H |
|
23 #define CREMCONPOCTARGET_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <remconextensionapi.h> |
|
27 #include <e32base.h> |
|
28 #include <remcon/remconinterfacebase.h> |
|
29 #include <remcon/remconinterfaceif.h> |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 // MACROS |
|
34 |
|
35 // DATA TYPES |
|
36 |
|
37 // FUNCTION PROTOTYPES |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class MRemConPocTargetObserver; |
|
41 class CRemConInterfaceSelector; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Part of Remote Control Extension Api. |
|
47 * This class receives PoC related operations from accessories. |
|
48 * |
|
49 * @lib RemConExtensionApi.dll |
|
50 * @since Series 60 3.0 |
|
51 */ |
|
52 class CRemConPocTarget : public CRemConInterfaceBase, MRemConInterfaceIf3 |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 @param aInterfaceSelector The interface selector. |
|
59 @param aObserver The observer of this interface. |
|
60 @return A new CRemConPocTarget, owned by the interface selector. |
|
61 */ |
|
62 IMPORT_C static CRemConPocTarget* NewL( |
|
63 CRemConInterfaceSelector& aInterfaceSelector, |
|
64 MRemConPocTargetObserver& aObserver ); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 IMPORT_C virtual ~CRemConPocTarget(); |
|
70 |
|
71 public: // New functions |
|
72 |
|
73 /** |
|
74 * Called by client to send a response to remote target's operation after |
|
75 * client has processed operation. |
|
76 * @since Series 60 3.0 |
|
77 * @param aStatus Indicates the completion status of a request made |
|
78 * @param aError An error code |
|
79 * @return void |
|
80 */ |
|
81 IMPORT_C void APOCButtonUpResponse( TRequestStatus& aStatus, TInt aError ); |
|
82 |
|
83 /** |
|
84 * Called by client to send a response to remote target's operation after |
|
85 * client has processed operation. |
|
86 * @since Series 60 3.0 |
|
87 * @param aStatus Indicates the completion status of a request made |
|
88 * @param aError An error code |
|
89 * @return void |
|
90 */ |
|
91 IMPORT_C void APOCButtonDownResponse( TRequestStatus& aStatus, TInt aError ); |
|
92 |
|
93 /** |
|
94 * Method to get the bearer source detail for the last command received |
|
95 * |
|
96 * @since TB 9.2 |
|
97 * @param aSource returns the bearer source as TRemConExtCmdSource |
|
98 * @return void |
|
99 */ |
|
100 IMPORT_C void GetCommandSourceInfo( TRemConExtCmdSource& aSource ); |
|
101 |
|
102 public: // Functions from base classes |
|
103 |
|
104 protected: // New functions |
|
105 |
|
106 protected: // Functions from base classes |
|
107 |
|
108 private: |
|
109 |
|
110 // From CRemConInterfaceBase |
|
111 TAny* GetInterfaceIf( TUid aUid ); |
|
112 |
|
113 // From MRemConInterfaceIf3 |
|
114 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData, TRemConMessageSubType aMessageSubType, const TRemConAddress& aRemoteAddr); |
|
115 |
|
116 private: |
|
117 |
|
118 /** |
|
119 Constructor. |
|
120 @param aInterfaceSelector The interface selector. |
|
121 @param aObserver The observer of this interface. |
|
122 */ |
|
123 CRemConPocTarget( CRemConInterfaceSelector& aInterfaceSelector, |
|
124 MRemConPocTargetObserver& aObserver ); |
|
125 |
|
126 /** |
|
127 * Method that sends all reponses. |
|
128 */ |
|
129 void SendResponse( |
|
130 TRequestStatus& aStatus, |
|
131 TInt aOperationId, |
|
132 TInt aError); |
|
133 |
|
134 |
|
135 public: // Data |
|
136 |
|
137 protected: // Data |
|
138 |
|
139 private: // Data |
|
140 // Observer implemented by client of CRemConPocTarget |
|
141 MRemConPocTargetObserver& iObserver; |
|
142 // Stores any parameters associated with operation response client |
|
143 // sends. |
|
144 TBuf8<KRemConExtParamMaxLength> iOutData; |
|
145 // Stores the number of remotes the message was sent to. |
|
146 TUint iNumRemotes; |
|
147 |
|
148 // Stores the UID of the bearer from which the last command was received |
|
149 TUint32 iSourceUID; |
|
150 |
|
151 public: // Friend classes |
|
152 |
|
153 protected: // Friend classes |
|
154 |
|
155 private: // Friend classes |
|
156 |
|
157 }; |
|
158 |
|
159 #endif // CREMCONPOCTARGET_H |
|
160 |
|
161 // End of File |