|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMCEMSRPSOURCE_H |
|
21 #define CMCEMSRPSOURCE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <mcemediasource.h> |
|
25 #include <e32std.h> |
|
26 #include <bamdesca.h> |
|
27 #include<uri8.h> |
|
28 #include<e32des8.h> |
|
29 #include <mcemessagestream.h> |
|
30 #include <badesca.h> |
|
31 |
|
32 // CONSTANTS |
|
33 const TMceSourceType KMceMSRPSource = 5; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * Class representing a MSRP source (RFC 4975). |
|
38 * |
|
39 * @lib mceclient.lib |
|
40 */ |
|
41 class CMceMsrpSource: public CMceMediaSource |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 IMPORT_C static CMceMsrpSource* NewL(); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 */ |
|
53 IMPORT_C static CMceMsrpSource* NewLC(); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 IMPORT_C ~CMceMsrpSource(); |
|
59 |
|
60 public: // From CMceMediaSource |
|
61 |
|
62 /** |
|
63 * Sets the source enabled. |
|
64 */ |
|
65 IMPORT_C void EnableL(); |
|
66 |
|
67 /** |
|
68 * Sets the source disabled. |
|
69 */ |
|
70 IMPORT_C void DisableL(); |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 /** |
|
75 * Gets the value for "path" attribute. |
|
76 */ |
|
77 IMPORT_C RPointerArray<TUriC8>& Path(); |
|
78 |
|
79 /** |
|
80 * Sets the value for "path" attribute. |
|
81 */ |
|
82 IMPORT_C void SetPathL( const RPointerArray<TUriC8>& aPath ); |
|
83 |
|
84 /** |
|
85 * Gets the values for "accept-types" attribute. |
|
86 */ |
|
87 IMPORT_C void AcceptTypesL(CDesC8ArrayFlat& aAcceptTypes); |
|
88 |
|
89 /** |
|
90 * Sets the values for "accept-types" attribute. |
|
91 */ |
|
92 IMPORT_C void SetAcceptTypesL( const MDesC8Array& aAcceptTypes ); |
|
93 |
|
94 /** |
|
95 * Gets the values for "accept-wrapped-types" attribute |
|
96 */ |
|
97 |
|
98 IMPORT_C TDes8& AcceptWrappedTypesL(); |
|
99 |
|
100 /** |
|
101 * Sets the values for "accept-wrapped-types" attribute. |
|
102 * @param aAcceptWrappedTypes list of MIME types that are allowed inside compound types |
|
103 */ |
|
104 |
|
105 IMPORT_C void SetAcceptWrappedTypesL ( const TDes8& aAcceptWrappedTypes ); |
|
106 |
|
107 /** |
|
108 * Sets the values for file-selector attributes ('name', 'type', 'size'). |
|
109 * @param aName name of the file to be transferred |
|
110 * @param aPath path of the file to be transferred |
|
111 */ |
|
112 IMPORT_C void SetFileSelectorL(const TDesC& aName = KNullDesC, |
|
113 const TDesC8& aFileType = KNullDesC8, |
|
114 const TUint aSize = 0 ); |
|
115 |
|
116 /** |
|
117 * Sets the value for file-disposition attribute. |
|
118 * @param aVar indicate a preferred disposition of the file to be transferred |
|
119 */ |
|
120 IMPORT_C void SetFileDispositionL (const TDes8& aDispositionValue); |
|
121 |
|
122 /** |
|
123 * Sets the value for file-transfer-id attribute. |
|
124 * @returns the value of the file-transfer-id |
|
125 */ |
|
126 IMPORT_C void SetFileTransferIdL (TDes8& aId); |
|
127 |
|
128 /** |
|
129 * Sets the information attribue. |
|
130 * @param aInfo information to be set |
|
131 */ |
|
132 IMPORT_C void SetInformationAttrL(const TDes8& aInfo); |
|
133 |
|
134 /** |
|
135 * Set the path to save the received file in file sharing use case |
|
136 * It is mandatory for the clients to set this path to let |
|
137 * the MCE know the path where the received file will be saved |
|
138 * |
|
139 * @Param aFilePath Holds the path to save the received file |
|
140 */ |
|
141 IMPORT_C void SetPathToSaveReceivedFile(const TDesC16& aFilePath); |
|
142 |
|
143 /* |
|
144 * Used to get the file transfer progress notifications like transferred x bytes |
|
145 * out of total y file size. This is true by default. |
|
146 * @param enableFlag Default value is ETrue. |
|
147 */ |
|
148 IMPORT_C void EnableFileTransferProgressNotifications(TBool enableFlag = ETrue); |
|
149 |
|
150 public: // for internal purpose |
|
151 /** |
|
152 * Calls to set the local media port from the MSRP URI |
|
153 * @return Symtem wide error if the path attribute is not set for the aParent |
|
154 */ |
|
155 void InitializeL( CMceMediaStream& aParent ); |
|
156 |
|
157 private: |
|
158 |
|
159 /** |
|
160 * C++ default constructor. |
|
161 */ |
|
162 CMceMsrpSource(); |
|
163 |
|
164 /** |
|
165 * Second phase constructior. |
|
166 */ |
|
167 void ConstructL(); |
|
168 |
|
169 /** |
|
170 * Sets the local media port form the MSRP path attribute |
|
171 * @par aMsrpUri The Uri from which the port has to be extracted |
|
172 * @aStream Sets the local media port with the port extracted form the aMsrpUri |
|
173 */ |
|
174 void SetPortFromPathAttrL(TUriC8& aMsrpUri, CMceMessageStream& aStream); |
|
175 |
|
176 //for testing |
|
177 |
|
178 MCE_UNIT_TEST_DEFS |
|
179 |
|
180 }; |
|
181 |
|
182 |
|
183 #endif // CMCEMSRPSOURCE_H |