]> git.lyx.org Git - lyx.git/blob - src/insets/InsetGraphicsParams.h
Fix text frame drawing.
[lyx.git] / src / insets / InsetGraphicsParams.h
1 // -*- C++ -*-
2 /**
3  * \file InsetGraphicsParams.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Baruch Even
8  * \author Herbert Voß
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef INSETGRAPHICSPARAMS_H
14 #define INSETGRAPHICSPARAMS_H
15
16
17 #include "graphics/GraphicsTypes.h"
18 #include "Length.h"
19 #include "support/FileName.h"
20
21 namespace lyx {
22
23 namespace graphics { class Params; }
24
25 class Lexer;
26
27
28 /// This class holds all the parameters needed by insetGraphics.
29 class InsetGraphicsParams
30 {
31 public:
32         /// Image filename.
33         support::DocFileName filename;
34         /// Scaling the Screen inside Lyx
35         unsigned int lyxscale;
36         /// How to display the image inside LyX
37         graphics::DisplayType display;
38         /// Scaling for output (LaTeX)
39         std::string scale;
40         /// sizes for output (LaTeX)
41         Length width;
42         ///
43         Length height;
44         /// Keep the ratio between height and width when resizing.
45         bool keepAspectRatio;
46         /// draft mode
47         bool draft;
48         /// what to do with zipped files
49         bool noUnzip;
50         /// scale image before rotating
51         bool scaleBeforeRotation;
52
53         /// The bounding box with "xLB yLB yRT yRT ", divided by a space!
54         std::string bb;
55         /// clip image
56         bool clip;
57
58         /// Rotation angle.
59         std::string rotateAngle;
60         /// Origin point of rotation
61         std::string rotateOrigin;
62         /// Do we have a subcaption?
63         bool subcaption;
64         /// The text of the subcaption.
65         std::string subcaptionText;
66         /// any userdefined special command
67         std::string special;
68
69         ///
70         InsetGraphicsParams();
71         ///
72         InsetGraphicsParams(InsetGraphicsParams const &);
73         ///
74         InsetGraphicsParams & operator=(InsetGraphicsParams const &);
75         /// Save the parameters in the LyX format stream.
76         void Write(std::ostream & os, std::string const & bufpath) const;
77         /// If the token belongs to our parameters, read it.
78         bool Read(Lexer & lex, std::string const & token, std::string const & bufpath);
79         /// convert
80   // Only a subset of InsetGraphicsParams is needed for display purposes.
81   // This function also interrogates lyxrc to ascertain whether
82   // to display or not.
83         graphics::Params as_grfxParams() const;
84
85 private:
86         /// Initialize the object to a default status.
87         void init();
88         /// Copy the other objects content to us, used in copy c-tor and assignment
89         void copy(InsetGraphicsParams const & params);
90 };
91
92 ///
93 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
94 ///
95 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);
96
97 } // namespace lyx
98
99 #endif