]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormCitation.h
3b7fc4b9d4e0af90d2647ab71d6e0ce7fcf65f90
[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  */
8
9 #ifndef FORMCITATION_H
10 #define FORMCITATION_H
11
12 #include "DialogBase.h"
13 #include "support/lstrings.h"
14 #include "boost/utility.hpp"
15 #include "insets/insetcommand.h"
16
17 #include <vector>
18
19 class Dialogs;
20 class LyXView;
21 class CitationDialog;
22
23 class FormCitation : public DialogBase, public noncopyable {
24 public:
25         FormCitation(LyXView *, Dialogs *);
26
27         ~FormCitation();
28
29         /// Apply changes
30         void apply();
31         /// close the connections
32         void close();
33         /// add a key
34         void add();
35         /// remove a key
36         void remove();
37         /// move a key up
38         void up();
39         /// move a key down
40         void down();
41         /// a key has been highlighted
42         void highlight_key(char const * key);
43         /// a chosen key has been highlighted
44         void highlight_chosen(char const * key);
45         /// a key has been double-clicked
46         void select_key(char const * key);
47
48 private:
49         /// Create the dialog if necessary, update it and display it.
50         void show();
51         /// Hide the dialog.
52         void hide();
53         /// Update the dialog.
54         void update(bool switched = false);
55
56         /// create a Citation inset
57         void createCitation(string const &);
58         /// edit a Citation inset
59         void showCitation(InsetCommand * const);
60
61         /// update add,remove,up,down
62         void updateButtons();
63         /// update the available keys list
64         void updateAvailableList();
65         /// update the chosen keys list
66         void updateChosenList();
67         /// select the currently chosen key
68         void selectChosen();
69
70         /// Real GUI implementation.
71         CitationDialog * dialog_;
72
73         /// the LyXView we belong to
74         LyXView * lv_;
75
76         /** Which Dialogs do we belong to?
77             Used so we can get at the signals we have to connect to.
78         */
79         Dialogs * d_;
80         /// pointer to the inset if any
81         InsetCommand * inset_;
82         /// insets params
83         InsetCommandParams params;
84         /// is the inset we are reading from a readonly buffer ?
85         bool readonly;
86         
87         /// Hide connection.
88         Connection h_;
89         /// Update connection.
90         Connection u_;
91         /// Inset hide connection.
92         Connection ih_;
93
94         /// available citation keys
95         std::vector<std::pair<string, string> > keys;
96         /// chosen citation keys
97         std::vector<string> chosenkeys;
98
99         /// currently selected key
100         string selectedKey;
101
102         /// currently selected chosen key
103         string selectedChosenKey;
104 };
105
106 #endif // FORMCITATION_H