]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlRef.C
Controller-view split of Graphics and Index popups.
[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 "Dialogs.h"
21 #include "ControlRef.h"
22 #include "Dialogs.h"
23 #include "LyXView.h"
24 #include "buffer.h"
25 #include "lyxfunc.h"
26
27 using SigC::slot;
28
29 ControlRef::ControlRef(LyXView & lv, Dialogs & d)
30         : ControlCommand(lv, d, LFUN_REF_INSERT)
31 {
32         d_.showRef.connect(slot(this, &ControlRef::showInset));
33         d_.createRef.connect(slot(this, &ControlRef::createInset));
34 }
35
36
37 std::vector<string> const ControlRef::getLabelList() const
38 {
39         return lv_.buffer()->getLabelList();
40 }
41
42
43 void ControlRef::gotoRef(string const & ref) const
44 {
45         lv_.getLyXFunc()->Dispatch(LFUN_BOOKMARK_SAVE, "0");
46         lv_.getLyXFunc()->Dispatch(LFUN_REF_GOTO, ref);
47 }
48
49
50 void ControlRef::gotoBookmark() const
51 {
52         lv_.getLyXFunc()->Dispatch(LFUN_BOOKMARK_GOTO, "0");
53 }
54