]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlRef.C
Added // -*- C++ -*- to the top of all files in controllers/ and xforms/
[lyx.git] / src / frontends / controllers / ControlRef.C
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2001 The LyX Team.
8  *
9  * ======================================================
10  *
11  * \file ControlRef.C
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  */
14
15 #include <config.h>
16
17 #ifdef __GNUG__
18 #pragma implementation
19 #endif
20
21 #include "ViewBase.h"
22 #include "ButtonControllerBase.h"
23 #include "ControlRef.h"
24 #include "Dialogs.h"
25 #include "LyXView.h"
26 #include "buffer.h"
27 #include "lyxfunc.h"
28
29 using SigC::slot;
30
31 ControlRef::ControlRef(LyXView & lv, Dialogs & d)
32         : ControlCommand(lv, d, LFUN_REF_INSERT)
33 {
34         d_.showRef.connect(slot(this, &ControlRef::showInset));
35         d_.createRef.connect(slot(this, &ControlRef::createInset));
36 }
37
38
39 std::vector<string> const ControlRef::getLabelList() const
40 {
41         return lv_.buffer()->getLabelList();
42 }
43
44
45 void ControlRef::gotoRef(string const & ref) const
46 {
47         lv_.getLyXFunc()->Dispatch(LFUN_BOOKMARK_SAVE, "0");
48         lv_.getLyXFunc()->Dispatch(LFUN_REF_GOTO, ref);
49 }
50
51
52 void ControlRef::gotoBookmark() const
53 {
54         lv_.getLyXFunc()->Dispatch(LFUN_BOOKMARK_GOTO, "0");
55 }
56