libsub
raw_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_RAW_SUBTITLE_H
21 #define LIBSUB_RAW_SUBTITLE_H
22 
23 #include "sub_time.h"
24 #include "colour.h"
25 #include "vertical_reference.h"
26 #include "effect.h"
27 #include "font_size.h"
28 #include "vertical_position.h"
29 #include "horizontal_position.h"
30 #include <boost/optional.hpp>
31 #include <string>
32 #include <vector>
33 
34 namespace sub {
35 
40 {
41 public:
42  RawSubtitle ()
43  : colour (1, 1, 1)
44  , bold (false)
45  , italic (false)
46  , underline (false)
47  {}
48 
50  std::string text;
51  boost::optional<std::string> font;
52 
55 
56  boost::optional<Effect> effect;
57  boost::optional<Colour> effect_colour;
58 
59  Colour colour;
60  bool bold;
61  bool italic;
62  bool underline;
63 
64  HorizontalPosition horizontal_position;
65 
68 
73 
74  boost::optional<Time> fade_up;
75  boost::optional<Time> fade_down;
76 };
77 
78 bool operator< (RawSubtitle const &, RawSubtitle const &);
79 
80 }
81 
82 #endif
An RGB colour.
Definition: colour.h:36
A description of a font's size in one of a number of ways.
Definition: font_size.h:34
Definition: horizontal_position.h:28
A bit of a subtitle, created with no regard for any nearby bits.
Definition: raw_subtitle.h:40
bool italic
true to use an italic version of font
Definition: raw_subtitle.h:61
bool underline
true to underline
Definition: raw_subtitle.h:62
std::string text
Definition: raw_subtitle.h:50
Time to
Definition: raw_subtitle.h:72
FontSize font_size
Definition: raw_subtitle.h:54
VerticalPosition vertical_position
Definition: raw_subtitle.h:67
Time from
Definition: raw_subtitle.h:70
bool bold
true to use a bold version of font
Definition: raw_subtitle.h:60
Definition: sub_time.h:29
Vertical position of the baseline of some text, expressed in one of a number of ways.
Definition: vertical_position.h:32
Colour class.