kexirelationviewconnection.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2004 Lucijan Busch <lucijan@kde.org> 00003 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl> 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this program; see the file COPYING. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KEXIRELATIONVIEWCONNECTION_H 00022 #define KEXIRELATIONVIEWCONNECTION_H 00023 00024 #include <qstring.h> 00025 #include <qguardedptr.h> 00026 00027 class QPainter; 00028 class KexiRelationViewTableContainer; 00029 class KexiRelationView; 00030 00031 class KEXIRELATIONSVIEW_EXPORT KexiRelationViewConnection 00032 { 00033 public: 00034 00035 KexiRelationViewConnection(KexiRelationViewTableContainer *masterTbl, 00036 KexiRelationViewTableContainer *detailsTbl, struct SourceConnection &s, KexiRelationView *parent); 00037 ~KexiRelationViewConnection(); 00038 00039 00040 /* 00041 C++PROGRAMMIERER bestehen darauf, da�der Elefant eine Klasse sei, 00042 und somit schlie�ich seine Fang-Methoden selbst mitzubringen habe. 00043 00044 http://www.c-plusplus.de ;) 00045 */ 00046 void drawConnection(QPainter *p); 00047 00048 bool selected() { return m_selected; } 00049 void setSelected(bool s) { m_selected = s; } 00050 00051 const QRect connectionRect(); 00052 const QRect oldRect() const { return m_oldRect; } 00053 00054 KexiRelationViewTableContainer *masterTable() { return m_masterTable; } 00055 KexiRelationViewTableContainer *detailsTable() { return m_detailsTable; } 00056 QString masterField() const { return m_masterField; } 00057 QString detailsField() const { return m_detailsField; } 00058 00059 00060 bool matchesPoint(const QPoint &p, int tolerance=3); 00061 // SourceConnection connection() { return m_conn; } 00062 00063 QString toString() const; 00064 00065 private: 00066 QGuardedPtr<KexiRelationViewTableContainer> m_masterTable; 00067 QGuardedPtr<KexiRelationViewTableContainer> m_detailsTable; 00068 QString m_masterField; 00069 QString m_detailsField; 00070 QRect m_oldRect; 00071 bool m_selected; 00072 QGuardedPtr<KexiRelationView> m_parent; 00073 }; 00074 00075 #endif
