lib

Kolinewidthaction.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Peter Simonsson <psn@linux.se>
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 KOLINEWIDTHACTION_H
21#define KOLINEWIDTHACTION_H
22
23#include <kdialogbase.h>
24
25#include <KoUnit.h>
26#include <KoSelectAction.h>
27#include <koffice_export.h>
28
30class KOFFICEUI_EXPORT KoLineWidthAction : public KoSelectAction
31{
32 TQ_OBJECT
33
34 public:
41 KoLineWidthAction(const TQString& text, const TQString& icon, TQObject* parent = 0, const char* name = 0);
50 KoLineWidthAction(const TQString& text, const TQString& icon, const TQObject* receiver,
51 const char* slot, TQObject* parent, const char* name = 0);
53
55 double currentWidth() const;
56
57 signals:
59 void lineWidthChanged(double);
60
61 public slots:
65 void setCurrentWidth(double width);
69 void setUnit(KoUnit::Unit unit);
70
71 protected slots:
76 void execute(int index);
77
78 protected:
80 void createMenu();
81
82 private:
83 class KoLineWidthActionPrivate;
84 KoLineWidthActionPrivate* d;
85};
86
88class KoLineWidthChooser : public KDialogBase
89{
90 TQ_OBJECT
91
92 public:
93 KoLineWidthChooser(TQWidget* parent = 0, const char* name = 0);
94 ~KoLineWidthChooser();
95
97 double width() const;
98
99 public slots:
103 void setUnit(KoUnit::Unit unit);
107 void setWidth(double width);
108
109 private:
110 class KoLineWidthChooserPrivate;
111 KoLineWidthChooserPrivate* d;
112};
113
114#endif
KDialogBase(TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem())
void createMenu()
Draws and adds each item of the menu.
void setCurrentWidth(double width)
Set the current width.
KoLineWidthAction(const TQString &text, const TQString &icon, TQObject *parent=0, const char *name=0)
Constructs a KoLineWidthAction with a text and an icon.
double currentWidth() const
Returns the currently selected line width.
void setUnit(KoUnit::Unit unit)
Set which unit to use in the custom width dialog.
void lineWidthChanged(double)
Emited when a new line width have been selected.
void setUnit(KoUnit::Unit unit)
Set unit to use when showing the width.
void setWidth(double width)
Set line width.
double width() const
Returns the selected line width in points.
virtual void execute(int index)
Execute an item.
KoSelectAction(const TQString &text, const TQString &icon, TQObject *parent=0, const char *name=0)
Constructs a KoSelectAction with a text and an icon.
Unit
Length units supported by KOffice.
Definition KoUnit.h:63
virtual TQString text() const