1 /** |
1 /** |
2 * @file smfsubtitle.h |
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
3 * @author Nalina Hariharan, Sasken Communication Technologies Ltd - Initial contribution |
3 * All rights reserved. |
4 * @version 1.0 |
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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" |
5 * |
8 * |
6 * @section LICENSE |
9 * Initial Contributors: |
|
10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
7 * |
11 * |
8 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
12 * Contributors: |
9 * All rights reserved. |
13 * Manasij Roy, Nalina Hariharan |
10 * This component and the accompanying materials are made available |
|
11 * under the terms of the "{License}" |
|
12 * which accompanies this distribution, and is available |
|
13 * at the URL "{LicenseUrl}". |
|
14 * |
14 * |
15 * @section DESCRIPTION |
15 * Description: |
|
16 * The subtitle class represents information about a track's subtitle |
16 * |
17 * |
17 * The subtitle class represents information about a track's subtitle |
|
18 */ |
18 */ |
19 |
19 |
20 #ifndef SMFSUBTITLE_H_ |
20 #ifndef SMFSUBTITLE_H_ |
21 #define SMFSUBTITLE_H_ |
21 #define SMFSUBTITLE_H_ |
22 |
22 |
23 #include <QObject> |
23 #include <QObject> |
24 #include <qdatastream.h> |
24 #include <qdatastream.h> |
25 #include <QDateTime> |
25 #include <QDateTime> |
26 #include "SmfClientGlobal.h" |
26 #include <QSharedData> |
|
27 #include <smfclientglobal.h> |
|
28 |
|
29 enum SmfSubtitleSearchFilterFields |
|
30 { |
|
31 SubtitleLanguage = 0, |
|
32 SubtitleFrameRate, // value = 1 |
|
33 SubtitleDuration, // value = 2 |
|
34 SubtitleReleaseYear, // value = 3 |
|
35 SubtitleAll = SubtitleLanguage | SubtitleFrameRate | |
|
36 SubtitleDuration | SubtitleReleaseYear |
|
37 }; |
|
38 typedef QMap<SmfSubtitleSearchFilterFields,QString> SmfSubtitleSearchFilter; |
|
39 |
|
40 class SmfSubtitlePrivate; |
|
41 |
27 /** |
42 /** |
|
43 * @ingroup smf_common_group |
28 * The subtitle class represents information about a track's subtitle |
44 * The subtitle class represents information about a track's subtitle |
29 */ |
45 */ |
30 class SMFCLIENT_EXPORT SmfSubtitle : public QObject |
46 class SMFCLIENT_EXPORT SmfSubtitle : public QObject |
31 { |
47 { |
32 Q_OBJECT |
48 Q_OBJECT |
36 * @param aParent The parent object |
52 * @param aParent The parent object |
37 */ |
53 */ |
38 SmfSubtitle( QObject *aParent = 0 ); |
54 SmfSubtitle( QObject *aParent = 0 ); |
39 |
55 |
40 /** |
56 /** |
|
57 * Copy Constructor |
|
58 * @param aOther The reference object |
|
59 */ |
|
60 SmfSubtitle( const SmfSubtitle &aOther ); |
|
61 |
|
62 /** |
41 * Destructor |
63 * Destructor |
42 */ |
64 */ |
43 ~SmfSubtitle( ); |
65 ~SmfSubtitle( ); |
44 |
66 |
45 |
|
46 /** |
67 /** |
47 * Method to get the subtitle as a bytearray |
68 * Method to get the subtitle as a bytearray |
48 * @param aSubTitle The subtitle content |
69 * @return The subtitle content |
49 */ |
70 */ |
50 void getSubtitle( QByteArray &aSubTitle ); |
71 QByteArray subtitle( ) const; |
51 |
72 |
52 /** |
73 /** |
53 * Method to get the language |
74 * Method to get the language |
54 * @param aLanguage The language |
75 * @return The language |
55 */ |
76 */ |
56 void getLanguage( QString &aLanguage ); |
77 QString language( ) const; |
57 |
78 |
58 /** |
79 /** |
59 * Method to get the frame rate |
80 * Method to get the frame rate |
60 * @return the frame rate |
81 * @return the frame rate |
61 */ |
82 */ |
62 double getFrameRate( ); |
83 double frameRate( ) const; |
63 |
84 |
64 /** |
85 /** |
65 * Method to get the duration |
86 * Method to get the duration |
66 * @return the duration |
87 * @return the duration |
67 */ |
88 */ |
68 double getDuration( ); |
89 double duration( ) const; |
69 |
90 |
70 /** |
91 /** |
71 * Method to get the release year |
92 * Method to get the release year |
72 * @param aRelYear The release year |
93 * @return The release year |
73 */ |
94 */ |
74 void getReleaseYear( QDateTime &aRelYear ); |
95 QDateTime releaseYear( ) const; |
75 |
96 |
76 /** |
97 /** |
77 * Method to get the id of the subtitle |
98 * Method to get the id of the subtitle |
78 * @param aId The ID value |
99 * @return The ID value |
79 */ |
100 */ |
80 void getId( QString &aId ); |
101 QString id( ) const; |
81 |
102 |
82 private: |
103 private: |
83 QByteArray m_subtitle; // subtitle data |
104 QSharedDataPointer<SmfSubtitlePrivate> d; |
84 QString m_language; // language |
105 |
85 double m_frameRate; // frame rate |
106 friend QDataStream &operator<<( QDataStream &aDataStream, |
86 double m_duration; // duration |
107 const SmfSubtitle &aSubtitle ); |
87 QDateTime m_releaseYr; // release year |
108 |
88 QString m_subtitleId; // subtitle id |
109 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
110 SmfSubtitle &aSubtitle ); |
|
111 |
89 }; |
112 }; |
|
113 |
|
114 |
90 /** |
115 /** |
91 * Externalization |
116 * Method for Externalization. Writes the SmfSubtitle object to |
|
117 * the stream and returns a reference to the stream. |
|
118 * @param aDataStream Stream to be written |
|
119 * @param aSubtitle The SmfSubtitle object to be externalized |
|
120 * @return reference to the written stream |
92 */ |
121 */ |
93 QDataStream &operator<<(QDataStream &, const SmfSubtitle&); |
122 QDataStream &operator<<( QDataStream &aDataStream, |
94 /** |
123 const SmfSubtitle &aSubtitle ); |
95 * Internalization |
124 |
96 */ |
125 /** |
97 QDataStream &operator>>(QDataStream &, SmfSubtitle&); |
126 * Method for Internalization. Reads a SmfSubtitle object from |
|
127 * the stream and returns a reference to the stream. |
|
128 * @param aDataStream Stream to be read |
|
129 * @param aSubtitle The SmfSubtitle object to be internalized |
|
130 * @return reference to the stream |
|
131 */ |
|
132 QDataStream &operator>>( QDataStream &aDataStream, |
|
133 SmfSubtitle &aSubtitle); |
|
134 |
98 #endif /* SMFSUBTITLE_H_ */ |
135 #endif /* SMFSUBTITLE_H_ */ |