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

« back to all changes in this revision

Viewing changes to kdgantt/kdganttconstraintmodel.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 KDGANTTCONSTRAINTMODEL_H
24
 
#define KDGANTTCONSTRAINTMODEL_H
25
 
 
26
 
#include <QModelIndex>
27
 
#include <QDebug>
28
 
 
29
 
#include "kdganttglobal.h"
30
 
#include "kdganttconstraint.h"
31
 
 
32
 
namespace KDGantt {
33
 
    class KDGANTT_EXPORT ConstraintModel : public QObject {
34
 
        Q_OBJECT
35
 
        KDGANTT_DECLARE_PRIVATE_DERIVED_PARENT( ConstraintModel, QObject* )
36
 
     public:
37
 
        explicit ConstraintModel( QObject* parent=0 );
38
 
        virtual ~ConstraintModel();
39
 
 
40
 
        void addConstraint( const Constraint& c );
41
 
        bool removeConstraint( const Constraint& c );
42
 
 
43
 
        void clear();
44
 
        void cleanup();
45
 
 
46
 
        QList<Constraint> constraints() const;
47
 
 
48
 
        bool hasConstraint( const Constraint& c ) const;
49
 
        inline bool hasConstraint( const QModelIndex& s, 
50
 
                                   const QModelIndex& e ) const;
51
 
 
52
 
        QList<Constraint> constraintsForIndex( const QModelIndex& ) const;
53
 
 
54
 
    Q_SIGNALS:
55
 
        void constraintAdded(const Constraint&);
56
 
        void constraintRemoved(const Constraint&);
57
 
 
58
 
    private:
59
 
        Private* _d;
60
 
    };
61
 
 
62
 
    inline const ConstraintModel::Private* ConstraintModel::d_func() const { return _d; }
63
 
    inline ConstraintModel::Private* ConstraintModel::d_func() { return _d; }
64
 
    inline bool ConstraintModel::hasConstraint( const QModelIndex& s, const QModelIndex& e ) const {
65
 
        return hasConstraint( Constraint( s, e ) );
66
 
    }
67
 
}
68
 
 
69
 
#ifndef QT_NO_DEBUG_STREAM
70
 
#include <QDebug>
71
 
 
72
 
QDebug operator<<( QDebug dbg, const KDGantt::ConstraintModel& model );
73
 
inline QDebug operator<<( QDebug dbg, KDGantt::ConstraintModel* model ) 
74
 
{
75
 
    return operator<<(dbg,*model);
76
 
}
77
 
 
78
 
#endif /* QT_NO_DEBUG_STREAM */
79
 
 
80
 
#endif /* KDGANTTCONSTRAINTMODEL_H */
81