|
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 __MENUENGDELETIONCHECKER_H__ |
|
19 #define __MENUENGDELETIONCHECKER_H__ |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "menuengvisitor.h" |
|
25 |
|
26 // CLASS DECLARATION |
|
27 |
|
28 /** |
|
29 * Menu Engine deletion checker - recurse a directory to check if there are |
|
30 * any read-only items (lock_delete). Leave with KErrAccessDenied if yes. |
|
31 */ |
|
32 NONSHARABLE_CLASS( TMenuEngDeletionChecker ): public MMenuEngVisitor |
|
33 { |
|
34 |
|
35 public: // new methods |
|
36 |
|
37 /** |
|
38 * Enter folder. |
|
39 * @param aFolder Entering this folder. |
|
40 * @return ETrue (visit children of this folder). |
|
41 */ |
|
42 TBool VisitEnterL( CMenuEngObject& aFolder ) |
|
43 { CheckL( aFolder ); return ETrue; } |
|
44 |
|
45 /** |
|
46 * Visit leaf node. |
|
47 * @param aLeaf Leaf node. |
|
48 * @return ETrue (visit next sibling of this leaf). |
|
49 */ |
|
50 TBool VisitL( CMenuEngObject& aLeaf ) |
|
51 { CheckL( aLeaf ); return ETrue; } |
|
52 |
|
53 private: // new methods |
|
54 |
|
55 /** |
|
56 * Check node. Leave with KErrAccessDenied if read-only. |
|
57 * @param aObject Object. |
|
58 */ |
|
59 void CheckL( CMenuEngObject& aObject ); |
|
60 |
|
61 }; |
|
62 |
|
63 #endif // __MENUENGDELETIONCHECKER_H__ |