|
1 /* |
|
2 * Copyright (c) 2009 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 "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 * |
|
16 */ |
|
17 |
|
18 #ifndef __MENUENGIDMANAGERINIT_H__ |
|
19 #define __MENUENGIDMANAGERINIT_H__ |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "menuengvisitor.h" |
|
25 |
|
26 // FORWARD DECLARATION |
|
27 |
|
28 class CMenuEngIdManager; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Menu Engine ID manager initialization - recurse the menu tree and collect |
|
34 * all used ID-s from objects, into the ID manager. |
|
35 */ |
|
36 NONSHARABLE_CLASS( TMenuEngIdManagerInit ): public MMenuEngVisitor |
|
37 { |
|
38 |
|
39 public: // construction |
|
40 |
|
41 /** |
|
42 * Constructor. |
|
43 * @param aIdManager Ids are collected into this manager. |
|
44 */ |
|
45 TMenuEngIdManagerInit( CMenuEngIdManager& aIdManager ) |
|
46 : iIdManager( aIdManager ) {} |
|
47 |
|
48 public: // new methods |
|
49 |
|
50 /** |
|
51 * Enter folder. |
|
52 * @param aFolder Entering this folder. |
|
53 * @return ETrue (visit children of this folder). |
|
54 */ |
|
55 TBool VisitEnterL( CMenuEngObject& aFolder ) |
|
56 { AddIdL( aFolder ); return ETrue; } |
|
57 |
|
58 /** |
|
59 * Visit leaf node. |
|
60 * @param aLeaf Leaf node. |
|
61 * @return ETrue (visit next sibling of this leaf). |
|
62 */ |
|
63 TBool VisitL( CMenuEngObject& aLeaf ) |
|
64 { AddIdL( aLeaf ); return ETrue; } |
|
65 |
|
66 private: // new methods |
|
67 |
|
68 /** |
|
69 * Add ID from object. |
|
70 * @param aObject Object. |
|
71 */ |
|
72 void AddIdL( CMenuEngObject& aObject ); |
|
73 |
|
74 private: // data |
|
75 |
|
76 CMenuEngIdManager& iIdManager; ///< Id manager. |
|
77 |
|
78 }; |
|
79 |
|
80 #endif // __MENUENGIDMANAGERINIT_H__ |