20#ifndef __VTEXTTOOL_H__
21#define __VTEXTTOOL_H__
28#include <kdialogbase.h>
31#include "tqgroupbox.h"
32#include "tqcombobox.h"
48class ShadowPreview :
public TQWidget
54 ShadowPreview( ShadowWidget* parent );
58 void changed(
int angle,
int distance,
bool );
61 virtual void mouseReleaseEvent( TQMouseEvent* );
62 virtual void paintEvent( TQPaintEvent* );
65 ShadowWidget* m_parent;
69class ShadowWidget :
public TQGroupBox
75 ShadowWidget( TQWidget* parent,
const char* name,
int angle,
int distance,
bool translucent );
78 void setUseShadow(
bool use );
80 void setShadowAngle(
int angle );
82 void setShadowDistance(
int distance );
84 void setTranslucent(
bool translucent );
88 void setShadowValues(
int angle,
int distance,
bool translucent );
89 void updatePreview(
int );
93 TQCheckBox* m_useShadow;
94 KIntNumInput* m_angle;
95 KIntNumInput* m_distance;
96 TQCheckBox* m_translucent;
97 ShadowPreview* m_preview;
101class VTextOptionsWidget :
public KDialogBase
107 VTextOptionsWidget( VTextTool* tool, TQWidget *parent );
108 ~VTextOptionsWidget();
110 void setFont(
const TQFont& font );
112 void setText(
const TQString& text );
114 void setPosition( VText::Position position );
115 VText::Position position();
116 void setAlignment( VText::Alignment alignment );
117 VText::Alignment alignment();
118 void setOffset(
double offset );
120 void setUseShadow(
bool state );
122 void setShadow(
int angle,
int distance,
bool translucent );
123 bool translucentShadow();
125 int shadowDistance();
128 void valueChanged(
int );
129 void valueChanged(
double );
132 void textChanged(
const TQString& );
134 void convertToShapes();
135 void initialize(
VObject &text );
138 TQTabWidget* m_tabWidget;
139 TDEFontCombo* m_fontCombo;
140 TQCheckBox* m_boldCheck;
141 TQCheckBox* m_italicCheck;
142 KIntNumInput* m_fontSize;
143 TQLineEdit* m_textEditor;
144 ShadowWidget* m_shadow;
145 TQComboBox* m_textAlignment;
146 TQComboBox* m_textPosition;
147 TQPushButton* m_editBasePath;
148 TQPushButton* m_convertToShapes;
149 KDoubleNumInput* m_textOffset;
157 VTextTool( KarbonView *
view );
160 virtual void setup (TDEActionCollection *collection );
161 virtual TQString
uiname() {
return i18n(
"Text Tool" ); }
173 virtual void textChanged();
176 virtual void editBasePath();
177 virtual void convertToShapes();
192 virtual void draw( VPainter* painter );
202 VTextCmd(
VDocument* doc,
const TQString&
name, VText* text );
204 const TQFont &newFont,
const VSubpath& newBasePath, VText::Position newPosition, VText::Alignment newAlignment,
double newOffset,
const TQString& newText,
205 bool newUseShadow,
int newShadowAngle,
int newShadowDistance,
bool newTranslucentShadow );
208 virtual void execute();
209 virtual void unexecute();
210 virtual bool isExecuted()
214 virtual bool changesSelection()
const {
return true; }
217 class VTextModifPrivate
220 VTextModifPrivate() : oldBasePath( 0L ), newBasePath( 0L )
227 VText::Position oldPosition;
228 VText::Position newPosition;
229 VText::Alignment oldAlignment;
230 VText::Alignment newAlignment;
239 int oldShadowDistance;
240 int newShadowDistance;
241 bool oldTranslucentShadow;
242 bool newTranslucentShadow;
247 VTextModifPrivate* m_textModifications;
250 class VTextToCompositeCmd :
public VCommand
253 VTextToCompositeCmd(
VDocument* doc,
const TQString&
name, VText* text );
254 virtual ~VTextToCompositeCmd();
256 virtual void execute();
257 virtual void unexecute();
258 virtual bool isExecuted()
269 void drawPathCreation();
270 void drawEditedText();
279 VTextOptionsWidget* m_optionsWidget;
The base class for all karbon commands.
TQString name() const
Returns the name of the command.
All non-visual, static doc info is in here.
Base class for all sort of VObject conglomerats.
VLayer manages a set of vobjects.
The base class for all karbon objects.
A composite path consists of one or many subpaths.
VSubpath provides a sophisticated list of VSegment.
The abstract visitor class.
virtual void visitVSubpath(VSubpath &path)
Visit method for a VSubpath.
virtual void visitVText(VText &text)
Visit method for a VText.
virtual void visitVDocument(VDocument &document)
Visit method for a VDocument.
virtual void visitVGroup(VGroup &group)
Visit method for a VGroup.
virtual void visitVLayer(VLayer &layer)
Visit method for a VLayer.
virtual void visitVPath(VPath &composite)
Visit method for a VPath.