3afd0f33b5f95921efbbad641b6d19c73d4ee297
[libsub.git] / src / subtitle.h
1 /*
2     Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef LIBSUB_SUBTITLE_H
21 #define LIBSUB_SUBTITLE_H
22
23 #include "frame_time.h"
24 #include <boost/optional.hpp>
25 #include <string>
26
27 namespace sub {
28
29 class Subtitle
30 {
31 public:
32         Subtitle ()
33                 : font_size (0)
34                 , bold (false)
35                 , italic (false)
36                 , underline (false)
37                 , line (0)
38         {}
39
40         Subtitle (
41                 std::string text,
42                 std::string font,
43                 int font_size,
44                 bool bold,
45                 bool italic,
46                 bool underline,
47                 int line,
48                 FrameTime from,
49                 FrameTime to
50                 )
51                 : text (text)
52                 , font (font)
53                 , font_size (font_size)
54                 , bold (bold)
55                 , italic (italic)
56                 , underline (underline)
57                 , line (line)
58                 , frame_from (from)
59                 , frame_to (to)
60         {}
61
62         std::string text;
63         std::string font;
64         int font_size;
65         bool bold;
66         bool italic;
67         bool underline;
68         int line;
69         boost::optional<FrameTime> frame_from;
70         boost::optional<FrameTime> frame_to;
71 };
72
73 }
74
75 #endif