|
1 /* |
|
2 * Copyright (c) 2006 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: Execution context class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <cvtlogger.h> |
|
20 |
|
21 #include "cvtuiexecutioncontext.h" |
|
22 #include "cvtuicmdcustomvalidationactionbase.h" |
|
23 |
|
24 /** Execution context reference priority */ |
|
25 static const TInt KVtUiExecutionContextPriority = 1000; |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // CVtUiExecutionContext::~CVtUiExecutionContext |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 CVtUiExecutionContext::~CVtUiExecutionContext() |
|
34 { |
|
35 __VTPRINTENTER( "ExecCtx.~" ) |
|
36 UnregisterCommandContext(); |
|
37 __VTPRINTEXIT( "ExecCtx.~" ) |
|
38 } |
|
39 |
|
40 // --------------------------------------------------------------------------- |
|
41 // CVtUiExecutionContext::NewL |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 CVtUiExecutionContext* CVtUiExecutionContext::NewL( |
|
45 MVtUiCommandManager& aCommandManager ) |
|
46 { |
|
47 __VTPRINTENTER( "ExecCtx.NewL" ) |
|
48 CVtUiExecutionContext* self = |
|
49 new ( ELeave ) CVtUiExecutionContext( aCommandManager ); |
|
50 CleanupStack::PushL( self ); |
|
51 self->ConstructL(); |
|
52 CleanupStack::Pop(); // self |
|
53 __VTPRINTEXIT( "ExecCtx.NewL" ) |
|
54 return self; |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CVtUiExecutionContext::ValidateL |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 void CVtUiExecutionContext::ValidateL( CVtUiCmdValidationActionBase& aAction ) |
|
62 { |
|
63 __VTPRINTENTER( "ExecCtx.ValidateL" ) |
|
64 CustomValidationL( |
|
65 static_cast< CVtUiCmdCustomValidationActionBase& >( aAction ) ); |
|
66 __VTPRINTEXIT( "ExecCtx.ValidateL" ) |
|
67 } |
|
68 |
|
69 // --------------------------------------------------------------------------- |
|
70 // CVtUiExecutionContext::CVtUiExecutionContext |
|
71 // --------------------------------------------------------------------------- |
|
72 // |
|
73 CVtUiExecutionContext::CVtUiExecutionContext( |
|
74 MVtUiCommandManager& aCommandManager ) |
|
75 : CVtUiCmdContext( aCommandManager, EVtUiCmdContextTypeExecution, |
|
76 KVtUiExecutionContextPriority ) |
|
77 { |
|
78 __VTPRINTENTER( "ExecCtx.ctor" ) |
|
79 __VTPRINTEXIT( "ExecCtx.ctor" ) |
|
80 } |
|
81 |
|
82 // --------------------------------------------------------------------------- |
|
83 // CVtUiExecutionContext::ConstructL |
|
84 // --------------------------------------------------------------------------- |
|
85 // |
|
86 void CVtUiExecutionContext::ConstructL() |
|
87 { |
|
88 __VTPRINTENTER( "ExecCtx.ConstructL" ) |
|
89 RegisterCommandContextL(); |
|
90 __VTPRINTEXIT( "ExecCtx.ConstructL" ) |
|
91 } |