VoiceAssistant  main
Resource-efficient, customizable voice assistant
Loading...
Searching...
No Matches
PluginBridge Class Referencefinal

The PluginBridge class provides a bridge for communication between plugins and the host application. More...

#include <bridge.h>

Inheritance diagram for PluginBridge:
[legend]
Collaboration diagram for PluginBridge:
[legend]

Public Slots

void say (const QString &text)
 say sends a speech request to the host application.
 

Signals

void _say (const QString &text, QPrivateSignal)
 _say signal emitted to send a speech request to the host application.
 
void _sayAndWait (const QString &text, QPrivateSignal)
 _sayAndWait signal emitted to send a speech request to the host application and wait until it completes.
 
void _ask (const QString &text, QPrivateSignal)
 _ask signal emitted to send a question to the host application and wait for an answer.
 
void useWidget (QWidget *widget)
 useWidget signal emitted to send a widget to the host application for usage.
 

Public Member Functions

 PluginBridge (QObject *parent=nullptr)
 PluginBridge constructor.
 
 ~PluginBridge () final
 PluginBridge destructor.
 
QString ask (const QString &text)
 ask sends a request to the host application with a question and waits for an answer.
 
void sayAndWait (const QString &text)
 sayAndWait sends a speech request to the host application and waits until it completes.
 

Friends

class MainWindow
 

Detailed Description

The PluginBridge class provides a bridge for communication between plugins and the host application.

PluginBridge serves as a communication bridge between plugins and the host application. It allows plugins to interact with the host application's functionality and services like text to speech and voice recognition.

Definition at line 20 of file bridge.h.

Constructor & Destructor Documentation

◆ PluginBridge()

PluginBridge::PluginBridge ( QObject *  parent = nullptr)
inlineexplicit

PluginBridge constructor.

Parameters
parentThe parent object.

Definition at line 31 of file bridge.h.

◆ ~PluginBridge()

PluginBridge::~PluginBridge ( )
inlinefinal

PluginBridge destructor.

The destructor releases the mutex lock if acquired.

Definition at line 39 of file bridge.h.

Member Function Documentation

◆ _ask

void PluginBridge::_ask ( const QString &  text,
QPrivateSignal   
)
signal

_ask signal emitted to send a question to the host application and wait for an answer.

Parameters
textThe question text.

This signal is emitted to send a question to the host application and wait for an answer.

◆ _say

void PluginBridge::_say ( const QString &  text,
QPrivateSignal   
)
signal

_say signal emitted to send a speech request to the host application.

Parameters
textThe text to be spoken.

This signal is emitted to send a speech request to the host application.

◆ _sayAndWait

void PluginBridge::_sayAndWait ( const QString &  text,
QPrivateSignal   
)
signal

_sayAndWait signal emitted to send a speech request to the host application and wait until it completes.

Parameters
textThe text to be spoken.

This signal is emitted to send a speech request to the host application and wait until it completes.

◆ ask()

QString PluginBridge::ask ( const QString &  text)
inline

ask sends a request to the host application with a question and waits for an answer.

Parameters
textThe question text.
Returns
The answer received from the host application.

This function sends a question to the host application and waits for a response. It blocks the plugin execution until an answer is received.

Definition at line 53 of file bridge.h.

◆ say

void PluginBridge::say ( const QString &  text)
inlineslot

say sends a speech request to the host application.

Parameters
textThe text to be spoken.

This function sends a speech request to the host application. It does not block the plugin execution.

Definition at line 98 of file bridge.h.

◆ sayAndWait()

void PluginBridge::sayAndWait ( const QString &  text)
inline

sayAndWait sends a speech request to the host application and waits until it completes.

Parameters
textThe text to be spoken.

This function sends a speech request to the host application and waits until the speech is completed. It blocks the plugin execution until the speech is finished.

Definition at line 74 of file bridge.h.

◆ useWidget

void PluginBridge::useWidget ( QWidget *  widget)
signal

useWidget signal emitted to send a widget to the host application for usage.

Parameters
widgetThe widget to be used.

This signal is emitted to send a widget to the host application for usage. The host application can use the provided widget as needed.

Friends And Related Function Documentation

◆ MainWindow

friend class MainWindow
friend

Definition at line 24 of file bridge.h.


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