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