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