|
1 /* |
|
2 * Copyright (c) 2009 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: Declares Bluetooth notifiers UI utility class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef BTNOTIFUIUTIL_H |
|
19 #define BTNOTIFUIUTIL_H |
|
20 #include <eikenv.h> // Eikon environment |
|
21 #include <data_caging_path_literals.hrh> |
|
22 #include <AknQueryDialog.h> |
|
23 #include <AknWaitDialog.h> |
|
24 #include <secondarydisplay/BTnotifSecondaryDisplayAPI.h> |
|
25 |
|
26 // CONSTANTS |
|
27 // Literals for resource and bitmap files ( drive, directory, filename(s) ) |
|
28 _LIT(KFileDrive,"z:"); |
|
29 _LIT(KResourceFileName, "btnotif.rsc"); |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CEikonEnv; |
|
33 |
|
34 NONSHARABLE_CLASS( CBTNotifUIUtil ) : public CBase |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 static CBTNotifUIUtil* NewL( TBool aCoverDisplayEnabled ); |
|
39 |
|
40 /** |
|
41 * Destructor. |
|
42 */ |
|
43 virtual ~CBTNotifUIUtil(); |
|
44 |
|
45 private: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * C++ default constructor. |
|
49 */ |
|
50 CBTNotifUIUtil( TBool aCoverDisplayEnabled ); |
|
51 |
|
52 /** |
|
53 * Symbian 2nd phase constructor. |
|
54 */ |
|
55 void ConstructL(); |
|
56 |
|
57 public: |
|
58 /** |
|
59 * A utility function for requesting the activation of lights. |
|
60 * @param None. |
|
61 * @return None. |
|
62 */ |
|
63 void TurnLightsOn(); |
|
64 |
|
65 /** |
|
66 * Get the local eikon environment. |
|
67 * @return the reference of the local Eikon Environment |
|
68 */ |
|
69 CEikonEnv& LocalEikonEnv(); |
|
70 |
|
71 /** |
|
72 * Common utility for user confirmation dialog. |
|
73 * @return the keypress value |
|
74 */ |
|
75 TInt ShowQueryL(TInt aPromptResource, TInt aExecuteResource, |
|
76 TSecondaryDisplayBTnotifDialogs aDialogId, |
|
77 CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone ); |
|
78 |
|
79 /** |
|
80 * Common utility for user confirmation dialog. |
|
81 * @return the keypress value |
|
82 */ |
|
83 TInt ShowQueryL(const TDesC& aPrompt, TInt aExecuteResource, |
|
84 TSecondaryDisplayBTnotifDialogs aDialogId, |
|
85 const TBTDeviceName& aDevNameInCoverUI, |
|
86 CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone ); |
|
87 |
|
88 /** |
|
89 * Common utility for user confirmation dialog. |
|
90 * @return the keypress value |
|
91 */ |
|
92 TInt ShowMessageQueryL(TDesC& aMessage, const TDesC& aHeader, |
|
93 TInt aResourceId, |
|
94 CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone ); |
|
95 /** |
|
96 * Common utility for user confirmation dialog. |
|
97 * @return the keypress value |
|
98 */ |
|
99 TInt ShowTextInputQueryL(TDes& aText, TInt aExecuteResource, |
|
100 TSecondaryDisplayBTnotifDialogs aDialogId, |
|
101 CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone ); |
|
102 |
|
103 /** |
|
104 * Common utility for user confirmation dialog. |
|
105 * @return the keypress value |
|
106 */ |
|
107 TInt ShowTextInputQueryL(TDes& aText, const TDesC& aPrompt, TInt aExecuteResource, |
|
108 TSecondaryDisplayBTnotifDialogs aDialogId, |
|
109 CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone ); |
|
110 |
|
111 /** |
|
112 * Common utility for UI inforamtion note. |
|
113 */ |
|
114 void ShowInfoNoteL( TInt aResourceId, TSecondaryDisplayBTnotifDialogs aDialogId ); |
|
115 |
|
116 /** |
|
117 * Common utility for UI inforamtion note. |
|
118 */ |
|
119 void ShowInfoNoteL( const TDesC& aResource, TSecondaryDisplayBTnotifDialogs aDialogId ); |
|
120 |
|
121 /** |
|
122 * Common utility for Confirmation note. |
|
123 */ |
|
124 void ShowConfirmationNoteL( TBool aWaitingDlg, const TDesC& aResource, |
|
125 TSecondaryDisplayBTnotifDialogs aDialogId, const TBTDeviceName& aDevNameInCoverUi ); |
|
126 |
|
127 /** |
|
128 * Common utility for Error note. |
|
129 */ |
|
130 void ShowErrorNoteL( TBool aWaitingDlg, const TDesC& aResource, |
|
131 TSecondaryDisplayBTnotifDialogs aDialogId, TBTDeviceName aDevNameInCoverUi ); |
|
132 |
|
133 /** |
|
134 * Check if iYesNoDlg is NULL |
|
135 */ |
|
136 TBool IsQueryReleased(); |
|
137 |
|
138 /** |
|
139 * Update the dialog when UpdateL() is called by client. |
|
140 */ |
|
141 void UpdateQueryDlgL( TDesC& aMessage ); |
|
142 |
|
143 /** |
|
144 * Update the message dialog when UpdateL() is called by client. |
|
145 */ |
|
146 void UpdateMessageQueryDlgL( TDesC& aMessage ); |
|
147 |
|
148 /** |
|
149 * It is used for Secondary display to update. |
|
150 */ |
|
151 void UpdateCoverUiL( const TDesC8& aMessage ); |
|
152 |
|
153 /** |
|
154 * Delete the dialog, mostly used by UpdateL() |
|
155 */ |
|
156 void DismissDialog(); |
|
157 |
|
158 TInt ShowWaitDlgL( TInt aResourceId ); |
|
159 |
|
160 void CompleteWaitDlgL(); |
|
161 |
|
162 private: |
|
163 |
|
164 void CoverUIDisplayL( const MObjectProvider* aMop, const TBTDeviceName& aDevNameInCoverUi ); |
|
165 |
|
166 private: //DATA |
|
167 CEikonEnv* iEikEnv; // Local eikonenv |
|
168 TInt iResourceFileFlag; // Flag for eikon env. |
|
169 CAknQueryDialog* iQueryDlg; // All kinds of query dialog |
|
170 CAknWaitDialog* iWaitDlg; // WaitDialog |
|
171 TBool iCoverDisplayEnabled; // Flag that indicate cover UI featur |
|
172 TBool iSystemCancel; // Used to check if iEikEnv is valid. |
|
173 TBool iAppKeyBlocked; // Apps key is deactivated. |
|
174 }; |
|
175 #endif //BTNOTIFUIUTIL_H |
|
176 |
|
177 |