|
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 #include "musmanagercommon.h" |
|
23 //#include "musunittesting.h" |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <sipstrconsts.h> |
|
27 |
|
28 class CMusManagerImpl; |
|
29 class MMusAvailabilityObserver; |
|
30 |
|
31 /** |
|
32 * Class to manager MultimediaSharing application. |
|
33 * |
|
34 * Class CMusManager provides an interface to monitor |
|
35 * the system's ability to initiate a MultimediaSharing |
|
36 * session. Also, MultimediaSharing application can be started |
|
37 * via this interface. Application can be ordered to close |
|
38 * itself by calling the stop application function. |
|
39 * |
|
40 * MultimediaSharing availability is a variable of a system |
|
41 * that describes that is a MultimediaSharing session currently |
|
42 * possible, or not. It depends on call state, network state, |
|
43 * SIP profiles and SIP OPTIONS. |
|
44 * |
|
45 * @lib musmanagerclient.dll |
|
46 */ |
|
47 class CMusManager : public CBase |
|
48 { |
|
49 public: |
|
50 |
|
51 enum TRequestType |
|
52 { |
|
53 ESipOptions = 0x1028238D, |
|
54 ESipInviteDesired = 0x10282391, |
|
55 ESipInviteNotDesired = 0x1028238D |
|
56 }; |
|
57 |
|
58 |
|
59 public: // first phase constructors and destructor |
|
60 |
|
61 IMPORT_C static CMusManager* NewL(); |
|
62 |
|
63 IMPORT_C static CMusManager* NewLC(); |
|
64 |
|
65 /** |
|
66 * Creates Mus Manager instance allowing the clients to pass |
|
67 * an observer interface through which the clients will be capable |
|
68 * to listen for the availability state of Multimedia Sharing |
|
69 * |
|
70 * @param aAvailabilityObserver pointer to the implementation of |
|
71 * availabilty observer interface |
|
72 * |
|
73 * @since S60 v5.0 |
|
74 */ |
|
75 IMPORT_C static CMusManager* NewL( |
|
76 MMusAvailabilityObserver* aAvailabilityObserver ); |
|
77 |
|
78 /** |
|
79 * Creates Mus Manager instance allowing the clients to pass |
|
80 * an observer interface through which the clients will be capable |
|
81 * to listen for the availability state of Multimedia Sharing |
|
82 * Mus Manager instance is left on cleanup stack. |
|
83 * |
|
84 * @param aAvailabilityObserver pointer to the implementation of |
|
85 * availabilty observer interface |
|
86 * |
|
87 * @since S60 v5.0 |
|
88 */ |
|
89 IMPORT_C static CMusManager* NewLC( |
|
90 MMusAvailabilityObserver* aAvailabilityObserver ); |
|
91 |
|
92 virtual ~CMusManager(); |
|
93 |
|
94 public: // functions related to availability of MultimediaSharing |
|
95 |
|
96 /** |
|
97 * This function causes following things: |
|
98 * - MS manager starts to monitor call and network state |
|
99 * - In case of active call, MS manager |
|
100 * - resolves the SIP address of the remote host |
|
101 * - makes a capability query (SIP OPTIONS) |
|
102 * |
|
103 * This function must be called before a MultimediaSharing |
|
104 * session is tried to be established. Otherwise, the internal state of |
|
105 * MultimediaSharing will remain as undefined. In that state, |
|
106 * MultimediaSharing Manager will not start the application. |
|
107 * |
|
108 * @since S60 v3.2 |
|
109 */ |
|
110 IMPORT_C void ExamineAvailabilityL(); |
|
111 |
|
112 /** |
|
113 * Returns the current availability status. |
|
114 * |
|
115 * @since S60 v3.2 |
|
116 * @return The current availability status. |
|
117 */ |
|
118 IMPORT_C MultimediaSharing::TMusAvailabilityStatus AvailabilityL(); |
|
119 |
|
120 public: // functions related to application start-up |
|
121 |
|
122 /** |
|
123 * This function allows clients to request coomand's to be executed by |
|
124 * the MUS manager server. |
|
125 * |
|
126 * In erroneous cases, this function will leave |
|
127 * with an error code that describes the error. Positive leave codes |
|
128 * are defined in MultimediaSharing::TMusAvailabilityStatus. |
|
129 * |
|
130 * @param aRequest Defines the coomand type. |
|
131 * |
|
132 */ |
|
133 IMPORT_C void HandleCommandL( MultimediaSharing::TCommandType aCommandType ); |
|
134 |
|
135 |
|
136 /** |
|
137 * Orders MultimediaSharing subsystem to handle a SIP request. |
|
138 * In some cases, this function call starts the application. |
|
139 * |
|
140 * In erroneous cases, 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 aRequest Defines the request type. |
|
145 * Must be SipStrConsts::EOptions or SipStrConsts::EInvite |
|
146 */ |
|
147 IMPORT_C void HandleSipRequestL( TRequestType aRequestType ); |
|
148 |
|
149 /** |
|
150 * Starts the MultimediaSharing application |
|
151 * |
|
152 * If the application can't be started, this function will leave |
|
153 * with an error code that describes the error. Positive leave codes |
|
154 * are defined in MultimediaSharing::TMusAvailabilityStatus. |
|
155 * |
|
156 * @param aUseCase Describes the desired use case and |
|
157 affects the default view. |
|
158 */ |
|
159 IMPORT_C void StartApplicationL( MultimediaSharing::TMusUseCase aUseCase ); |
|
160 |
|
161 public: // functions to related application closing |
|
162 |
|
163 /** |
|
164 * This function causes the application to get a stop signal. |
|
165 * Application will close itself smoothly. |
|
166 * |
|
167 */ |
|
168 IMPORT_C void StopApplicationL(); |
|
169 |
|
170 private: // second phase constructors |
|
171 |
|
172 CMusManager(); |
|
173 |
|
174 void ConstructL(); |
|
175 |
|
176 void ConstructL( MMusAvailabilityObserver* aAvailabilityObserver ); |
|
177 |
|
178 private: // data |
|
179 |
|
180 /** |
|
181 * The actual implementation of the interface. |
|
182 * Own. |
|
183 */ |
|
184 CMusManagerImpl* iImpl; |
|
185 }; |
|
186 |
|
187 #endif // ? MUSMANAGER_H |