]> git.lyx.org Git - lyx.git/blob - src/insets/insetgraphicsParams.h
namespace grfx -> lyx::graphics
[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 Voss
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 "LString.h"
19 #include "lyxlength.h"
20
21 namespace grfx = lyx::graphics;
22
23 class LyXLex;
24
25 namespace lyx {
26 namespace graphics {
27         class Params;
28 }
29 }
30
31
32 /// This struct holds all the parameters needed by insetGraphics.
33 struct InsetGraphicsParams
34 {
35         /// Image filename.
36         string filename;
37         /// Scaling the Screen inside Lyx
38         unsigned int lyxscale;
39         /// How to display the image inside LyX
40         grfx::DisplayType display;
41         /// Scaling for output (LaTeX)
42         float scale;
43         /// sizes for output (LaTeX)
44         LyXLength width;
45         ///
46         LyXLength height;
47         /// Keep the ratio between height and width when resizing.
48         bool keepAspectRatio;
49         /// draft mode
50         bool draft;
51         /// what to do with zipped files
52         bool noUnzip;
53
54         /// The bounding box with "xLB yLB yRT yRT ", divided by a space!
55         string bb;
56         /// clip image
57         bool clip;
58
59         /// Rotation angle.
60         float rotateAngle;
61         /// Origin point of rotation
62         string rotateOrigin;
63         /// Do we have a subcaption?
64         bool subcaption;
65         /// The text of the subcaption.
66         string subcaptionText;
67         /// any userdefined special command
68         string special;
69
70         ///
71         InsetGraphicsParams();
72         ///
73         InsetGraphicsParams(InsetGraphicsParams const &);
74         ///
75         InsetGraphicsParams & operator=(InsetGraphicsParams const &);
76         /// Save the parameters in the LyX format stream.
77         void Write(std::ostream & os, string const & bufpath) const;
78         /// If the token belongs to our parameters, read it.
79         bool Read(LyXLex & lex, string const & token, string const & bufpath);
80         /// convert
81   // Only a subset of InsetGraphicsParams is needed for display purposes.
82   // This function also interrogates lyxrc to ascertain whether
83   // to display or not.
84         grfx::Params as_grfxParams() const;
85
86 private:
87         /// Initialize the object to a default status.
88         void init();
89         /// Copy the other objects content to us, used in copy c-tor and assignment
90         void copy(InsetGraphicsParams const & params);
91 };
92
93 ///
94 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
95 ///
96 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);
97
98 #endif