Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BluepingPlugin Class Reference

Multi-authentication bluetooth plugin, which tries to ping a specific MAC address. More...

#include </home/clem/local/src/opie/noncore/securityplugins/blueping/bluepingplugin.h>

Inheritance diagram for BluepingPlugin:

Inheritance graph
[legend]
Collaboration diagram for BluepingPlugin:

Collaboration graph
[legend]
List of all members.

Signals

void emitCode (int resultCode)
 Signal carrying the result code of this plugin.

Public Member Functions

 BluepingPlugin ()
 standard c'tor
virtual ~BluepingPlugin ()
 cleans m_ping and m_bluepingW if we need to
int authenticate ()
 Make one authentication attempt with this plugin.
Opie::Security::MultiauthConfigWidgetconfigWidget (QWidget *parent)
 returns a BluepingConfigWidget
QString pixmapNameConfig () const
 (optional) plugin configuration tab icon
QString pixmapNameWidget () const
 Plugin icon, to be displayed in the plugin list configuration widget.
QString pluginName () const
 Simply return its name (Blueping plugin).

Private Slots

void success ()
 Emit the MultiauthPluginObject::Success emitCode.
void failure ()
 Emit the MultiauthPluginObject::Failure emitCode.
void skip ()
 Emit the MultiauthPluginObject::Skip emitCode.
void ping ()
 do the actual ping
void pingFinished (Opie::Core::OProcess *ping)
 Deals with m_ping result.

Private Member Functions

void killBluetoothIfNecessary ()
 If Bluetooth was off before the plugin ran, we switch it off again.

Private Attributes

Opie::Core::OProcessm_ping
Configm_config
BluepingConfigWidgetm_bluepingW
bool bluetoothWasOff
QString macToPing

Detailed Description

Multi-authentication bluetooth plugin, which tries to ping a specific MAC address.

The plugin itself, implementing the main authenticate() function.

Definition at line 51 of file bluepingplugin.h.


Constructor & Destructor Documentation

BluepingPlugin::BluepingPlugin  ) 
 

standard c'tor

Definition at line 20 of file bluepingplugin.cpp.

BluepingPlugin::~BluepingPlugin  )  [virtual]
 

cleans m_ping and m_bluepingW if we need to

Definition at line 24 of file bluepingplugin.cpp.

References killBluetoothIfNecessary(), m_bluepingW, m_ping, odebug, and oendl.


Member Function Documentation

int BluepingPlugin::authenticate  )  [virtual]
 

Make one authentication attempt with this plugin.

(very simple "success" / "failure" buttons in a dialog)

Returns:
The outcome code of this authentication

Implements Opie::Security::MultiauthPluginObject.

Definition at line 120 of file bluepingplugin.cpp.

References Qt::AlignHCenter, Qt::AlignTop, OProcess::Block, bluetoothWasOff, emitCode(), Opie::Core::OProcess::exitStatus(), Opie::Core::ODevice::inst(), QString::isEmpty(), macToPing, model, Opie::Core::Model_iPAQ_H39xx, Opie::Core::Model_iPAQ_H5xxx, Opie::Core::OProcess::normalExit(), oApp, odebug, oendl, oerr, owarn, ping(), Config::readEntry(), Config::setGroup(), skip(), Opie::Core::OProcess::start(), title, TRUE, Qt::WStyle_Customize, Qt::WStyle_NoBorder, and Qt::WStyle_StaysOnTop.

MultiauthConfigWidget * BluepingPlugin::configWidget QWidget *  parent  )  [virtual]
 

returns a BluepingConfigWidget

Implements Opie::Security::MultiauthPluginObject.

Definition at line 39 of file bluepingplugin.cpp.

References m_bluepingW.

void BluepingPlugin::emitCode int  resultCode  )  [signal]
 

Signal carrying the result code of this plugin.

Referenced by authenticate(), failure(), skip(), and success().

void BluepingPlugin::failure  )  [private, slot]
 

Emit the MultiauthPluginObject::Failure emitCode.

Definition at line 73 of file bluepingplugin.cpp.

References emitCode().

Referenced by pingFinished().

void BluepingPlugin::killBluetoothIfNecessary  )  [private]
 

If Bluetooth was off before the plugin ran, we switch it off again.

Definition at line 54 of file bluepingplugin.cpp.

References OProcess::Block, bluetoothWasOff, odebug, oendl, oerr, and Opie::Core::OProcess::start().

Referenced by ~BluepingPlugin().

void BluepingPlugin::ping  )  [private, slot]
 

do the actual ping

Todo:
as soon as ping is launched, check RSSI (signal strength) and check it's high enough, meaning the device is close enough?

make it optionally pollable, so don't finish the ping and call Opie suspend if l2ping timeouts?

Definition at line 83 of file bluepingplugin.cpp.

References m_ping, macToPing, odebug, oendl, oerr, OProcess, pingFinished(), skip(), and Opie::Core::OProcess::start().

Referenced by authenticate().

void BluepingPlugin::pingFinished Opie::Core::OProcess ping  )  [private, slot]
 

Deals with m_ping result.

Definition at line 102 of file bluepingplugin.cpp.

References Opie::Core::OProcess::exitStatus(), failure(), Opie::Core::OProcess::normalExit(), odebug, oendl, and success().

Referenced by ping().

QString BluepingPlugin::pixmapNameConfig  )  const [virtual]
 

(optional) plugin configuration tab icon

Returns:
path to the image file (without the extension) from $OPIEDIR/pics

Implements Opie::Security::MultiauthPluginObject.

Definition at line 49 of file bluepingplugin.cpp.

QString BluepingPlugin::pixmapNameWidget  )  const [virtual]
 

Plugin icon, to be displayed in the plugin list configuration widget.

Returns:
path to the image file (without the extension) from $OPIEDIR/pics

Implements Opie::Security::MultiauthPluginObject.

Definition at line 45 of file bluepingplugin.cpp.

QString BluepingPlugin::pluginName  )  const [virtual]
 

Simply return its name (Blueping plugin).

Implements Opie::Security::MultiauthPluginObject.

Definition at line 34 of file bluepingplugin.cpp.

void BluepingPlugin::skip  )  [private, slot]
 

Emit the MultiauthPluginObject::Skip emitCode.

Definition at line 78 of file bluepingplugin.cpp.

References emitCode().

Referenced by authenticate(), and ping().

void BluepingPlugin::success  )  [private, slot]
 

Emit the MultiauthPluginObject::Success emitCode.

Definition at line 68 of file bluepingplugin.cpp.

References emitCode().

Referenced by pingFinished().


Member Data Documentation

bool BluepingPlugin::bluetoothWasOff [private]
 

Definition at line 80 of file bluepingplugin.h.

Referenced by authenticate(), and killBluetoothIfNecessary().

BluepingConfigWidget* BluepingPlugin::m_bluepingW [private]
 

Definition at line 79 of file bluepingplugin.h.

Referenced by configWidget(), and ~BluepingPlugin().

Config* BluepingPlugin::m_config [private]
 

Definition at line 78 of file bluepingplugin.h.

Opie::Core::OProcess* BluepingPlugin::m_ping [private]
 

Definition at line 77 of file bluepingplugin.h.

Referenced by ping(), and ~BluepingPlugin().

QString BluepingPlugin::macToPing [private]
 

Definition at line 81 of file bluepingplugin.h.

Referenced by authenticate(), and ping().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:27:18 2005 for OPIE by  doxygen 1.4.2