kspread

kspread_toolbox.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef TOOLBOX_H
00021 #define TOOLBOX_H
00022 
00023 #include <qframe.h>
00024 #include <qpoint.h>
00025 #include <koffice_export.h>
00026 class QVBoxLayout;
00027 class QSpinBox;
00028 
00029 class KoDocumentChild;
00030 
00031 namespace KSpread
00032 {
00033 
00034 class KOFFICEUI_EXPORT ToolBox : public QFrame
00035 {
00036     Q_OBJECT
00037 public:
00038     ToolBox( QWidget* parent = 0, const char* name = 0 );
00039 
00040 public slots:
00041     void setEnabled( bool enable );
00042 
00043 protected:
00044     // void paintEvent( QPaintEvent* );
00045     void childEvent( QChildEvent* ev );
00046     void mousePressEvent( QMouseEvent* ev );
00047     void mouseMoveEvent( QMouseEvent* ev );
00048 
00049 private:
00050     QVBoxLayout* m_layout;
00051     QPoint m_mousePos;
00052     QPoint m_startPos;
00053 };
00054 
00055 class KOFFICEUI_EXPORT KoTransformToolBox : public ToolBox
00056 {
00057     Q_OBJECT
00058 public:
00059     KoTransformToolBox( KoDocumentChild* child, QWidget* parent = 0, const char* name = 0 );
00060 
00061     double rotation() const;
00062     double scaling() const;
00063     double xShearing() const;
00064     double yShearing() const;
00065 
00066     void setRotation( double );
00067     void setScaling( double );
00068     void setXShearing( double );
00069     void setYShearing( double );
00070 
00071 signals:
00072     void rotationChanged( double );
00073     void scalingChanged( double );
00074     void xShearingChanged( double );
00075     void yShearingChanged( double );
00076 
00077 public slots:
00078     void setDocumentChild( KoDocumentChild* );
00079 
00080 private slots:
00081     void slotRotationChanged( int );
00082     void slotScalingChanged( int );
00083     void slotXShearingChanged( int );
00084     void slotYShearingChanged( int );
00085 
00086 private:
00087     QSpinBox* m_rotation;
00088     QSpinBox* m_scale;
00089     QSpinBox* m_shearX;
00090     QSpinBox* m_shearY;
00091     KoDocumentChild* m_child;
00092     class Private;
00093     Private *d;
00094 };
00095 
00096 } // namespace KSpread
00097 
00098 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys