Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Attributes
KXSRangeItem Class Reference

#include <kxsitem.h>

Inheritance diagram for KXSRangeItem:
Inheritance graph
Collaboration diagram for KXSRangeItem:
Collaboration graph

List of all members.

Public Member Functions

 KXSRangeItem (const QString &name, KConfig &config)
 KXSRangeItem (const QString &name, const QXmlAttributes &attr)
virtual QString command ()
virtual void save (KConfig &config)
virtual void read (KConfig &config)

Protected Attributes

QString mSwitch
int mMinimum
int mMaximum
int mValue
bool mInvert
QString mName
QString mLabel

Detailed Description

Definition at line 46 of file kxsitem.h.

Constructor & Destructor Documentation

KXSRangeItem::KXSRangeItem ( const QString &  name,
KConfig &  config 

Definition at line 41 of file kxsitem.cpp.

  : KXSConfigItem(name, config), mInvert(false)
  KConfigGroup grp(&config, name);
  mMinimum = grp.readEntry("Minimum",0);
  mMaximum = grp.readEntry("Maximum",0);
  mValue   = grp.readEntry("Value",0);
  mSwitch  = grp.readEntry("Switch",0);
KXSRangeItem::KXSRangeItem ( const QString &  name,
const QXmlAttributes &  attr 

Definition at line 51 of file kxsitem.cpp.

  : KXSConfigItem(name, attr), mInvert(false)
  mMinimum = attr.value("low").toInt();
  mMaximum = attr.value("high").toInt();
  mValue   = attr.value("default").toInt();
  mSwitch  = attr.value("arg");
  int pos = mSwitch.indexOf( '%' );
  if (pos >= 0)
    mSwitch.insert(pos+1, '1');
  if ( attr.value("convert") == "invert" )
    mInvert = true;
  if (mInvert)
    mValue = mMaximum-(mValue-mMinimum);

Member Function Documentation

QString KXSRangeItem::command ( ) [virtual]

Implements KXSConfigItem.

Definition at line 67 of file kxsitem.cpp.

void KXSRangeItem::read ( KConfig &  config) [virtual]

Implements KXSConfigItem.

Reimplemented in KXSRangeControl.

Definition at line 72 of file kxsitem.cpp.

  KConfigGroup grp =;
  if (grp.hasKey("Value"))
      mValue = grp.readEntry("Value",0);
void KXSRangeItem::save ( KConfig &  config) [virtual]

Implements KXSConfigItem.

Definition at line 79 of file kxsitem.cpp.

  KConfigGroup grp =;
  grp.writeEntry("Value", mValue);

Member Data Documentation

bool KXSRangeItem::mInvert [protected]

Definition at line 61 of file kxsitem.h.

QString KXSConfigItem::mLabel [protected, inherited]

Definition at line 43 of file kxsitem.h.

int KXSRangeItem::mMaximum [protected]

Definition at line 59 of file kxsitem.h.

int KXSRangeItem::mMinimum [protected]

Definition at line 58 of file kxsitem.h.

QString KXSConfigItem::mName [protected, inherited]

Definition at line 42 of file kxsitem.h.

QString KXSRangeItem::mSwitch [protected]

Definition at line 57 of file kxsitem.h.

int KXSRangeItem::mValue [protected]

Definition at line 60 of file kxsitem.h.

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