|
1 /* |
|
2 * Copyright (c) 2008 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: Tabbed view declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cvimpstuistatuspanehandler.h" |
|
19 |
|
20 // -------------------------------------------------------------------------- |
|
21 // CCVIMPSTUiStatusPaneHandler::CCVIMPSTUiStatusPaneHandler |
|
22 // -------------------------------------------------------------------------- |
|
23 CCVIMPSTUiStatusPaneHandler::CCVIMPSTUiStatusPaneHandler() |
|
24 { |
|
25 // No implementation required |
|
26 iNaviPush = EFalse; |
|
27 } |
|
28 |
|
29 // -------------------------------------------------------------------------- |
|
30 // CCVIMPSTUiStatusPaneHandler::~CCVIMPSTUiStatusPaneHandler |
|
31 // -------------------------------------------------------------------------- |
|
32 CCVIMPSTUiStatusPaneHandler::~CCVIMPSTUiStatusPaneHandler() |
|
33 { |
|
34 if( iNaviPush && iNaviPane ) |
|
35 { |
|
36 iNaviPane->Pop( iNaviDeco ); |
|
37 } |
|
38 } |
|
39 |
|
40 // -------------------------------------------------------------------------- |
|
41 // CCVIMPSTUiStatusPaneHandler::NewLC() |
|
42 // -------------------------------------------------------------------------- |
|
43 CCVIMPSTUiStatusPaneHandler* CCVIMPSTUiStatusPaneHandler::NewLC() |
|
44 { |
|
45 CCVIMPSTUiStatusPaneHandler* self = new (ELeave)CCVIMPSTUiStatusPaneHandler(); |
|
46 CleanupStack::PushL(self); |
|
47 self->ConstructL(); |
|
48 return self; |
|
49 } |
|
50 |
|
51 // -------------------------------------------------------------------------- |
|
52 // CCVIMPSTUiStatusPaneHandler::NewL() |
|
53 // -------------------------------------------------------------------------- |
|
54 CCVIMPSTUiStatusPaneHandler* CCVIMPSTUiStatusPaneHandler::NewL() |
|
55 { |
|
56 CCVIMPSTUiStatusPaneHandler* self=CCVIMPSTUiStatusPaneHandler::NewLC(); |
|
57 CleanupStack::Pop(); // self; |
|
58 return self; |
|
59 } |
|
60 |
|
61 // -------------------------------------------------------------------------- |
|
62 // CCVIMPSTUiStatusPaneHandler::ConstructL() |
|
63 // -------------------------------------------------------------------------- |
|
64 void CCVIMPSTUiStatusPaneHandler::ConstructL() |
|
65 { |
|
66 iEnv = CEikonEnv::Static(); |
|
67 iStatusPane = iEnv->AppUiFactory()->StatusPane(); |
|
68 |
|
69 if( iStatusPane->PaneCapabilities( TUid::Uid(EEikStatusPaneUidTitle) ).IsPresent() ) |
|
70 iTitlePane = static_cast<CAknTitlePane*>( iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
71 |
|
72 if( iStatusPane->PaneCapabilities( TUid::Uid(EEikStatusPaneUidContext) ).IsPresent() ) |
|
73 iContextPane = static_cast<CAknContextPane*> ( iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidContext ) ) ); |
|
74 |
|
75 if( iStatusPane->PaneCapabilities( TUid::Uid(EEikStatusPaneUidNavi)).IsPresent() ) |
|
76 iNaviPane = static_cast<CAknNavigationControlContainer*>( iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); |
|
77 |
|
78 } |
|
79 |
|
80 // -------------------------------------------------------------------------- |
|
81 // CCVIMPSTUiStatusPaneHandler::SetPictureL() |
|
82 // -------------------------------------------------------------------------- |
|
83 void CCVIMPSTUiStatusPaneHandler::SetPictureL( CFbsBitmap* aBitmap, CFbsBitmap* aMask, TBool aNaviPush ) |
|
84 { |
|
85 if( iContextPane->IsVisible() ) |
|
86 { |
|
87 iContextPane->SetPicture( aBitmap, aMask ); |
|
88 } |
|
89 else if( aNaviPush ) |
|
90 { |
|
91 iNaviDeco = iNaviPane->CreateNavigationImageL( aBitmap, aMask ); |
|
92 iNaviPane->PushL( *iNaviDeco ); |
|
93 iNaviPush = aNaviPush; |
|
94 } |
|
95 else |
|
96 { |
|
97 delete aBitmap; |
|
98 aBitmap = NULL; |
|
99 delete aMask; |
|
100 aMask = NULL; |
|
101 } |
|
102 } |
|
103 |
|
104 // -------------------------------------------------------------------------- |
|
105 // CCVIMPSTUiStatusPaneHandler::SetTextL() |
|
106 // -------------------------------------------------------------------------- |
|
107 void CCVIMPSTUiStatusPaneHandler::SetTextL( const TDesC& aText ) |
|
108 { |
|
109 iTitlePane->SetTextL( aText ); |
|
110 } |
|
111 |
|
112 // -------------------------------------------------------------------------- |
|
113 // CCVIMPSTUiStatusPaneHandler::ClearPaneL() |
|
114 // -------------------------------------------------------------------------- |
|
115 void CCVIMPSTUiStatusPaneHandler::ClearPaneL( ) |
|
116 { |
|
117 if( iContextPane->IsVisible() ) |
|
118 { |
|
119 iContextPane->SetPicture( NULL, NULL); |
|
120 } |
|
121 if( iNaviPush ) |
|
122 { |
|
123 iNaviPane->Pop( iNaviDeco ); |
|
124 iNaviPush = EFalse; |
|
125 } |
|
126 } |
|
127 |
|
128 //END OF FILE |
|
129 |