|
1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
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" |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Manasij Roy, Nalina Hariharan |
|
14 * |
|
15 * Description: |
|
16 * The subtitle class represents information about a track's subtitle |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFSUBTITLE_H_ |
|
21 #define SMFSUBTITLE_H_ |
|
22 |
|
23 #include <QObject> |
|
24 #include <qdatastream.h> |
|
25 #include <QDateTime> |
|
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 |
|
42 /** |
|
43 * @ingroup smf_common_group |
|
44 * The subtitle class represents information about a track's subtitle |
|
45 */ |
|
46 class SMFCLIENT_EXPORT SmfSubtitle : public QObject |
|
47 { |
|
48 Q_OBJECT |
|
49 public: |
|
50 /** |
|
51 * Constructor with default argument |
|
52 * @param aParent The parent object |
|
53 */ |
|
54 SmfSubtitle( QObject *aParent = 0 ); |
|
55 |
|
56 /** |
|
57 * Copy Constructor |
|
58 * @param aOther The reference object |
|
59 */ |
|
60 SmfSubtitle( const SmfSubtitle &aOther ); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 ~SmfSubtitle( ); |
|
66 |
|
67 /** |
|
68 * Method to get the subtitle as a bytearray |
|
69 * @return The subtitle content |
|
70 */ |
|
71 QByteArray subtitle( ) const; |
|
72 |
|
73 /** |
|
74 * Method to get the language |
|
75 * @return The language |
|
76 */ |
|
77 QString language( ) const; |
|
78 |
|
79 /** |
|
80 * Method to get the frame rate |
|
81 * @return the frame rate |
|
82 */ |
|
83 double frameRate( ) const; |
|
84 |
|
85 /** |
|
86 * Method to get the duration |
|
87 * @return the duration |
|
88 */ |
|
89 double duration( ) const; |
|
90 |
|
91 /** |
|
92 * Method to get the release year |
|
93 * @return The release year |
|
94 */ |
|
95 QDateTime releaseYear( ) const; |
|
96 |
|
97 /** |
|
98 * Method to get the id of the subtitle |
|
99 * @return The ID value |
|
100 */ |
|
101 QString id( ) const; |
|
102 |
|
103 private: |
|
104 QSharedDataPointer<SmfSubtitlePrivate> d; |
|
105 |
|
106 friend QDataStream &operator<<( QDataStream &aDataStream, |
|
107 const SmfSubtitle &aSubtitle ); |
|
108 |
|
109 friend QDataStream &operator>>( QDataStream &aDataStream, |
|
110 SmfSubtitle &aSubtitle ); |
|
111 |
|
112 }; |
|
113 |
|
114 |
|
115 /** |
|
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 |
|
121 */ |
|
122 QDataStream &operator<<( QDataStream &aDataStream, |
|
123 const SmfSubtitle &aSubtitle ); |
|
124 |
|
125 /** |
|
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 |
|
135 // Make the class SmfSubtitle known to QMetaType, so that as to register it. |
|
136 Q_DECLARE_METATYPE(SmfSubtitle) |
|
137 |
|
138 #endif /* SMFSUBTITLE_H_ */ |