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

Opie::Core::OKeyConfigItem Class Reference

#include </home/clem/local/src/opie/libopie2/opiecore/okeyconfigmanager.h>

Collaboration diagram for Opie::Core::OKeyConfigItem:

Collaboration graph
[legend]
List of all members.

Public Types

typedef QValueList< OKeyConfigItemList

Public Member Functions

 OKeyConfigItem (const QString &text=QString::null, const QCString &config_key=QCString(), const QPixmap &symbol=QPixmap(), int id=-1, const OKeyPair &def=OKeyPair::emptyKey(), QObject *caller=0, const char *slot=0)
 OKeyConfigItem (const Opie::Core::ODeviceButton &)
 ~OKeyConfigItem ()
bool operator== (const OKeyConfigItem &) const
bool operator!= (const OKeyConfigItem &) const
QString text () const
QPixmap pixmap () const
int id () const
OKeyPair keyPair () const
OKeyPair defaultKeyPair () const
QCString configKey () const
void setText (const QString &text)
void setPixmap (const QPixmap &)
void setKeyPair (const OKeyPair &)
void setDefaultKeyPair (const OKeyPair &)
bool isEmpty () const

Protected Member Functions

QObject * object () const
QCString slot () const
void setId (int id)
void setConfigKey (const QCString &)

Private Attributes

QString m_text
QCString m_config
QPixmap m_pix
int m_id
OKeyPair m_key
OKeyPair m_def
QObject * m_obj
QCString m_str
Private * d

Friends

class OKeyConfigManager

Detailed Description

A class to represent an OKeyPair. It consists out of a Text exposed to the user, Config Key Item, Pixmap, A default OKeyPair and the set OKeyPair. You can also pass an id to it

Since:
1.2

Definition at line 71 of file okeyconfigmanager.h.


Member Typedef Documentation

typedef QValueList<OKeyConfigItem> Opie::Core::OKeyConfigItem::List
 

Definition at line 74 of file okeyconfigmanager.h.


Constructor & Destructor Documentation

Opie::Core::OKeyConfigItem::OKeyConfigItem const QString text = QString::null,
const QCString config_key = QCString(),
const QPixmap &  pix = QPixmap(),
int  id = -1,
const OKeyPair def = OKeyPair::emptyKey(),
QObject *  caller = 0,
const char *  slot = 0
 

The normal Constructor to create a OKeyConfigItem

You can set the the key paramater of this item but if you use this item with the OKeyConfigManager your setting will be overwritten. You can also specify a QObject and slot which sould get called once this item is activated. This slot only works if you use the OKeyConfigManager. The actual Key is read by load()

 void MySlot::create(){
    OKeyConfigItem item(tr("Delete"),"delete",Resource::loadPixmap("trash"),
                        123, OKeyPair(Qt::Key_D,Qt::ControlButton),
                        this,SLOT(slotDelete(QWidget*,QKeyEvent*)));
 }

Parameters:
text The text exposed to the user
config_key The key used in the config
pix A Pixmap associated with this Item
def The OKeyPair used as default
caller The object where the slot exists
slot The slot which should get called

Definition at line 220 of file okeyconfigmanager.cpp.

Opie::Core::OKeyConfigItem::OKeyConfigItem const Opie::Core::ODeviceButton b  ) 
 

A special Constructor for converting from an Opie::Core::ODeviceButton delivered by Opie::Core::ODevice::buttons() There is no Config Key set and both default key and key are set to Opie::Core::ODeviceButton::keycode() and 0 to modifier

See also:
Opie::Core::ODevice

Opie::Core::ODeviceButton

Opie::Core::ODevice::buttons()

Definition at line 238 of file okeyconfigmanager.cpp.

Opie::Core::OKeyConfigItem::~OKeyConfigItem  ) 
 

Destructor

Definition at line 247 of file okeyconfigmanager.cpp.


Member Function Documentation

QCString Opie::Core::OKeyConfigItem::configKey  )  const
 

reutrn the Config Key. Setting it is only possible by the constructor

Definition at line 298 of file okeyconfigmanager.cpp.

References m_config.

OKeyPair Opie::Core::OKeyConfigItem::defaultKeyPair  )  const
 

Return the default OKeyPair

See also:
setDefaultKeyPair

Definition at line 281 of file okeyconfigmanager.cpp.

References m_def.

int Opie::Core::OKeyConfigItem::id  )  const
 

Return the Id you assigned to this item. setting is only possible by the constructor

Definition at line 290 of file okeyconfigmanager.cpp.

References m_id.

Referenced by TestMainWindow::slotAction().

bool Opie::Core::OKeyConfigItem::isEmpty  )  const
 

If the item is not configured isEmpty() will return true It is empty if no text is present and no default and no configured key

Definition at line 378 of file okeyconfigmanager.cpp.

References QString::isEmpty(), Opie::Core::OKeyPair::isEmpty(), m_def, m_id, m_key, and m_text.

Referenced by Opie::Core::OKeyConfigManager::eventFilter().

OKeyPair Opie::Core::OKeyConfigItem::keyPair  )  const
 

Return the OKeyPair this OKeyConfigItem is configured for.

See also:
setKeyPair

Definition at line 273 of file okeyconfigmanager.cpp.

References m_key.

Referenced by Opie::Ui::OKeyConfigWidget::slotListViewItem(), and Opie::Ui::Internal::OKeyListViewItem::updateText().

QObject * Opie::Core::OKeyConfigItem::object  )  const [protected]
 

For internal use only.

Definition at line 305 of file okeyconfigmanager.cpp.

References m_obj.

Referenced by Opie::Core::OKeyConfigManager::eventFilter().

bool Opie::Core::OKeyConfigItem::operator!= const OKeyConfigItem  )  const
 

Definition at line 408 of file okeyconfigmanager.cpp.

bool Opie::Core::OKeyConfigItem::operator== const OKeyConfigItem conf  )  const
 

Check if the KeyPairs are the same

Definition at line 390 of file okeyconfigmanager.cpp.

References m_def, m_id, m_key, m_obj, and m_text.

QPixmap Opie::Core::OKeyConfigItem::pixmap  )  const
 

The pixmap shown to the user for your action/key

See also:
setPixmap

Definition at line 264 of file okeyconfigmanager.cpp.

References m_pix.

void Opie::Core::OKeyConfigItem::setConfigKey const QCString str  )  [protected]
 

For internal use only.

Definition at line 361 of file okeyconfigmanager.cpp.

References m_config.

void Opie::Core::OKeyConfigItem::setDefaultKeyPair const OKeyPair key  ) 
 

Set the default KeyPair.

Parameters:
key The default keypair
See also:
defaultKeyPair()

Definition at line 354 of file okeyconfigmanager.cpp.

References m_def.

void Opie::Core::OKeyConfigItem::setId int  id  )  [protected]
 

For internal use only.

Definition at line 369 of file okeyconfigmanager.cpp.

References m_id.

void Opie::Core::OKeyConfigItem::setKeyPair const OKeyPair key  ) 
 

Set the KeyPair the OKeyConfigItem uses. Your set Key could get overwritten if you use the manager or GUI to configure the key

Parameters:
key Set the OKeyPair used
See also:
keyPair()

Definition at line 344 of file okeyconfigmanager.cpp.

References m_key.

void Opie::Core::OKeyConfigItem::setPixmap const QPixmap &  pix  ) 
 

Set the pixmap of this action

Parameters:
pix The Pixmap to set
See also:
pixmap()

Definition at line 332 of file okeyconfigmanager.cpp.

References m_pix.

void Opie::Core::OKeyConfigItem::setText const QString text  ) 
 

Set the text

Parameters:
text Set the Text of this Action to text
See also:
text()

Definition at line 322 of file okeyconfigmanager.cpp.

References m_text.

QCString Opie::Core::OKeyConfigItem::slot  )  const [protected]
 

For internal use only.

Definition at line 312 of file okeyconfigmanager.cpp.

References m_str.

Referenced by Opie::Core::OKeyConfigManager::eventFilter().

QString Opie::Core::OKeyConfigItem::text  )  const
 

The text exposed to the user

See also:
setText

Definition at line 255 of file okeyconfigmanager.cpp.

References m_text.

Referenced by TestMainWindow::slotAction().


Friends And Related Function Documentation

friend class OKeyConfigManager [friend]
 

Definition at line 72 of file okeyconfigmanager.h.


Member Data Documentation

Private* Opie::Core::OKeyConfigItem::d [private]
 

Definition at line 119 of file okeyconfigmanager.h.

QCString Opie::Core::OKeyConfigItem::m_config [private]
 

Definition at line 112 of file okeyconfigmanager.h.

Referenced by configKey(), and setConfigKey().

OKeyPair Opie::Core::OKeyConfigItem::m_def [private]
 

Definition at line 116 of file okeyconfigmanager.h.

Referenced by defaultKeyPair(), isEmpty(), operator==(), and setDefaultKeyPair().

int Opie::Core::OKeyConfigItem::m_id [private]
 

Definition at line 114 of file okeyconfigmanager.h.

Referenced by id(), isEmpty(), operator==(), and setId().

OKeyPair Opie::Core::OKeyConfigItem::m_key [private]
 

Definition at line 115 of file okeyconfigmanager.h.

Referenced by isEmpty(), keyPair(), operator==(), and setKeyPair().

QObject* Opie::Core::OKeyConfigItem::m_obj [private]
 

Definition at line 117 of file okeyconfigmanager.h.

Referenced by object(), and operator==().

QPixmap Opie::Core::OKeyConfigItem::m_pix [private]
 

Definition at line 113 of file okeyconfigmanager.h.

Referenced by pixmap(), and setPixmap().

QCString Opie::Core::OKeyConfigItem::m_str [private]
 

Definition at line 118 of file okeyconfigmanager.h.

Referenced by slot().

QString Opie::Core::OKeyConfigItem::m_text [private]
 

Definition at line 111 of file okeyconfigmanager.h.

Referenced by isEmpty(), operator==(), setText(), and text().


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