|
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 { |
|
41 calltype = iTmsCall->GetCallType(); |
|
42 } |
|
43 return calltype; |
|
44 } |
|
45 |
|
46 gint QTMSCall::GetCallContextId(guint& ctxid) |
|
47 { |
|
48 gint status(QTMS_RESULT_UNINITIALIZED_OBJECT); |
|
49 if (iTmsCall) |
|
50 { |
|
51 status = iTmsCall->GetCallContextId(ctxid); |
|
52 } |
|
53 return status; |
|
54 } |
|
55 |
|
56 gint QTMSCall::CreateStream(const QTMSStreamType type, QTMSStream*& qstrm) |
|
57 { |
|
58 gint status(QTMS_RESULT_UNINITIALIZED_OBJECT); |
|
59 |
|
60 TMSStream* tmsstrm(NULL); |
|
61 if (iTmsCall) |
|
62 { |
|
63 status = iTmsCall->CreateStream(type, tmsstrm); |
|
64 } |
|
65 |
|
66 if (status == TMS_RESULT_SUCCESS) |
|
67 { |
|
68 QTMSCallType calltype = iTmsCall->GetCallType(); |
|
69 switch (type) |
|
70 { |
|
71 case TMS_STREAM_UPLINK: |
|
72 case TMS_STREAM_DOWNLINK: |
|
73 status = QTMSStreamImpl::Create(calltype, type, qstrm, tmsstrm); |
|
74 break; |
|
75 default: |
|
76 status = QTMS_RESULT_STREAM_TYPE_NOT_SUPPORTED; |
|
77 break; |
|
78 } |
|
79 } |
|
80 return status; |
|
81 } |
|
82 |
|
83 gint QTMSCall::DeleteStream(QTMSStream*& strm) |
|
84 { |
|
85 gint status(QTMS_RESULT_SUCCESS); |
|
86 //delete (static_cast<QTMSStreamImpl*> (strm)); |
|
87 delete strm; |
|
88 strm = NULL; |
|
89 return status; |
|
90 } |
|
91 |
|
92 // End of file |