|
1 /* |
|
2 * Copyright (c) 2003-2004 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: Observer getting notifications about command handler requests |
|
15 * from Phone Server. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include "RPhCltCommandHandlerNotify.h" |
|
24 #include <RPhCltServer.h> |
|
25 #include <PhCltTypes.h> |
|
26 #include "PhCltClientServer.h" |
|
27 #include <e32base.h> |
|
28 |
|
29 |
|
30 |
|
31 // ============================ MEMBER FUNCTIONS =============================== |
|
32 |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // RPhCltCommandHandlerNotify::RPhCltCommandHandlerNotify |
|
36 // C++ default constructor can NOT contain any code, that |
|
37 // might leave. |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 RPhCltCommandHandlerNotify::RPhCltCommandHandlerNotify() |
|
41 : RSubSessionBase() |
|
42 { |
|
43 } |
|
44 |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // RPhCltCommandHandlerNotify::Open |
|
48 // |
|
49 // Open subsession to Phone Server. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 TInt RPhCltCommandHandlerNotify::Open( RPhCltServer& aServer ) |
|
53 { |
|
54 return CreateSubSession( |
|
55 aServer, |
|
56 EPhoneServerComHandNotifySubSessionOpen, |
|
57 TIpcArgs() ); |
|
58 } |
|
59 |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // RPhCltCommandHandlerNotify::Close |
|
63 // |
|
64 // Close subsession. |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 void RPhCltCommandHandlerNotify::Close() |
|
68 { |
|
69 CloseSubSession( EPhoneServerComHandNotifySubSessionClose ); |
|
70 } |
|
71 |
|
72 |
|
73 // ----------------------------------------------------------------------------- |
|
74 // RPhCltCommandHandlerNotify::NotifyComHandCommand |
|
75 // |
|
76 // Notifies when a Command handler request arrives. |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 void RPhCltCommandHandlerNotify::NotifyComHandCommand( |
|
80 TRequestStatus& aStatus, |
|
81 TDes8& aCommandArgs ) |
|
82 { |
|
83 SendReceive( |
|
84 EPhoneServerComHandNotifySubSessionComHandRequest, |
|
85 TIpcArgs( &aCommandArgs ), |
|
86 aStatus ); |
|
87 } |
|
88 |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // RPhCltCommandHandlerNotify::CancelNotifyComHandCommand |
|
92 // |
|
93 // Cancel pending command handler request notification. |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 void RPhCltCommandHandlerNotify::CancelNotifyComHandCommand() const |
|
97 { |
|
98 SendReceive( |
|
99 EPhoneServerComHandNotifySubSessionComHandRequestCancel, |
|
100 TIpcArgs() ); |
|
101 } |
|
102 |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // RPhCltCommandHandlerNotify::RespondClient |
|
106 // |
|
107 // Respond to client's command handler request. |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 TInt RPhCltCommandHandlerNotify::RespondClient( |
|
111 const TInt aResultCode ) |
|
112 { |
|
113 return Send( |
|
114 EPhoneServerComHandNotifySubSessionReportComHandResult, |
|
115 TIpcArgs( aResultCode ) ); |
|
116 } |
|
117 |
|
118 |
|
119 // End of File |