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