QCefView
Loading...
Searching...
No Matches
QCefQuery

Represents the query request sent from the web content(Javascript) More...

#include <QCefQuery.h>

Public Member Functions

 QCefQuery ()
 Constructs a query instance.
 
 ~QCefQuery ()
 Destructs a query instance.
 
const QString request () const
 Gets the query content.
 
const qint64 id () const
 Gets the query id.
 
const QString response () const
 Gets the response content string.
 
const bool result () const
 Gets the response result.
 
const int error () const
 Gets the response error.
 
void setResponseResult (bool success, const QString &response, int error=0) const
 Sets the response.
 
void reply (bool success, const QString &response, int error=0) const
 Replies the query.
 

Protected Member Functions

 QCefQuery (QCefViewPrivate *source, const QString &req, const int64_t query)
 Constructs a query instance with request context and query id.
 
void markAsReplied () const
 Marks the query as replied (for internal use only)
 

Detailed Description

Represents the query request sent from the web content(Javascript)

Constructor & Destructor Documentation

◆ QCefQuery() [1/2]

QCefQuery::QCefQuery ( QCefViewPrivate * source,
const QString & req,
const int64_t query )
protected

Constructs a query instance with request context and query id.

Parameters
sourceThe source CefView
reqThe request context
queryThe query id

◆ QCefQuery() [2/2]

QCefQuery::QCefQuery ( )

Constructs a query instance.

◆ ~QCefQuery()

QCefQuery::~QCefQuery ( )

Destructs a query instance.

Member Function Documentation

◆ markAsReplied()

void QCefQuery::markAsReplied ( ) const
protected

Marks the query as replied (for internal use only)

◆ request()

const QString QCefQuery::request ( ) const

Gets the query content.

Returns
The content string

◆ id()

const qint64 QCefQuery::id ( ) const

Gets the query id.

Returns
The query id

◆ response()

const QString QCefQuery::response ( ) const

Gets the response content string.

Returns
The response content string

◆ result()

const bool QCefQuery::result ( ) const

Gets the response result.

Returns
The respone result

◆ error()

const int QCefQuery::error ( ) const

Gets the response error.

Returns
The response error

◆ setResponseResult()

void QCefQuery::setResponseResult ( bool success,
const QString & response,
int error = 0 ) const

Sets the response.

Parameters
successTrue if the query is successful; otherwise false
responseThe response content string
errorThe response error

◆ reply()

void QCefQuery::reply ( bool success,
const QString & response,
int error = 0 ) const

Replies the query.

Parameters
successThe result
responseThe response data
errorThe error code