kmditaskbar.h
//----------------------------------------------------------------------------
// filename : kmditaskbar.h
//----------------------------------------------------------------------------
// Project : KDE MDI extension
//
// begin : 07/1999 by Szymon Stefanek as part of kvirc
// (an IRC application)
// changes : 09/1999 by Falk Brettschneider to create an
// - 06/2000 stand-alone Qt extension set of
// classes and a Qt-based library
// 2000-2003 maintained by the KDevelop project
//
// copyright : (C) 1999-2003 by Falk Brettschneider
// and
// Szymon Stefanek (stefanek@tin.it)
// email : falkbr@kdevelop.org (Falk Brettschneider)
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
//
// This program 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.
//
//----------------------------------------------------------------------------
#ifndef _KMDITASKBAR_H_
#define _KMDITASKBAR_H_
#include <ktoolbar.h>
#include <qptrlist.h>
#include <qpixmap.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include "kmdidefines.h"
class KMdiMainFrm;
class KMdiChildView;
class KMdiTaskBar;
class KMdiTaskBarButtonPrivate;
class KMDI_EXPORT KMdiTaskBarButton : public QPushButton
{
Q_OBJECT
// methods
public:
KMdiTaskBarButton( KMdiTaskBar *pTaskBar, KMdiChildView *win_ptr );
~KMdiTaskBarButton();
QString actualText() const;
void fitText( const QString&, int newWidth );
void setText( const QString& );
signals:
void clicked( KMdiChildView* );
void leftMouseButtonClicked( KMdiChildView* );
void rightMouseButtonClicked( KMdiChildView* );
void buttonTextChanged( int );
public slots:
void setNewText( const QString& );
protected slots:
void mousePressEvent( QMouseEvent* );
// attributes
public:
KMdiChildView *m_pWindow;
protected:
QString m_actualText;
private:
KMdiTaskBarButtonPrivate *d;
};
class KMdiTaskBarPrivate;
class KMDI_EXPORT KMdiTaskBar : public KToolBar
{
Q_OBJECT
public:
KMdiTaskBar( KMdiMainFrm *parent, QMainWindow::ToolBarDock dock );
~KMdiTaskBar();
KMdiTaskBarButton * addWinButton( KMdiChildView *win_ptr );
void removeWinButton( KMdiChildView *win_ptr, bool haveToLayoutTaskBar = true );
KMdiTaskBarButton * getNextWindowButton( bool bRight, KMdiChildView *win_ptr );
KMdiTaskBarButton * getButton( KMdiChildView *win_ptr );
void switchOn( bool bOn );
bool isSwitchedOn() const
{
return m_bSwitchedOn;
};
protected:
void resizeEvent( QResizeEvent* );
protected slots:
void layoutTaskBar( int taskBarWidth = 0 );
public slots:
void setActiveButton( KMdiChildView *win_ptr );
protected:
QPtrList<KMdiTaskBarButton>* m_pButtonList;
KMdiMainFrm* m_pFrm;
KMdiChildView* m_pCurrentFocusedWindow;
QLabel* m_pStretchSpace;
bool m_layoutIsPending;
bool m_bSwitchedOn;
private:
KMdiTaskBarPrivate *d;
};
#endif //_KMDITASKBAR_H_
// kate: space-indent off; tab-width 4; replace-tabs off; indent-mode csands;
KMdiMainFrm
Base class for all your special main frames.
Definition: kmdimainfrm.h:239
KMdiTaskBarButton
Internal class.
Definition: kmditaskbar.h:51
KMdiTaskBar::isSwitchedOn
bool isSwitchedOn() const
Definition: kmditaskbar.h:168
KMdiTaskBarButton::m_pWindow
KMdiChildView * m_pWindow
The according MDI view.
Definition: kmditaskbar.h:109
KMdiTaskBar::m_pButtonList
QPtrList< KMdiTaskBarButton > * m_pButtonList
A list of taskbar buttons.
Definition: kmditaskbar.h:197
KMdiTaskBar
Internal class.
Definition: kmditaskbar.h:129
KMdiTaskBar::m_pStretchSpace
QLabel * m_pStretchSpace
A stretchable widget used as 'space' at the end of a half filled taskbar.
Definition: kmditaskbar.h:209
KMdiTaskBar::m_pFrm
KMdiMainFrm * m_pFrm
The belonging MDI mainframe (parent widget of this)
Definition: kmditaskbar.h:201
KMdiTaskBarButton::m_actualText
QString m_actualText
Internally we must remember the real text because the button text can be abbreviated.
Definition: kmditaskbar.h:114
KMdiChildView
Base class for all your special view windows.
Definition: kmdichildview.h:108
KMdiTaskBar::m_pCurrentFocusedWindow
KMdiChildView * m_pCurrentFocusedWindow
The MDI view belonging to the currently pressed taskbar button.
Definition: kmditaskbar.h:205

KDE Home | KDE Accessibility Home | Description of Access Keys