|
1 /* |
|
2 * Copyright (c) 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: Provides wrapper for waiting dialogs. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef DIAGPLUGINWAITINGDIALOGWRAPPER_H |
|
20 #define DIAGPLUGINWAITINGDIALOGWRAPPER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> // CBase |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CAknDialog; |
|
27 |
|
28 /** |
|
29 * Diagnostics Plugin Waiting Dialog Wrapper. |
|
30 * |
|
31 * This class provides a wrapper for executing dialogs. The only functionality |
|
32 * it adds is that it provides a way for the caller to find out whether |
|
33 * the dialog was dismissed by the user response, or by application deletion. |
|
34 * |
|
35 * @since S60 v5.0 |
|
36 */ |
|
37 class CDiagPluginWaitingDialogWrapper : public CBase |
|
38 { |
|
39 public: // new API |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * |
|
43 * @param - aWaitingDialog. Pointer to dialog to display. Note that |
|
44 * it must be a dialog with EEikDialogFlagWait set. Otherwise, it |
|
45 * will panic with EDiagPluginBasePanicBadArgument |
|
46 * Ownership is transferred to the wrapper. |
|
47 * @return - New instance of CDiagPluginWaitingDialogWrapper |
|
48 */ |
|
49 IMPORT_C static CDiagPluginWaitingDialogWrapper* NewL( CAknDialog* aWaitingDialog ); |
|
50 |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 IMPORT_C virtual ~CDiagPluginWaitingDialogWrapper(); |
|
55 |
|
56 /** |
|
57 * Run a dialog that waits for response. |
|
58 * |
|
59 * To dismiss the dialog, simply delete CDiagPluginWaitingDialogWrapper instance. |
|
60 * |
|
61 * The difference from normal dialog RunLD is that this function returns |
|
62 * ETrue if dialog exited due to user response and |
|
63 * EFalse if the object was deleted. |
|
64 * |
|
65 * !!!! NOTE THAT PLUG-IN MUST RETURN IMMEDIATELY WITHOUT ACCESSING !!!! |
|
66 * !!!! LOCAL VARIABLE OR LOCAL FUNCITONS WHEN THIS FUNCTION RETURNS !!!! |
|
67 * !!!! EFalse VALUE BECAUSE "THIS" POINTER MAY BE FREED ALREADY. !!!! |
|
68 * |
|
69 * The normal dialog response is returned via aDialogResponse parameter. |
|
70 * |
|
71 * @param aDialogResponse - Response from the dialog. |
|
72 * For detailed values @see avkon.hrh "CBA constants". E.g. EAknSoftkeyYes |
|
73 * The only exception is that if cancel is pressed, it will be 0. |
|
74 * @return ETrue if dialog is exiting due to user response. |
|
75 * Efalse if dialog is dismissed without user input. |
|
76 * If EFalse is returned, plug-in MUST NOT act on the response. |
|
77 */ |
|
78 IMPORT_C TBool RunLD( TInt& aDialogResponse ); |
|
79 |
|
80 private: // private interface |
|
81 /** |
|
82 * C++ Constructor |
|
83 * |
|
84 * @param - aWaitingDialog. Pointer to dialog to display. Note that |
|
85 * it must be a dialog with EEikDialogFlagWait set. Otherwise, it |
|
86 * will panic with EDiagPluginBasePanicBadArgument |
|
87 * Ownership is transferred to the wrapper. |
|
88 */ |
|
89 CDiagPluginWaitingDialogWrapper( CAknDialog* aWaitingDialog ); |
|
90 |
|
91 private: // Private Data |
|
92 /** |
|
93 * Pointer to the dialog being displayed. |
|
94 * Ownership: Shared. Normally, dialog will dismiss itself. However, |
|
95 * if plug-in is being deleted, it can be deleted by the plug-in as well. |
|
96 */ |
|
97 CAknDialog* iWaitingDialog; |
|
98 |
|
99 /** |
|
100 * Indicates whether this class is deleted by caller. |
|
101 * Ownership: Not owned. Normally, it will point to a stack entry. |
|
102 */ |
|
103 TBool* iIsObjectDeletedPtr; |
|
104 }; |
|
105 |
|
106 #endif // DIAGTESTPLUGINBASE_H |
|
107 |
|
108 // End of File |
|
109 |