25 #ifndef TBX_EXT_OLECLIENT_H
26 #define TBX_EXT_OLECLIENT_H
29 #include "../wimpmessagelistener.h"
30 #include "../window.h"
37 class OleClientHandler;
73 std::string _tmp_prefix;
76 static int _next_session_id;
77 std::string _server_name;
78 std::string _server_start;
80 std::string _file_name;
85 static int _open_count;
88 OleClient(
int file_type,
const char *temp_prefix = 0);
134 void edit_finished();
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
The Window object represents a toolbox window.
Definition: window.h:70
virtual void edit_file_changed(OleClient &client, const std::string &file_name)
Called when the file has been saved in the OLE server (when edit_file was called).
Definition: oleclient.h:179
virtual void failed_to_start_server(OleClient &client)=0
Called if attempt to start the OLE server failed.
OleClient(int file_type, const char *temp_prefix=0)
Construct OleClient for a file type.
Definition: oleclient.cc:51
void edit_text(std::string text, tbx::Window file_window, int x_offset, int y_offset, OleClientHandler *handler)
Edit the given text using OLE.
Definition: oleclient.cc:190
void delete_file(bool del)
Set if file used to pass data to OLE server should be deleted when editing session is closed.
Definition: oleclient.h:121
Interface called back from OleServer to inform of state of edited file.
Definition: oleclient.h:142
virtual void edit_closed(OleClient &client)
Called when the OLE editor has been closed.
Definition: oleclient.h:163
bool in_progress() const
Check if OLE edit is in progress.
Definition: oleclient.h:128
virtual void edit_started(OleClient &client)
Called once the OLE edit has successfully started.
Definition: oleclient.h:157
std::string get_scrap_file_name()
Get file name suitable for scrap file for edit session.
Definition: oleclient.cc:173
void closed_in_client()
Called to close OLE editing from the client.
Definition: oleclient.cc:342
static void client_closed()
Client application has closed so broadcast a message to close any open OLE sessions in the third part...
Definition: oleclient.cc:389
Listener to handle WimpUserMessages (event code 17)
Definition: wimpmessagelistener.h:253
bool delete_file() const
Check if file should be deleted.
Definition: oleclient.h:111
Wimp message received event.
Definition: wimpmessagelistener.h:210
Class to provide an OleClient to edit a document externally for an application.
Definition: oleclient.h:71
static int open_count()
Return the number of currently open OLE sessions.
Definition: oleclient.h:95
virtual void edit_text_changed(OleClient &client, const std::string &text)
Called with the new text from the OLE server if the the edit was started using the edit_text method.
Definition: oleclient.h:171
void edit_file(std::string file_name, tbx::Window file_window, int x_offset, int y_offset, OleClientHandler *handler)
Edit the given file using OLE.
Definition: oleclient.cc:213
virtual void acknowledge_message(tbx::WimpMessageEvent &event)
Handle OLE acknowledge message.
Definition: oleclient.cc:252
Listener to handle WimpAcnowledgeMessages (event code 19)
Definition: wimpmessagelistener.h:290
bool find_server(bool use_ole_support=true)
Find the server for this OleClient.
Definition: oleclient.cc:93
virtual void user_message(tbx::WimpMessageEvent &event)
Handle messages from the OLE server.
Definition: oleclient.cc:290