4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
16 #include "frontends/mouse_state.h"
23 * This class encapsulates a LyX action and its argument
24 * in order to pass it around easily.
28 /// Where the request came from
31 UI, // The menu or the toolbar
32 KEYBOARD, // a keyboard binding
36 /// just for putting these things in std::container
37 explicit FuncRequest(Origin o = INTERNAL);
38 /// actions without extra argument
39 explicit FuncRequest(kb_action act, Origin o = INTERNAL);
40 /// actions without extra argument
41 FuncRequest(kb_action act, int x, int y, mouse_button::state button,
43 /// actions with extra argument
44 FuncRequest(kb_action act, std::string const & arg,
46 /// for changing requests a bit
47 FuncRequest(FuncRequest const & cmd, std::string const & arg,
51 mouse_button::state button() const;
53 /// argument parsing, extract argument i as std::string
54 std::string getArg(unsigned int i) const;
56 public: // should be private
59 /// the action's std::string argument
61 /// who initiated the action
63 /// the x coordinate of a mouse press
65 /// the y coordinate of a mouse press
67 /// some extra information (like button number)
68 mouse_button::state button_;
72 bool operator==(FuncRequest const & lhs, FuncRequest const & rhs);
74 std::ostream & operator<<(std::ostream &, FuncRequest const &);
76 #endif // FUNCREQUEST_H