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