]> git.lyx.org Git - lyx.git/blob - src/insets/insetbib.h
3549ceccefa9d23079369831f5cc936bce1efbda
[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-1999 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() const {
36                 return new InsetCitation(contents, options);
37         }
38         ///
39         string getScreenLabel()const;
40         ///
41         void Edit(int, int);
42         ///
43         unsigned char Editable() const {
44                 return 1;
45         }
46 };
47
48
49 /** Used to insert bibitem's information (key and label)
50   
51   Must be automatically inserted as the first object in a
52   bibliography paragraph. 
53   */
54 class InsetBibKey: public InsetCommand {
55 public:
56         ///
57         InsetBibKey() : InsetCommand("bibitem") { counter = 1; }
58         ///
59         InsetBibKey(string const & key, string const & label = string());
60         ///
61         InsetBibKey(InsetBibKey const *);
62         ///
63         ~InsetBibKey();
64         ///
65         Inset * Clone() const { return new InsetBibKey(this); }
66         /// Currently \bibitem is used as a LyX2.x command, so we need this method.
67         void Write(FILE *);
68         ///
69         virtual string getScreenLabel() const;
70         ///
71         void Edit(int, int);
72         ///
73         unsigned char Editable() const {
74                 return 1;
75         }
76         /// A user can't neither insert nor delete this inset
77         bool Deletable() const {
78                 return false;
79         }
80         ///
81         void setCounter(int);
82         ///
83         int  getCounter() const { return counter; }
84
85  private:
86         ///
87         int counter;
88 };
89
90
91 /** Used to insert BibTeX's information 
92   */
93 class InsetBibtex: public InsetCommand {
94 public:
95         /// 
96         InsetBibtex(): InsetCommand("BibTeX") { owner = 0; }
97         ///
98         InsetBibtex(string const & dbase, string const & style,
99                     Buffer *);
100         ///
101         Inset * Clone() const {
102                 return new InsetBibtex(contents, options, 0);
103         }
104         ///  
105         Inset::Code LyxCode() const
106         {
107                 return Inset::BIBTEX_CODE;
108         }
109         ///
110         string getScreenLabel() const;
111         ///
112         void Edit(int, int);
113         /// 
114         int Latex(FILE *, signed char);
115         ///
116         int Latex(string & file, signed char fragile);
117         ///
118         string getKeys();
119         ///
120         unsigned char Editable() const {
121                 return 1;
122         }
123         ///
124         bool addDatabase(string const &);
125         ///
126         bool delDatabase(string const &);
127         ///
128         bool display() const { return true; }    
129 private:
130         ///
131         Buffer * owner;
132 };
133
134 #endif