X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetinclude.h;h=e713fb8f02d0fa6cd8fb57d29c01e089740fe2e5;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=4919819f62dfc8b3752fb8de42a1d3db32ca00ea;hpb=0eccdd1c3613e5170deb77b22174dd0afde833e9;p=lyx.git diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index 4919819f62..e713fb8f02 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -4,9 +4,9 @@ * * LyX, The Document Processor * - * Copyright (C) 1997 LyX Team (this file was created this year) + * Copyright 1997 LyX Team (this file was created this year) * - *======================================================*/ + * ====================================================== */ #ifndef INSET_INCLUDE_H #define INSET_INCLUDE_H @@ -33,11 +33,11 @@ public: flag = InsetInclude::INCLUDE; } /// - InsetInclude(string const &, Buffer*); + InsetInclude(string const &, Buffer *); /// ~InsetInclude(); /// - Inset* Clone(); + Inset * Clone() const; /// Inset::Code LyxCode() const { return Inset::INCLUDE_CODE; } /// This is 1 if the childs have labels, 0 otherwise @@ -45,57 +45,50 @@ public: /// This returns the list of labels on the child buffer string getLabel(int) const; /// This returns the list of bibkeys on the child buffer - string getKeys() const; + string getKeys(char delim) const; /// - void Edit(int, int); + void Edit(BufferView *, int x, int y, unsigned int button); /// - unsigned char Editable() const + EDITABLE Editable() const { - return 1; + return IS_EDITABLE; } /// With lyx3 we won't overload these 3 methods - void Write(FILE *); + void Write(std::ostream &) const; /// void Read(LyXLex &); /// - int Latex(FILE *file, signed char fragile); - /// - int Latex(string &file, signed char fragile); - + int Latex(std::ostream &, bool fragile, bool free_spc) const; /// void Validate(LaTeXFeatures &) const; /// Input inserts anything inside a paragraph, Display can give some visual feedback - bool Display() const { return !(isInput()); } + bool display() const; /// string getScreenLabel() const; /// - void setContents(string const & c) { - InsetCommand::setContents(c); - filename = MakeAbsPath(contents, - OnlyPath(getMasterFilename())); - } + void setContents(string const & c); /// void setFilename(string const & n) { setContents(n); } /// - string getMasterFilename() const { return master->getFileName(); } + string getMasterFilename() const { return master->fileName(); } /// string getFileName() const { return filename; } /// In "input" mode uses \input instead of \include. - bool isInput() const { return (bool)(flag == InsetInclude::INPUT); } + bool isInput() const { return flag == InsetInclude::INPUT; } /// If this is true, the child file shouldn't be loaded by lyx - bool isNoLoad() const { return (bool)(noload); } + bool isNoLoad() const { return noload; } /** A verbatim file shouldn't be loaded by LyX * No need to generate LaTeX code of a verbatim file */ bool isVerb() const; /// - bool isVerbVisibleSpace() const { return (bool)(flag==InsetInclude::VERBAST);} + bool isVerbVisibleSpace() const { return flag == InsetInclude::VERBAST;} /// - bool isInclude() const { return (bool)(flag == InsetInclude::INCLUDE);} + bool isInclude() const { return flag == InsetInclude::INCLUDE;} /// void setInput(); /// @@ -112,7 +105,7 @@ private: /// enum Include_Flags { /// - INCLUDE=0, + INCLUDE= 0, /// VERB = 1, /// @@ -126,7 +119,7 @@ private: /// int flag; /// - Buffer *master; + Buffer * master; /// string filename; }; @@ -135,7 +128,7 @@ private: inline bool InsetInclude::isVerb() const { - return (bool)(flag==InsetInclude::VERB || flag==InsetInclude::VERBAST); + return flag == InsetInclude::VERB || flag == InsetInclude::VERBAST; } @@ -179,10 +172,10 @@ void InsetInclude::setVerb() inline void InsetInclude::setVisibleSpace(bool b) { - if (b && flag==InsetInclude::VERB) { + if (b && flag == InsetInclude::VERB) { setCmdName("verbatiminput*"); flag = InsetInclude::VERBAST; - } else if (!b && flag==InsetInclude::VERBAST) { + } else if (!b && flag == InsetInclude::VERBAST) { setCmdName("verbatiminput"); flag = InsetInclude::VERB; }