kstatusbar.h
/* This file is part of the KDE libraries
Copyright (C) 1997 Mark Donohoe (donohoe@kde.org)
Copyright (C) 1997, 1998 1998 Sven Radej (sven@lisa.exp.univie.ac.at)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __KSTATUSBAR_H__
#define __KSTATUSBAR_H__
#include <qstatusbar.h>
#include <qintdict.h>
#include <qlabel.h>
#include <kdelibs_export.h>
class KStatusBar;
class KDEUI_EXPORT KStatusBarLabel : public QLabel
{
Q_OBJECT
public:
KStatusBarLabel( const QString& text, int _id, KStatusBar* parent = 0L, const char *name=0L );
~KStatusBarLabel () {}
protected:
void mousePressEvent (QMouseEvent* _event);
void mouseReleaseEvent (QMouseEvent* _event);
private:
int id;
signals:
void itemPressed (int id);
void itemReleased (int id);
};
class KDEUI_EXPORT KStatusBar : public QStatusBar
{
Q_OBJECT
public:
enum BarStatus{ Toggle, Show, Hide };
KStatusBar( QWidget* parent = 0L, const char* name = 0L );
~KStatusBar();
void insertItem(const QString& text, int id, int stretch=0, bool permanent=false );
inline void insertFixedItem(const QString& text, int id, bool permanent=false)
{ insertItem(text, id, 0, permanent); setItemFixed(id); }
void removeItem( int id );
bool hasItem( int id ) const;
void changeItem( const QString& text, int id );
void setItemAlignment(int id, int align);
void setItemFixed(int id, int width=-1);
signals:
void pressed( int );
void released( int );
private:
QIntDict<KStatusBarLabel> items;
class KStatusBarPrivate* d;
};
#endif // __KSTATUSBAR_H__
KStatusBarLabel
Internal label class for use in KStatusBar.
Definition: kstatusbar.h:35
KStatusBar
KDE statusbar widget
Definition: kstatusbar.h:87
KStatusBar::insertFixedItem
void insertFixedItem(const QString &text, int id, bool permanent=false)
Inserts a fixed width text label into status bar.
Definition: kstatusbar.h:138
KStatusBar::BarStatus
BarStatus
Definition: kstatusbar.h:97

KDE Home | KDE Accessibility Home | Description of Access Keys