]> git.lyx.org Git - lyx.git/blob - src/insets/insetgraphicsParams.h
The speed patch: redraw only rows that have changed
[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 class holds all the parameters needed by insetGraphics.
31 class InsetGraphicsParams
32 {
33 public:
34         /// Image filename.
35         lyx::support::FileName filename;
36         /// Scaling the Screen inside Lyx
37         unsigned int lyxscale;
38         /// How to display the image inside LyX
39         lyx::graphics::DisplayType display;
40         /// Scaling for output (LaTeX)
41         std::string scale;
42         /// sizes for output (LaTeX)
43         LyXLength width;
44         ///
45         LyXLength 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
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(LyXLex & 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         lyx::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 #endif