vstrokecmd.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, The Karbon Developers
3 Copyright (C) 2002, The Karbon Developers
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __VSTROKECMD_H__
22#define __VSTROKECMD_H__
23
24#include "vcommand.h"
25#include "vcolor.h"
26#include "vstroke.h"
27
28#include <tqvaluevector.h>
29#include <koffice_export.h>
30// Stroke object(s)
31
32class KARBONCOMMAND_EXPORT VStrokeCmd : public VCommand
33{
34public:
35 VStrokeCmd( VDocument *doc, const VStroke *, const TQString& icon = "14_action" );
36 VStrokeCmd( VDocument *doc, VGradient * );
37 VStrokeCmd( VDocument *doc, VPattern * );
38 VStrokeCmd( VDocument *doc, const VColor & );
39 VStrokeCmd( VDocument *doc, double );
40 VStrokeCmd( VDocument *doc, const TQValueList<float>& );
41 virtual ~VStrokeCmd();
42
43 virtual void execute();
44 virtual void unexecute();
45
46 virtual bool changesSelection() const { return true; }
47
48 virtual void changeStroke( const VColor & );
49 virtual VSelection* getSelection() const { return m_selection; }
50
51protected:
52 typedef enum
53 {
54 LineWidth,
55 Color,
56 Gradient,
57 Pattern,
58 Stroke,
59 Dash
60 } State;
61
62 State m_state;
63 VSelection *m_selection;
64 VStroke m_stroke;
65 TQValueVector<VStroke> m_oldstrokes;
66};
67
68#endif
69
This class keeps track of color properties.
Definition vcolor.h:41
The base class for all karbon commands.
Definition vcommand.h:42
virtual void unexecute()
Unexecutes the command.
Definition vcommand.h:75
virtual bool changesSelection() const
Returns if the command changes the actual document selection.
Definition vcommand.h:84
virtual void execute()=0
Executes the command.
All non-visual, static doc info is in here.
Definition vdocument.h:53
VSelection manages a set of selected vobjects.
Definition vselection.h:62
Manages stroke properties.
Definition vstroke.h:49