|
1 /* |
|
2 * |
|
3 * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of the License "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Original Contributors: |
|
11 * Comarch S.A. - original contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 #include "hfpprofileplugin.h" |
|
20 #include "hfpdatahandler.h" |
|
21 #include "hfpsettings.h" |
|
22 #include "debug.h" |
|
23 |
|
24 CHsHFPProfile* CHsHFPProfile::NewL() |
|
25 { |
|
26 CHsHFPProfile *self = CHsHFPProfile::NewLC(); |
|
27 CleanupStack::Pop(self); |
|
28 return self; |
|
29 } |
|
30 |
|
31 CHsHFPProfile* CHsHFPProfile::NewLC() |
|
32 { |
|
33 CHsHFPProfile *self = new (ELeave) CHsHFPProfile(); |
|
34 CleanupStack::PushL(self); |
|
35 self->ContructL(); |
|
36 return self; |
|
37 } |
|
38 |
|
39 CHsHFPProfile::CHsHFPProfile() |
|
40 { |
|
41 |
|
42 } |
|
43 |
|
44 void CHsHFPProfile::ContructL() |
|
45 { |
|
46 TRACE_FUNC_ENTRY |
|
47 iDataHandler = CHsHFPDataHandler::NewL(); |
|
48 iSettings = CHsHFPSettings::InstanceL(); |
|
49 TRACE_FUNC_EXIT |
|
50 } |
|
51 |
|
52 CHsHFPProfile::~CHsHFPProfile() |
|
53 { |
|
54 TRACE_FUNC_ENTRY |
|
55 if (iDataHandler) |
|
56 { |
|
57 delete iDataHandler; |
|
58 } |
|
59 if (iSettings) |
|
60 { |
|
61 iSettings->Release(); |
|
62 } |
|
63 TRACE_FUNC_EXIT |
|
64 } |
|
65 |
|
66 void CHsHFPProfile::HandleCommandL(const TDesC8& aCommandsIn, |
|
67 TDes8& aCommandsOut, const TBool aFromAG) |
|
68 { |
|
69 TRACE_FUNC_ENTRY |
|
70 |
|
71 iDataHandler->ProcessDataL(aCommandsIn, aFromAG, aCommandsOut); |
|
72 |
|
73 TRACE_FUNC_EXIT |
|
74 } |
|
75 |
|
76 void CHsHFPProfile::HandleClientDisconnected(TInt aErr) |
|
77 { |
|
78 TRACE_FUNC_ENTRY |
|
79 iDataHandler->HandleClientDisconnected(aErr); |
|
80 TRACE_FUNC_EXIT |
|
81 } |
|
82 |
|
83 void CHsHFPProfile::HandleClientConnected(TDes8& aCommandOut) |
|
84 { |
|
85 TRACE_FUNC_ENTRY |
|
86 iDataHandler->HandleClientConnected(aCommandOut); |
|
87 TRACE_FUNC_EXIT |
|
88 } |
|
89 |
|
90 void CHsHFPProfile::HandleAcceptCallL(TDes8& aCommandOut) |
|
91 { |
|
92 TRACE_FUNC_ENTRY |
|
93 |
|
94 iDataHandler->HandleAcceptCallL(aCommandOut); |
|
95 |
|
96 TRACE_FUNC_EXIT |
|
97 } |
|
98 |
|
99 void CHsHFPProfile::HandleReleaseCallL(TDes8& aCommandOut) |
|
100 { |
|
101 TRACE_FUNC_ENTRY |
|
102 |
|
103 iDataHandler->HandleReleaseCallL(aCommandOut); |
|
104 |
|
105 TRACE_FUNC_EXIT |
|
106 } |