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: Manages note showing in UI |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CDUNNOTEHANDLER_H |
|
20 #define C_CDUNNOTEHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <dunutils.rsg> |
|
24 #include <AknGlobalConfirmationQuery.h> |
|
25 #include <data_caging_path_literals.hrh> |
|
26 #include "DunTransporter.h" |
|
27 |
|
28 /** |
|
29 * Class for managing note showing in UI |
|
30 * |
|
31 * @lib dunutils.lib |
|
32 * @since S60 v3.2 |
|
33 */ |
|
34 NONSHARABLE_CLASS( CDunNoteHandler ) : public CActive |
|
35 { |
|
36 |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @return Instance of self |
|
42 */ |
|
43 static CDunNoteHandler* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CDunNoteHandler(); |
|
49 |
|
50 /** |
|
51 * Resets data to initial values |
|
52 * |
|
53 * @since S60 3.2 |
|
54 * @return None |
|
55 */ |
|
56 void ResetData(); |
|
57 |
|
58 /** |
|
59 * Issues request to start showing UI note |
|
60 * |
|
61 * @since S60 3.2 |
|
62 * @return Symbian error code on error, KErrNone otherwise |
|
63 */ |
|
64 TInt IssueRequest(); |
|
65 |
|
66 /** |
|
67 * Stops showing UI note |
|
68 * |
|
69 * @since S60 3.2 |
|
70 * @return Symbian error code on error, KErrNone otherwise |
|
71 */ |
|
72 TInt Stop(); |
|
73 |
|
74 private: |
|
75 |
|
76 CDunNoteHandler(); |
|
77 |
|
78 void ConstructL(); |
|
79 |
|
80 /** |
|
81 * Initializes this class |
|
82 * |
|
83 * @since S60 3.2 |
|
84 * @return None |
|
85 */ |
|
86 void Initialize(); |
|
87 |
|
88 /** |
|
89 * Issues request to start showing UI note |
|
90 * |
|
91 * @since S60 3.2 |
|
92 * @return None |
|
93 */ |
|
94 void DoIssueRequestL(); |
|
95 |
|
96 /** |
|
97 * Reads resource text |
|
98 * |
|
99 * @since S60 3.2 |
|
100 * @param aResourceId Resource ID to read |
|
101 * @param aUnicode Buffer containing the note string to show |
|
102 * @return None |
|
103 */ |
|
104 void ReadResourceTextL( TInt aResourceId, HBufC16*& aUnicode ); |
|
105 |
|
106 // from base class CActive |
|
107 |
|
108 /* |
|
109 * From CActive. |
|
110 * Gets called when UI note dismissed |
|
111 * |
|
112 * @since S60 3.2 |
|
113 * @return None |
|
114 */ |
|
115 void RunL(); |
|
116 |
|
117 /** |
|
118 * From CActive. |
|
119 * Gets called on cancel |
|
120 * |
|
121 * @since S60 3.2 |
|
122 * @return None |
|
123 */ |
|
124 void DoCancel(); |
|
125 |
|
126 private: // data |
|
127 |
|
128 /** |
|
129 * Note to show |
|
130 */ |
|
131 CAknGlobalConfirmationQuery* iNote; |
|
132 |
|
133 /** |
|
134 * Current state of note showing: active or inactive |
|
135 */ |
|
136 TDunState iNoteState; |
|
137 |
|
138 }; |
|
139 |
|
140 #endif // C_CDUNNOTEHANDLER_H |
|