]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormCitation.h
Use same button handling as in XForms frontend
[lyx.git] / src / frontends / qt2 / FormCitation.h
1 /* FormCitation.h
2  * (C) 2000 LyX Team
3  * John Levon, moz@compsoc.man.ac.uk
4  * Changed for Qt2 port by Kalle Dalheimer, kalle@klaralvdalens-datakonsult.se
5  */
6
7 /***************************************************************************
8  *                                                                         *
9  *   This program is free software; you can redistribute it and/or modify  *
10  *   it under the terms of the GNU General Public License as published by  *
11  *   the Free Software Foundation; either version 2 of the License, or     *
12  *   (at your option) any later version.                                   *
13  *                                                                         *
14  ***************************************************************************/
15
16 #ifndef FORMCITATION_H
17 #define FORMCITATION_H
18
19 #include "DialogBase.h"
20 #include "insets/insetcommand.h"
21
22 #include <vector> 
23  
24 class Dialogs;
25 class LyXView;
26 class FormCitationDialog;
27
28 class QListBox;
29
30 class FormCitation : public DialogBase {
31     friend class FormCitationDialogImpl;
32 public: 
33         /**@name Constructors and Destructors */
34         //@{
35         ///
36         FormCitation(LyXView *, Dialogs *);
37         /// 
38         ~FormCitation();
39         //@}
40
41         /// Apply changes
42         void apply();
43 private: 
44         ///
45         enum State {
46                 ON,
47                 ///
48                 OFF
49         };
50         /// Create the dialog if necessary, update it and display it.
51         void show();
52         /// Hide the dialog.
53         void hide();
54         /// Update the dialog.
55         void update();
56
57         void setBibButtons(State status) const;
58         void setCiteButtons(State status) const;
59
60         /// create a Citation inset
61         void createCitation(string const &);
62         /// edit a Citation inset
63         void showCitation(InsetCommand * const);
64  
65         /// update a listbox
66         void updateBrowser( QListBox* listbox,
67                             vector<string> const & keys) const;
68  
69         /// Real GUI implementation.
70         FormCitationDialog * dialog_;
71
72         /// the LyXView we belong to
73         LyXView * lv_;
74  
75         /** Which Dialogs do we belong to?
76             Used so we can get at the signals we have to connect to.
77         */
78         Dialogs * d_;
79         /// pointer to the inset if any
80         InsetCommand * inset_;
81         /// insets params
82         InsetCommandParams params;
83         /// is the inset we are reading from a readonly buffer ?
84         bool readonly;
85         
86         /// Inset hide connection.
87         SigC::Connection ih_;
88
89         std::vector<string> citekeys;
90         ///
91         std::vector<string> bibkeys;
92         ///
93         std::vector<string> bibkeysInfo;
94 };
95
96 #endif