]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
Rename WriteStream to TeXMathStream.
[lyx.git] / src / graphics / GraphicsParams.h
1 // -*- C++ -*-
2 /**
3  * \file GraphicsParams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  *
11  * Used internally by the lyx::graphics::Image.
12  */
13
14 #ifndef GRAPHICSPARAMS_H
15 #define GRAPHICSPARAMS_H
16
17 #include "support/FileName.h"
18 #include "support/Length.h"
19
20 #include <string>
21 #include <iosfwd>
22
23
24 namespace lyx {
25 namespace graphics {
26
27 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
28  *  usable bounding box.
29  */
30 class BoundingBox {
31 public:
32         ///
33         BoundingBox();
34         ///
35         BoundingBox(std::string const &);
36
37         /// 0 0 0 0 is empty!
38         bool empty() const;
39
40         Length xl;
41         Length yb;
42         Length xr;
43         Length yt;
44 };
45
46 bool operator==(BoundingBox const &, BoundingBox const &);
47 bool operator!=(BoundingBox const &, BoundingBox const &);
48
49 /// output bounding box in LyX file format
50 std::ostream & operator<<(std::ostream &, BoundingBox const &);
51
52
53 class Params
54 {
55 public:
56         Params();
57
58         bool display;
59         unsigned int scale;
60         double pixel_ratio;
61
62         /// The image filename.
63         support::FileName filename;
64
65         /** Note that the BoundingBox is always relative to the BoundingBox
66          *  as stored in the EPS file.
67          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
68          */
69         BoundingBox bb;
70
71         /** The size of the view inside lyx in pixels or the scaling of the
72          *  image.
73          */
74         /// Rotation angle.
75         double angle;
76 };
77
78 bool operator==(Params const &, Params const &);
79 bool operator!=(Params const &, Params const &);
80
81 } // namespace graphics
82 } // namespace lyx
83
84 #endif // GRAPHICSPARAMS_H