Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QBluetoothAuthorizationAgent Class Reference
[QtBluetoothModule]

The QBluetoothAuthorizationAgent class represents an authorization proxy. More...

    #include <QBluetoothAuthorizationAgent>

Inherits QObject.

Public Types

  • enum Error { NoError, AlreadyExists, DoesNotExist, UnknownError }

Public Functions

  • 29 public functions inherited from QObject

Protected Functions

  • virtual bool authorize ( const QString & localDevice, const QBluetoothAddress & remote, const QString & service, const QString & uuid ) = 0
  • virtual void cancel ( const QString & localDevice, const QBluetoothAddress & remote, const QString & service, const QString & uuid )
  • virtual void release ()
  • 7 protected functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QBluetoothAuthorizationAgent class represents an authorization proxy.

The QBluetoothAuthorizationAgent class provides an abstract interface for querying and granting authorization requests whenever remote bluetooth devices wish to use local bluetooth services. It is up to the clients of this class to actually establish whether the authorization request is granted or denied. For instance, the client could ask the user by informing him or her of the incoming request.

The authorization agent can be registered as a global for all local adapters or for a particular adapter.

See also QBluetoothAddress and QBluetoothLocalDevice.


Member Type Documentation

enum QBluetoothAuthorizationAgent::Error

Possible errors that might occur.

ConstantValueDescription
QBluetoothAuthorizationAgent::NoError0No error.
QBluetoothAuthorizationAgent::AlreadyExists1Another passkey agent has already been registered.
QBluetoothAuthorizationAgent::DoesNotExist2The passkey agent has not been registered.
QBluetoothAuthorizationAgent::UnknownError3An unknown error has occurred.


Member Function Documentation

QBluetoothAuthorizationAgent::QBluetoothAuthorizationAgent ( const QString & name, QObject * parent = 0 )

Constructs an authorization agent. The name parameter specifies a unique name of the authorization agent. The name should be a valid identifier name, e.g. it cannot contain special characters or start with a number. For instance: DefaultAuthAgent.

The parent parameter holds the QObject parent.

QBluetoothAuthorizationAgent::~QBluetoothAuthorizationAgent ()

Destroys the passkey agent.

bool QBluetoothAuthorizationAgent::authorize ( const QString & localDevice, const QBluetoothAddress & remote, const QString & service, const QString & uuid )   [pure virtual protected]

This virtual function will be called whenever the bluetooth system has received an authorization request, and the agent is registered to handle the particular request.

The localDevice parameter contains the local adapter this request came in on. The remote parameter contains the Bluetooth address of the remote device requesting authorization, and service parameter holds the name of the service the authorization is being obtained for. The uuid contains an optional uuid of the request.

This function should return true if the request is to be authorized and false otherwise.

See also cancel().

void QBluetoothAuthorizationAgent::cancel ( const QString & localDevice, const QBluetoothAddress & remote, const QString & service, const QString & uuid )   [virtual protected]

This function will be called whenever an authorization request has been canceled by the requestor (e.g. connection to the service has been dropped).

The request being cancelled is on localDevice and remote is the address of the remote device. The service is the service name of the service canceling the authorization request. The uuid contains an optional uuid of the request.

See also authorize().

QBluetoothAuthorizationAgent::Error QBluetoothAuthorizationAgent::error () const

Returns the last error that has occurred.

QString QBluetoothAuthorizationAgent::name () const

Returns the name of the passkey agent as a string.

bool QBluetoothAuthorizationAgent::registerAgent ()

Register the authorization agent for all local adapters.

Returns true if the agent cou7ld be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also unregisterAgent() and error().

bool QBluetoothAuthorizationAgent::registerAgent ( const QString & localDevice )

This is an overloaded member function, provided for convenience.

Register the authorization agent for localDevice adapter. The adapter name can be obtained from the QBluetoothLocalDevice object.

Returns true if the agent could be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also unregisterAgent(), error(), and QBluetoothLocalDevice.

void QBluetoothAuthorizationAgent::release ()   [virtual protected]

This function will be called whenever a passkey agent has been unregistered.

See also unregisterAgent().

bool QBluetoothAuthorizationAgent::unregisterAgent ()

Unregister the authorization agent for all local adapters.

Returns true if the agent could be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also registerAgent() and error().

bool QBluetoothAuthorizationAgent::unregisterAgent ( const QString & localDevice )

This is an overloaded member function, provided for convenience.

Unregister the authorization agent for localDevice adapter. The adapter name can be obtained from the QBluetoothLocalDevice object.

Returns true if the agent could be registered successfully, and false otherwise. If the call fails, the error can be obtained by calling error().

See also unregisterAgent(), error(), and QBluetoothLocalDevice.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 77
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web