X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetref.h;h=a616a08e28a95403b517956897c9cdb45951901c;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=c1e12cc90b710bdfd5c575ec232186b4dda46fbd;hpb=245007468d0bb2aaa65dea4feab571b744dd9dec;p=lyx.git diff --git a/src/insets/insetref.h b/src/insets/insetref.h index c1e12cc90b..a616a08e28 100644 --- a/src/insets/insetref.h +++ b/src/insets/insetref.h @@ -1,100 +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 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 { - /// - REF = 0, - /// - PAGE_REF, - /// - VREF, - /// - VPAGE_REF, + struct type_info { /// - PRETTY_REF, + std::string latex_name; /// - REF_LAST = PRETTY_REF, + std::string gui_name; /// - REF_FIRST = REF + std::string short_gui_name; }; - + static type_info types[]; /// - InsetRef() : InsetCommand("ref") { flag = InsetRef::REF; } + static int getType(std::string const & name); /// - InsetRef(string const &, Buffer *); + static std::string const & getName(int type); + + + InsetRef(InsetCommandParams const &, Buffer const &); + /// - InsetRef(InsetCommand const &, Buffer *); - /// - Inset * 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(BufferView *, int, int, unsigned int); + Code lyxCode() const { return REF_CODE; } /// - EDITABLE Editable() const { - return IS_EDITABLE; - } - /// bool display() const { return false; } /// - string getScreenLabel() const; + int latex(Buffer const &, odocstream &, OutputParams const &) const; /// - void Toggle(); - /// - void gotoLabel(); + int plaintext(Buffer const &, odocstream &, OutputParams const &) const; /// - int Latex(std::ostream &, bool fragile, bool free_spc) const; + 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 Ascii(std::ostream &) const; - /// - int Linuxdoc(std::ostream &) const; - /// - int DocBook(std::ostream &) const; + void validate(LaTeXFeatures & features) const; +protected: + InsetRef(InsetRef const &); + /// - void Validate(LaTeXFeatures & features) const; + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); private: + virtual std::auto_ptr doClone() const { + return std::auto_ptr(new InsetRef(*this)); + } /// - void GenerateFlag(); - /// This function escapes 8-bit characters - string escape(string const &) const; - /// - Ref_Flags flag; - /// - Buffer * master; + bool isLatex; }; +} // namespace lyx -inline -void InsetRef::gotoLabel() -{ - if (master) { - master->getUser()->gotoLabel(getContents()); - } -} #endif