|
1 /* |
|
2 * Copyright (c) 2006 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSMANAGER_H |
|
20 #define MUSMANAGER_H |
|
21 |
|
22 |
|
23 #include "musmanagercommon.h" |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <sipstrconsts.h> |
|
27 |
|
28 |
|
29 |
|
30 class CMusManagerImpl; |
|
31 |
|
32 #undef IMPORT_C |
|
33 #define IMPORT_C |
|
34 /** |
|
35 * ?one_line_short_description |
|
36 * |
|
37 * ?more_complete_description |
|
38 * |
|
39 * @lib ?library |
|
40 * @since S60 ?S60_version *** for example, S60 v3.0 |
|
41 */ |
|
42 class CMusManager : public CBase |
|
43 { |
|
44 public: |
|
45 enum TRequestType |
|
46 { |
|
47 ESipOptions = 0x1028238D, |
|
48 ESipInviteDesired = 0x10282391, |
|
49 ESipInviteDesired2WayVideo = 0x10282392, |
|
50 ESipInviteNotDesired = 0x1028238D |
|
51 }; |
|
52 |
|
53 public: // first phase constructors |
|
54 |
|
55 IMPORT_C static CMusManager* NewL(); |
|
56 |
|
57 IMPORT_C static CMusManager* NewLC(); |
|
58 |
|
59 virtual ~CMusManager(); |
|
60 |
|
61 |
|
62 public: // new functions |
|
63 /** |
|
64 * This function causes following things: |
|
65 * - MS manager starts to monitor call and network state |
|
66 * - In case of active call, MS manager |
|
67 * - resolves the SIP address of the remote host |
|
68 * - makes a capability query (SIP OPTIONS) |
|
69 * |
|
70 * This function must be called before a MultimediaSharing |
|
71 * session is tried to be established. Otherwise, the internal state of |
|
72 * MultimediaSharing will remain as undefined. In that state, |
|
73 * MultimediaSharing Manager will not start the application. |
|
74 * |
|
75 * @since S60 v3.2 |
|
76 */ |
|
77 IMPORT_C void ExamineAvailabilityL(); |
|
78 |
|
79 /** |
|
80 * This function allows clients to monitor the availability |
|
81 * status of MultimediaSharing. |
|
82 * |
|
83 * The request will return when the availability status changes. |
|
84 * |
|
85 * @since S60 v3.2 |
|
86 * @param aStatus TRequestStatus object of the listener. |
|
87 * @param aAvailabilityStatus Contains the new status, when request complete. |
|
88 */ |
|
89 IMPORT_C void MonitorAvailabilityL( |
|
90 TRequestStatus& aRequestStatus, |
|
91 MultimediaSharing::TMusAvailabilityStatus& aAvailabilityStatus ); |
|
92 |
|
93 /** |
|
94 * Cancels the currently active availability monitoring. |
|
95 * |
|
96 * @since S60 v3.2 |
|
97 */ |
|
98 IMPORT_C void CancelMonitoring(); |
|
99 |
|
100 /** |
|
101 * Returns the current availability status. |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 * @return The current availability status. |
|
105 */ |
|
106 IMPORT_C MultimediaSharing::TMusAvailabilityStatus AvailabilityL(); |
|
107 |
|
108 |
|
109 public: // functions related to application start-up |
|
110 |
|
111 /** |
|
112 * This function allows clients to request coomand's to be executed by |
|
113 * the MUS manager server. |
|
114 * |
|
115 * In erroneous cases, this function will leave |
|
116 * with an error code that describes the error. Positive leave codes |
|
117 * are defined in MultimediaSharing::TMusAvailabilityStatus. |
|
118 * |
|
119 * @param aRequest Defines the coomand type. |
|
120 * |
|
121 */ |
|
122 IMPORT_C void HandleCommandL( MultimediaSharing::TCommandType aCommandType ); |
|
123 |
|
124 |
|
125 /** |
|
126 * Orders MultimediaSharing subsystem to handle a SIP request. |
|
127 * In some cases, this function call starts the application. |
|
128 * |
|
129 * In erroneous cases, this function will leave |
|
130 * with an error code that describes the error. Positive leave codes |
|
131 * are defined in MultimediaSharing::TMusAvailabilityStatus. |
|
132 * |
|
133 * @param aRequest Defines the request type. |
|
134 * Must be SipStrConsts::EOptions or SipStrConsts::EInvite |
|
135 */ |
|
136 IMPORT_C void HandleSipRequestL( TRequestType aRequestType ); |
|
137 |
|
138 /** |
|
139 * Starts the MultimediaSharing application |
|
140 * |
|
141 * If the application can't be started, this function will leave |
|
142 * with an error code that describes the error. Positive leave codes |
|
143 * are defined in MultimediaSharing::TMusAvailabilityStatus. |
|
144 * |
|
145 * @param aUseCase Describes the desired use case and |
|
146 affects the default view. |
|
147 */ |
|
148 IMPORT_C void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); |
|
149 |
|
150 |
|
151 public: // functions to related application closing |
|
152 |
|
153 /** |
|
154 * This function causes the application to get a stop signal. |
|
155 * Application will close itself smoothly. |
|
156 * |
|
157 * @since S60 v3.2 |
|
158 */ |
|
159 IMPORT_C void StopApplicationL(); |
|
160 |
|
161 private: // second phase constructors |
|
162 |
|
163 CMusManager(); |
|
164 |
|
165 void ConstructL(); |
|
166 |
|
167 |
|
168 public: // new functions for testing purposes |
|
169 |
|
170 IMPORT_C static void SetStartError( TInt aError ); |
|
171 |
|
172 IMPORT_C static void SetAvailability( TInt aAvailability ); |
|
173 |
|
174 IMPORT_C static void SetUseCase( MultimediaSharing::TMusUseCase aUseCase ); |
|
175 |
|
176 IMPORT_C static MultimediaSharing::TMusUseCase UseCase(); |
|
177 |
|
178 public: // data |
|
179 |
|
180 MultimediaSharing::TMusAvailabilityStatus iAvailability; |
|
181 |
|
182 TInt iExamineLeaveCode; |
|
183 |
|
184 TInt iStartError; |
|
185 |
|
186 TRequestStatus* iStatus; |
|
187 |
|
188 TRequestType iHandleSipRequestLCalledWithParam; |
|
189 |
|
190 }; |
|
191 |
|
192 #endif // ? C_CLASSNAME_H |