* \author Lars Gullik Bjønnes
* \author Matthias Ettrich
*
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
*/
#ifndef INSETOLD_H
#define INSETOLD_H
-#include "LColor.h"
#include "insetbase.h"
#include "dimension.h"
-#include "support/types.h"
+#include "ParagraphList_fwd.h"
-#include <vector>
-
-class LyXFont;
class Buffer;
-class Painter;
+class EnumLColor;
+class FuncRequest;
class LatexRunParams;
-class LyXText;
+class LyXCursor;
+class LyXFont;
class LyXLex;
+class LyXText;
+class Painter;
class Paragraph;
-class LyXCursor;
-class FuncRequest;
-class WordLangTuple;
-class ParagraphList;
class UpdatableInset;
+class WordLangTuple;
namespace lyx {
namespace graphics {
in a cleaner way. */
enum Code {
///
- NO_CODE,
+ NO_CODE, // 0
///
TOC_CODE, // do these insets really need a code? (ale)
///
///
MARK_CODE,
///
- REF_CODE, // 5
+ REF_CODE,
///
- URL_CODE,
+ URL_CODE, // 5
///
HTMLURL_CODE,
///
///
ENDING_CODE,
///
- LABEL_CODE, // 10
+ LABEL_CODE,
///
- NOTE_CODE,
+ NOTE_CODE, // 10
///
ACCENT_CODE,
///
///
INDEX_CODE,
///
- INCLUDE_CODE, // 15
+ INCLUDE_CODE,
///
- GRAPHICS_CODE,
+ GRAPHICS_CODE, // 15
///
BIBITEM_CODE,
///
///
TEXT_CODE,
///
- ERT_CODE, // 20
+ ERT_CODE,
///
- FOOT_CODE,
+ FOOT_CODE, // 20
///
MARGIN_CODE,
///
///
MINIPAGE_CODE,
///
- SPACE_CODE,
+ SPACE_CODE, // 25
///
- SPECIALCHAR_CODE, // 25
+ SPECIALCHAR_CODE,
///
TABULAR_CODE,
///
///
INDEX_PRINT_CODE,
///
- OPTARG_CODE,
+ OPTARG_CODE, // 35
///
ENVIRONMENT_CODE,
///
HFILL_CODE,
///
- NEWLINE_CODE
+ NEWLINE_CODE,
+ ///
+ BRANCH_CODE
};
///
/// wrapper around the above
bool insetAllowed(InsetOld * in) const;
///
- virtual void write(Buffer const *, std::ostream &) const = 0;
+ virtual void write(Buffer const &, std::ostream &) const = 0;
///
- virtual void read(Buffer const *, LyXLex & lex) = 0;
+ virtual void read(Buffer const &, LyXLex & lex) = 0;
/// returns the number of rows (\n's) of generated tex code.
- virtual int latex(Buffer const *, std::ostream &,
+ virtual int latex(Buffer const &, std::ostream &,
LatexRunParams const &) const = 0;
///
- virtual int ascii(Buffer const *,
+ virtual int ascii(Buffer const &,
std::ostream &, int linelen = 0) const = 0;
///
- virtual int linuxdoc(Buffer const *, std::ostream &) const = 0;
+ virtual int linuxdoc(Buffer const &, std::ostream &) const = 0;
///
- virtual int docbook(Buffer const *, std::ostream &, bool) const = 0;
+ virtual int docbook(Buffer const &, std::ostream &, bool) const = 0;
/// returns LyX code associated with the inset. Used for TOC, ...)
virtual InsetOld::Code lyxCode() const { return NO_CODE; }
/// returns true to override begin and end inset in file
virtual bool directWrite() const;
- /// Returns true if the inset should be centered alone
- virtual bool display() const { return false; }
- /// Changes the display state of the inset
- virtual void display(bool) {}
- ///
- /// returns true if this inset needs a row on it's own
- ///
- virtual bool needFullRow() const { return false; }
///
void setInsetName(string const & s) { name_ = s; }
///
///
UpdatableInset * owner() const { return owner_; }
///
- void parOwner(Paragraph * par) { par_owner_ = par; }
+ void setBackgroundColor(EnumLColor);
///
- Paragraph * parOwner() const { return par_owner_; }
- ///
- void setBackgroundColor(LColor::color);
- ///
- LColor::color backgroundColor() const;
+ EnumLColor backgroundColor() const;
///
int x() const { return top_x; }
///
bool recursive = false) const;
///
virtual void deleteLyXText(BufferView *, bool = true) const {}
- ///
- virtual void resizeLyXText(BufferView *, bool /*force*/= false) const {}
/// returns the actuall scroll-value
virtual int scroll(bool recursive=true) const {
if (!recursive || !owner_)
private:
///
UpdatableInset * owner_;
- /// the paragraph in which this inset has been inserted
- Paragraph * par_owner_;
///
string name_;
- ///
- LColor::color background_color_;
+ /** We store the LColor::color value as an int to get LColor.h out
+ * of the header file.
+ */
+ int background_color_;
};