kpresenter

KPrRotationDialogImpl.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2005 Thomas Zander <zander@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; version 2.
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 #ifndef __rotationdialogimpl_h__
00020 #define __rotationdialogimpl_h__
00021 
00022 #include <qlabel.h>
00023 #include <kdialogbase.h>
00024 
00025 class KPrTextPreview;
00026 class RotationPropertyUI;
00027 class QObject;
00028 class QEvent;
00029 class KPrCircleGroup;
00030 
00034 class KPrRotationDialogImpl : public KDialogBase
00035 {
00036     Q_OBJECT
00037 
00038 public:
00039     KPrRotationDialogImpl( QWidget *parent, const char* name = 0 );
00040     ~KPrRotationDialogImpl() {}
00041 
00042     void setAngle( double angle );
00043     double angle();
00044 
00045 protected slots:
00046     void angleChanged( double );
00047     void angleMode( int );
00048     void slotOk();
00049 
00050 protected:
00051     KPrTextPreview *m_preview;
00052     RotationPropertyUI *m_dialog;
00053     KPrCircleGroup *m_angleGroup;
00054 
00055 private:
00056     bool noSignals;
00057 };
00058 
00063 class KPrCircleToggle : public QLabel
00064 {
00065     Q_OBJECT
00066 public:
00074     KPrCircleToggle(QWidget *parent, const QString &image, int id);
00076     int id() { return m_id; }
00077 
00078 signals:
00080     void clicked(int id);
00081 
00082 public slots:
00087     void setChecked(bool on);
00088 
00089 protected:
00091     void mousePressEvent ( QMouseEvent * e );
00092 
00093 private:
00094     QPixmap m_on, m_off;
00095     bool m_selected;
00096     int m_id;
00097 };
00098 
00102 class KPrCircleGroup : public QFrame
00103 {
00104     Q_OBJECT
00105 public:
00110     KPrCircleGroup(QWidget *parent);
00117     void setAngle(int angle);
00122     void add(KPrCircleToggle *button);
00123 
00124 signals:
00126     void clicked(int id);
00127 
00128 private slots:
00129     void selectionChanged(int buttonId);
00130 
00131 private:
00132     QPtrList<KPrCircleToggle> m_buttons;
00133     bool noSignals;
00134 };
00135 
00136 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys