1 /* |
|
2 * Copyright (c) 2010 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: QT Bindings for TMS |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <tmscall.h> |
|
19 #include <qtmscall.h> |
|
20 #include <tmsstream.h> |
|
21 #include "qtmscallimpl.h" |
|
22 #include "qtmsstreamimpl.h" |
|
23 |
|
24 using namespace QTMS; |
|
25 using namespace TMS; |
|
26 |
|
27 QTMSCall::QTMSCall() : |
|
28 iTmsCall(NULL) |
|
29 { |
|
30 } |
|
31 |
|
32 QTMSCall::~QTMSCall() |
|
33 { |
|
34 } |
|
35 |
|
36 QTMSCallType QTMSCall::GetCallType() |
|
37 { |
|
38 QTMSCallType calltype(-1); |
|
39 if (iTmsCall) { |
|
40 calltype = iTmsCall->GetCallType(); |
|
41 } |
|
42 return calltype; |
|
43 } |
|
44 |
|
45 gint QTMSCall::GetCallContextId(guint& ctxid) |
|
46 { |
|
47 gint status(QTMS_RESULT_UNINITIALIZED_OBJECT); |
|
48 if (iTmsCall) { |
|
49 status = iTmsCall->GetCallContextId(ctxid); |
|
50 } |
|
51 return status; |
|
52 } |
|
53 |
|
54 gint QTMSCall::CreateStream(const QTMSStreamType type, QTMSStream*& qstrm) |
|
55 { |
|
56 gint status(QTMS_RESULT_UNINITIALIZED_OBJECT); |
|
57 |
|
58 TMSStream* tmsstrm(NULL); |
|
59 if (iTmsCall) { |
|
60 status = iTmsCall->CreateStream(type, tmsstrm); |
|
61 } |
|
62 |
|
63 if (status == TMS_RESULT_SUCCESS) { |
|
64 QTMSCallType calltype = iTmsCall->GetCallType(); |
|
65 switch (type) { |
|
66 case TMS_STREAM_UPLINK: |
|
67 case TMS_STREAM_DOWNLINK: |
|
68 status = QTMSStreamImpl::Create(calltype, type, qstrm, tmsstrm); |
|
69 break; |
|
70 default: |
|
71 status = QTMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; |
|
72 break; |
|
73 } |
|
74 } |
|
75 return status; |
|
76 } |
|
77 |
|
78 gint QTMSCall::DeleteStream(QTMSStream*& strm) |
|
79 { |
|
80 gint status(QTMS_RESULT_SUCCESS); |
|
81 delete strm; |
|
82 strm = NULL; |
|
83 return status; |
|
84 } |
|
85 |
|
86 // End of file |
|