1 /* |
1 /* |
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2002, 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Declares Generic Query Notifier Class. |
14 * Description: Declares Generic Query Notifier Class. |
15 * |
15 * |
16 */ |
16 */ |
17 |
|
18 |
17 |
19 #ifndef BTNGENERICQUERYNOTIFIER_H |
18 #ifndef BTNGENERICQUERYNOTIFIER_H |
20 #define BTNGENERICQUERYNOTIFIER_H |
19 #define BTNGENERICQUERYNOTIFIER_H |
21 |
20 |
22 // INCLUDES |
21 // INCLUDES |
23 |
22 |
24 #include "btnotifier.h" // Base class |
23 #include "btnotifier.h" // Base class |
|
24 #include "btnotifactive.h" |
25 |
25 |
26 // FORWARD DECLARATIONS |
26 // FORWARD DECLARATIONS |
27 |
27 |
28 // CLASS DECLARATION |
28 // CLASS DECLARATION |
29 NONSHARABLE_CLASS(CBTGenericQueryNotifier) : public CBTNotifierBase |
29 NONSHARABLE_CLASS(CBTGenericQueryNotifier): public CBTNotifierBase, |
30 { |
30 public MBTNotifActiveObserver |
31 public: // Constructors and destructor |
31 { |
|
32 public: |
|
33 // Constructors and destructor |
32 |
34 |
33 /** |
35 /** |
34 * Two-phased constructor. |
36 * Two-phased constructor. |
35 */ |
37 */ |
36 static CBTGenericQueryNotifier* NewL(); |
38 static CBTGenericQueryNotifier* NewL(); |
37 |
39 |
38 /** |
40 /** |
39 * Destructor. |
41 * Destructor. |
40 */ |
42 */ |
41 virtual ~CBTGenericQueryNotifier(); |
43 virtual ~CBTGenericQueryNotifier(); |
42 |
44 |
43 private: // Functions from base classes |
45 private: |
|
46 // Functions from base classes |
44 |
47 |
45 /** |
48 /** |
46 * From CBTNotifierBase Called when a notifier is first loaded |
49 * From CBTNotifierBase Called when a notifier is first loaded |
47 * to allow any initial construction that is required. |
50 * to allow any initial construction that is required. |
48 * @param None. |
51 * @param None. |
49 * @return A structure containing priority and channel info. |
52 * @return A structure containing priority and channel info. |
50 */ |
53 */ |
51 TNotifierInfo RegisterL(); |
54 TNotifierInfo RegisterL(); |
52 |
|
53 /** From CBTNotifierBase Synchronic notifier launch. |
|
54 * @param aBuffer Received parameter data. |
|
55 * @return A pointer to return value. |
|
56 */ |
|
57 TPtrC8 StartL(const TDesC8& aBuffer ); |
|
58 |
|
59 /** |
|
60 * From CBTNotifierBase Used in asynchronous notifier launch to |
|
61 * store received parameters into members variables and |
|
62 * make needed initializations. |
|
63 * @param aBuffer A buffer containing received parameters |
|
64 * @param aReturnVal The return value to be passed back. |
|
65 * @param aMessage Should be completed when the notifier is deactivated. |
|
66 * @return None. |
|
67 */ |
|
68 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); |
|
69 |
55 |
70 /** |
56 /** From CBTNotifierBase Synchronic notifier launch. |
71 * From CBTNotifierBase Updates a currently active notifier. |
57 * @param aBuffer Received parameter data. |
72 * @param aBuffer The updated data. |
58 * @return A pointer to return value. |
73 * @return A pointer to return value. |
59 */ |
74 */ |
60 TPtrC8 StartL(const TDesC8& aBuffer); |
75 TPtrC8 UpdateL(const TDesC8& aBuffer); |
|
76 |
|
77 private: |
|
78 |
61 |
79 /** |
62 /** |
80 * Parse the data out of the message that is sent by the client of the notifier. |
63 * From CBTNotifierBase Used in asynchronous notifier launch to |
81 * @param aBuffer A package buffer containing received parameters. |
64 * store received parameters into members variables and |
82 * @return None. |
65 * make needed initializations. |
83 */ |
66 * @param aBuffer A buffer containing received parameters |
84 void ProcessParamBufferL(const TDesC8& aBuffer); |
67 * @param aReturnVal The return value to be passed back. |
85 |
68 * @param aMessage Should be completed when the notifier is deactivated. |
86 /** |
69 * @return None. |
87 * C++ default constructor. |
70 */ |
88 */ |
71 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, |
89 CBTGenericQueryNotifier(); |
72 const RMessagePtr2& aMessage); |
90 |
|
91 /** |
|
92 * Show query and complete message. |
|
93 */ |
|
94 void ShowQueryAndCompleteL(); |
|
95 |
|
96 private: |
|
97 |
|
98 RBuf iQueryMessage; |
|
99 HBufC* iQueryHeader; |
|
100 HBufC* iName; |
|
101 |
73 |
102 TInt iMessageResourceId; |
74 /** |
103 TSecondaryDisplayBTnotifDialogs iSecondaryDisplayCommand; |
75 * From CBTNotifierBase Updates a currently active notifier. |
104 TBool iIsMessageQuery; |
76 * @param aBuffer The updated data. |
105 TBool iIsNameQuery; |
77 * @return A pointer to return value. |
106 }; |
78 */ |
|
79 TPtrC8 UpdateL(const TDesC8& aBuffer); |
|
80 |
|
81 /** |
|
82 * From MBTNotifActiveObserver |
|
83 * Gets called when P&S key notifies change. |
|
84 */ |
|
85 void RequestCompletedL(CBTNotifActive* aActive, TInt aId, TInt aStatus); |
|
86 |
|
87 /** |
|
88 * From MBTNotifActiveObserver |
|
89 */ |
|
90 void HandleError(CBTNotifActive* aActive, TInt aId, TInt aError); |
|
91 |
|
92 /** |
|
93 * From MBTNotifActiveObserver |
|
94 */ |
|
95 void DoCancelRequest(CBTNotifActive* aActive, TInt aId); |
|
96 |
|
97 private: |
|
98 |
|
99 /** |
|
100 * Parse the data out of the message that is sent by the client of the notifier. |
|
101 * @param aBuffer A package buffer containing received parameters. |
|
102 * @return None. |
|
103 */ |
|
104 void ProcessParamBufferL(const TDesC8& aBuffer); |
|
105 |
|
106 /** |
|
107 * C++ default constructor. |
|
108 */ |
|
109 CBTGenericQueryNotifier(); |
|
110 |
|
111 /** |
|
112 * Symbian 2nd phase constructor. |
|
113 */ |
|
114 void ConstructL(); |
|
115 |
|
116 /** |
|
117 * Show query and complete message. |
|
118 */ |
|
119 void ShowQueryAndCompleteL(); |
|
120 |
|
121 private: |
|
122 |
|
123 RBuf iQueryMessage; |
|
124 HBufC* iQueryHeader; |
|
125 HBufC* iName; |
|
126 |
|
127 TInt iMessageResourceId; |
|
128 TSecondaryDisplayBTnotifDialogs iSecondaryDisplayCommand; |
|
129 TBool iIsMessageQuery; |
|
130 TBool iIsNameQuery; |
|
131 RProperty iPhonePowerKey; |
|
132 CBTNotifActive* iPhonePowerKeyWatcher; |
|
133 }; |
107 |
134 |
108 #endif |
135 #endif |
109 |
136 |
110 // End of File |
137 // End of File |