|
1 /* |
|
2 * Copyright (c) 2004-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: Definition of the global progress dialog class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef VUICGLOBALPROGRESSDIALOG_H |
|
20 #define VUICGLOBALPROGRESSDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <AknProgressDialog.h> |
|
25 #include <AknsItemID.h> |
|
26 |
|
27 #include <secondarydisplay/vuisecondarydisplayapi.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MKeyCallback; |
|
31 |
|
32 // CLASS DECLARATION |
|
33 |
|
34 /** |
|
35 * Displays progress dialog |
|
36 */ |
|
37 NONSHARABLE_CLASS( CGlobalProgressDialog ) : public CCoeControl, |
|
38 public MProgressDialogCallback |
|
39 { |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CGlobalProgressDialog* NewLC(); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CGlobalProgressDialog* NewL(); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 virtual ~CGlobalProgressDialog(); |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
60 * Sets the icon for this dialog |
|
61 * since 2.0 |
|
62 * @param aIconFile File containing icon |
|
63 * @param aIconId Icon ID |
|
64 * @param aIconMaskId Icon mask ID |
|
65 */ |
|
66 void SetIconL( const TDesC& aIconFile, TInt aIconId = 0, |
|
67 TInt aIconMaskId = -1 ); |
|
68 /** |
|
69 * Sets the image for the dialog |
|
70 * since 2.0 |
|
71 * @param aImageFile Image filename |
|
72 * @param aImageId Image ID |
|
73 * @param aImageMaskId Image mask ID |
|
74 */ |
|
75 void SetImageL( const TDesC& aImageFile, TInt aImageId = 0, |
|
76 TInt aImageMaskId = -1 ); |
|
77 |
|
78 /** |
|
79 * Sets additional information to be sent to secondary display. |
|
80 * Must be called before sending data to notifier to have effect. |
|
81 * |
|
82 * @param aCategory Category Uid |
|
83 * @param aDialogIndex One of dialog indices |
|
84 * @param aData Data to be sent to cover UI |
|
85 */ |
|
86 void SetSecondaryDisplayDataL( TUid aCategory, TInt aDialogIndex, |
|
87 const SecondaryDisplay::TMatchData* aData ); |
|
88 |
|
89 /** |
|
90 * Shows the progress dialog |
|
91 * since 2.0 |
|
92 * @param aPrompt Dialog prompt |
|
93 * @param aIconText Text of the icon |
|
94 * @param aSoftkeys Dialog soft keys |
|
95 */ |
|
96 void ShowProgressDialogL( const TDesC& aPrompt, const TDesC& aIconText, TInt aSoftkeys = 0 ); |
|
97 |
|
98 /** |
|
99 * Updates the progress dialog |
|
100 * since 2.0 |
|
101 * @param aValue progress bar value |
|
102 * @param aFinalValue progress bar final value |
|
103 */ |
|
104 void UpdateProgressDialogL( TInt aValue, TInt aFinalValue ); |
|
105 |
|
106 /** |
|
107 * Register for softkey callback |
|
108 * since 2.0 |
|
109 * @param aKeyCallback Pointer to callback client |
|
110 */ |
|
111 void RegisterForKeyCallback( MKeyCallback* aKeyCallback ); |
|
112 |
|
113 /** |
|
114 * Sets skin ids for image and icon |
|
115 * @param aImageId Image id |
|
116 * @param aImageBitmapId Fallback bitmap id for the image |
|
117 * @param aImageMaskId Fallback mask id for the image |
|
118 * @param aIconId Icon id |
|
119 */ |
|
120 void SetSkinIds( TAknsItemID aImageId, TInt aImageBitmapId, |
|
121 TInt aImageMaskId, TAknsItemID aIconId ); |
|
122 |
|
123 public: // Functions from base classes |
|
124 |
|
125 /** |
|
126 * From MProgressDialogCallback Handles keypresses and closing of the dialog |
|
127 * @see MProgressDialogCallback |
|
128 */ |
|
129 void DialogDismissedL( TInt aButtonId ); |
|
130 |
|
131 private: |
|
132 |
|
133 /** |
|
134 * By default Symbian constructor is private. |
|
135 */ |
|
136 void ConstructL(); |
|
137 |
|
138 /** |
|
139 * C++ default constructor. |
|
140 */ |
|
141 CGlobalProgressDialog(); |
|
142 |
|
143 /** |
|
144 * Called to complete the global progress dialog |
|
145 * since 2.0 |
|
146 */ |
|
147 void ProcessFinished(); |
|
148 |
|
149 private: // Data |
|
150 |
|
151 enum TInternalState |
|
152 { |
|
153 EStarted, |
|
154 ERunning, |
|
155 EFinished |
|
156 }; |
|
157 |
|
158 // Progress dialog |
|
159 CAknProgressDialog* iProgressDialog; |
|
160 |
|
161 // Key observer |
|
162 MKeyCallback* iKeyCallback; |
|
163 |
|
164 // For handling internal logics |
|
165 TInternalState iInternalState; |
|
166 }; |
|
167 |
|
168 #endif // VUICGLOBALPROGRESSDIALOG_H |
|
169 |
|
170 // End of File |