Qtopia library API Documentation

Resource Class Reference

The Resource class provides access to named resources. More...

#include <resource.h>

List of all members.

Static Public Member Functions

QImage loadImage (const QString &name)
QPixmap loadPixmap (const QString &name)
QBitmap loadBitmap (const QString &name)
QString findPixmap (const QString &name)
QIconSet loadIconSet (const QString &name)
QString findSound (const QString &name)
QStringList allSounds ()


Detailed Description

The Resource class provides access to named resources.

The resources may be provided from files or other sources.

The allSounds() function returns a list of all the sounds available. A particular sound can be searched for using findSound().

Images can be loaded with loadImage(), loadPixmap(), loadBitmap() and loadIconSet().

Definition at line 28 of file resource.h.


Member Function Documentation

QImage Resource::loadImage const QString name  )  [static]
 

Returns the QImage called name. You should avoid including any filename type extension (e.g. .png, .xpm).

Definition at line 176 of file resource.cpp.

References QImage::create(), QImage::detach(), QImage::height(), QImage::isNull(), QString::left(), QString::length(), QImage::pixel(), QString::right(), QImage::setAlphaBuffer(), QImage::setPixel(), and QImage::width().

Referenced by loadPixmap(), and AppLnk::setIcon().

QPixmap Resource::loadPixmap const QString pix  )  [static]
 

Returns the QPixmap called pix. You should avoid including any filename type extension (e.g. .png, .xpm).

Definition at line 63 of file resource.cpp.

References QPixmap::convertFromImage(), QPixmapCache::find(), QPixmapCache::insert(), and loadImage().

Referenced by loadBitmap(), and loadIconSet().

QBitmap Resource::loadBitmap const QString pix  )  [static]
 

Returns the QBitmap called pix. You should avoid including any filename type extension (e.g. .png, .xpm).

Definition at line 78 of file resource.cpp.

References loadPixmap().

QString Resource::findPixmap const QString pix  )  [static]
 

Returns the filename of a pixmap called pix. You should avoid including any filename type extension (e.g. .png, .xpm).

Normally you will use loadPixmap() rather than this function.

Definition at line 91 of file resource.cpp.

References QValueList::begin(), QList::current(), QValueList::end(), QList::first(), QImageIO::inputFormats(), QString::lower(), QList::next(), and QPEApplication::qpeDir().

QIconSet Resource::loadIconSet const QString pix  )  [inline, static]
 

Returns a QIconSet for the pixmap named name. A disabled icon is generated that conforms to the Qtopia look & feel. You should avoid including any filename type extension (eg. .png, .xpm).

Definition at line 46 of file resource.h.

References QPixmap::isNull(), loadPixmap(), QIconSet::setPixmap(), and QPixmap::width().

QString Resource::findSound const QString name  )  [static]
 

Returns a sound file for a sound called name.

You should avoid including any filename type extension (e.g. .wav), as the system will search for only those fileformats which are supported by the library.

Currently, only WAV files are supported.

Definition at line 136 of file resource.cpp.

References QPEApplication::qpeDir().

QStringList Resource::allSounds  )  [static]
 

Returns a list of all sound names.

Definition at line 150 of file resource.cpp.

References QValueList::append(), QValueList::begin(), QValueList::end(), and QDir::entryList().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:25 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001