]> git.lyx.org Git - lyx.git/blob - src/insets/insetgraphicsParams.h
move inset related stuff from src/graphics to src/inset/
[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 "LString.h"
21
22 #include "buffer.h"
23 #include "lyxlex.h"
24
25 #include "graphics/GraphicsParams.h"
26
27
28 /// This struct holds all the parameters needed by insetGraphics.
29 struct InsetGraphicsParams
30 {
31         /// How do we display the image?
32         enum DisplayType {
33             DEFAULT,            // whatever is in lyxrc.display_graphics
34             COLOR,              // full color range
35             GRAYSCALE,          // 256 shades of gray
36             MONOCHROME,         // In black and white.
37             NONE                // only keep a frame in place.
38         };
39         ///
40         enum sizeType {         // for latex and/or lyx
41             DEFAULT_SIZE,       // like none
42             WH,                 // width/height values
43             SCALE               // percentage value
44         };
45         /// Image filename.
46         string filename;
47         /// Do we have a subcaption?
48         bool subcaption;
49         /// The text of the subcaption.
50         string subcaptionText;
51         /// Do we rotate?
52         bool rotate;
53         /// Origin point of rotation
54         string rotateOrigin;
55         /// Rotation angle.
56         float rotateAngle;
57         /// clip image
58         bool clip;
59         /// draft mode
60         bool draft;
61         /// what to do with zipped files
62         bool noUnzip;
63         /// The bounding box with "xLB yLB yRT yRT ", divided by a space!
64         string bb;
65         /// Type of rescaling
66         sizeType size_type;
67         /// three possible values for rescaling (latex)
68         LyXLength width;
69         ///
70         LyXLength height;
71         ///
72         int scale;
73         /// Keep the ratio between height and width when resizing.
74         bool keepAspectRatio;
75         /// any userdefined special command
76         string special;
77         /// How to display the image inside lyx
78         DisplayType display;
79         /// Typ of the LyXView, same as for latex
80         sizeType lyxsize_type;
81         /// the size for the view inside lyx
82         LyXLength lyxwidth;
83         ///
84         LyXLength lyxheight;
85         /// Typ of rescaling the Screen inside lyx
86         int lyxscale;
87         ///
88         InsetGraphicsParams();
89         ///
90         InsetGraphicsParams(InsetGraphicsParams const &);
91         ///
92         InsetGraphicsParams & operator=(InsetGraphicsParams const &);
93         /// Save the parameters in the LyX format stream.
94         void Write(std::ostream & os) const;
95         /// If the token belongs to our parameters, read it.
96         bool Read(LyXLex & lex, string const & token);
97         /// convert 
98         grfx::GParams asGParams(string const & filepath) const;
99
100 private:
101         /// Initialize the object to a default status.
102         void init();
103         /// Copy the other objects content to us, used in copy c-tor and assignment
104         void copy(InsetGraphicsParams const & params);
105 };
106
107 ///
108 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
109 ///
110 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);
111
112 #endif