Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

BitmapResourceTool Class Reference

#include <BitmapResourceTool.h>

Inheritance diagram for BitmapResourceTool:

Inheritance graph
[legend]
Collaboration diagram for BitmapResourceTool:

Collaboration graph
[legend]
List of all members.

Public Slots

void handleBitmapDirectoryChanged (const QString newBitmapDirectory)

Signals

void bitmapChanged (const QImage *newBitmapImage)

Public Methods

RESOURCETOOL_API BitmapResourceTool (const QString bitmapDirectory, const BitmapUserData::BitmapProperties bitmapProperties)
virtual RESOURCETOOL_API ~BitmapResourceTool ()
RESOURCETOOL_API QString getBitmapDirectory () const
RESOURCETOOL_API void setBitmapProperties (const BitmapUserData::BitmapProperties newBitmapProperties)
RESOURCETOOL_API BitmapUserData::BitmapProperties getBitmapProperties () const
RESOURCETOOL_API uint getNofBitmaps () const
RESOURCETOOL_API void setBitmapSelected (uint id)
RESOURCETOOL_API const QImage * getSelectedBitmap () const
RESOURCETOOL_API uint getSelectedBitmapID () const
RESOURCETOOL_API QToolButton * addButtonToToolBar (QToolBar *toolBar)
RESOURCETOOL_API void addMenuToPushButton (QPushButton *pushButton)

Static Public Attributes

const uint NO_BITMAPS

Private Slots

void handleBitmapSelected (int id)

Private Methods

void updateBitmaps ()

Private Attributes

QToolButton * bitmapButton
QString bitmapDirectory
BitmapUserData::BitmapProperties bitmapProperties
const QImage * currentBitmap
uint currentBitmapID
QVector< QImage > registry
QPopupMenu popupMenu

Detailed Description

This class implements a resource tool which offers 8bit, 24bit and/or 32bit bitmaps to other tools. Any bitmap which is supported by Qt can be read, such as BMP, PNG or JPG.

Author:
Oliver Knoll
Version:
1.2


Constructor & Destructor Documentation

RESOURCETOOL_API BitmapResourceTool::BitmapResourceTool const QString    bitmapDirectory,
const BitmapUserData::BitmapProperties    bitmapProperties
 

Creates this BitmapResourceTool which looks in bitmapDirectory for available bitmaps which have the specified bitmapProperties.

Parameters:
bitmapDirectory  a QString specifying the absolute or relative path to the directory where the bitmaps are expected to be
bitmapProperties  the expected BitmapProperties
See also:
BitmapUserData::BitmapProperties

virtual RESOURCETOOL_API BitmapResourceTool::~BitmapResourceTool   [virtual]
 


Member Function Documentation

RESOURCETOOL_API QToolButton* BitmapResourceTool::addButtonToToolBar QToolBar *    toolBar [virtual]
 

Creates a tool button and adds it to the toolBar. The QToolButton may also activate QPopupMenus, for example.

Parameters:
toolBar  a pointer to the QToolBar to which this tool has to be added
Returns:
a pointer to the QToolButton which was created and added to the toolBar

Implements ResourceToolInterface.

RESOURCETOOL_API void BitmapResourceTool::addMenuToPushButton QPushButton *    pushButton [virtual]
 

If this ResourceToolInterface provides a method where resources can be chosen from, for example bitmaps, this QPopupMenu is added to the QPushButton.

Parameters:
pushButton  a pointer to the QPushButton to which the QPopupMenu is to be added

Implements ResourceToolInterface.

void BitmapResourceTool::bitmapChanged const QImage *    newBitmapImage [signal]
 

Emitted whenever a new bitmap has been selected. The newBitmapImage may be 0 in case there are no valid bitmaps available in the given directory.

Parameters:
newBitmapImage  a pointer to a QImage which represents the new bitmap which has been selected; may be 0 in case there is no texture image available

RESOURCETOOL_API QString BitmapResourceTool::getBitmapDirectory   const
 

Returns the bitmap directory of the available bitmaps.

Returns:
a QString specifying the absolute or relative path to the bitmap directory
See also:
handleBitmapDirectoryChanged

RESOURCETOOL_API BitmapUserData::BitmapProperties BitmapResourceTool::getBitmapProperties   const
 

Returns the BitmapProperties of the available bitmaps.

Returns:
the BitmapProperties of the available bitmaps

RESOURCETOOL_API uint BitmapResourceTool::getNofBitmaps   const
 

Returns the number of bitmaps this BitmapResourceTool provides.

Returns:
the number of bitmaps this BitmapResourceTool provides; may be 0 in case there are no bitmaps available

RESOURCETOOL_API const QImage* BitmapResourceTool::getSelectedBitmap   const
 

Returns the currently selected bitmap. The returned QImage may be 0 in case the aren't any bitmaps available.

Returns:
a pointer to a QImage representing the currently selected bitmap; may be 0

RESOURCETOOL_API uint BitmapResourceTool::getSelectedBitmapID   const
 

Returns the currently selected bitmap ID. A valid ID is in 0 <= ID < n, where n is the number of bitmaps this BitmapResourceTool provides.. A return value of NO_BITMAPS signals that there are no bitmaps available.

Returns:
the ID of the currently selected bitmap; valid if in [0, n[; NO_BITMAPS if there are no bitmaps available

void BitmapResourceTool::handleBitmapDirectoryChanged const QString    newBitmapDirectory [slot]
 

Sets the newBitmapDirectory and updates the available bitmaps.

Signals:

  • bitmapChanged
Parameters:
newBitmapDirectory  a QString specifying the absolute or relative path to the directory where the bitmaps are expected to be
See also:
getBitmapDirectory , bitmapChanged

void BitmapResourceTool::handleBitmapSelected int    id [private, slot]
 

RESOURCETOOL_API void BitmapResourceTool::setBitmapProperties const BitmapUserData::BitmapProperties    newBitmapProperties
 

Specifies the new BitmapProperties and updates the available bitmaps.

Signals:

  • bitmapChanged
Parameters:
newBitmapProperties  the BitmapProperties of the available bitmaps
See also:
BitmapUserData::BitmapProperties , bitmapChanged

RESOURCETOOL_API void BitmapResourceTool::setBitmapSelected uint    id
 

Makes the bitmap with ID id the currently selected one. The id is clipped to 0 <= id < n, where n is the number of bitmaps this BitmapResourceTool provides.

Signals:

  • bitmapChanged
Parameters:
id  the identifier specifying the bitmap to be selected; is clipped to 0 <= ID < n
See also:
getNofBitmaps , bitmapChanged

void BitmapResourceTool::updateBitmaps   [private]
 


Member Data Documentation

QToolButton* BitmapResourceTool::bitmapButton [private]
 

QString BitmapResourceTool::bitmapDirectory [private]
 

BitmapUserData::BitmapProperties BitmapResourceTool::bitmapProperties [private]
 

const QImage* BitmapResourceTool::currentBitmap [private]
 

uint BitmapResourceTool::currentBitmapID [private]
 

const uint BitmapResourceTool::NO_BITMAPS [static]
 

QPopupMenu BitmapResourceTool::popupMenu [private]
 

QVector<QImage> BitmapResourceTool::registry [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Sep 30 15:54:25 2002 for PointShop by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002