|
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, CCoeControl* aParent, TParentType aParentType); |
|
81 |
|
82 /** |
|
83 * default constructor. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 /** |
|
88 * Destructor. |
|
89 */ |
|
90 virtual ~CBrowserAdaptiveListPopup(); |
|
91 |
|
92 |
|
93 public: // Functions from base classes |
|
94 |
|
95 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
96 |
|
97 void HidePopupL(); |
|
98 |
|
99 TBool IsInDirectoryMode(); |
|
100 |
|
101 void SetDirectoryModeL(TBool aDirMode); |
|
102 |
|
103 TBool IsOpenDirToShow(); |
|
104 |
|
105 TBool IsPoppedUp(); |
|
106 |
|
107 void HandleResourceChange( TInt aType ); |
|
108 |
|
109 void HandleResourceChangeL( TInt aType ); |
|
110 |
|
111 void SetUrlSuffixList(HBufC* urlSuffixList); |
|
112 |
|
113 void SetMaxRecentUrls (TInt maxRecentUrls); |
|
114 |
|
115 /** |
|
116 * Sets the OrdinalPosition of GotoPane |
|
117 * @param aPos The OrdinalPosition |
|
118 */ |
|
119 void SetOrdinalPosition( TInt aPos ); |
|
120 /** |
|
121 * From CCoeControl. |
|
122 * Handles pointer events |
|
123 */ |
|
124 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
125 void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType); |
|
126 private: // Functions from base classes |
|
127 |
|
128 void HandleControlEventL(CCoeControl* aControl,enum MCoeControlObserver::TCoeEvent aEventType); |
|
129 |
|
130 TInt CountComponentControls() const; |
|
131 |
|
132 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
133 |
|
134 void SetIconsL(); |
|
135 |
|
136 void CreateURLCompletionListL(); |
|
137 |
|
138 private: |
|
139 |
|
140 /** |
|
141 * ShowPopupList handles displaying the adaptive list box |
|
142 * @since |
|
143 * @param aRelayout Whether or not this popup list is being displayed as the result |
|
144 * of a layout changed event (in which case we need to make sure that the popup |
|
145 * is redrawn in the correct position) Set to EFalse by default. |
|
146 * @return void |
|
147 */ |
|
148 void ShowPopupListL(TBool aRelayout = EFalse); |
|
149 void UpdateScrollBarPositionL(const TInt aPosition); |
|
150 |
|
151 private: // from CCoeControl |
|
152 |
|
153 HBufC* iPrevGotoContent;//to compare if there were really any changes! |
|
154 |
|
155 private: // private members |
|
156 |
|
157 CBrowserPopupList* iList;//owned |
|
158 CDesCArrayFlat* iItems;//owned |
|
159 CDesCArrayFlat* iItemNames;//owned |
|
160 CDesCArrayFlat* iItemNamesToShow;//owned |
|
161 CEikEdwin* iEditor;//Editor of the GotoPane |
|
162 TInt iItemNo; |
|
163 TInt iPrevItem; |
|
164 TBool iPoppedUp;//it shows wheter it is popped up |
|
165 TAknPopupWindowLayoutDef iLayout; |
|
166 HBufC* iFirstGotoContent; |
|
167 CRecentUrlStore* iRecentUrlStore; // not owned |
|
168 TBool iDirectoryMode;//this shows wheter it is in a directory |
|
169 TBool iOpenCBA;//this shows whether Open directory shuold be showed |
|
170 CCoeControl *iParent; |
|
171 TAknLayoutRect iCover, iShadow, iOutline, iInside; |
|
172 CFormattedCellListBoxItemDrawer *iItemDrawer; |
|
173 TParentType iParentType; |
|
174 TBool iUrlCompletionMode; |
|
175 HBufC* iUrlSuffixBuf; |
|
176 TBool iTouchSupported; |
|
177 TInt iMaxRecentUrlsToShow; |
|
178 }; |
|
179 |
|
180 #endif // BROWSERADAPTIVELISTPOPUP_H |
|
181 |
|
182 // End of File |