Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
Sonde::TrustRequest Class Reference

A pending request for trust, from ui_open. More...

#include <qmltemplatetrust.h>

Public Member Functions

 TrustRequest ()=default
 An invalid request; every operation on it does nothing.
bool isValid () const
 Whether this refers to a request.
QString templateName () const
 The template the client asked to open.
QList< TrustFile > files () const
 The files that need trust: the template, or a component it imports.
bool isAnswered () const
 Whether it was answered, or can no longer be.
void grant (TrustScope scope=TrustScope::Everywhere) const
 Trusts every file in files() and opens the template.
void deny () const
 Refuses: the tool call fails, saying the user declined.

Private Member Functions

 TrustRequest (std::shared_ptr< TrustRequestPrivate > state)
 Wraps the shared state (created by the QML window tools).

Private Attributes

std::shared_ptr< TrustRequestPrivate > d
 Shared request state.

Friends

class TrustRequestPrivate

Detailed Description

A pending request for trust, from ui_open.

A value type: copies share the request. The first grant() or deny() on any copy answers it; later ones, and those after the tool call ended (it was cancelled, or the user took longer than two minutes), do nothing. Call them on the thread of the server's tools (normally the GUI thread).

Member Function Documentation

◆ grant()

void Sonde::TrustRequest::grant ( TrustScope scope = TrustScope::Everywhere) const

Trusts every file in files() and opens the template.

Other untrusted files it imports lead to another request.


The documentation for this class was generated from the following files: