author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:23:59 +0300 | |
branch | RCL_3 |
changeset 83 | 26b2b12093af |
parent 77 | 7cee158cb8cd |
permissions | -rw-r--r-- |
66 | 1 |
/* |
2 |
* Copyright (c) 2003-2006 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: The CMIDChoiceGroup listbox |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef CMIDCHOICEGROUPLISTBOX_H |
|
19 |
#define CMIDCHOICEGROUPLISTBOX_H |
|
20 |
||
21 |
#include <lcdui.h> |
|
22 |
#include <eikclb.h> |
|
23 |
// using CMIDChoiceGroupModel as parameter of ConstructL function |
|
24 |
#include "CMIDChoiceGroupModel.h" |
|
25 |
// CAknColumnListBox inheritance in declaration |
|
26 |
// using API in CMIDChoiceGroupControl |
|
27 |
#include <aknlists.h> |
|
28 |
||
29 |
||
30 |
#ifdef RD_TACTILE_FEEDBACK |
|
31 |
#include <touchfeedback.h> |
|
32 |
#endif //RD_TACTILE_FEEDBACK |
|
33 |
||
34 |
||
35 |
class CAknsFrameBackgroundControlContext; |
|
36 |
class CMIDChoiceGroupControl; |
|
37 |
||
38 |
// Shallow frosting around the CAknColumnListBox cake |
|
39 |
NONSHARABLE_CLASS(CMIDChoiceGroupListBox) : public CAknColumnListBox |
|
40 |
{ |
|
41 |
public: |
|
42 |
// c'tor |
|
43 |
CMIDChoiceGroupListBox(CMIDChoiceGroupControl* aChoiceControl); |
|
44 |
||
45 |
// d'tor |
|
46 |
~CMIDChoiceGroupListBox(); |
|
47 |
||
48 |
// Construct with model from outside. Just sets the model |
|
49 |
// and calls CAknColumnListBox::ContructL() |
|
50 |
void ConstructL( |
|
51 |
const CCoeControl* aParent, |
|
52 |
TInt aFlags, |
|
53 |
CMIDChoiceGroupModel* aModel); |
|
54 |
||
55 |
public: // from CCoeControl |
|
56 |
// Overridden, because CEikListBox returns EKeyWasConsumed when |
|
57 |
// up is pressed on the first item, or down on last. We need to |
|
58 |
// return not consumed in order to make the form move focus |
|
59 |
// to other items |
|
60 |
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
61 |
||
62 |
void SizeChanged(); |
|
63 |
void PositionChanged(); |
|
64 |
void Draw(const TRect& aRect) const; |
|
65 |
||
66 |
TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
67 |
void HandleResourceChange(TInt aType); |
|
68 |
||
69 |
#ifdef RD_SCALABLE_UI_V2 |
|
70 |
void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
71 |
#endif |
|
72 |
||
73 |
#ifdef RD_JAVA_S60_RELEASE_9_2 |
|
74 |
/** |
|
75 |
* Returns index of ChoiceGroup element, which is the first |
|
76 |
* visible element in ChoiceGroup from top of Form. |
|
77 |
*/ |
|
78 |
TInt TopVisibleItemIndex(); |
|
79 |
||
80 |
/** |
|
81 |
* Fuction sets ESingleClickDisabledHighlight - item drawer flags |
|
82 |
* and reports current highlight element change event |
|
83 |
*/ |
|
84 |
void SingleClickDisableHighlightL(TBool aDisable); |
|
85 |
void SetHighlight(TBool aVisible); |
|
77
7cee158cb8cd
Revision: v2.2.13
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
66
diff
changeset
|
86 |
|
66 | 87 |
#endif // RD_JAVA_S60_RELEASE_9_2 |
88 |
||
89 |
#ifdef RD_TACTILE_FEEDBACK |
|
90 |
private: |
|
91 |
MTouchFeedback* iFeedback; |
|
92 |
#endif |
|
93 |
||
94 |
protected: |
|
95 |
// Overridden to use the CMIDChoiceGroupModel instead of the |
|
96 |
// normal listbox model. Note that this model is owned outside |
|
97 |
// the listbox, and must not be deleted by the box |
|
98 |
virtual void CreateModelL(); |
|
99 |
||
100 |
private: |
|
101 |
void SetTextColors(); |
|
102 |
||
103 |
/** |
|
104 |
* Checks if highlight is needed |
|
105 |
* @param aCurrentSelected - currently selected item |
|
106 |
* @param aKeyEvent |
|
107 |
* @return EFalse when highlight is not needed |
|
108 |
*/ |
|
109 |
TBool IsHighlightNeeded(TInt aCurrentSelected, const TKeyEvent& aKeyEvent); |
|
110 |
||
111 |
#ifdef RD_JAVA_S60_RELEASE_9_2 |
|
112 |
/** |
|
113 |
* Fuction calculates index of element, which is the first |
|
114 |
* visible element in ChoiceGroup from top of Form. |
|
115 |
*/ |
|
116 |
void UpdateTopVisibleItemIndex(); |
|
117 |
||
118 |
#endif // RD_JAVA_S60_RELEASE_9_2 |
|
119 |
||
120 |
private: |
|
121 |
CMIDChoiceGroupControl* iChoiceControl; |
|
122 |
||
123 |
#ifdef RD_JAVA_S60_RELEASE_9_2 |
|
124 |
TBool iUpEventSent; |
|
125 |
TBool iHighlight; |
|
126 |
TInt iTopVisibleItemIndex; |
|
127 |
#endif // RD_JAVA_S60_RELEASE_9_2 |
|
128 |
}; |
|
129 |
||
130 |
||
131 |
#endif // CMIDCHOICEGROUPLISTBOX_H |