]> git.lyx.org Git - lyx.git/blob - src/insets/insetgraphicsParams.h
Rob's patch and some minor cleanup
[lyx.git] / src / insets / insetgraphicsParams.h
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  *
5  *          LyX, The Document Processor
6  *          Copyright 1995 Matthias Ettrich.
7  *          Copyright 1995-2002 The LyX Team.
8  *
9  * \author Baruch Even
10  * \author Herbert Voss <voss@lyx.org>
11  * ================================================= */
12
13 #ifndef INSETGRAPHICSPARAMS_H
14 #define INSETGRAPHICSPARAMS_H
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "graphics/GraphicsTypes.h"
21 #include "LString.h"
22 #include "lyxlength.h"
23
24 class LyXLex;
25
26 namespace grfx {
27         class Params;
28 }
29
30 /// This struct holds all the parameters needed by insetGraphics.
31 struct InsetGraphicsParams
32 {
33         /// Image filename.
34         string filename;
35         /// Scaling the Screen inside Lyx
36         unsigned int lyxscale;
37         /// How to display the image inside LyX
38         grfx::DisplayType display;
39         /// Scaling for output (LaTeX)
40         unsigned int 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         string bb;
54         /// clip image
55         bool clip;
56
57         /// Rotation angle.
58         float rotateAngle;
59         /// Origin point of rotation
60         string rotateOrigin;
61         /// Do we have a subcaption?
62         bool subcaption;
63         /// The text of the subcaption.
64         string subcaptionText;
65         /// any userdefined special command
66         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) const;
76         /// If the token belongs to our parameters, read it.
77         bool Read(LyXLex & lex, string const & token);
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         grfx::Params as_grfxParams(string const & filepath) 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