|
1 /* |
|
2 * Copyright (c) 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 the License "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: Header file for CBrowserPopupList and CBrowserAdaptiveListPopup |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef BROWSERADAPTIVELISTPOPUP_H |
|
20 #define BROWSERADAPTIVELISTPOPUP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknpopuplayout.h> |
|
24 #include <AknLists.h> |
|
25 |
|
26 //for testing purposes you can define fake ahle engine |
|
27 //wich will provide random results |
|
28 // CONSTANTS |
|
29 // UID of view |
|
30 const TUid KViewId = {1}; |
|
31 |
|
32 enum TParentType |
|
33 { |
|
34 EGotoPane, |
|
35 EBookmarksGotoPane |
|
36 }; |
|
37 |
|
38 class CRecentUrlStore; |
|
39 |
|
40 |
|
41 class CAknsListBoxBackgroundControlContext; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 class CBrowserPopupList : public CAknSingleGraphicPopupMenuStyleListBox |
|
45 { |
|
46 public : |
|
47 CBrowserPopupList(TParentType aParentType); |
|
48 ~CBrowserPopupList(); |
|
49 |
|
50 void SetHighLight(TBool aHighLight); |
|
51 |
|
52 TBool HighLightEnabled(); |
|
53 |
|
54 void ConstructL(const CCoeControl* aParent, TInt aFlags); |
|
55 |
|
56 void SizeChanged(); |
|
57 void Draw(const TRect& /*aRect*/) const; |
|
58 |
|
59 protected : |
|
60 TParentType iParentType; |
|
61 TBool iOnePartFrameBitmapUsed; |
|
62 }; |
|
63 |
|
64 |
|
65 |
|
66 /** |
|
67 * CBrowserAdaptiveListPopup view class. |
|
68 * |
|
69 */ |
|
70 class CBrowserAdaptiveListPopup : |
|
71 public CCoeControl, |
|
72 public MCoeControlObserver, public MEikListBoxObserver |
|
73 |
|
74 { |
|
75 public: // Constructors and destructor |
|
76 |
|
77 /** |
|
78 *C++ Constructor |
|
79 */ |
|
80 CBrowserAdaptiveListPopup( CEikEdwin* aGotoPaneEdit, |
|
81 CCoeControl* aParent, |
|
82 TParentType aParentType, |
|
83 TBool aSearchFeature = EFalse ); |
|
84 |
|
85 /** |
|
86 * default constructor. |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 /** |
|
91 * Destructor. |
|
92 */ |
|
93 virtual ~CBrowserAdaptiveListPopup(); |
|
94 |
|
95 |
|
96 public: // Functions from base classes |
|
97 |
|
98 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
99 |
|
100 void HidePopupL(); |
|
101 |
|
102 TBool IsInDirectoryMode(); |
|
103 |
|
104 void SetDirectoryModeL(TBool aDirMode); |
|
105 |
|
106 TBool IsOpenDirToShow(); |
|
107 |
|
108 TBool IsPoppedUp(); |
|
109 |
|
110 void HandleResourceChange( TInt aType ); |
|
111 |
|
112 void HandleResourceChangeL( TInt aType ); |
|
113 |
|
114 void SetUrlSuffixList(HBufC* urlSuffixList); |
|
115 |
|
116 void SetMaxRecentUrls (TInt maxRecentUrls); |
|
117 |
|
118 /** |
|
119 * Sets the OrdinalPosition of GotoPane |
|
120 * @param aPos The OrdinalPosition |
|
121 */ |
|
122 void SetOrdinalPosition( TInt aPos ); |
|
123 /** |
|
124 * From CCoeControl. |
|
125 * Handles pointer events |
|
126 */ |
|
127 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
128 void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType); |
|
129 private: // Functions from base classes |
|
130 |
|
131 void HandleControlEventL(CCoeControl* aControl,enum MCoeControlObserver::TCoeEvent aEventType); |
|
132 |
|
133 TInt CountComponentControls() const; |
|
134 |
|
135 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
136 |
|
137 void SetIconsL(); |
|
138 |
|
139 void CreateURLCompletionListL(); |
|
140 |
|
141 private: |
|
142 |
|
143 /** |
|
144 * ShowPopupList handles displaying the adaptive list box |
|
145 * @since |
|
146 * @param aRelayout Whether or not this popup list is being displayed as the result |
|
147 * of a layout changed event (in which case we need to make sure that the popup |
|
148 * is redrawn in the correct position) Set to EFalse by default. |
|
149 * @return void |
|
150 */ |
|
151 void ShowPopupListL(TBool aRelayout = EFalse); |
|
152 void UpdateScrollBarPositionL(const TInt aPosition); |
|
153 void HandleItemClickedL(CEikListBox* aListBox ); |
|
154 |
|
155 static TInt ListScrollTimerCallBack(TAny* aAny); |
|
156 void DoListScrolling(); |
|
157 |
|
158 |
|
159 private: // from CCoeControl |
|
160 |
|
161 HBufC* iPrevGotoContent;//to compare if there were really any changes! |
|
162 |
|
163 private: // private members |
|
164 |
|
165 CBrowserPopupList* iList;//owned |
|
166 CDesCArrayFlat* iItems;//owned |
|
167 CDesCArrayFlat* iItemNames;//owned |
|
168 CDesCArrayFlat* iItemNamesToShow;//owned |
|
169 CEikEdwin* iEditor;//Editor of the GotoPane |
|
170 TInt iItemNo; |
|
171 TInt iPrevItem; |
|
172 TBool iPoppedUp;//it shows wheter it is popped up |
|
173 TAknPopupWindowLayoutDef iLayout; |
|
174 HBufC* iFirstGotoContent; |
|
175 CRecentUrlStore* iRecentUrlStore; // not owned |
|
176 TBool iDirectoryMode;//this shows wheter it is in a directory |
|
177 TBool iOpenCBA;//this shows whether Open directory shuold be showed |
|
178 CCoeControl *iParent; |
|
179 TAknLayoutRect iCover, iShadow, iOutline, iInside; |
|
180 CFormattedCellListBoxItemDrawer *iItemDrawer; |
|
181 TParentType iParentType; |
|
182 TBool iUrlCompletionMode; |
|
183 HBufC* iUrlSuffixBuf; |
|
184 TBool iTouchSupported; |
|
185 TInt iMaxRecentUrlsToShow; |
|
186 // shows whether search feature is enabled or not. |
|
187 TBool iSearchFeature; |
|
188 CPeriodic* iListScrollTimer; |
|
189 }; |
|
190 |
|
191 #endif // BROWSERADAPTIVELISTPOPUP_H |
|
192 |
|
193 // End of File |