|
1 /* |
|
2 * Copyright (c) 2005-2007 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: Phonebook 2 view activation transaction. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2VIEWACTIVATIONTRANSACTION_H |
|
20 #define CPBK2VIEWACTIVATIONTRANSACTION_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2ViewActivationTransaction.h> |
|
25 #include <vwsdef.h> // TVwsViewId |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CPbk2ViewNode; |
|
29 class CAknTitlePane; |
|
30 class CAknContextPane; |
|
31 class CEikImage; |
|
32 class CAknNavigationDecorator; |
|
33 class CAknTabGroup; |
|
34 class CPbk2AppUi; |
|
35 class CPbk2ViewExplorer; |
|
36 class CAknNavigationControlContainer; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Phonebook 2 view activation transaction. |
|
42 * Transaction class for updating application-wide state leave-safely |
|
43 * at a view switch. |
|
44 */ |
|
45 class CPbk2ViewActivationTransaction : public CBase, |
|
46 public MPbk2ViewActivationTransaction |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * Creates an instace of this transaction, performs all update |
|
52 * operations of this transaction and saves rollback data in case |
|
53 * the transaction is not committed. |
|
54 * |
|
55 * @param aAppUi Phonebook 2's application UI. |
|
56 * @param aViewExplorer Phonebook 2 view explorer. |
|
57 * @param aViewId Id of the view to be activated. |
|
58 * @param aPrevViewId Previously active view's id. |
|
59 * @param aTitlePaneText Text to place into the title pane, |
|
60 * if NULL default text is used. |
|
61 * @param aContextPanePicture Picture to place into context pane, |
|
62 * if NULL default picture is used. |
|
63 * @param aFlags View actication flags. |
|
64 * @return A new instance of this class. |
|
65 */ |
|
66 static CPbk2ViewActivationTransaction* NewLC( |
|
67 CPbk2AppUi& aAppUi, |
|
68 CPbk2ViewExplorer& aViewExplorer, |
|
69 const TUid& aViewId, |
|
70 const TVwsViewId& aPrevViewId, |
|
71 const TDesC* aTitlePaneText, |
|
72 const CEikImage* aContextPanePicture, |
|
73 TUint aFlags ); |
|
74 |
|
75 /** |
|
76 * Destructor. Rolls back changes done in NewLC if this transaction |
|
77 * is not committed. |
|
78 */ |
|
79 ~CPbk2ViewActivationTransaction(); |
|
80 |
|
81 public: // From MPbk2ViewActivationTransaction |
|
82 void Commit(); |
|
83 void RollbackL(); |
|
84 |
|
85 private: // Implementation |
|
86 CPbk2ViewActivationTransaction( |
|
87 CPbk2AppUi& aAppUi, |
|
88 CPbk2ViewExplorer& aViewExplorer, |
|
89 const TUid& aViewId, |
|
90 const TVwsViewId& aPrevViewId, |
|
91 TUint aFlags ); |
|
92 void ConstructL( |
|
93 const TDesC* aTitlePaneText, |
|
94 const CEikImage* aContextPanePicture ); |
|
95 void UpdateViewNavigationState(); |
|
96 void UpdateNaviPaneL( |
|
97 TUid aViewId ); |
|
98 void SetTitlePaneTextL( |
|
99 const TDesC* aTitlePaneText ); |
|
100 void SetContextPanePictureL( |
|
101 const CEikImage* aContextPanePicture ); |
|
102 CEikImage* CopyImageL( |
|
103 const CEikImage& aSrc ); |
|
104 void Rollback(); |
|
105 |
|
106 private: // Data |
|
107 /// Ref: Phonebook 2 Application UI |
|
108 CPbk2AppUi* iAppUi; |
|
109 /// Ref: Phonebook 2 view explorer |
|
110 CPbk2ViewExplorer& iViewExplorer; |
|
111 /// Own: Activated view's id |
|
112 TUid iViewId; |
|
113 /// Own: Deactivated view's id |
|
114 TVwsViewId iPrevViewId; |
|
115 /// Own: Flags |
|
116 TUint iFlags; |
|
117 /// Ref: Saved previous view node state |
|
118 CPbk2ViewNode* iSavePreviousViewNode; |
|
119 /// Ref: Application's title pane |
|
120 CAknTitlePane* iTitlePane; |
|
121 /// Own: Saved title pane text |
|
122 HBufC* iSaveTitlePaneText; |
|
123 /// Ref: Application's context pane |
|
124 CAknContextPane* iContextPane; |
|
125 /// Own: Saved picture from context pane |
|
126 CEikImage* iSaveContextPanePicture; |
|
127 /// Ref: Navigation decorator pushed on the navi pane, |
|
128 /// if NULL nothing was pushed |
|
129 CAknNavigationDecorator* iPushedNaviDecorator; |
|
130 /// Ref: Modified tab group |
|
131 CAknTabGroup* iTabGroup; |
|
132 /// Own: Saved index of active tab in iTabGroup |
|
133 TInt iSaveTabIndex; |
|
134 /// Ref: Navi pane |
|
135 CAknNavigationControlContainer* iNaviPane; |
|
136 }; |
|
137 |
|
138 #endif // CPBK2VIEWACTIVATIONTRANSACTION_H |
|
139 |
|
140 // End of File |