~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/widget/relations/KexiRelationsConnection.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
Import upstream version 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2004 Lucijan Busch <lucijan@kde.org>
 
3
   Copyright (C) 2004-2007 Jarosław Staniek <staniek@kde.org>
 
4
 
 
5
   This program is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU Library General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2 of the License, or (at your option) any later version.
 
9
 
 
10
   This program is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Library General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Library General Public License
 
16
   along with this program; see the file COPYING.  If not, write to
 
17
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
 * Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#ifndef KEXIRELATIONSCONNECTION_H
 
22
#define KEXIRELATIONSCONNECTION_H
 
23
 
 
24
#include "kexirelationsview_export.h"
 
25
 
 
26
#include <QString>
 
27
 
 
28
class QRect;
 
29
class QPoint;
 
30
class QPainter;
 
31
class KexiRelationsTableContainer;
 
32
class KexiRelationsScrollArea;
 
33
struct SourceConnection;
 
34
 
 
35
//! A model for a single connection (relationship) between tables in the relations view
 
36
class KEXIRELATIONSVIEW_EXPORT KexiRelationsConnection
 
37
{
 
38
public:
 
39
    KexiRelationsConnection(
 
40
        KexiRelationsTableContainer *masterTbl,
 
41
        KexiRelationsTableContainer *detailsTbl,
 
42
        SourceConnection &s,
 
43
        KexiRelationsScrollArea *scrollArea);
 
44
 
 
45
    ~KexiRelationsConnection();
 
46
 
 
47
    void drawConnection(QPainter *p);
 
48
 
 
49
    bool selected() const;
 
50
 
 
51
    void setSelected(bool s);
 
52
 
 
53
    QRect connectionRect();
 
54
 
 
55
    QRect oldRect() const;
 
56
 
 
57
    KexiRelationsTableContainer *masterTable() const;
 
58
 
 
59
    KexiRelationsTableContainer *detailsTable() const;
 
60
 
 
61
    QString masterField() const;
 
62
 
 
63
    QString detailsField() const;
 
64
 
 
65
    bool matchesPoint(const QPoint &p, int tolerance = 3);
 
66
 
 
67
    QString toString() const;
 
68
 
 
69
private:
 
70
    class Private;
 
71
    Private* const d;
 
72
};
 
73
 
 
74
#endif