Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Attributes
KXSDoubleRangeItem Class Reference

#include <kxsitem.h>

Inheritance diagram for KXSDoubleRangeItem:
Inheritance graph
[legend]
Collaboration diagram for KXSDoubleRangeItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Protected Attributes

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

Detailed Description

Definition at line 64 of file kxsitem.h.


Constructor & Destructor Documentation

KXSDoubleRangeItem::KXSDoubleRangeItem ( const QString &  name,
KConfig &  config 
)

Definition at line 86 of file kxsitem.cpp.

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

Definition at line 96 of file kxsitem.cpp.

  : KXSConfigItem(name, attr), mInvert(false)
{
  mMinimum = attr.value("low").toDouble();
  mMaximum = attr.value("high").toDouble();
  mValue   = attr.value("default").toDouble();
  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 KXSDoubleRangeItem::command ( ) [virtual]

Implements KXSConfigItem.

Definition at line 112 of file kxsitem.cpp.

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

Implements KXSConfigItem.

Reimplemented in KXSDoubleRangeControl.

Definition at line 117 of file kxsitem.cpp.

{
  KConfigGroup grp = config.group(mName);
  if (grp.hasKey("Value"))
      mValue = grp.readEntry("Value",0.0);
}
void KXSDoubleRangeItem::save ( KConfig &  config) [virtual]

Implements KXSConfigItem.

Definition at line 124 of file kxsitem.cpp.

{
  KConfigGroup grp = config.group(mName);
  grp.writeEntry("Value", mValue);
}

Member Data Documentation

bool KXSDoubleRangeItem::mInvert [protected]

Definition at line 79 of file kxsitem.h.

QString KXSConfigItem::mLabel [protected, inherited]

Definition at line 43 of file kxsitem.h.

double KXSDoubleRangeItem::mMaximum [protected]

Definition at line 77 of file kxsitem.h.

double KXSDoubleRangeItem::mMinimum [protected]

Definition at line 76 of file kxsitem.h.

QString KXSConfigItem::mName [protected, inherited]

Definition at line 42 of file kxsitem.h.

QString KXSDoubleRangeItem::mSwitch [protected]

Definition at line 75 of file kxsitem.h.

double KXSDoubleRangeItem::mValue [protected]

Definition at line 78 of file kxsitem.h.


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