]> git.lyx.org Git - lyx.git/blob - src/insets/insetbib.h
b0dfb75d2fd213d1348f3c77e9985d06c02b083e
[lyx.git] / src / insets / insetbib.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *       
7  *          Copyright (C) 1995 Matthias Ettrich
8  *          Copyright (C) 1995-1998 The LyX Team.
9  * 
10  *======================================================*/
11
12 #ifndef _INSET_BIB_H
13 #define _INSET_BIB_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "insetcommand.h"
20
21 // Created by Alejandro 970222
22
23
24 /** Used to insert citations  
25  */
26 class InsetCitation: public InsetCommand {
27 public:
28         ///
29         InsetCitation(): InsetCommand("cite") { }
30         ///
31         InsetCitation(string const & key, string const & note=string());
32         ///
33         ~InsetCitation();
34         ///
35         Inset* Clone() { return new InsetCitation(contents, options); }
36         ///
37         string getScreenLabel()const;
38         ///
39         void Edit(int, int);
40         ///
41         unsigned char Editable() const {
42                 return 1;
43         }
44 };
45
46
47 /** Used to insert bibitem's information (key and label)
48   
49   Must be automatically inserted as the first object in a
50   bibliography paragraph. 
51   */
52 class InsetBibKey: public InsetCommand {
53 public:
54         ///
55         InsetBibKey(): InsetCommand("bibitem") { counter = 1; }
56         ///
57         InsetBibKey(string const & key, string const & label=string());
58         ///
59         InsetBibKey(InsetBibKey const*);
60         ///
61         ~InsetBibKey();
62         ///
63         Inset* Clone() { return new InsetBibKey(this); }
64         /// Currently \bibitem is used as a LyX2.x command, so we need this method.
65         void Write(FILE *);
66         ///
67         virtual string getScreenLabel() const;
68         ///
69         void Edit(int, int);
70         ///
71         unsigned char Editable() const {
72                 return 1;
73         }
74         /// A user can't neither insert nor delete this inset
75         bool Deletable() const {
76                 return false;
77         }
78         ///
79         void setCounter(int);
80         ///
81         int  getCounter() const { return counter; }
82
83  private:
84         ///
85         int counter;
86 };
87
88
89 /** Used to insert BibTeX's information 
90   */
91 class InsetBibtex: public InsetCommand {
92 public:
93         /// 
94         InsetBibtex(): InsetCommand("BibTeX") { owner = 0; }
95         ///
96         InsetBibtex(string const & dbase, string const & style,
97                     Buffer *);
98         ///
99         ~InsetBibtex();
100         ///
101         Inset* Clone() { return new InsetBibtex(contents, options, 0); }
102         ///  
103         Inset::Code LyxCode() const
104         {
105                 return Inset::BIBTEX_CODE;
106         }
107         ///
108         string getScreenLabel() const;
109         ///
110         void Edit(int, int);
111         /// 
112         int Latex(FILE *, signed char);
113         ///
114         int Latex(string &file, signed char fragile);
115         ///
116         string getKeys();
117         ///
118         unsigned char Editable() const {
119                 return 1;
120         }
121         ///
122         bool addDatabase(string const&);
123         ///
124         bool delDatabase(string const&);
125         ///
126         bool Display() const { return true; }    
127 private:
128         ///
129         Buffer *owner;
130 };
131
132
133 #endif