~ubuntu-branches/ubuntu/vivid/kdesdk/vivid

« back to all changes in this revision

Viewing changes to umbrello/umbrello/widgets/floatingdashlinewidget.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-06 11:49:54 UTC
  • mfrom: (0.4.21)
  • Revision ID: package-import@ubuntu.com-20120606114954-rdls73fzlpzxglbx
Tags: 4:4.8.80-0ubuntu1
* New uptream beta release
* Update dont_export_private_classes.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *   the Free Software Foundation; either version 2 of the License, or     *
5
5
 *   (at your option) any later version.                                   *
6
6
 *                                                                         *
7
 
 *   copyright (C) 2002-2006                                               *
 
7
 *   copyright (C) 2002-2012                                               *
8
8
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
9
9
 ***************************************************************************/
10
10
 
12
12
#define FLOATINGDASHLINEWIDGET_H
13
13
 
14
14
#include "umlwidget.h"
 
15
 
15
16
#define FLOATING_DASH_LINE_MARGIN 25
16
17
#define FLOATING_DASH_LINE_TEXT_MARGIN 5
17
18
 
18
19
/* how many pixels a user could click around a point */
19
20
#define POINT_DELTA 5
20
21
 
21
 
 
22
22
/**
23
23
 * This class is used to draw dash lines for UML combined fragments. A FloatingDashLineWidget
24
24
 * belongs to one @ref CombinedFragmentWidget instance.
30
30
 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
31
31
 */
32
32
 
33
 
class FloatingDashLineWidget : public UMLWidget {
 
33
class FloatingDashLineWidget : public UMLWidget
 
34
{
34
35
    Q_OBJECT
35
36
public:
36
 
    /**
37
 
     * Creates a floating dash line.
38
 
     * @param scene              The parent of the widget
39
 
     * @param id                The ID to assign (-1 will prompt a new ID)
40
 
     */
41
37
    explicit FloatingDashLineWidget(UMLScene * scene, Uml::IDType id = Uml::id_None);
42
 
 
43
 
    /**
44
 
     * destructor
45
 
     */
46
38
    ~FloatingDashLineWidget();
47
39
 
48
 
    /**
49
 
     * Overrides the standard paint event.
50
 
     */
51
40
    void paint(QPainter & p, int offsetX, int offsetY);
52
41
 
53
42
    void slotMenuSelection(QAction* action);
54
 
     /**
55
 
     * Returns true if the given point is near the floatingdashline
56
 
     */
57
 
     bool onLine(const QPoint & point);
58
 
 
59
 
    /**
60
 
     * Sets m_text
61
 
     */
 
43
 
 
44
    bool onLine(const QPoint & point);
 
45
 
62
46
    void setText(const QString& text);
63
47
 
64
 
    /**
65
 
     * Overrides the setY method
66
 
     */
67
48
    void setY(int y);
68
 
 
69
 
    /**
70
 
     * Sets m_yMin
71
 
     */
72
49
    void setYMin(int yMin);
73
 
 
74
 
    /**
75
 
     * Sets m_yMax
76
 
     */
77
50
    void setYMax(int yMax);
78
 
 
79
 
    /**
80
 
     * Returns m_yMin
81
 
     */
82
 
    int getYMin();
83
 
 
84
 
    /**
85
 
     * Returns the difference between the y-coordinate of the dash line and m_yMin
86
 
     */
87
 
    int getDiffY();
88
 
 
89
 
     /**
90
 
     * Creates the "floatingdashline" XMI element.
91
 
     */
 
51
    int getYMin() const;
 
52
    int getDiffY() const;
 
53
 
92
54
    void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
93
 
 
94
 
    /**
95
 
     * Loads the "floatingdashline" XMI element.
96
 
     */
97
55
    bool loadFromXMI( QDomElement & qElement );
98
56
 
99
57
private: