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
25 #include "graphics/GraphicsParams.h"
28 /// This struct holds all the parameters needed by insetGraphics.
29 struct InsetGraphicsParams
31 /// How do we display the image?
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.
40 enum sizeType { // for latex and/or lyx
41 DEFAULT_SIZE, // like none
42 WH, // width/height values
43 SCALE // percentage value
47 /// Do we have a subcaption?
49 /// The text of the subcaption.
50 string subcaptionText;
53 /// Origin point of rotation
61 /// what to do with zipped files
63 /// The bounding box with "xLB yLB yRT yRT ", divided by a space!
67 /// three possible values for rescaling (latex)
73 /// Keep the ratio between height and width when resizing.
75 /// any userdefined special command
77 /// How to display the image inside lyx
79 /// Typ of the LyXView, same as for latex
80 sizeType lyxsize_type;
81 /// the size for the view inside lyx
85 /// Typ of rescaling the Screen inside lyx
88 InsetGraphicsParams();
90 InsetGraphicsParams(InsetGraphicsParams const &);
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);
98 // Only a subset of InsetGraphicsParams is needed for display purposes.
99 // This function also interrogates lyxrc to ascertain whether
100 // to display or not.
101 grfx::GParams asGParams(string const & filepath) const;
104 /// Initialize the object to a default status.
106 /// Copy the other objects content to us, used in copy c-tor and assignment
107 void copy(InsetGraphicsParams const & params);
111 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
113 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);