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