diff options
Diffstat (limited to 'lib/kofficeui/KoTabChooser.h')
-rw-r--r-- | lib/kofficeui/KoTabChooser.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/lib/kofficeui/KoTabChooser.h b/lib/kofficeui/KoTabChooser.h new file mode 100644 index 00000000..7a49f495 --- /dev/null +++ b/lib/kofficeui/KoTabChooser.h @@ -0,0 +1,80 @@ +/* This file is part of the KDE project + Copyright (C) 1998, 1999 Reginald Stadlbauer <[email protected]> + + 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 koTabChooser_h +#define koTabChooser_h + +#include <qframe.h> +#include <koffice_export.h> +class QMouseEvent; +class QPainter; +class QPopupMenu; + +/** + * class KoTabChooser + */ + +class KoTabChooserPrivate; + +class KOFFICEUI_EXPORT KoTabChooser : public QFrame +{ + Q_OBJECT + +public: + enum { TAB_LEFT = 1, + TAB_CENTER = 2, + TAB_RIGHT = 4, + TAB_DEC_PNT = 8, + TAB_ALL = TAB_LEFT | TAB_CENTER | TAB_RIGHT | TAB_DEC_PNT }; + + KoTabChooser( QWidget *parent, int _flags ); + ~KoTabChooser(); + + int getCurrTabType() { return currType; } + + /** + * put m_bReadWrite to true as default + * and used setReadWrite(false) to make in readOnly mode + */ + void setReadWrite(bool _readWrite); + +protected: + void mousePressEvent( QMouseEvent *e ); + void drawContents( QPainter *painter ); + void setupMenu(); + + int flags; + int currType; + QPopupMenu *rb_menu; + int mLeft; + int mRight; + int mCenter; + int mDecPoint; + + KoTabChooserPrivate *d; + +protected slots: + void rbLeft() { currType = TAB_LEFT; repaint( true ); } + void rbCenter() { currType = TAB_CENTER; repaint( true ); } + void rbRight() { currType = TAB_RIGHT; repaint( true ); } + void rbDecPoint() { currType = TAB_DEC_PNT; repaint( true ); } + +}; + +#endif |