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();
179 virtual void visitVPath( VPath& composite );
180 virtual void visitVDocument( VDocument& )
183 virtual void visitVGroup( VGroup& )
186 virtual void visitVLayer( VLayer& )
189 virtual void visitVSubpath( VSubpath& path );
190 virtual void visitVText( VText& text );
192 virtual void draw( VPainter* painter );
199 class VTextCmd :
public VCommand
202 VTextCmd( VDocument* doc,
const TQString&
name, VText* text );
203 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 );
210 virtual bool isExecuted()
217 class VTextModifPrivate
220 VTextModifPrivate() : oldBasePath( 0L ), newBasePath( 0L )
225 VSubpath oldBasePath;
226 VSubpath newBasePath;
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();
258 virtual bool isExecuted()
269 void drawPathCreation();
270 void drawEditedText();
277 bool createText( VSubpath &path );
279 VTextOptionsWidget* m_optionsWidget;
virtual void unexecute()
Unexecutes the command.
TQString name() const
Returns the name of the command.
virtual bool changesSelection() const
Returns if the command changes the actual document selection.
virtual void execute()=0
Executes the command.
The abstract visitor class.