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 #ifndef QTMS_CALL_H |
|
19 #define QTMS_CALL_H |
|
20 |
|
21 #include <qtms.h> |
|
22 #include <QObject> |
|
23 #include "qtmswrapperexport.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 namespace TMS |
|
27 { |
|
28 class TMSCall; |
|
29 } |
|
30 |
|
31 namespace QTMS |
|
32 { |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class QTMSStream; |
|
36 |
|
37 /** |
|
38 * QTMSCall class |
|
39 * |
|
40 * This class instantiates QTMS call object of one of the following types: |
|
41 * QTMS_CALL_CS |
|
42 * QTMS_CALL_ECS |
|
43 * QTMS_CALL_IP |
|
44 * |
|
45 * Each QTMS call contains at least 1 stream (uplink or downlink). |
|
46 * |
|
47 * Usage: |
|
48 * <code> |
|
49 * QTMSFactory *iFactory; |
|
50 * QTMSCall *iCall; |
|
51 * QTMSStream *iUplink; |
|
52 * QTMSStream *iDownlink; |
|
53 * gint err; |
|
54 * err = QTMSFactory::CreateFactory(iFactory); |
|
55 * err = iFactory->CreateCall(QTMS_CALL_IP, iCall); |
|
56 * err = iCall->CreateStream(QTMS_STREAM_UPLINK, iUplink); |
|
57 * err = iCall->CreateStream(QTMS_STREAM_DOWNLINK, iDownlink); |
|
58 * ... |
|
59 * err = iCall->DeleteStream(iDownlink); |
|
60 * err = iCall->DeleteStream(iUplink); |
|
61 * err = iFactory->DeleteCall(iCall); |
|
62 * delete iFactory; |
|
63 * ... |
|
64 * </code> |
|
65 * |
|
66 * @lib QTMSapi.lib |
|
67 * |
|
68 */ |
|
69 class QTMS_WRAPPER_DLL_EXPORT QTMSCall : public QObject |
|
70 { |
|
71 Q_OBJECT |
|
72 public: |
|
73 /** |
|
74 * Destructor |
|
75 * |
|
76 */ |
|
77 virtual ~QTMSCall(); |
|
78 |
|
79 /** |
|
80 * Return call type. |
|
81 * |
|
82 * This function can be called at any time. |
|
83 * |
|
84 * Possible call types are as follows: |
|
85 * QTMS_CALL_CS, |
|
86 * QTMS_CALL_ECS |
|
87 * QTMS_CALL_IP |
|
88 * |
|
89 * @return |
|
90 * Call type as indicated above. |
|
91 * |
|
92 */ |
|
93 QTMSCallType GetCallType(); |
|
94 |
|
95 /** |
|
96 * Get call context ID. |
|
97 * |
|
98 * This ID is passed during the creation of the call object. |
|
99 * |
|
100 * @param ctxid |
|
101 * Context ID. |
|
102 * |
|
103 * @return |
|
104 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
105 * QTMS_RESULT_FATAL_ERROR if an error occured. |
|
106 * |
|
107 */ |
|
108 gint GetCallContextId(guint& ctxid); |
|
109 |
|
110 /** |
|
111 * Create QTMS stream of the given type. |
|
112 * |
|
113 * @param type |
|
114 * Stream type to be created. |
|
115 * |
|
116 * @param strm |
|
117 * Created stream. |
|
118 * |
|
119 * @return |
|
120 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
121 * QTMS_RESULT_INSUFFICIENT_MEMORY if call creation failed due to |
|
122 * insufficient memory. |
|
123 * QTMS_RESULT_STREAM_TYPE_NOT_SUPPORTED if stream type is not |
|
124 * supported. |
|
125 * QTMS_RESULT_FATAL_ERROR if an error occured. |
|
126 * QTMS_REASON_EMERGENCY_CALL_ONGOING if emergency call is active. |
|
127 * QTMS_REASON_PERMISSION_DENIED if permission is denied. |
|
128 * |
|
129 */ |
|
130 gint CreateStream(const QTMSStreamType type, QTMSStream*& strm); |
|
131 |
|
132 /** |
|
133 * Delete stream object. |
|
134 * |
|
135 * @param strm |
|
136 * Stream to be deleted. |
|
137 * |
|
138 * @return |
|
139 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
140 * QTMS_RESULT_INVALID_ARGUMENT if the stream is not valid. |
|
141 */ |
|
142 gint DeleteStream(QTMSStream*& strm); |
|
143 |
|
144 protected: |
|
145 /** |
|
146 * Constructor |
|
147 */ |
|
148 QTMSCall(); |
|
149 |
|
150 protected: |
|
151 TMS::TMSCall* iTmsCall; |
|
152 }; |
|
153 |
|
154 } //namespace QTMS |
|
155 |
|
156 #endif //QTMS_CALL_H |
|
157 // End of file |
|
158 |
|