|
1 /* |
|
2 * Copyright (c) 2002-2004 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: Polymorphic interface to Accessory Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CASYPROXY_H |
|
20 #define CASYPROXY_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "AsyProxyAPI.h" |
|
24 #include "ASYProxyAsyLoader.h" |
|
25 #include <e32svr.h> |
|
26 #include <e32base.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // MACROS |
|
31 |
|
32 // DATA TYPES |
|
33 |
|
34 // FUNCTION PROTOTYPES |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 |
|
38 // CLASS DECLARATION |
|
39 class CASYProxyASYHandler; |
|
40 |
|
41 /** |
|
42 * Provides polymorphic interface to Accessory Server |
|
43 * for the module construction. |
|
44 * |
|
45 * @lib ASYProxy.dll |
|
46 * @since S60 3.1 |
|
47 */ |
|
48 class CASYProxy : public CASYProxyAPI |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * C++ default constructor. |
|
54 */ |
|
55 CASYProxy(); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CASYProxy(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 /** |
|
65 * Symbian 2nd phase constructor. |
|
66 */ |
|
67 void ConstructL(); |
|
68 |
|
69 /** |
|
70 * Creates and initializes loading objects. |
|
71 * @since S60 3.1 |
|
72 * @param aAccServerObserver Observer class for call back methods. |
|
73 * @return void |
|
74 */ |
|
75 void InitializeL( MASYProxyObserver* aAccServerObserver ); |
|
76 |
|
77 /** |
|
78 * Begins to load ASYs. |
|
79 * @since S60 3.1 |
|
80 * @param void |
|
81 * @return void |
|
82 */ |
|
83 void LoadASYs(); |
|
84 |
|
85 /** |
|
86 * Gets static information about ASY. |
|
87 * @since S60 3.1 |
|
88 * @param aIndex Zero based index of ASY. |
|
89 * @return Implementation information. |
|
90 */ |
|
91 const CImplementationInformation* ASYInfo( TInt aIndex ) const; |
|
92 |
|
93 /** |
|
94 * Gets dynamic information about ASY. |
|
95 * @since S60 3.1 |
|
96 * @param aIndex Zero based index of ASY. |
|
97 * @return ASY's state information. |
|
98 */ |
|
99 TASYProxyASYState ASYState( TInt aIndex ) const; |
|
100 |
|
101 /** |
|
102 * Gets ASY's count. |
|
103 * @since S60 3.1 |
|
104 * @param void |
|
105 * @return Count of ASYs |
|
106 */ |
|
107 TInt ASYsCount() const; |
|
108 |
|
109 /** |
|
110 * Sets the ASY's count. |
|
111 * @since S60 3.1 |
|
112 * @param aCount Count of ASYs. |
|
113 * @return void |
|
114 */ |
|
115 void SetASYsCount( TInt aCount ); |
|
116 |
|
117 /** |
|
118 * Passes ASY loading completion status to Accessory Server |
|
119 * @since S60 3.1 |
|
120 * @param aASYIndex Index of ASY to complete |
|
121 * @return void |
|
122 */ |
|
123 void LoadCompleteL( const TInt aASYIndex ); |
|
124 |
|
125 /** |
|
126 * Passes status to Accessory Server if ASYThread kills |
|
127 * @since S60 3.1 |
|
128 * @param aASYIndex Index of killing ASY |
|
129 * @return void |
|
130 */ |
|
131 void ThreadKills( const TInt aASYIndex ); |
|
132 |
|
133 /** |
|
134 * Passes time out to Accessory Server |
|
135 * @since S60 3.1 |
|
136 * @param void |
|
137 * @return void |
|
138 */ |
|
139 void LoadTimeOutL(); |
|
140 |
|
141 public: // Functions from base classes |
|
142 |
|
143 protected: // New functions |
|
144 |
|
145 protected: // Functions from base classes |
|
146 |
|
147 private: |
|
148 |
|
149 /** |
|
150 * Deletes loader object |
|
151 * @since S60 3.1 |
|
152 * @param void |
|
153 * @return void |
|
154 */ |
|
155 void DestroyLoader(); |
|
156 |
|
157 public: // Data |
|
158 |
|
159 protected: // Data |
|
160 |
|
161 private: // Data |
|
162 |
|
163 // Array of ASY handler. CASYProxyAsyLoader uses. |
|
164 RPointerArray<CASYProxyASYHandler> iAccHandlerArray; |
|
165 |
|
166 // Pointer to loader of ASYs |
|
167 CASYProxyAsyLoader* iAsyLoader; // Owned |
|
168 |
|
169 // Pointer to observer class. |
|
170 MASYProxyObserver* iAccServerObserver; // Not owned |
|
171 |
|
172 // Total count of "real" ASYs |
|
173 TInt iRealASYsCount; |
|
174 |
|
175 // Count of loaded "real" ASYs |
|
176 TInt iLoadedRealASYsCount; |
|
177 |
|
178 // Count of loaded ASYs |
|
179 TInt iLoadedASYsCount; |
|
180 |
|
181 public: // Friend classes |
|
182 |
|
183 friend void CASYProxyAsyLoader::DoIssueRequestL(); |
|
184 friend void CASYProxyAsyLoader::ArrangeImplementationsL(); |
|
185 |
|
186 protected: // Friend classes |
|
187 |
|
188 private: // Friend classes |
|
189 }; |
|
190 |
|
191 #endif // CASYPROXY_H |
|
192 |
|
193 // End of File |