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