|
1 /* |
|
2 * Copyright (c) 2002-2005 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: controls management utility |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CPENINPUTCTRLPOOL_H |
|
20 #define C_CPENINPUTCTRLPOOL_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 #include <w32std.h> |
|
25 |
|
26 // Forward declaration |
|
27 class CFepUiBaseCtrl; |
|
28 |
|
29 /** |
|
30 * Peninput control pool class |
|
31 * |
|
32 * This class is control pool. Application can use this class to |
|
33 * manage their controls. Control creates out side and add itself to this |
|
34 * pool. Application can get and remove one control based on control |
|
35 * id. |
|
36 * |
|
37 * @lib peninputcommonlayout.lib |
|
38 * @since S60 v3.2 |
|
39 */ |
|
40 class CPeninputCtrlPool : public CBase |
|
41 { |
|
42 |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Symbian constructor |
|
47 * |
|
48 * @since S60 v3.2 |
|
49 * @return Pointer to created CPeninputCtrlPool object |
|
50 */ |
|
51 IMPORT_C static CPeninputCtrlPool* NewL(); |
|
52 |
|
53 /** |
|
54 * Symbian constructor |
|
55 * |
|
56 * @since S60 v3.2 |
|
57 * @return Pointer to created CPeninputCtrlPool object |
|
58 */ |
|
59 IMPORT_C static CPeninputCtrlPool* NewLC(); |
|
60 |
|
61 /** |
|
62 * Destructor, it need to destroy all controls |
|
63 * |
|
64 * @since S60 v3.2 |
|
65 * @return None |
|
66 */ |
|
67 IMPORT_C virtual ~CPeninputCtrlPool(); |
|
68 |
|
69 /** |
|
70 * Add one control to the pooling, the control should have |
|
71 * one control id |
|
72 * |
|
73 * @since S60 v3.2 |
|
74 * @param aControl Pointer to control |
|
75 * @return None |
|
76 */ |
|
77 IMPORT_C void AddControl( CFepUiBaseCtrl* aControl ); |
|
78 |
|
79 /** |
|
80 * Remove one control from the pooling |
|
81 * |
|
82 * @since S60 v3.2 |
|
83 * @param aControlID Control id |
|
84 * @return None |
|
85 */ |
|
86 IMPORT_C void RemoveControl( const TInt aControlID ); |
|
87 |
|
88 /** |
|
89 * Get one control from the pooling according to the control id |
|
90 * |
|
91 * @since S60 v3.2 |
|
92 * @param aControlID Control id |
|
93 * @return Pointer to control |
|
94 */ |
|
95 IMPORT_C CFepUiBaseCtrl* Control( const TInt aControlID ) const; |
|
96 |
|
97 /** |
|
98 * Remove all controls and delete them |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 * @return None |
|
102 */ |
|
103 IMPORT_C void Reset(); |
|
104 |
|
105 /** |
|
106 * Get current control count in this pool |
|
107 * |
|
108 * @since S60 v3.2 |
|
109 * @return The count of controls |
|
110 */ |
|
111 IMPORT_C TInt ControlCount() const; |
|
112 |
|
113 /** |
|
114 * Get the control from the pool according to the index |
|
115 * |
|
116 * @since S60 v3.2 |
|
117 * @param aIndex Index in array |
|
118 * @return Pointer to control |
|
119 */ |
|
120 IMPORT_C CFepUiBaseCtrl* ControlByIndex( const TInt aIndex ) const; |
|
121 |
|
122 protected: |
|
123 |
|
124 /** |
|
125 * Symbian second-phase constructor |
|
126 * |
|
127 * @since S60 v3.2 |
|
128 * @return None |
|
129 */ |
|
130 IMPORT_C void Construct(); |
|
131 |
|
132 private: // Data |
|
133 |
|
134 /** |
|
135 * Control pointer array |
|
136 */ |
|
137 RPointerArray<CFepUiBaseCtrl> iControlList; |
|
138 |
|
139 }; |
|
140 |
|
141 #endif // C_CPENINPUTCTRLPOOL_H |