2002-08-07 23:43:38 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file funcrequest.h
|
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
|
* Read the file COPYING
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*/
|
|
|
|
|
|
2002-08-07 08:11:41 +00:00
|
|
|
|
#ifndef FUNCREQUEST_H
|
|
|
|
|
#define FUNCREQUEST_H
|
|
|
|
|
|
2003-03-19 17:15:32 +00:00
|
|
|
|
#include "lfuns.h"
|
2002-08-19 10:11:13 +00:00
|
|
|
|
#include "frontends/mouse_state.h"
|
2002-08-07 08:11:41 +00:00
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
2002-08-13 17:43:40 +00:00
|
|
|
|
class BufferView;
|
|
|
|
|
|
2002-12-01 22:59:25 +00:00
|
|
|
|
/**
|
2002-08-07 23:43:38 +00:00
|
|
|
|
* This class encapsulates a LyX action and its argument
|
|
|
|
|
* in order to pass it around easily.
|
2002-08-07 08:11:41 +00:00
|
|
|
|
*/
|
2002-08-13 17:43:40 +00:00
|
|
|
|
class FuncRequest {
|
|
|
|
|
public:
|
|
|
|
|
/// just for putting thes things in std::container
|
|
|
|
|
FuncRequest();
|
|
|
|
|
/// actions without extra argument
|
|
|
|
|
explicit FuncRequest(kb_action act);
|
2002-08-28 08:30:27 +00:00
|
|
|
|
/// actions without extra argument
|
|
|
|
|
FuncRequest(kb_action act, int x, int y, mouse_button::state button);
|
2002-08-13 17:43:40 +00:00
|
|
|
|
/// actions with extra argument
|
|
|
|
|
FuncRequest(kb_action act, string const & arg);
|
|
|
|
|
/// actions without extra argument
|
2002-08-28 08:30:27 +00:00
|
|
|
|
FuncRequest(BufferView * bv, kb_action act);
|
2002-08-13 17:43:40 +00:00
|
|
|
|
/// actions with extra argument
|
2002-08-28 08:30:27 +00:00
|
|
|
|
FuncRequest(BufferView * bv, kb_action act, string const & arg);
|
2002-08-12 09:53:04 +00:00
|
|
|
|
/// for mouse events
|
2002-08-28 08:30:27 +00:00
|
|
|
|
FuncRequest(BufferView * bv, kb_action act,
|
2002-08-19 10:11:13 +00:00
|
|
|
|
int x, int y, mouse_button::state button);
|
2002-08-20 13:00:25 +00:00
|
|
|
|
/// for changing requests a bit
|
|
|
|
|
FuncRequest(FuncRequest const & cmd, string const & arg);
|
2002-08-28 08:30:27 +00:00
|
|
|
|
/// for changing requests a bit
|
|
|
|
|
FuncRequest(FuncRequest const & cmd, BufferView * bv);
|
2002-08-20 13:00:25 +00:00
|
|
|
|
|
2002-08-13 17:43:40 +00:00
|
|
|
|
/// access to the view
|
|
|
|
|
BufferView * view() const;
|
|
|
|
|
/// access to the view
|
2002-08-28 08:30:27 +00:00
|
|
|
|
void setView(BufferView * bv);
|
2002-08-19 10:11:13 +00:00
|
|
|
|
/// access to button
|
|
|
|
|
mouse_button::state button() const;
|
2002-08-13 17:43:40 +00:00
|
|
|
|
|
2002-08-20 13:00:25 +00:00
|
|
|
|
/// output a message
|
|
|
|
|
void message(string const & msg) const;
|
|
|
|
|
/// output an error message
|
|
|
|
|
void errorMessage(string const & msg) const;
|
|
|
|
|
|
2003-02-26 18:03:48 +00:00
|
|
|
|
/// argument parsing, extract argument i as string
|
|
|
|
|
string getArg(int i) const;
|
|
|
|
|
|
2002-08-13 17:43:40 +00:00
|
|
|
|
private:
|
|
|
|
|
/// the BufferView we are talking to
|
|
|
|
|
BufferView * view_;
|
|
|
|
|
public: // should be private, too...
|
2002-08-07 23:43:38 +00:00
|
|
|
|
/// the action
|
2002-08-07 08:11:41 +00:00
|
|
|
|
kb_action action;
|
2002-08-07 23:43:38 +00:00
|
|
|
|
/// the action's string argument
|
2002-08-07 08:11:41 +00:00
|
|
|
|
string argument;
|
2002-08-12 09:53:04 +00:00
|
|
|
|
/// the x coordinate of a mouse press
|
|
|
|
|
int x;
|
|
|
|
|
/// the y coordinate of a mouse press
|
|
|
|
|
int y;
|
|
|
|
|
/// some extra information (like button number)
|
2002-08-19 10:11:13 +00:00
|
|
|
|
mouse_button::state button_;
|
2002-08-07 08:11:41 +00:00
|
|
|
|
};
|
|
|
|
|
|
2002-08-07 23:43:38 +00:00
|
|
|
|
#endif // FUNCREQUEST_H
|