]> git.lyx.org Git - lyx.git/blob - src/insets/insetref.h
Forgot to add this files.
[lyx.git] / src / insets / insetref.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1997 LyX Team (this file was created this year)
8  * 
9  * ====================================================== */
10
11 #ifndef INSET_REF_H
12 #define INSET_REF_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "insetcommand.h"
19
20 class Buffer;
21 struct LaTeXFeatures;
22
23 /** The reference inset  
24  */
25 class InsetRef : public InsetCommand {
26 public:
27         ///
28         enum Ref_Flags {
29                 ///
30                 REF = 0,
31                 ///
32                 PAGE_REF,
33                 ///
34                 VREF,
35                 ///
36                 VPAGE_REF,
37                 ///
38                 PRETTY_REF,
39                 ///
40                 REF_LAST = PRETTY_REF,
41                 ///
42                 REF_FIRST = REF
43         };
44         
45         ///
46         InsetRef(InsetCommandParams const &, Buffer *);
47         ///
48         Inset * Clone() const { return new InsetRef(params(), master); }
49         ///
50         string getScreenLabel() const;
51         ///
52         EDITABLE Editable() const { return IS_EDITABLE; }
53         ///
54         Inset::Code LyxCode() const { return Inset::REF_CODE; }
55         ///
56         void Edit(BufferView *, int, int, unsigned int);
57         ///
58         bool display() const { return false; }
59         ///
60         void Toggle();
61         ///
62         void gotoLabel();
63         ///
64         int Latex(Buffer const *, std::ostream &,
65                   bool fragile, bool free_spc) const;
66         ///
67         int Ascii(Buffer const *, std::ostream &) const;
68         ///
69         int Linuxdoc(Buffer const *, std::ostream &) const;
70         ///
71         int DocBook(Buffer const *, std::ostream &) const;
72         ///
73         void Validate(LaTeXFeatures & features) const;
74 private:
75         ///
76         void GenerateFlag();
77         /// This function escapes 8-bit characters
78         string escape(string const &) const;
79         ///
80         Ref_Flags flag;
81         ///
82         Buffer * master;
83 };
84 #endif