]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlCitation.C
Remove some xforms cruft from BufferView.h BufferView_pimpl.h.
[lyx.git] / src / frontends / controllers / ControlCitation.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlCitation.C
11  * \author Angus Leeming <a.leeming@ic.ac.uk>
12  */
13
14 #include <config.h>
15 #include <algorithm>
16
17 #ifdef __GNUG__
18 #pragma implementation
19 #endif
20
21 #include "ControlCitation.h"
22 #include "buffer.h"
23 #include "Dialogs.h"
24 #include "LyXView.h"
25
26 using std::pair;
27 using std::vector;
28 using SigC::slot;
29
30 ControlCitation::ControlCitation(LyXView & lv, Dialogs & d)
31         : ControlCommand(lv, d, LFUN_CITATION_INSERT)
32 {
33         // These are permanent connections so we won't bother
34         // storing a copy because we won't be disconnecting.
35         d_.showCitation.connect(slot(this, &ControlCitation::showInset));
36         d_.createCitation.connect(slot(this, &ControlCitation::createInset));
37 }
38
39
40 void ControlCitation::clearDaughterParams()
41 {
42         bibkeysInfo_.clear();
43 }
44
45
46 void ControlCitation::setDaughterParams()
47 {
48         vector<pair<string,string> > blist = lv_.buffer()->getBibkeyList();
49
50         typedef std::map<string, string>::value_type InfoMapValue;
51
52         for (vector<pair<string,string> >::size_type i=0; i<blist.size(); ++i) {
53                 bibkeysInfo_.insert(InfoMapValue(blist[i].first,
54                                                  blist[i].second));
55         }
56 }
57
58
59 biblio::InfoMap const & ControlCitation::bibkeysInfo() const
60 {
61         return bibkeysInfo_;
62 }