]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormCitation.h
implement getLabelList
[lyx.git] / src / frontends / kde / FormCitation.h
1 /**
2  * \file FormCitation.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  * \author Angus Leeming
8  */
9
10 #ifndef FORMCITATION_H
11 #define FORMCITATION_H
12
13 #include <vector>
14
15 #include "KFormBase.h"
16
17 class QListBox;
18 class ControlCitation;
19 class CitationDialog;
20
21 class FormCitation : public KFormBase<ControlCitation, CitationDialog> {
22 public:
23         FormCitation(ControlCitation &);
24
25         // Functions accessible to the Controller
26
27         /// set the Params variable for the Controller
28         virtual void apply();
29         /// set the Params variable for the Controller
30         virtual void build();
31         /// update dialog before/whilst showing it
32         virtual void update();
33         /// hide the dialog
34         virtual void hide(); 
35
36         /// add a key
37         ButtonPolicy::SMInput add();
38         /// remove a key
39         ButtonPolicy::SMInput remove();
40         /// move a key up
41         ButtonPolicy::SMInput up();
42         /// move a key down
43         ButtonPolicy::SMInput down();
44         /// a key has been highlighted
45         void highlight_key(char const * key);
46         /// a chosen key has been highlighted
47         void highlight_chosen(char const * key);
48         /// a key has been double-clicked
49         ButtonPolicy::SMInput select_key(char const * key);
50
51         friend class CitationDialog;
52  
53 private:
54         /// update add,remove,up,down
55         void updateButtons();
56         /// update the available keys list
57         void updateAvailableList();
58         /// update the chosen keys list
59         void updateChosenList();
60         /// select the currently chosen key
61         void selectChosen();
62         /// does the dirty work for highlight_key(), highlight_chosen()
63         void highlight(char const *, QListBox *, string &, string &);
64         /// does the dirty work for updateAvailableList(), updateChosenList()
65         void updateList(QListBox *, std::vector<string> const &);
66
67         /// available citation keys
68         std::vector<string> keys;
69         /// chosen citation keys
70         std::vector<string> chosenkeys;
71
72         /// currently selected key
73         string selectedKey;
74
75         /// currently selected chosen key
76         string selectedChosenKey;
77 };
78
79 #endif // FORMCITATION_H