X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetref.h;h=a616a08e28a95403b517956897c9cdb45951901c;hb=e28331ed63062dea10d0a21b9ec12034b4b17b9a;hp=a64e02d27e64a008f8e6d0b91f403c934f06de6f;hpb=0eccdd1c3613e5170deb77b22174dd0afde833e9;p=lyx.git diff --git a/src/insets/insetref.h b/src/insets/insetref.h index a64e02d27e..a616a08e28 100644 --- a/src/insets/insetref.h +++ b/src/insets/insetref.h @@ -1,89 +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 +#ifndef INSET_REF_H +#define INSET_REF_H #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*); - /// - ~InsetRef(); - /// - Inset* Clone() { return new InsetRef (getCommand(), master); } + static std::string const & getName(int type); + + + InsetRef(InsetCommandParams const &, Buffer const &); + /// - Inset::Code LyxCode() const { return Inset::REF_CODE; } + docstring const getScreenLabel(Buffer const &) const; /// - void Edit(int, int); + EDITABLE editable() const { return IS_EDITABLE; } /// - unsigned char Editable() const { - return 1; - } - /// - bool Display() const { return false; } + Code lyxCode() const { return REF_CODE; } /// - string getScreenLabel() const; + bool display() const { return false; } /// - InsetRef::Ref_Flags getFlag() { return flag; } + int latex(Buffer const &, odocstream &, OutputParams const &) const; /// - void setFlag(InsetRef::Ref_Flags f) { flag = f; } - /// - void gotoLabel(); + int plaintext(Buffer const &, odocstream &, OutputParams const &) const; /// - int Latex(FILE *file, signed char fragile); + 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(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; }; - -inline -void InsetRef::gotoLabel() -{ - if (master) { - master->gotoLabel(getContents()); - } -} +} // namespace lyx #endif