]> git.lyx.org Git - lyx.git/blob - src/funcrequest.C
partial framebox support
[lyx.git] / src / funcrequest.C
1 /**
2  * \file funcrequest.C
3  * Copyright 2002 the LyX Team
4  * Read the file COPYING
5  *
6  * \author André Pönitz
7  */
8
9 #include "funcrequest.h"
10 #include "BufferView.h"
11 #include "lyxfunc.h" // only for setMessage()
12 #include "frontends/LyXView.h"
13 #include "debug.h"
14
15
16 FuncRequest::FuncRequest()
17         : view_(0), action(LFUN_UNKNOWN_ACTION)
18 {}
19
20
21 FuncRequest::FuncRequest(kb_action act)
22         : view_(0), action(act)
23 {}
24
25
26 FuncRequest::FuncRequest(kb_action act, string const & arg)
27         : view_(0), action(act), argument(arg)
28 {}
29
30
31 FuncRequest::FuncRequest
32                 (kb_action act, int ax, int ay, mouse_button::state button)
33         : view_(0), action(act), argument(), x(ax), y(ay), button_(button)
34 {}
35
36
37 FuncRequest::FuncRequest(BufferView * view, kb_action act)
38         : view_(view), action(act)
39 {}
40
41
42 FuncRequest::FuncRequest(BufferView * view, kb_action act, string const & arg)
43         : view_(view), action(act), argument(arg)
44 {}
45
46
47 FuncRequest::FuncRequest
48                 (BufferView * view, kb_action act, int ax, int ay, mouse_button::state but)
49         : view_(view), action(act), argument(), x(ax), y(ay), button_(but)
50 {}
51
52
53 FuncRequest::FuncRequest(FuncRequest const & cmd, string const & arg)
54         : view_(cmd.view_), action(cmd.action), argument(arg),
55           x(cmd.x), y(cmd.y), button_(cmd.button_)
56 {}
57         
58
59 FuncRequest::FuncRequest(FuncRequest const & cmd, BufferView * view)
60         : view_(view), action(cmd.action), argument(cmd.argument),
61           x(cmd.x), y(cmd.y), button_(cmd.button_)
62 {}
63         
64
65 BufferView * FuncRequest::view() const
66 {
67         return view_;
68 }
69
70
71 void FuncRequest::setView(BufferView * view)
72 {
73         view_ = view;
74 }
75
76
77 mouse_button::state FuncRequest::button() const
78 {
79         return button_;
80 }
81
82
83 void FuncRequest::message(string const & msg) const
84 {
85         if (view_)
86                 view_->owner()->getLyXFunc().setMessage(msg);
87         else
88                 lyxerr  << "Dropping message '" << msg << "'\n";
89 }
90
91
92 void FuncRequest::errorMessage(string const & msg) const
93 {
94         if (view_)
95                 view_->owner()->getLyXFunc().setErrorMessage(msg);
96         else
97                 lyxerr  << "Dropping error message '" << msg << "'\n";
98 }