|
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: Empty view for UI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknviewappui.h> |
|
20 #include <imageprintui.rsg> |
|
21 |
|
22 #include "emptyview.h" |
|
23 #include "emptycontainer.h" |
|
24 #include "imageprintuidebug.h" |
|
25 |
|
26 |
|
27 // ======== MEMBER FUNCTIONS ======== |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // constructor |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 CEmptyView::CEmptyView() |
|
34 { |
|
35 } |
|
36 |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 // ConstructL |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 void CEmptyView::ConstructL() |
|
43 { |
|
44 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::ConstructL()")); |
|
45 BaseConstructL( R_EMPTY_VIEW ); |
|
46 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::ConstructL() complete")); |
|
47 } |
|
48 |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // NewL |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 CEmptyView* CEmptyView::NewL() |
|
55 { |
|
56 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewL()")); |
|
57 CEmptyView* self = CEmptyView::NewLC(); |
|
58 CleanupStack::Pop( self ); |
|
59 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewL() complete")); |
|
60 return self; |
|
61 } |
|
62 |
|
63 |
|
64 // --------------------------------------------------------------------------- |
|
65 // NewLC |
|
66 // --------------------------------------------------------------------------- |
|
67 // |
|
68 CEmptyView* CEmptyView::NewLC() |
|
69 { |
|
70 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewLC()")); |
|
71 CEmptyView* self = new( ELeave ) CEmptyView; |
|
72 CleanupStack::PushL( self ); |
|
73 self->ConstructL(); |
|
74 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::NewLC() complete")); |
|
75 return self; |
|
76 } |
|
77 |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // destructor |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 CEmptyView::~CEmptyView() |
|
84 { |
|
85 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::Destructor")); |
|
86 if ( iContainer ) |
|
87 { |
|
88 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
89 delete iContainer; |
|
90 } |
|
91 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::Destructor complete")); |
|
92 |
|
93 } |
|
94 |
|
95 |
|
96 // --------------------------------------------------------------------------- |
|
97 // Returns the id of the view |
|
98 // --------------------------------------------------------------------------- |
|
99 // |
|
100 TUid CEmptyView::Id() const |
|
101 { |
|
102 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::Id")); |
|
103 return KImagePrintEmptyViewId; |
|
104 } |
|
105 |
|
106 |
|
107 // --------------------------------------------------------------------------- |
|
108 // Forwards all the commands to appUi |
|
109 // --------------------------------------------------------------------------- |
|
110 // |
|
111 void CEmptyView::HandleCommandL( |
|
112 TInt aCommand ) |
|
113 { |
|
114 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::HandleCommandL")); |
|
115 AppUi()->HandleCommandL( aCommand ); |
|
116 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::HandleCommandL complete")); |
|
117 } |
|
118 |
|
119 // --------------------------------------------------------------------------- |
|
120 // Creates a container and puts it to stack |
|
121 // --------------------------------------------------------------------------- |
|
122 // |
|
123 void CEmptyView::DoActivateL( |
|
124 const TVwsViewId& /*aPrevViewId*/, |
|
125 TUid /*aCustomMessageId*/, |
|
126 const TDesC8& /*aCustomMessage*/) |
|
127 { |
|
128 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoActivateL")); |
|
129 |
|
130 iContainer = CEmptyContainer::NewL( ClientRect() ); |
|
131 iContainer->SetMopParent( this ); |
|
132 AppUi()->AddToStackL( *this, iContainer ); |
|
133 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoActivateL complete")); |
|
134 } |
|
135 |
|
136 |
|
137 // --------------------------------------------------------------------------- |
|
138 // Deletes container |
|
139 // --------------------------------------------------------------------------- |
|
140 // |
|
141 void CEmptyView::DoDeactivate() |
|
142 { |
|
143 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoDeactivate()")); |
|
144 if ( iContainer ) |
|
145 { |
|
146 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
147 delete iContainer; |
|
148 iContainer = NULL; |
|
149 } |
|
150 FLOG(_L("[IMAGEPRINTUI]\t CEmptyView::DoDeactivate() complete")); |
|
151 |
|
152 } |
|
153 |
|
154 //End of File |