KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.5KB

  1. /* This file is part of the KDE project
  2. Copyright (C) 2004 Lucijan Busch <lucijan@kde.org>
  3. Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this program; see the file COPYING. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. * Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef KEXIRELATIONVIEWCONNECTION_H
  18. #define KEXIRELATIONVIEWCONNECTION_H
  19. #include <tqstring.h>
  20. #include <tqguardedptr.h>
  21. class TQPainter;
  22. class KexiRelationViewTableContainer;
  23. class KexiRelationView;
  24. class KEXIRELATIONSVIEW_EXPORT KexiRelationViewConnection
  25. {
  26. public:
  27. KexiRelationViewConnection(KexiRelationViewTableContainer *masterTbl,
  28. KexiRelationViewTableContainer *detailsTbl, struct SourceConnection &s, KexiRelationView *parent);
  29. ~KexiRelationViewConnection();
  30. /*
  31. C++PROGRAMMIERER bestehen darauf, daß der Elefant eine Klasse sei,
  32. und somit schließlich seine Fang-Methoden selbst mitzubringen habe.
  33. http://www.c-plusplus.de ;)
  34. */
  35. void drawConnection(TQPainter *p);
  36. bool selected() { return m_selected; }
  37. void setSelected(bool s) { m_selected = s; }
  38. const TQRect connectionRect();
  39. const TQRect oldRect() const { return m_oldRect; }
  40. KexiRelationViewTableContainer *masterTable() { return m_masterTable; }
  41. KexiRelationViewTableContainer *detailsTable() { return m_detailsTable; }
  42. TQString masterField() const { return m_masterField; }
  43. TQString detailsField() const { return m_detailsField; }
  44. bool matchesPoint(const TQPoint &p, int tolerance=3);
  45. // SourceConnection connection() { return m_conn; }
  46. TQString toString() const;
  47. private:
  48. TQGuardedPtr<KexiRelationViewTableContainer> m_masterTable;
  49. TQGuardedPtr<KexiRelationViewTableContainer> m_detailsTable;
  50. TQString m_masterField;
  51. TQString m_detailsField;
  52. TQRect m_oldRect;
  53. bool m_selected;
  54. TQGuardedPtr<KexiRelationView> m_parent;
  55. };
  56. #endif