]> git.lyx.org Git - lyx.git/blob - src/graphics/GraphicsParams.h
Revert part of c053a9394d1075ecad02ccce2f34c95f08c1f00f
[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 "Length.h"
18
19 #include "support/FileName.h"
20
21 #include <string>
22 #include <iosfwd>
23
24
25 namespace lyx {
26 namespace graphics {
27
28 /** Parse a string of the form "200pt 500pt 300mm 5in" into a
29  *  usable bounding box.
30  */
31 class BoundingBox {
32 public:
33         ///
34         BoundingBox();
35         ///
36         BoundingBox(std::string const &);
37
38         /// 0 0 0 0 is empty!
39         bool empty() const;
40
41         Length xl;
42         Length yb;
43         Length xr;
44         Length yt;
45 };
46
47 bool operator==(BoundingBox const &, BoundingBox const &);
48 bool operator!=(BoundingBox const &, BoundingBox const &);
49
50 /// output bounding box in LyX file format
51 std::ostream & operator<<(std::ostream &, BoundingBox const &);
52
53
54 class Params
55 {
56 public:
57         Params();
58
59         bool display;
60         unsigned int scale;
61         double pixel_ratio;
62
63         /// The image filename.
64         support::FileName filename;
65
66         /** Note that the BoundingBox is always relative to the BoundingBox
67          *  as stored in the EPS file.
68          *  Ie, bb.xl and bb.yb == 0 if that corner is not moved.
69          */
70         BoundingBox bb;
71
72         /** The size of the view inside lyx in pixels or the scaling of the
73          *  image.
74          */
75         /// Rotation angle.
76         double angle;
77 };
78
79 bool operator==(Params const &, Params const &);
80 bool operator!=(Params const &, Params const &);
81
82 } // namespace graphics
83 } // namespace lyx
84
85 #endif // GRAPHICSPARAMS_H