\end_document replaces \the_end.
[lyx.git] / src / funcrequest.h
blob910d6bee92bf4f39196d8730532a92d4346539f6
1 /**
2 * \file funcrequest.h
3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
6 * \author André Pönitz
7 */
9 #ifndef FUNCREQUEST_H
10 #define FUNCREQUEST_H
12 #include "lfuns.h"
13 #include "frontends/mouse_state.h"
14 #include "LString.h"
16 class BufferView;
18 /**
19 * This class encapsulates a LyX action and its argument
20 * in order to pass it around easily.
22 class FuncRequest {
23 public:
24 /// just for putting thes things in std::container
25 FuncRequest();
26 /// actions without extra argument
27 explicit FuncRequest(kb_action act);
28 /// actions without extra argument
29 FuncRequest(kb_action act, int x, int y, mouse_button::state button);
30 /// actions with extra argument
31 FuncRequest(kb_action act, string const & arg);
32 /// actions without extra argument
33 FuncRequest(BufferView * bv, kb_action act);
34 /// actions with extra argument
35 FuncRequest(BufferView * bv, kb_action act, string const & arg);
36 /// for mouse events
37 FuncRequest(BufferView * bv, kb_action act,
38 int x, int y, mouse_button::state button);
39 /// for changing requests a bit
40 FuncRequest(FuncRequest const & cmd, string const & arg);
41 /// for changing requests a bit
42 FuncRequest(FuncRequest const & cmd, BufferView * bv);
44 /// access to the view
45 BufferView * view() const;
46 /// access to the view
47 void setView(BufferView * bv);
48 /// access to button
49 mouse_button::state button() const;
51 /// output a message
52 void message(string const & msg) const;
53 /// output an error message
54 void errorMessage(string const & msg) const;
56 /// argument parsing, extract argument i as string
57 string getArg(int i) const;
59 private:
60 /// the BufferView we are talking to
61 BufferView * view_;
62 public: // should be private, too...
63 /// the action
64 kb_action action;
65 /// the action's string argument
66 string argument;
67 /// the x coordinate of a mouse press
68 int x;
69 /// the y coordinate of a mouse press
70 int y;
71 /// some extra information (like button number)
72 mouse_button::state button_;
75 #endif // FUNCREQUEST_H