|
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 class MWmlBrowserFavouritesListboxIconHandler. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef BROWSER_FAVOURITES_LISTBOX_ICON_HANDLER_H |
|
22 #define BROWSER_FAVOURITES_LISTBOX_ICON_HANDLER_H |
|
23 |
|
24 // INCLUDE FILES |
|
25 |
|
26 #include <e32def.h> |
|
27 // #include <AknIconArray.h> |
|
28 |
|
29 // FORWARD DECLARATION |
|
30 |
|
31 class CAknIconArray; |
|
32 class CFavouritesItem; |
|
33 class CBrowserFavouritesListbox; |
|
34 class CApListItemList; |
|
35 class TFavouritesWapAp; |
|
36 struct TBrowserFavouritesIconIndexes; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Icon handling in the WML Browser's Favourites Views listboxes. |
|
42 * The problem with listbox icons is that iconarray is held by the listbox's |
|
43 * itemdrawer, while their indexes are used in the model; and there is no safe |
|
44 * way to enforce that the indexes used are really exist. So this class was |
|
45 * introduced to make it safe: an instance is given to the listbox upon |
|
46 * creation; the listbox uses the factory to create the iconarray for the |
|
47 * itemdrawer, and setting icon indexes for items. This way, creating the |
|
48 * iconarray and indexing to it is in the same class. |
|
49 * Pure virtual. |
|
50 */ |
|
51 |
|
52 class MBrowserFavouritesListboxIconHandler |
|
53 { |
|
54 public: // new methods |
|
55 |
|
56 /** |
|
57 * Create the iconarray. Derived classes please don't forget that the |
|
58 * 0th icon must be the markable listbox's mark icon. |
|
59 * @return The created iconarray. Owner is the caller. |
|
60 */ |
|
61 CAknIconArray* CreateIconArrayL() const; |
|
62 |
|
63 /** |
|
64 * Get the icon indexes for this item (index into the array). |
|
65 * @param aItem Item to get icon indexes for. |
|
66 * @param aAccessPoints Access Points to use (if bearer info is needed). |
|
67 * May be NULL. |
|
68 * @return Icon indexes for the item. |
|
69 */ |
|
70 TBrowserFavouritesIconIndexes IconIndexes |
|
71 ( |
|
72 const CFavouritesItem& aItem, |
|
73 /* const CApListItemList* aAccessPoints,*/ |
|
74 CBrowserFavouritesListbox* aListbox |
|
75 ) const; |
|
76 |
|
77 protected: // new methods |
|
78 |
|
79 /** |
|
80 * Get item icon index for this item (index into the array). |
|
81 * Derived classes must implement this method. |
|
82 * @param aItem Item to get icon index for. |
|
83 * @return Icon index for the item. |
|
84 */ |
|
85 virtual TInt ItemIconIndex( const CFavouritesItem& aItem ,CBrowserFavouritesListbox* aListbox ) const = 0; |
|
86 |
|
87 /** |
|
88 * Get bearer icon index for this access point (index into the array). |
|
89 * Derived classes may override this method; current |
|
90 * implementation returns KBrowserFavouritesNoBearerIcon. |
|
91 * @param aAccessPoint Access Points to get bearer icon for. |
|
92 * @param aAccessPoints Access Points to use. |
|
93 * @return Icon index for the access point. |
|
94 */ |
|
95 virtual TInt BearerIconIndex |
|
96 ( |
|
97 const TFavouritesWapAp aAccessPoint, |
|
98 const CApListItemList& aAccessPoints |
|
99 ) const; |
|
100 |
|
101 /** |
|
102 * Dynamically load Icon from files (AVKON skin supported) |
|
103 * @return pointer to the created icon array |
|
104 */ |
|
105 virtual CAknIconArray* LoadIconsL( ) const = 0; |
|
106 }; |
|
107 |
|
108 #endif |
|
109 |
|
110 // End of file |