00001 /* This file is part of the KDE project 00002 Copyright (C) 2004 Peter Simonsson <psn@linux.se> 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 KOLINEWIDTHACTION_H 00021 #define KOLINEWIDTHACTION_H 00022 00023 #include <kdialogbase.h> 00024 00025 #include <KoUnit.h> 00026 #include <KoSelectAction.h> 00027 #include <koffice_export.h> 00028 00030 class KOFFICEUI_EXPORT KoLineWidthAction : public KoSelectAction 00031 { 00032 Q_OBJECT 00033 public: 00040 KoLineWidthAction(const QString& text, const QString& icon, QObject* parent = 0, const char* name = 0); 00049 KoLineWidthAction(const QString& text, const QString& icon, const QObject* receiver, 00050 const char* slot, QObject* parent, const char* name = 0); 00051 ~KoLineWidthAction(); 00052 00054 double currentWidth() const; 00055 00056 signals: 00058 void lineWidthChanged(double); 00059 00060 public slots: 00064 void setCurrentWidth(double width); 00068 void setUnit(KoUnit::Unit unit); 00069 00070 protected slots: 00075 void execute(int index); 00076 00077 protected: 00079 void createMenu(); 00080 00081 private: 00082 class KoLineWidthActionPrivate; 00083 KoLineWidthActionPrivate* d; 00084 }; 00085 00087 class KoLineWidthChooser : public KDialogBase 00088 { 00089 Q_OBJECT 00090 public: 00091 KoLineWidthChooser(QWidget* parent = 0, const char* name = 0); 00092 ~KoLineWidthChooser(); 00093 00095 double width() const; 00096 00097 public slots: 00101 void setUnit(KoUnit::Unit unit); 00105 void setWidth(double width); 00106 00107 private: 00108 class KoLineWidthChooserPrivate; 00109 KoLineWidthChooserPrivate* d; 00110 }; 00111 00112 #endif