]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlRef.C
John's character.C patch (bug fix).
[lyx.git] / src / frontends / controllers / ControlRef.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 ControlRef.C
11  * \author Angus Leeming <a.leeming@ic.ac.uk>
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ViewBase.h"
21 #include "ButtonControllerBase.h"
22 #include "ControlRef.h"
23 #include "Dialogs.h"
24 #include "LyXView.h"
25 #include "buffer.h"
26 #include "lyxfunc.h"
27
28 using SigC::slot;
29
30 ControlRef::ControlRef(LyXView & lv, Dialogs & d)
31         : ControlCommand(lv, d, LFUN_REF_INSERT)
32 {
33         d_.showRef.connect(slot(this, &ControlRef::showInset));
34         d_.createRef.connect(slot(this, &ControlRef::createInset));
35 }
36
37
38 std::vector<string> const ControlRef::getLabelList() const
39 {
40         return lv_.buffer()->getLabelList();
41 }
42
43
44 void ControlRef::gotoRef(string const & ref) const
45 {
46         lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_SAVE, "0");
47         lv_.getLyXFunc()->dispatch(LFUN_REF_GOTO, ref);
48 }
49
50
51 void ControlRef::gotoBookmark() const
52 {
53         lv_.getLyXFunc()->dispatch(LFUN_BOOKMARK_GOTO, "0");
54 }
55