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

« back to all changes in this revision

Viewing changes to umbrello/umbrello/widgets/associationline.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:
17
17
#include <QtCore/QObject>
18
18
#include <QtCore/QList>
19
19
#include <QtCore/QPoint>
20
 
#include <umlviewcanvas.h>
21
20
 
22
21
/* how many pixels a user could click around a point */
23
22
#define POINT_DELTA 5
44
43
    AssociationLine();
45
44
    ~AssociationLine();
46
45
 
47
 
    QPoint point( int pointIndex ) const;
48
 
    bool setPoint( int pointIndex, const QPoint &point );
 
46
    QPoint point(int pointIndex) const;
 
47
    bool setPoint(int pointIndex, const QPoint &point);
49
48
    QPoint startPoint() const;
50
49
    QPoint endPoint() const;
51
50
 
52
 
    bool insertPoint( int pointIndex, const QPoint &point );
53
 
    bool removePoint( int pointIndex, const QPoint &point = QPoint(), unsigned short delta = 0 );
 
51
    bool insertPoint(int pointIndex, const QPoint &point);
 
52
    bool removePoint(int pointIndex, const QPoint &point = QPoint(), unsigned short delta = 0);
54
53
 
55
54
    int count() const;
56
55
    void cleanup();
57
56
 
58
 
    int closestPointIndex( const QPoint &position );
59
 
    bool isPoint( int pointIndex, const QPoint &point, unsigned short delta = 0 );
60
 
 
61
 
    bool setEndPoints( const QPoint &start, const QPoint &end );
62
 
 
63
 
    bool hasPoints () const;
64
 
    void dumpPoints ();
65
 
 
66
 
    bool loadFromXMI( QDomElement & qElement );
67
 
    void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
68
 
 
69
 
    QPen getPen();
 
57
    int closestPointIndex(const QPoint &position);
 
58
    bool isPoint(int pointIndex, const QPoint &point, unsigned short delta = 0);
 
59
 
 
60
    bool setEndPoints(const QPoint &start, const QPoint &end);
 
61
 
 
62
    bool hasPoints() const;
 
63
    void dumpPoints();
 
64
 
 
65
    bool loadFromXMI(QDomElement & qElement);
 
66
    void saveToXMI(QDomDocument & qDoc, QDomElement & qElement);
 
67
 
 
68
    QPen pen();
70
69
 
71
70
    QColor lineColor();
72
 
    void setLineColor( const QColor &color );
 
71
    void setLineColor(const QColor &color);
73
72
 
74
73
    uint lineWidth();
75
 
    void setLineWidth( uint width );
 
74
    void setLineWidth(uint width);
76
75
 
77
76
    /**
78
77
     * Returns the Association this class is linked to.
83
82
    void setAssociation(AssociationWidget * association);
84
83
 
85
84
    Uml::AssociationType getAssocType() const;
86
 
    void setAssocType( Uml::AssociationType type );
87
 
 
88
 
    bool operator==( const AssociationLine & rhs );
89
 
 
90
 
    AssociationLine & operator=( const AssociationLine & rhs );
 
85
    void setAssocType(Uml::AssociationType type);
 
86
 
 
87
    bool operator==(const AssociationLine & rhs);
 
88
 
 
89
    AssociationLine & operator=(const AssociationLine & rhs);
91
90
 
92
91
    enum Region {  ///< Enum to tell whether the line docks top/bottom or left/right.
93
92
        TopBottom, LeftRight
94
93
    };
95
94
 
96
 
    void setDockRegion( Region region );
 
95
    void setDockRegion(Region region);
97
96
 
98
 
    void setSelected( bool select );
 
97
    void setSelected(bool select);
99
98
 
100
99
    void activate();
101
100
 
102
101
    void update();
103
102
 
104
103
public slots:
105
 
    void slotLineColorChanged( Uml::IDType viewID );
106
 
    void slotLineWidthChanged( Uml::IDType viewID );
 
104
    void slotLineColorChanged(Uml::IDType viewID);
 
105
    void slotLineWidthChanged(Uml::IDType viewID);
107
106
 
108
107
protected:
109
108
 
115
114
    class Circle : public UMLSceneEllipseItem
116
115
    {
117
116
    public:
118
 
        explicit Circle(UMLViewCanvas * canvas, int radius = 0);
 
117
        explicit Circle(int radius = 0);
119
118
        void setRadius(int radius);
120
119
        int getRadius() const;
121
120
        void setX(int x);
130
129
    class SubsetSymbol : public UMLSceneEllipseItem
131
130
    {
132
131
    public:
133
 
        explicit SubsetSymbol(UMLViewCanvas* canvas);
 
132
        explicit SubsetSymbol();
134
133
 
135
134
        /**
136
135
         * Sets the Inclination of the Subset Symbol w.r.t horizontal x axis
146
145
        int inclination;
147
146
    };
148
147
 
149
 
    UMLViewCanvas * getScene();
 
148
    Q3Canvas * canvas();
150
149
 
151
 
    void moveSelected( int pointIndex );
 
150
    void moveSelected(int pointIndex);
152
151
 
153
152
    void setupSelected();
154
153