~ubuntu-branches/ubuntu/raring/calligra/raring-proposed

« back to all changes in this revision

Viewing changes to kdgantt/kdganttconstraint.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-01-15 17:26:10 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20130115172610-b193s9546hyssmym
Tags: 1:2.5.94-0ubuntu1
New upstream RC release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
 ** Copyright (C) 2001-2006 Klarälvdalens Datakonsult AB.  All rights reserved.
3
 
 **
4
 
 ** This file is part of the KD Gantt library.
5
 
 **
6
 
 ** This file may be used under the terms of the GNU General Public
7
 
 ** License versions 2.0 or 3.0 as published by the Free Software
8
 
 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
9
 
 ** included in the packaging of this file.  Alternatively you may (at
10
 
 ** your option) use any later version of the GNU General Public
11
 
 ** License if such license has been publicly approved by
12
 
 ** Klarälvdalens Datakonsult AB (or its successors, if any).
13
 
 ** 
14
 
 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
15
 
 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
16
 
 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights
17
 
 ** not expressly granted herein.
18
 
 ** 
19
 
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20
 
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
 
 **
22
 
 **********************************************************************/
23
 
#ifndef KDGANTTCONSTRAINT_H
24
 
#define KDGANTTCONSTRAINT_H
25
 
 
26
 
#include <QModelIndex>
27
 
#include <QObject>
28
 
#include <QSharedDataPointer>
29
 
 
30
 
#include "kdgantt_export.h"
31
 
#ifndef QT_NO_DEBUG_STREAM
32
 
#include <QDebug>
33
 
#endif
34
 
 
35
 
namespace KDGantt {
36
 
    class KDGANTT_EXPORT Constraint {
37
 
        class Private;
38
 
    public:
39
 
        enum Type
40
 
        { 
41
 
            TypeSoft = 0, 
42
 
            TypeHard = 1
43
 
        };      
44
 
        enum RelationType
45
 
        { 
46
 
            FinishStart = 0,
47
 
            FinishFinish = 1,
48
 
            StartStart = 2,
49
 
            StartFinish = 3
50
 
        };
51
 
 
52
 
        enum ConstraintDataRole
53
 
        {
54
 
            ValidConstraintPen = Qt::UserRole,
55
 
            InvalidConstraintPen
56
 
        };
57
 
 
58
 
        Constraint( const QModelIndex& idx1,  const QModelIndex& idx2, Type type=TypeSoft, RelationType=FinishStart );
59
 
        Constraint( const Constraint& other);
60
 
        ~Constraint();
61
 
 
62
 
        Type type() const;
63
 
        RelationType relationType() const;
64
 
        QModelIndex startIndex() const;
65
 
        QModelIndex endIndex() const;
66
 
 
67
 
        void setData( int role, const QVariant& value );
68
 
        QVariant data( int role ) const;
69
 
 
70
 
        Constraint& operator=( const Constraint& other );
71
 
 
72
 
        bool operator==( const Constraint& other ) const;
73
 
 
74
 
        inline bool operator!=( const Constraint& other ) const {
75
 
            return !operator==( other );
76
 
        }
77
 
 
78
 
        uint hash() const;
79
 
#ifndef QT_NO_DEBUG_STREAM
80
 
        QDebug debug( QDebug dbg) const;
81
 
#endif
82
 
 
83
 
    private:
84
 
        QSharedDataPointer<Private> d;
85
 
    };
86
 
 
87
 
    inline uint qHash( const Constraint& c ) {return c.hash();}
88
 
}
89
 
 
90
 
#ifndef QT_NO_DEBUG_STREAM
91
 
QDebug operator<<( QDebug dbg, const KDGantt::Constraint& c );
92
 
#endif /* QT_NO_DEBUG_STREAM */
93
 
 
94
 
#endif /* KDGANTTCONSTRAINT_H */
95