~ubuntu-branches/ubuntu/oneiric/kdepim/oneiric-updates

« back to all changes in this revision

Viewing changes to kdgantt2/kdganttconstraint.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-06-28 19:33:24 UTC
  • mfrom: (0.2.13) (0.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20110628193324-8yvjs8sdv9rdoo6c
Tags: 4:4.7.0-0ubuntu1
* New upstream release
  - update install files
  - add missing kdepim-doc package to control file
  - Fix Vcs lines
  - kontact breaks/replaces korganizer << 4:4.6.80
  - tighten the dependency of kdepim-dev on libkdepim4 to fix lintian error

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 distributed and/or modified under the terms of the
 
7
 ** GNU General Public License version 2 as published by the Free Software
 
8
 ** Foundation and appearing in the file LICENSE.GPL included in the
 
9
 ** packaging of this file.
 
10
 **
 
11
 ** Licensees holding valid commercial KD Gantt licenses may use this file in
 
12
 ** accordance with the KD Gantt Commercial License Agreement provided with
 
13
 ** the Software.
 
14
 **
 
15
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
16
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
17
 **
 
18
 ** See http://www.kdab.net/kdgantt for
 
19
 **   information about KD Gantt Commercial License Agreements.
 
20
 **
 
21
 ** Contact info@kdab.net if any conditions of this
 
22
 ** licensing are not clear to you.
 
23
 **
 
24
 **********************************************************************/
 
25
#ifndef KDGANTTCONSTRAINT_H
 
26
#define KDGANTTCONSTRAINT_H
 
27
 
 
28
#include <QModelIndex>
 
29
#include <QObject>
 
30
#include <QSharedDataPointer>
 
31
 
 
32
#include "kdgantt_export.h"
 
33
#ifndef QT_NO_DEBUG_STREAM
 
34
#include <QDebug>
 
35
#endif
 
36
 
 
37
namespace KDGantt {
 
38
    class KDGANTT_EXPORT Constraint {
 
39
        class Private;
 
40
    public:
 
41
        enum Type
 
42
        { 
 
43
            TypeSoft = 0, 
 
44
            TypeHard = 1
 
45
        };      
 
46
 
 
47
        enum ConstraintDataRole
 
48
        {
 
49
            ValidConstraintPen = Qt::UserRole,
 
50
            InvalidConstraintPen
 
51
        };
 
52
 
 
53
        Constraint( const QModelIndex& idx1,  const QModelIndex& idx2, Type type=TypeSoft);
 
54
        Constraint( const Constraint& other);
 
55
        ~Constraint();
 
56
 
 
57
        Type type() const;
 
58
        QModelIndex startIndex() const;
 
59
        QModelIndex endIndex() const;
 
60
 
 
61
        void setData( int role, const QVariant& value );
 
62
        QVariant data( int role ) const;
 
63
 
 
64
        Constraint& operator=( const Constraint& other );
 
65
 
 
66
        bool operator==( const Constraint& other ) const;
 
67
 
 
68
        inline bool operator!=( const Constraint& other ) const {
 
69
            return !operator==( other );
 
70
        }
 
71
 
 
72
        uint hash() const;
 
73
#ifndef QT_NO_DEBUG_STREAM
 
74
        QDebug debug( QDebug dbg) const;
 
75
#endif
 
76
 
 
77
    private:
 
78
        QSharedDataPointer<Private> d;
 
79
    };
 
80
 
 
81
    inline uint qHash( const Constraint& c ) {return c.hash();}
 
82
}
 
83
 
 
84
#ifndef QT_NO_DEBUG_STREAM
 
85
QDebug operator<<( QDebug dbg, const KDGantt::Constraint& c );
 
86
#endif /* QT_NO_DEBUG_STREAM */
 
87
 
 
88
#endif /* KDGANTTCONSTRAINT_H */
 
89