|
1 /* |
|
2 * Copyright (c) 2005 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: Utility class for info view dialog. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PBKINFOVIEWDIALOGUTIL_H |
|
20 #define PBKINFOVIEWDIALOGUTIL_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <akntabgrp.h> // for AknTextUtils |
|
26 #include <aknlistquerycontrol.h> |
|
27 #include <AknQueryDialog.h> |
|
28 #include <AknsUtils.h> // for AknsUtils |
|
29 |
|
30 // CONSTANTS |
|
31 const TInt KBufSize = 128; |
|
32 |
|
33 |
|
34 /** |
|
35 * TDialogUtil |
|
36 * |
|
37 * TDialogUtil contains general dialog utilities. |
|
38 */ |
|
39 NONSHARABLE_CLASS ( TDialogUtil ) |
|
40 { |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Constructs a list-box item for CAknDoubleLargeStyleListBox. |
|
45 * @param aFirstLine First line of the dialog item |
|
46 * @param aSecondLine Second line of the dialog item |
|
47 * @param aIconIndex Icon index |
|
48 * @return HBufC* Pointer to the newly created list box item. |
|
49 */ |
|
50 static HBufC* ConstructListBoxItemLC( const TDesC& aFirstLine, |
|
51 const TDesC& aSecondLine, |
|
52 TInt aIconIndex ); |
|
53 |
|
54 /** |
|
55 * Constructs an independent CGulIcon object with fallback support. |
|
56 * If no matching item (aId) is found in the currently active skin, |
|
57 * attempts to construct the item using the given file (last 3 parameters). |
|
58 * @param aID Item ID of the masked bitmap to be created. |
|
59 * @param aFilename Filename to be used to construct the item, |
|
60 * @param aFileBitmapId Id (for bitmap) in the file. |
|
61 * @param aFileMaskId Id (for mask) in the file. |
|
62 * @return CGulIcon* Pointer to the newly created CGulIcon object. |
|
63 * Ownership of the object is transferred to the caller. |
|
64 */ |
|
65 static CGulIcon* CreateIconL( TAknsItemID aId, const TDesC& aFileName, |
|
66 TInt aFileBitmapId, TInt aFileMaskId); |
|
67 }; |
|
68 |
|
69 /** |
|
70 * CStatusPaneHandler |
|
71 * |
|
72 * This class is used for changing dialog title and image. |
|
73 */ |
|
74 NONSHARABLE_CLASS (CStatusPaneHandler) : public CBase |
|
75 { |
|
76 public: |
|
77 /** |
|
78 * Two-phased constructor. |
|
79 */ |
|
80 static CStatusPaneHandler* NewL(CAknAppUi* aAppUi); |
|
81 |
|
82 /** |
|
83 * Destructor. |
|
84 */ |
|
85 virtual ~CStatusPaneHandler(); |
|
86 |
|
87 private: |
|
88 /** |
|
89 * By default Symbian OS constructor is private. |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 */ |
|
96 CStatusPaneHandler(CAknAppUi* aAppUi); |
|
97 |
|
98 public: |
|
99 /** |
|
100 * Sets the member variable for previous title. |
|
101 * @param None. |
|
102 * @return None. |
|
103 */ |
|
104 void StoreOriginalTitleL(); |
|
105 |
|
106 /** |
|
107 * Sets the dialog title. |
|
108 * @param aResourceId Resource id from resource file. |
|
109 * @return None. |
|
110 */ |
|
111 void SetTitleL( TInt aResourceId ); |
|
112 |
|
113 /** |
|
114 * Restores previous title when returning to previous view. |
|
115 * @param None. |
|
116 * @return None. |
|
117 */ |
|
118 void RestorePreviousTitleL(); |
|
119 |
|
120 private: |
|
121 /** |
|
122 * Gets the dialog title. |
|
123 * @param aAppUi Pointer to UI class. |
|
124 * @param aText Title will be put to this variable. |
|
125 * @return TBool ETrue: success / EFalse: failure. |
|
126 */ |
|
127 static TBool GetPreviousTitleL( CAknAppUi* aAppUi, TDes& aText ); |
|
128 |
|
129 /** |
|
130 * Restores previous title image when returning to previous view. |
|
131 * @param None. |
|
132 * @return None. |
|
133 */ |
|
134 void RestoreOriginalImageL(); |
|
135 |
|
136 /** |
|
137 * Sets dialog image. |
|
138 * @param aAppUi Pointer to UI class. |
|
139 * @param aIcon New image . |
|
140 * @return CEikImage* previous image. |
|
141 */ |
|
142 static CEikImage* SetImageL( CAknAppUi* aAppUi, CEikImage* aIcon ); |
|
143 |
|
144 /** |
|
145 * Sets the dialog title. |
|
146 * @param aAppUi Pointer to the UI class. |
|
147 * @param aText TItle text. |
|
148 */ |
|
149 void static SetTitleL( CAknAppUi* aAppUi, const TDesC& aText ); |
|
150 |
|
151 |
|
152 private: |
|
153 // Access to app ui |
|
154 CAknAppUi* iAppUi; |
|
155 |
|
156 // Original status pane title |
|
157 TBuf<KBufSize> iOriginalTitle; |
|
158 |
|
159 // Is original status pane title stored |
|
160 TBool iOriginalTitleStored; |
|
161 |
|
162 // Original context pane image |
|
163 CEikImage* iOriginalImage; |
|
164 }; |
|
165 |
|
166 #endif // PBKINFOVIEWDIALOGUTIL_H |
|
167 |
|
168 // End of File |