|
1 /* |
|
2 * Copyright (c) 2009 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: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TMS_CALL_H |
|
19 #define TMS_CALL_H |
|
20 |
|
21 #include <tms.h> |
|
22 |
|
23 namespace TMS { |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class TMSStream; |
|
27 class TMSCallBody; |
|
28 |
|
29 /** |
|
30 * TMSCall class |
|
31 * |
|
32 * This class instantiates TMS call object of one of the following types: |
|
33 * TMS_CALL_CS |
|
34 * TMS_CALL_ECS |
|
35 * TMS_CALL_IP |
|
36 * |
|
37 * Each TMS call contains at least 1 stream (uplink or downlink). |
|
38 * |
|
39 * Usage: |
|
40 * <code> |
|
41 * TMSFactory *iFactory; |
|
42 * TMSCall *iCall; |
|
43 * TMSStream *iUplink; |
|
44 * TMSStream *iDownlink; |
|
45 * gint err; |
|
46 * err = TMSFactory::CreateFactory(iFactory); |
|
47 * err = iFactory->CreateCall(TMS_CALL_IP, iCall); |
|
48 * err = iCall->CreateStream(TMS_STREAM_UPLINK, iUplink); |
|
49 * err = iCall->CreateStream(TMS_STREAM_DOWNLINK, iDownlink); |
|
50 * ... |
|
51 * err = iCall->DeleteStream(iDownlink); |
|
52 * err = iCall->DeleteStream(iUplink); |
|
53 * err = iFactory->DeleteCall(iCall); |
|
54 * delete iFactory; |
|
55 * ... |
|
56 * </code> |
|
57 * |
|
58 * @lib tmsapi.lib |
|
59 * |
|
60 */ |
|
61 class TMSCall |
|
62 { |
|
63 public: |
|
64 /** |
|
65 * Destructor |
|
66 * |
|
67 */ |
|
68 IMPORT_C virtual ~TMSCall(); |
|
69 |
|
70 /** |
|
71 * Return call type. |
|
72 * |
|
73 * This function can be called at any time. |
|
74 * |
|
75 * Possible call types are as follows: |
|
76 * TMS_CALL_CS, |
|
77 * TMS_CALL_ECS |
|
78 * TMS_CALL_IP |
|
79 * |
|
80 * @return |
|
81 * Call type as indicated above. |
|
82 * |
|
83 */ |
|
84 IMPORT_C TMSCallType GetCallType(); |
|
85 |
|
86 /** |
|
87 * Get call context ID. |
|
88 * |
|
89 * This ID is passed during the creation of the call object. |
|
90 * |
|
91 * @param ctxid |
|
92 * Context ID. |
|
93 * |
|
94 * @return |
|
95 * TMS_RESULT_SUCCESS if the operation was successful. |
|
96 * TMS_RESULT_FATAL_ERROR if an error occured. |
|
97 * |
|
98 */ |
|
99 IMPORT_C gint GetCallContextId(guint& ctxid); |
|
100 |
|
101 /** |
|
102 * Create TMS stream of the given type. |
|
103 * |
|
104 * @param type |
|
105 * Stream type to be created. |
|
106 * |
|
107 * @param strm |
|
108 * Created stream. |
|
109 * |
|
110 * @return |
|
111 * TMS_RESULT_SUCCESS if the operation was successful. |
|
112 * TMS_RESULT_INSUFFICIENT_MEMORY if call creation failed due to |
|
113 * insufficient memory. |
|
114 * TMS_RESULT_STREAM_TYPE_NOT_SUPPORTED if stream type is not |
|
115 * supported. |
|
116 * TMS_RESULT_FATAL_ERROR if an error occured. |
|
117 * TMS_REASON_EMERGENCY_CALL_ONGOING if emergency call is active. |
|
118 * TMS_REASON_PERMISSION_DENIED if permission is denied. |
|
119 * TMS_RESULT_INVALID_ARGUMENT if strm is not set to NULL. |
|
120 * TMS_RESULT_ALREADY_EXIST if the same streamtype is created |
|
121 * multiple times. |
|
122 * |
|
123 */ |
|
124 IMPORT_C gint CreateStream(const TMSStreamType type, TMSStream*& strm); |
|
125 |
|
126 /** |
|
127 * Delete stream object. |
|
128 * |
|
129 * @param strm |
|
130 * Stream to be deleted. |
|
131 * |
|
132 * @return |
|
133 * TMS_RESULT_SUCCESS if the operation was successful. |
|
134 * TMS_RESULT_INVALID_ARGUMENT if the stream is not valid. |
|
135 */ |
|
136 IMPORT_C gint DeleteStream(TMSStream*& strm); |
|
137 |
|
138 protected: |
|
139 /** |
|
140 * Constructor |
|
141 */ |
|
142 IMPORT_C TMSCall(); |
|
143 |
|
144 protected: |
|
145 TMSCallBody* iBody; |
|
146 }; |
|
147 |
|
148 } //namespace TMS |
|
149 |
|
150 #endif //TMS_CALL_H |
|
151 |
|
152 // End of file |
|
153 |