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>
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.
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.
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.
21
#ifndef KEXIRELATIONSCONNECTION_H
22
#define KEXIRELATIONSCONNECTION_H
24
#include "kexirelationsview_export.h"
31
class KexiRelationsTableContainer;
32
class KexiRelationsScrollArea;
33
struct SourceConnection;
35
//! A model for a single connection (relationship) between tables in the relations view
36
class KEXIRELATIONSVIEW_EXPORT KexiRelationsConnection
39
KexiRelationsConnection(
40
KexiRelationsTableContainer *masterTbl,
41
KexiRelationsTableContainer *detailsTbl,
43
KexiRelationsScrollArea *scrollArea);
45
~KexiRelationsConnection();
47
void drawConnection(QPainter *p);
49
bool selected() const;
51
void setSelected(bool s);
53
QRect connectionRect();
55
QRect oldRect() const;
57
KexiRelationsTableContainer *masterTable() const;
59
KexiRelationsTableContainer *detailsTable() const;
61
QString masterField() const;
63
QString detailsField() const;
65
bool matchesPoint(const QPoint &p, int tolerance = 3);
67
QString toString() const;