|
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: Component state base class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <cvtlogger.h> |
|
20 |
|
21 #include "tvtuicomponentstate.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // TVtUiComponentState::ActivateComponentL |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 void TVtUiComponentState::ActivateComponentL() |
|
28 { |
|
29 __VTPRINTENTER( "CompState.ActivateComponentL" ) |
|
30 iComponent.DoActivateL(); |
|
31 iState = EActive; |
|
32 __VTPRINTEXITR( "CompState.ActivateComponentL %d", iState ) |
|
33 } |
|
34 |
|
35 // ----------------------------------------------------------------------------- |
|
36 // TVtUiComponentState::BlockComponentL |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 void TVtUiComponentState::BlockComponentL() |
|
40 { |
|
41 __VTPRINTENTER( "CompState.BlockComponentL" ) |
|
42 iComponent.DoDeactivateL(); |
|
43 iState = EWaiting; |
|
44 __VTPRINTEXITR( "CompState.BlockComponentL %d", iState ) |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // TVtUiComponentState::DeActivateComponentL |
|
49 // ----------------------------------------------------------------------------- |
|
50 // |
|
51 void TVtUiComponentState::DeActivateComponentL() |
|
52 { |
|
53 __VTPRINTENTER( "CompState.DeActivateComponentL" ) |
|
54 iComponent.DoDeactivateL(); |
|
55 iState = EInactive; |
|
56 __VTPRINTEXITR( "CompState.DeActivateComponentL %d", iState ) |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // TVtUiComponentState::State |
|
61 // ----------------------------------------------------------------------------- |
|
62 // |
|
63 TVtUiComponentState::TState TVtUiComponentState::State() const |
|
64 { |
|
65 return iState; |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // TVtUiComponentState::Component |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 const MVtUiComponent& TVtUiComponentState::Component() const |
|
73 { |
|
74 return iComponent; |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // TVtUiComponentState::BlockMask |
|
79 // ----------------------------------------------------------------------------- |
|
80 // |
|
81 const TVtUiBlockList& TVtUiComponentState::BlockList() const |
|
82 { |
|
83 return iBlockList; |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // TVtUiComponentState::BlockMask |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 TVtUiBlockList& TVtUiComponentState::BlockList() |
|
91 { |
|
92 return iBlockList; |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // TVtUiComponentState::InformDeactivation |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 TVtUiComponentState::TVtUiComponentState( MVtUiComponent& aComponent, |
|
100 const TVtUiBlockList& aBlockList ) |
|
101 : iComponent( aComponent ), iState( EInactive ) |
|
102 { |
|
103 __VTPRINTENTER( "CompState.ctor" ) |
|
104 |
|
105 if( MVtUiComponent::EComponentIdToolbar == iComponent.ComponentId() ) |
|
106 return; |
|
107 |
|
108 iBlockList.Union( aBlockList ); |
|
109 __VTPRINTEXIT( "CompState.ctor" ) |
|
110 } |