56
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-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: Base class for Psln's view containers.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef C_PSLNBASECONTAINER_H
|
|
20 |
#define C_PSLNBASECONTAINER_H
|
|
21 |
|
|
22 |
#include <coeccntx.h>
|
|
23 |
#include <eikclb.h>
|
|
24 |
|
|
25 |
class CPslnModel;
|
|
26 |
class MPslnFWMSKObserver;
|
|
27 |
|
|
28 |
/**
|
|
29 |
* Base class for Psln's view containers.
|
|
30 |
*
|
|
31 |
*/
|
|
32 |
class CPslnBaseContainer : public CCoeControl
|
|
33 |
{
|
|
34 |
friend class CPslnGeneralThemeView;
|
|
35 |
|
|
36 |
public:
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Symbian default constructor.
|
|
40 |
*/
|
|
41 |
CPslnBaseContainer();
|
|
42 |
|
|
43 |
/**
|
|
44 |
* Symbian two-phase constructor.
|
|
45 |
* @param aRect Listbox's rect.
|
|
46 |
*/
|
|
47 |
virtual void ConstructL( const TRect& aRect ) = 0;
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Constructs all common parts of the container.
|
|
51 |
* @param aRect Listbox control's rect.
|
|
52 |
* @param aResLbxId Resource id for listbox.
|
|
53 |
*/
|
|
54 |
void BaseConstructL( const TRect& aRect, TInt aResLbxId );
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Constructs all common parts of the container.
|
|
58 |
* @param aRect Listbox control's rect.
|
|
59 |
* @param aResTitleId Resource id for title.
|
|
60 |
* @param aResLbxId Resource id for listbox.
|
|
61 |
*/
|
|
62 |
void BaseConstructL(
|
|
63 |
const TRect& aRect,
|
|
64 |
TInt aResTitleId,
|
|
65 |
TInt aResLbxId );
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Destructor.
|
|
69 |
*/
|
|
70 |
~CPslnBaseContainer();
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Sets listbox observer.
|
|
74 |
* @param aObserver observer object.
|
|
75 |
*/
|
|
76 |
void SetListBoxObserver( MEikListBoxObserver* aObserver );
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Returns currently selected item index.
|
|
80 |
* @return currently selected item index.
|
|
81 |
*/
|
|
82 |
virtual TInt CurrentItemIndex() const;
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Sets current item index and draws container. If index is invalid,
|
|
86 |
* it is set to zero (=first item).
|
|
87 |
* @param aNewIndex new current index.
|
|
88 |
*/
|
|
89 |
virtual void SetCurrentItemIndexAndDraw( TInt aNewIndex );
|
|
90 |
|
|
91 |
/**
|
|
92 |
* Sets current item index. If index is invalid,
|
|
93 |
* it is set to zero (=first item).
|
|
94 |
* @param aNewIndex new current index.
|
|
95 |
*/
|
|
96 |
virtual void SetCurrentItemIndex( TInt aNewIndex );
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Defines observer for the middle softkey label changes.
|
|
100 |
* Can only be set once. Further attempts are ignored.
|
|
101 |
* @since S60 v3.1
|
|
102 |
*/
|
|
103 |
virtual void SetMiddleSoftkeyObserver( MPslnFWMSKObserver* aObserver );
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Returns MSK Observer, if any.
|
|
107 |
* @return observer for MSK label changes, or NULL if it is not defined.
|
|
108 |
* @since S60 v3.2
|
|
109 |
*/
|
|
110 |
MPslnFWMSKObserver* GetMiddleSoftkeyObserver();
|
|
111 |
|
|
112 |
protected:
|
|
113 |
|
|
114 |
/**
|
|
115 |
* Updates listbox or specific one item.
|
|
116 |
*/
|
|
117 |
virtual void UpdateListBoxL();
|
|
118 |
|
|
119 |
/**
|
|
120 |
* Constructs listbox.
|
|
121 |
* @param aResLbxId Resource id for listbox.
|
|
122 |
*/
|
|
123 |
virtual void ConstructListBoxL( TInt aResLbxId ) = 0;
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Processes key events.
|
|
127 |
* @param aKeyEvent
|
|
128 |
* @param aType
|
|
129 |
* @return response
|
|
130 |
*/
|
|
131 |
TKeyResponse OfferKeyEventL(
|
|
132 |
const TKeyEvent& aKeyEvent,
|
|
133 |
TEventCode aType );
|
|
134 |
|
|
135 |
/**
|
|
136 |
* Creates list box items.
|
|
137 |
*/
|
|
138 |
virtual void CreateListBoxItemsL() = 0;
|
|
139 |
|
|
140 |
private:
|
|
141 |
|
|
142 |
/* From CCoeControl. */
|
|
143 |
void SizeChanged();
|
|
144 |
|
|
145 |
/* From CCoeControl. */
|
|
146 |
TInt CountComponentControls() const;
|
|
147 |
|
|
148 |
/* From CCoeControl. */
|
|
149 |
CCoeControl* ComponentControl( TInt aIndex ) const;
|
|
150 |
|
|
151 |
/* From CCoeControl. */
|
|
152 |
virtual void HandleResourceChange( TInt aType );
|
|
153 |
|
|
154 |
/* Handles focus change events in list item. */
|
|
155 |
void FocusChanged( TDrawNow aDrawNow );
|
|
156 |
|
|
157 |
protected:
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Model reference.
|
|
161 |
* Not own.
|
|
162 |
*/
|
|
163 |
CPslnModel* iModel;
|
|
164 |
|
|
165 |
/**
|
|
166 |
* Listbox.
|
|
167 |
* Own.
|
|
168 |
*/
|
|
169 |
CEikTextListBox* iListBox;
|
|
170 |
|
|
171 |
/**
|
|
172 |
* List of items in listbox.
|
|
173 |
* Not own (owned by listbox).
|
|
174 |
*/
|
|
175 |
CDesCArray* iItemArray;
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Middle softkey label observer.
|
|
179 |
* Own.
|
|
180 |
*/
|
|
181 |
MPslnFWMSKObserver* iMSKObserver;
|
|
182 |
};
|
|
183 |
|
|
184 |
#endif // C_PSLNBASECONTAINER_H
|
|
185 |
|
|
186 |
// End of File
|