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
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 /// Typ of rescaling the Screen inside lyx
89 InsetGraphicsParams();
91 InsetGraphicsParams(InsetGraphicsParams const &);
93 InsetGraphicsParams & operator=(InsetGraphicsParams const &);
94 /// Save the parameters in the LyX format stream.
95 void Write(std::ostream & os) const;
96 /// If the token belongs to our parameters, read it.
97 bool Read(LyXLex & lex, string const & token);
99 // Only a subset of InsetGraphicsParams is needed for display purposes.
100 // This function also interrogates lyxrc to ascertain whether
101 // to display or not.
102 grfx::Params as_grfxParams(string const & filepath) const;
105 /// Initialize the object to a default status.
107 /// Copy the other objects content to us, used in copy c-tor and assignment
108 void copy(InsetGraphicsParams const & params);
112 bool operator==(InsetGraphicsParams const &, InsetGraphicsParams const &);
114 bool operator!=(InsetGraphicsParams const &, InsetGraphicsParams const &);