1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Declaration of images map popup and listbox. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __IMAGEMAPPOPUP_H |
|
22 #define __IMAGEMAPPOPUP_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <e32def.h> |
|
26 #include <aknPopup.h> |
|
27 #include <aknlists.h> |
|
28 #include <apparc.h> |
|
29 #include <aknconsts.h> |
|
30 #include <aknEditStateIndicator.h> |
|
31 #include <AknsListBoxBackgroundControlContext.h> |
|
32 |
|
33 class CCoeControl; |
|
34 class TCoeEvent; |
|
35 class CEikListBox; |
|
36 class TListBoxEvent; |
|
37 class CGulIcon; |
|
38 class CAknsListBoxBackgroundControlContext; |
|
39 |
|
40 // use large icon list box with double item text |
|
41 class CImageMapListBox : public CAknDoubleLargeGraphicPopupMenuStyleListBox |
|
42 { |
|
43 public: |
|
44 |
|
45 /** |
|
46 * C++ default constructor. |
|
47 */ |
|
48 CImageMapListBox(); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CImageMapListBox(); |
|
54 |
|
55 /** |
|
56 * Symbian 2nd phase constructor. |
|
57 */ |
|
58 void ConstructL( CCoeControl& aParent, CArrayPtrFlat<CFbsBitmap>& aBitmapList, |
|
59 CArrayPtrFlat<HBufC>& aAltTextList ); |
|
60 |
|
61 private: |
|
62 |
|
63 /** |
|
64 * Fit |
|
65 * @since 2.1 |
|
66 * @param aSource: source size |
|
67 * @param aSource: target size |
|
68 * @return TSize target |
|
69 */ |
|
70 TSize Fit( const TSize& aSource, const TSize& aTarget ); |
|
71 }; |
|
72 |
|
73 // ------------------------------------------------------------------------------------ |
|
74 |
|
75 class CImageMapPopup : public CAknPopupList |
|
76 { |
|
77 public: |
|
78 |
|
79 /** |
|
80 * CreateAndRunL |
|
81 * @since 2.1 |
|
82 * @param aBitmapList: bitmap list |
|
83 * @param aAltTextList: alt text list |
|
84 * @return selected item (-1 if cancel was selected) |
|
85 */ |
|
86 static TInt CreateAndRunL( CArrayPtrFlat<CFbsBitmap>& aBitmapList, CArrayPtrFlat<HBufC>& aAltTextList ); |
|
87 |
|
88 /** |
|
89 * Destructor. |
|
90 */ |
|
91 virtual ~CImageMapPopup(); |
|
92 |
|
93 /** |
|
94 * HandleListBoxEventL |
|
95 * @since 2.1 |
|
96 * @param aListBox: list box |
|
97 * @param aEventType: event type |
|
98 * @return void |
|
99 */ |
|
100 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
101 |
|
102 /** |
|
103 * HandleControlEventL |
|
104 * @since 2.1 |
|
105 * @param aControl: coe control |
|
106 * @param aEventType: event type |
|
107 * @return void |
|
108 */ |
|
109 void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType ); |
|
110 |
|
111 private: // New functions |
|
112 |
|
113 /** |
|
114 * C++ default constructor. |
|
115 */ |
|
116 CImageMapPopup(); |
|
117 |
|
118 /** |
|
119 * By default Symbian 2nd phase constructor is private. |
|
120 */ |
|
121 void ConstructL( CEikListBox *aListBox, TInt aCbaResource, |
|
122 AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow ); |
|
123 |
|
124 private: // from MObjectProvider |
|
125 |
|
126 /** |
|
127 * MopSupplyObject |
|
128 * @since 2.1 |
|
129 * @param aId: id |
|
130 * @return TTypeUid::Ptr |
|
131 */ |
|
132 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
133 |
|
134 private: // members |
|
135 |
|
136 CAknsListBoxBackgroundControlContext* iSkinContext; // owned |
|
137 CArrayPtrFlat<CFbsBitmap>* iBitmapList; // owned |
|
138 CArrayPtrFlat<HBufC>* iAltTextList; // owned |
|
139 }; |
|
140 |
|
141 #endif // __IMAGEMAPPOPUP_H |
|
142 |
|
143 // End of file |
|