The application's side of the commands a document host does not answer itself (spec 6): sign-in and sign-out, which install a principal into the source, and the file commands, which read a picked file from disk and save a downloaded one, moving the bytes over the source's file side channel or inline.
More...
|
| | ApplicationHost (Source &source, SignInMapper signIn, std::filesystem::path downloads, std::function< void(SignedIn)> signedIn, std::function< void()> signedOut, std::function< void(std::string const &)> onProblem={}) |
| | A host over source.
|
| bool | signIn (ui::Value const &reply) override |
| | Maps the reply and hands a principal to signedIn.
|
| void | signOut () override |
| | Calls signedOut.
|
| bool | uploadFor (ui::UploadRequest const &request, std::function< void(ui::Value)> progress, std::function< void(std::expected< ui::Value, std::string >)> done) override |
| | Reads the picked file from disk and sends it through the source's file store.
|
| bool | download (ui::Value const &file, std::string const &option, ui::Value const &name, std::function< void(std::expected< ui::Value, std::string >)> done) override |
| | Fetches a file by reference and saves it in the downloads directory. A preview is not supported.
|
| bool | readFile (ui::Value const &file, std::size_t maxBytes, std::function< void(std::expected< ui::InlineFile, std::string >)> done) override |
| | Reads a picked file whose bytes a document moves inline; its size is read first, and one over the cap is refused without reading it.
|
| bool | saveFile (ui::InlineFile const &file, std::string const &option, std::function< void(std::expected< ui::Value, std::string >)> done) override |
| | Saves a file a document holds the bytes of in the downloads directory. A preview is not supported.
|
| void | setNotifySink (std::function< bool(std::string const &, std::string const &)> sink) |
| | Sets what notify calls to show a transient message; empty falls through to the base class's false.
|
| bool | notify (std::string const &text, std::string const &role) override |
| | Calls the notify sink if one is set.
|
|
| InterpreterHost (InterpreterHost const &)=delete |
|
InterpreterHost & | operator= (InterpreterHost const &)=delete |
|
| InterpreterHost (InterpreterHost &&)=delete |
|
InterpreterHost & | operator= (InterpreterHost &&)=delete |
| virtual bool | navigate (NavigateRequest const &request, std::function< void(Value)> onResult, std::function< void()> onCancel) |
| | Opens another screen.
|
| virtual bool | closeSelf (std::string const &screen, std::optional< Value > result) |
| | Ends the screen that ran return or close: self.
|
| virtual bool | hostCommand (std::string const &name, Value const &args) |
| | Runs a command the application registered (host/1).
|
| virtual bool | switchBackend (std::string const &name, std::function< void(std::expected< void, std::string >)> done) |
| | Switches to a backend the application's source lists (AppSource::switchBackend, spec 6 §9).
|
| virtual void | resetPrefs (std::string const &screen, std::string const &point) |
| | The document reset a customization point, or all of them; the host forgets the stored choice.
|
| virtual void | setLocale (std::string const &locale) |
| | Stores the active locale as a preference. The interpreter has already re-resolved every t.
|
| virtual bool | setAppValue (std::string const &name, Value const &value) |
| | Writes app.name with set (spec 6 §5).
|
| virtual bool | upload (Value const &file, std::function< void(Value)> progress, std::function< void(std::expected< Value, std::string >)> done) |
| | Sends a file through the server's file side channel (files/1).
|
| virtual bool | uploadFor (UploadRequest const &request, std::function< void(Value)> progress, std::function< void(std::expected< Value, std::string >)> done) |
| | Sends a file through the server's file side channel, knowing the mutation that will reference it. The interpreter calls this one; the default calls upload(file, …), so a host that overrides only that keeps working.
|
| virtual bool | download (Value const &file, std::string const &option, Value const &name, std::function< void(std::expected< Value, std::string >)> done) |
| | Fetches a file by reference to save it, or to a local temporary reference for a viewer.
|
| virtual bool | readFile (Value const &file, std::size_t maxBytes, std::function< void(std::expected< InlineFile, std::string >)> done) |
| | Reads a file's bytes for upload into bytes. A host reads the file's size first and refuses one over maxBytes without reading it; the interpreter refuses a reply over the cap as well.
|
| virtual bool | saveFile (InlineFile const &file, std::string const &option, std::function< void(std::expected< Value, std::string >)> done) |
| | Saves a file a document holds the bytes of, for download from bytes.
|
| virtual void | preferenceChanged (std::string const &screen, std::string const &point, Value const &value) |
| | The user chose at a customization point through a customize editor; the host stores the choice.
|
| virtual void | permissionsStale () |
| | A call was refused with error kind denied: the permitted set is a snapshot, so the host asks the server again and calls Session::setPermitted.
|
The application's side of the commands a document host does not answer itself (spec 6): sign-in and sign-out, which install a principal into the source, and the file commands, which read a picked file from disk and save a downloaded one, moving the bytes over the source's file side channel or inline.
A shell of an application's own builds one and passes it as DocumentScreenHostOptions::application; mountShell builds its own.
Definition at line 53 of file shell.hpp.