]> git.lyx.org Git - lyx.git/blob - src/insets/InsetGraphicsParams.h
- Simplify prefs, graphics and external display options which are now true or false.
[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
20 #include "support/FileName.h"
21
22 #include <string>
23
24 namespace lyx {
25
26 namespace graphics { class Params; }
27
28 class Lexer;
29 class Buffer;
30
31
32 /// This class holds all the parameters needed by insetGraphics.
33 class InsetGraphicsParams
34 {
35 public:
36         /// Image filename.
37         support::DocFileName filename;
38         /// Scaling the Screen inside Lyx
39         unsigned int lyxscale;
40         /// If to display the image inside LyX
41         bool display;
42         /// Scaling for output (LaTeX)
43         std::string scale;
44         /// sizes for output (LaTeX)
45         Length width;
46         ///
47         Length height;
48         /// Keep the ratio between height and width when resizing.
49         bool keepAspectRatio;
50         /// draft mode
51         bool draft;
52         /// what to do with zipped files
53         bool noUnzip;
54         /// scale image before rotating
55         bool scaleBeforeRotation;
56
57         /// The bounding box with "xLB yLB yRT yRT ", divided by a space!
58         std::string bb;
59         /// clip image
60         bool clip;
61
62         /// Rotation angle.
63         std::string rotateAngle;
64         /// Origin point of rotation
65         std::string rotateOrigin;
66         /// any userdefined special command
67         std::string special;
68
69         ///
70         InsetGraphicsParams();
71         ///
72         InsetGraphicsParams(InsetGraphicsParams const &);
73         ///
74         void operator=(InsetGraphicsParams const &);
75         /// Save the parameters in the LyX format stream.
76         /// Buffer is needed to figure out if a figure is embedded.
77         void Write(std::ostream & os, Buffer const & buf) const;
78         /// If the token belongs to our parameters, read it.
79         bool Read(Lexer & lex, std::string const & token, std::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         graphics::Params as_grfxParams() const;
85
86         // FIXME UNICODE. Write functions need to use odostream instead of ostream firstly.
87         /// Identification of the graphics template. No template equals empty string.
88         std::string groupId;
89 private:
90         /// Initialize the object to a default status.
91         void init();
92         /// Copy the other objects content to us, used in copy c-tor and assignment
93         void copy(InsetGraphicsParams const & params);
94 };
95
96 ///
97 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
98 ///
99 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);
100
101 } // namespace lyx
102
103 #endif