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
|
|
|
|
|
|
|
|
|
|
#include "commandtags.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-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);
|
|
|
|
|
/// actions with extra argument
|
|
|
|
|
FuncRequest(kb_action act, string const & arg);
|
|
|
|
|
/// actions without extra argument
|
|
|
|
|
FuncRequest(BufferView * view, kb_action act);
|
|
|
|
|
/// actions with extra argument
|
|
|
|
|
FuncRequest(BufferView * view, kb_action act, string const & arg);
|
2002-08-12 09:53:04 +00:00
|
|
|
|
/// for mouse events
|
2002-08-19 10:11:13 +00:00
|
|
|
|
FuncRequest(BufferView * view, kb_action act,
|
|
|
|
|
int x, int y, mouse_button::state button);
|
2002-08-13 17:43:40 +00:00
|
|
|
|
/// access to the view
|
|
|
|
|
BufferView * view() const;
|
|
|
|
|
/// access to the view
|
|
|
|
|
void setView(BufferView * view);
|
2002-08-19 10:11:13 +00:00
|
|
|
|
/// access to button
|
|
|
|
|
mouse_button::state button() 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
|