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 CWmlBrowserFavouritesSelectionState. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef BROWSER_FAVOURITES_SELECTION_STATE_H |
|
22 #define BROWSER_FAVOURITES_SELECTION_STATE_H |
|
23 |
|
24 // INCLUDES |
|
25 |
|
26 #include <e32def.h> |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * Selection state in the Favourites Views. |
|
32 */ |
|
33 struct TBrowserFavouritesSelectionState |
|
34 { |
|
35 public: // types |
|
36 |
|
37 /** |
|
38 * Flags for storing listbox highlighted and marked item state. They |
|
39 * have has slightly different meaning for the two flags. For marking, |
|
40 * most of the flags mean that the marking *includes* that; for the |
|
41 * current, most of the flags mean that the current *is* that. |
|
42 * For example, EHomepage in the marking flags means "Marking includes |
|
43 * Homepage", while in current flag means "Current is the Homepage". |
|
44 */ |
|
45 enum |
|
46 { |
|
47 ENone = 0x0, ///< No items. |
|
48 EAny = 0x1, ///< At least one (marking only). |
|
49 EAll = 0x2, ///< All (marking only). |
|
50 ECurrent = 0x4, ///< Current (marking only). |
|
51 EHomepage = 0x8, ///< Homepage. |
|
52 EStartPage = 0x10, ///< Start Page. |
|
53 ELastVisited = 0x20, ///< Last Visited Page. |
|
54 EItem = 0x40, ///< Any kind of item (incl. specials). |
|
55 EPlainItem = 0x80, ///< Plain (non-special) item. |
|
56 EFolder = 0x100 ///< Folder. |
|
57 }; |
|
58 |
|
59 public: // constructor |
|
60 |
|
61 /** |
|
62 * Constructor. Initialize with 0. |
|
63 */ |
|
64 inline TBrowserFavouritesSelectionState(); |
|
65 |
|
66 public: // new methods |
|
67 |
|
68 /** |
|
69 * Return ETrue if listbox is empty. |
|
70 * @return ETrue if listbox is empty. |
|
71 */ |
|
72 inline TBool IsEmpty() const; |
|
73 |
|
74 /** |
|
75 * Return ETrue if any item is marked. |
|
76 * @return ETrue if any item is marked. |
|
77 */ |
|
78 inline TBool AnyMarked() const; |
|
79 |
|
80 /** |
|
81 * Return ETrue if the current item is marked. |
|
82 * @return ETrue if the current item is marked. |
|
83 */ |
|
84 inline TBool CurrentIsMarked() const; |
|
85 |
|
86 /** |
|
87 * Return ETrue if the all items are marked. |
|
88 * @return ETrue if the all items are marked. |
|
89 */ |
|
90 inline TBool AllIsMarked() const; |
|
91 |
|
92 /** |
|
93 * Return ETrue if the no items are marked. |
|
94 * @return ETrue if the no items are marked. |
|
95 */ |
|
96 inline TBool NoneIsMarked() const; |
|
97 |
|
98 /** |
|
99 * Return ETrue if the no items are marked. |
|
100 * @return ETrue if the no items are marked. |
|
101 */ |
|
102 inline TBool NoItemsMarked() const; |
|
103 |
|
104 /** |
|
105 * Return ETrue if the no folders are marked. |
|
106 * @return ETrue if the no folders are marked. |
|
107 */ |
|
108 inline TBool NoFoldersMarked() const; |
|
109 |
|
110 /** |
|
111 * Count marked items (items + folders). |
|
112 * @return Count of marked items (items + folders). |
|
113 */ |
|
114 inline TInt MarkedCount() const; |
|
115 |
|
116 /** |
|
117 * Return ETrue if the current item is item. |
|
118 * @return ETrue if the current item is item. |
|
119 */ |
|
120 inline TBool CurrentIsItem() const; |
|
121 |
|
122 /** |
|
123 * Return ETrue if the current item is folder. |
|
124 * @return ETrue if the current item is folder. |
|
125 */ |
|
126 inline TBool CurrentIsFolder() const; |
|
127 |
|
128 /** |
|
129 * Return ETrue if selection allows deleting: |
|
130 * - Marked items contain something deletable, or |
|
131 * - No marking, highlighted item is deletable. |
|
132 * @return ETrue if selection allows deleting. |
|
133 */ |
|
134 inline TBool AnyDeletable() const; |
|
135 |
|
136 /** |
|
137 * Return ETrue if selection contains at least one non-special item: |
|
138 * - Marked items contain one non-special item, or |
|
139 * - No marking, highlighted item is non-special item. |
|
140 * @return ETrue if selection allows deleting. |
|
141 */ |
|
142 inline TBool AnyPlainItem() const; |
|
143 |
|
144 /** |
|
145 * Return ETrue if current item is Homepage, Start Page or Last Visited. |
|
146 * @return ETrue if current is Homepage, Start Page or Last Visited. |
|
147 */ |
|
148 inline TBool CurrentIsSpecial() const; |
|
149 |
|
150 /** |
|
151 * Return ETrue if Homepage, Start Page and/or Last Visited is marked. |
|
152 * @return ETrue if Homepage, Start Page and/or Last Visited is marked. |
|
153 */ |
|
154 inline TBool AnyMarkedSpecial() const; |
|
155 |
|
156 /** |
|
157 * Return ETrue if the current item is start page. |
|
158 * @return ETrue if the current item is start page. |
|
159 */ |
|
160 inline TBool CurrentIsStartPage() const; |
|
161 |
|
162 public: // data |
|
163 |
|
164 TInt iCurrentFlags; ///< Flags showing the highlighted one. |
|
165 TInt iMarkFlags; ///< Flags showing marking state. |
|
166 TInt iMarkedItemCount; ///< Count of marked items. |
|
167 TInt iMarkedFolderCount; ///< Count of marked folders. |
|
168 TInt iVisibleItemCount; ///< Count of visible items (not folders). |
|
169 TInt iVisibleFolderCount; ///< Count of visible folders (not items). |
|
170 }; |
|
171 |
|
172 #include "BrowserFavouritesSelectionState.inl" |
|
173 |
|
174 #endif |
|
175 |
|
176 // End of File |
|