]> git.lyx.org Git - lyx.git/blob - src/insets/insetcite.h
ee1581323b91d44ec2826afc22691ac48de2fa7c
[lyx.git] / src / insets / insetcite.h
1 // -*- C++ -*-
2 /* This file is part of*
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  * 
10  * ====================================================== */
11
12 #ifndef INSET_CITE_H
13 #define INSET_CITE_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "insetcommand.h"
20 #include "bibforms.h"
21 #include <vector>
22
23 class Buffer;
24
25 /** Used to insert citations  
26  */
27 class InsetCitation: public InsetCommand {
28 public:
29         ///
30         enum State {
31                 CANCEL,
32                 OK,
33                 DOWN,
34                 UP,
35                 DELETE,
36                 ADD,
37                 BIBBRSR,
38                 CITEBRSR,
39                 ON,
40                 OFF
41         };
42         ///
43         InsetCitation() : InsetCommand("cite") {}
44         ///
45         explicit
46         InsetCitation(string const & key, string const & note = string());
47         ///
48         ~InsetCitation();
49         ///
50         Inset * Clone() const {
51                 return new InsetCitation(getContents(), getOptions());
52         }
53         ///
54         string getScreenLabel()const;
55         ///
56         void Edit(BufferView *, int x, int y, unsigned int button);
57         ///
58         void callback( FD_citation_form *, State );
59         ///
60         EDITABLE Editable() const {
61                 return IS_EDITABLE;
62         }
63         ///
64         struct Holder {
65                 InsetCitation * inset;
66                 BufferView * view;
67         };
68
69 private:
70         ///
71         void setSize( FD_citation_form *, int, bool ) const;
72         ///
73         void setBibButtons( FD_citation_form *, State ) const;
74         ///
75         void setCiteButtons( FD_citation_form *, State ) const;
76         ///
77         void updateBrowser( FL_OBJECT *, std::vector<string> const & ) const;
78         ///     
79         Holder holder;
80 };
81
82 #endif // INSET_CITE_H