KoTabChooser.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef koTabChooser_h
21#define koTabChooser_h
22
23#include <tqframe.h>
24#include <koffice_export.h>
25class TQMouseEvent;
26class TQPainter;
27class TQPopupMenu;
28
33class KoTabChooserPrivate;
34
35class KOFFICEUI_EXPORT KoTabChooser : public TQFrame
36{
37 TQ_OBJECT
38
39
40public:
41 enum { TAB_LEFT = 1,
42 TAB_CENTER = 2,
43 TAB_RIGHT = 4,
44 TAB_DEC_PNT = 8,
45 TAB_ALL = TAB_LEFT | TAB_CENTER | TAB_RIGHT | TAB_DEC_PNT };
46
47 KoTabChooser( TQWidget *parent, int _flags );
48 ~KoTabChooser();
49
50 int getCurrTabType() { return currType; }
51
56 void setReadWrite(bool _readWrite);
57
58protected:
59 void mousePressEvent( TQMouseEvent *e );
60 void drawContents( TQPainter *painter );
61 void setupMenu();
62
63 int flags;
64 int currType;
65 TQPopupMenu *rb_menu;
66 int mLeft;
67 int mRight;
68 int mCenter;
69 int mDecPoint;
70
71 KoTabChooserPrivate *d;
72
73protected slots:
74 void rbLeft() { currType = TAB_LEFT; repaint( true ); }
75 void rbCenter() { currType = TAB_CENTER; repaint( true ); }
76 void rbRight() { currType = TAB_RIGHT; repaint( true ); }
77 void rbDecPoint() { currType = TAB_DEC_PNT; repaint( true ); }
78
79};
80
81#endif