2 /* This file is part of
3 * =================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich.
7 * Copyright 1995-2002 The LyX Team.
10 * \author Herbert Voss <voss@lyx.org>
11 * ================================================= */
13 #ifndef INSETGRAPHICSPARAMS_H
14 #define INSETGRAPHICSPARAMS_H
21 #include "lyxlength.h"
29 /// This struct holds all the parameters needed by insetGraphics.
30 struct InsetGraphicsParams
32 /// How do we display the image?
34 DEFAULT, // whatever is in lyxrc.display_graphics
35 COLOR, // full color range
36 GRAYSCALE, // 256 shades of gray
37 MONOCHROME, // In black and white.
38 NONE // only keep a frame in place.
41 enum sizeType { // for latex and/or lyx
42 DEFAULT_SIZE, // like none
43 WH, // width/height values
44 SCALE // percentage value
48 /// Do we have a subcaption?
50 /// The text of the subcaption.
51 string subcaptionText;
54 /// Origin point of rotation
62 /// what to do with zipped files
64 /// The bounding box with "xLB yLB yRT yRT ", divided by a space!
68 /// three possible values for rescaling (latex)
74 /// Keep the ratio between height and width when resizing.
76 /// any userdefined special command
78 /// How to display the image inside lyx
80 /// Typ of the LyXView, same as for latex
81 sizeType lyxsize_type;
82 /// the size for the view inside lyx
86 /// Keep the ratio between lyxheight and lyxwidth when resizing.
87 bool keepLyXAspectRatio;
88 /// Typ of rescaling the Screen inside lyx
91 InsetGraphicsParams();
93 InsetGraphicsParams(InsetGraphicsParams const &);
95 InsetGraphicsParams & operator=(InsetGraphicsParams const &);
96 /// Save the parameters in the LyX format stream.
97 void Write(std::ostream & os) const;
98 /// If the token belongs to our parameters, read it.
99 bool Read(LyXLex & lex, string const & token);
101 // Only a subset of InsetGraphicsParams is needed for display purposes.
102 // This function also interrogates lyxrc to ascertain whether
103 // to display or not.
104 grfx::Params as_grfxParams(string const & filepath) const;
107 /// Initialize the object to a default status.
109 /// Copy the other objects content to us, used in copy c-tor and assignment
110 void copy(InsetGraphicsParams const & params);
114 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
116 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);