| 1 |
#ifndef REQUESTMESSAGE_H |
| 2 |
#define REQUESTMESSAGE_H |
| 3 |
|
| 4 |
#include "LSP/Message.h" // Base class: LSP::Message |
| 5 |
#include "LSP/ResponseMessage.h" |
| 6 |
#include "LSP/basic_types.h" |
| 7 |
#include "json_rpc_params.h" |
| 8 |
#include <wx/event.h> |
| 9 |
#include <wx/sharedptr.h> |
| 10 |
|
| 11 |
namespace LSP |
| 12 |
{ |
| 13 |
|
| 14 |
class WXDLLIMPEXP_CL MessageWithParams : public LSP::Message |
| 15 |
{ |
| 16 |
public: |
| 17 |
typedef wxSharedPtr<LSP::MessageWithParams> Ptr_t; |
| 18 |
|
| 19 |
protected: |
| 20 |
wxString m_method; |
| 21 |
Params::Ptr_t m_params; |
| 22 |
wxString m_uuid; |
| 23 |
wxString m_statusMessage; // A custom message to be displayed to the user when this message is being processed |
| 24 |
|
| 25 |
public: |
| 26 |
MessageWithParams(); |
| 27 |
virtual ~MessageWithParams(); |
| 28 |
virtual JSONItem ToJSON(const wxString& name) const; |
| 29 |
virtual void FromJSON(const JSONItem& json); |
| 30 |
virtual std::string ToString() const; |
| 31 |
|
| 32 |
void SetMethod(const wxString& method) { this->m_method = method; } |
| 33 |
const wxString& GetMethod() const { return m_method; } |
| 34 |
void SetParams(Params::Ptr_t params) { m_params = params; } |
| 35 |
Params::Ptr_t GetParams() { return m_params; } |
| 36 |
|
| 37 |
/** |
| 38 |
* @brief factory method for creating Ptr_t type |
| 39 |
*/ |
| 40 |
static LSP::MessageWithParams::Ptr_t MakeRequest(LSP::MessageWithParams* message_ptr); |
| 41 |
|
| 42 |
void SetStatusMessage(const wxString& statusMessage) { this->m_statusMessage = statusMessage; } |
| 43 |
const wxString& GetStatusMessage() const { return m_statusMessage; } |
| 44 |
}; |
| 45 |
|
| 46 |
} // namespace LSP |
| 47 |
|
| 48 |
#endif // REQUESTMESSAGE_H |