|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Header file of CUpnpResParameters class. CUpnpResParameters |
|
15 * is created to encapsulate information that is needed in a |
|
16 * contentdirectory res element. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef C_UPNPRESPARAMETERS_H |
|
26 #define C_UPNPRESPARAMETERS_H |
|
27 |
|
28 // system includes |
|
29 #include <e32base.h> |
|
30 |
|
31 // user includes |
|
32 // NONE |
|
33 |
|
34 // forward declarations |
|
35 // NONE |
|
36 |
|
37 // data types |
|
38 // NONE |
|
39 |
|
40 // constants |
|
41 // NONE |
|
42 |
|
43 /** |
|
44 * CUpnpResParameters is created to encapsulate information that is needed |
|
45 * in a contentdirectory res element. |
|
46 * |
|
47 * @lib dlnaprofiler.lib |
|
48 * @since S60 v3.1 |
|
49 */ |
|
50 class CUpnpResParameters: public CBase |
|
51 { |
|
52 public: |
|
53 |
|
54 IMPORT_C static CUpnpResParameters* NewL(); |
|
55 |
|
56 IMPORT_C static CUpnpResParameters* NewLC(); |
|
57 |
|
58 virtual ~CUpnpResParameters(); |
|
59 |
|
60 // getters |
|
61 |
|
62 /** |
|
63 * ProtocolInfo returns the protocolinfo string. |
|
64 * |
|
65 * @since S60 v3.1 |
|
66 * @return HBufC8* Protocolinfo |
|
67 */ |
|
68 IMPORT_C const TDesC8& ProtocolInfo() const; |
|
69 |
|
70 /** |
|
71 * FileSizeL returns the size of the file in bytes as descriptor. |
|
72 * |
|
73 * @since S60 v3.1 |
|
74 * @return HBufC8* File Size |
|
75 */ |
|
76 IMPORT_C HBufC8* FileSizeL() const; |
|
77 |
|
78 /** |
|
79 * DurationL returns the duration in the following form: |
|
80 * duration = hours ":" minutes ":" seconds |
|
81 * hours = 1*5 DIGIT; 0-99999 |
|
82 * minutes = 2 DIGIT ; 00-59 |
|
83 * seconds = 2 DIGIT ["." 3 DIGIT] ; 00-59 (.000-.999) |
|
84 * |
|
85 * @since S60 v3.1 |
|
86 * @return HBufC8* Duration |
|
87 */ |
|
88 IMPORT_C HBufC8* DurationL() const; |
|
89 |
|
90 /** |
|
91 * ResolutionL returns the resolution in form widthXheight. |
|
92 * |
|
93 * @since S60 v3.1 |
|
94 * @return HBufC8* Resolution |
|
95 */ |
|
96 IMPORT_C HBufC8* ResolutionL() const; |
|
97 |
|
98 /** |
|
99 * MimeType is a getter for mime type. |
|
100 * |
|
101 * @since S60 v3.1 |
|
102 * @return HBufC8* Mime type |
|
103 */ |
|
104 const TDesC8& MimeType(); |
|
105 |
|
106 // Methods for querying file type |
|
107 |
|
108 /** |
|
109 * IsImageFile returns true if file is image file, false otherwise. |
|
110 * |
|
111 * @since S60 v3.1 |
|
112 * @return TBool |
|
113 */ |
|
114 IMPORT_C TBool IsImageFile() const ; |
|
115 |
|
116 /** |
|
117 * IsAudioOrVideoFile returns true if file is audio or video file, |
|
118 * false otherwise. |
|
119 * |
|
120 * @since S60 v3.1 |
|
121 * @return TBool |
|
122 */ |
|
123 IMPORT_C TBool IsAudioOrVideoFile() const; |
|
124 |
|
125 // setters |
|
126 |
|
127 /** |
|
128 * SetProtocolInfoL sets the protocolinfo attribute. |
|
129 * |
|
130 * @since S60 v3.1 |
|
131 * @param const TDesC8& Protocolinfo |
|
132 */ |
|
133 void SetProtocolInfoL( const TDesC8& aProtocolInfo ); |
|
134 |
|
135 /** |
|
136 * SetMimetypeL sets the mime type attribute. |
|
137 * |
|
138 * @since S60 v3.1 |
|
139 * @param const TDesC8& Mime type |
|
140 */ |
|
141 void SetMimetypeL( const TDesC8& aMimetype ); |
|
142 |
|
143 /** |
|
144 * SetFileSize sets the file size attribute. |
|
145 * |
|
146 * @since S60 v3.1 |
|
147 * @param const TInt File size |
|
148 */ |
|
149 void SetFileSize( const TInt aFileSize ); |
|
150 |
|
151 /** |
|
152 * SetResolution sets the resolution attribute. |
|
153 * |
|
154 * @since S60 v3.1 |
|
155 * @param const TSize Resolution |
|
156 */ |
|
157 void SetResolution( const TSize aResolution ); |
|
158 |
|
159 /** |
|
160 * SetDurationInSeconds sets the duration attribute. |
|
161 * |
|
162 * @since S60 v3.1 |
|
163 * @param const TInt64 Duration |
|
164 */ |
|
165 void SetDurationInSeconds( const TInt64 aDuration ); |
|
166 |
|
167 |
|
168 private: |
|
169 |
|
170 CUpnpResParameters(); |
|
171 |
|
172 void ConstructL(); |
|
173 |
|
174 private: // data |
|
175 HBufC8* iProtocolInfo; // owned |
|
176 HBufC8* iMimetype; // owned |
|
177 TInt iFileSize; |
|
178 TSize iResolution; |
|
179 TInt64 iDurationInSeconds; |
|
180 |
|
181 }; |
|
182 |
|
183 |
|
184 #endif // C_UPNPRESPARAMETERS_H |