X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetref.h;h=a616a08e28a95403b517956897c9cdb45951901c;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=f436e60908ce075760fb93ad9695a339bf2b0f91;hpb=1d7d3cc4afa2205c801ccc2aa71c7ac59359dc5f;p=lyx.git diff --git a/src/insets/insetref.h b/src/insets/insetref.h index f436e60908..a616a08e28 100644 --- a/src/insets/insetref.h +++ b/src/insets/insetref.h @@ -1,90 +1,75 @@ // -*- C++ -*- -/* This file is part of* - * ====================================================== +/** + * \file insetref.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor - * - * Copyright (C) 1997 LyX Team (this file was created this year) - * - * ====================================================== */ + * \author José Matos + * + * Full author contact details are available in file CREDITS. + */ #ifndef INSET_REF_H #define INSET_REF_H -#ifdef __GNUG__ -#pragma interface -#endif - #include "insetcommand.h" -#include "buffer.h" -struct LaTeXFeatures; -/** The reference inset - */ -class InsetRef: public InsetCommand { +namespace lyx { + + +/// The reference inset +class InsetRef : public InsetCommand { public: - /// - enum Ref_Flags { + struct type_info { /// - REF, + std::string latex_name; /// - PAGE_REF + std::string gui_name; + /// + std::string short_gui_name; }; - - /// - InsetRef() : InsetCommand("ref") { flag = InsetRef::REF; } + static type_info types[]; /// - InsetRef(string const &, Buffer *); + static int getType(std::string const & name); /// - InsetRef(InsetCommand const &, Buffer *); + static std::string const & getName(int type); + + + InsetRef(InsetCommandParams const &, Buffer const &); + /// - ~InsetRef(); - /// - InsetRef * Clone() const { - return new InsetRef (getCommand(), master); - } + docstring const getScreenLabel(Buffer const &) const; /// - Inset::Code LyxCode() const { return Inset::REF_CODE; } + EDITABLE editable() const { return IS_EDITABLE; } /// - void Edit(int, int); + Code lyxCode() const { return REF_CODE; } /// - unsigned char Editable() const { - return 1; - } - /// bool display() const { return false; } /// - string getScreenLabel() const; + int latex(Buffer const &, odocstream &, OutputParams const &) const; /// - InsetRef::Ref_Flags getFlag() { return flag; } + int plaintext(Buffer const &, odocstream &, OutputParams const &) const; /// - void setFlag(InsetRef::Ref_Flags f) { flag = f; } - /// - void gotoLabel(); + int docbook(Buffer const &, odocstream &, OutputParams const &) const; + /// the string that is passed to the TOC + virtual int textString(Buffer const &, odocstream &, + OutputParams const &) const; /// - int Latex(FILE * file, signed char fragile); - /// - int Latex(string & file, signed char fragile); - /// - int Linuxdoc(string & file); + void validate(LaTeXFeatures & features) const; +protected: + InsetRef(InsetRef const &); + /// - int DocBook(string & file); + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); private: - /// This function escapes 8-bit characters - string escape(string const &) const; + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetRef(*this)); + } /// - Ref_Flags flag; - /// - Buffer * master; + bool isLatex; }; +} // namespace lyx -inline -void InsetRef::gotoLabel() -{ - if (master) { - master->gotoLabel(getContents()); - } -} #endif