|
1 /* |
|
2 * Copyright (c) 2008 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: Dynamic soft notification observer. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef AKNDYNAMICSOFTNOTEOBSERVER_H |
|
19 #define AKNDYNAMICSOFTNOTEOBSERVER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <AknCapServerClient.h> // RAknUiServer |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class MAknDynamicSoftNoteObserver; |
|
27 class CAknDynamicSoftNotifier; |
|
28 |
|
29 |
|
30 /** |
|
31 * Observer class for dynamic soft notifications. Listens and receives |
|
32 * dynamic soft notification events from CapServer. |
|
33 * |
|
34 * @since S60 3.2 |
|
35 * @lib AknNotify.DLL |
|
36 */ |
|
37 class CAknDynamicSoftNoteObserver : public CActive |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Constructor. |
|
42 * |
|
43 * @param aDynamicSoftNotifier Dynamic soft notifier. |
|
44 * @param aClientApp Observer client. |
|
45 * @param aNoteId Observed soft notification id |
|
46 */ |
|
47 IMPORT_C static CAknDynamicSoftNoteObserver* NewL( |
|
48 CAknDynamicSoftNotifier& aDynamicSoftNotifier, |
|
49 MAknDynamicSoftNoteObserver* aClientApp, |
|
50 TInt aNoteId ); |
|
51 |
|
52 /** |
|
53 * Constructor. |
|
54 * |
|
55 * @param aDynamicSoftNotifier Dynamic soft notifier. |
|
56 * @param aClientApp Observer client. |
|
57 * @param aNoteId Observed soft notification id |
|
58 */ |
|
59 IMPORT_C static CAknDynamicSoftNoteObserver* NewLC( |
|
60 CAknDynamicSoftNotifier& aDynamicSoftNotifier, |
|
61 MAknDynamicSoftNoteObserver* aClientApp, |
|
62 TInt aNoteId ); |
|
63 |
|
64 /** |
|
65 * Destructor. |
|
66 */ |
|
67 virtual ~CAknDynamicSoftNoteObserver(); |
|
68 |
|
69 /** |
|
70 * Observed dynamic soft notification id. |
|
71 * |
|
72 * @return Observed note id. |
|
73 */ |
|
74 TInt NoteId() const; |
|
75 |
|
76 public: // From CActive |
|
77 void RunL(); |
|
78 void DoCancel(); |
|
79 |
|
80 private: // new methods |
|
81 |
|
82 /** |
|
83 * Constructor. |
|
84 * |
|
85 * @param aDynamicSoftNotifier Dynamic soft notifier. |
|
86 * @param aClientApp Observer client. |
|
87 * @param aNoteId Observed soft notification id |
|
88 */ |
|
89 CAknDynamicSoftNoteObserver( |
|
90 CAknDynamicSoftNotifier& aDynamicSoftNotifier, |
|
91 MAknDynamicSoftNoteObserver* aClientApp, |
|
92 TInt aNoteId ); |
|
93 |
|
94 /** |
|
95 * Constructor. |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 /** |
|
100 * Send asynchronous event request to server. Request is completed when |
|
101 * user responds to dynamic soft notification. |
|
102 */ |
|
103 void IssueRequest(); |
|
104 |
|
105 private: // Data |
|
106 /// Own. CapServer client session. |
|
107 RAknUiServer iSession; |
|
108 |
|
109 /// Not Own. Actual observing client. |
|
110 MAknDynamicSoftNoteObserver* iClientApp; |
|
111 /// Reference to soft notifier. |
|
112 CAknDynamicSoftNotifier& iDynamicSoftNotifier; |
|
113 /// Observed soft notification identifier. |
|
114 TInt iNoteId; |
|
115 /// Response data from the server. |
|
116 TPckgBuf<TInt> iEventBuffer; |
|
117 }; |
|
118 |
|
119 #endif // AKNDYNAMICSOFTNOTEOBSERVER_H |