1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableConnection.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_TABLECONNECTION_HXX
31 #define DBAUI_TABLECONNECTION_HXX
34 //#include <tools/gen.hxx>
36 //#ifndef DBAUI_CONNECTIONLINE_HXX
37 //#include "ConnectionLine.hxx"
40 #ifndef _TOOLS_DEBUG_HXX
41 #include <tools/debug.hxx>
43 #ifndef _SV_WINDOW_HXX
44 #include <vcl/window.hxx>
47 #include <tools/rtti.hxx>
49 #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
50 #include <com/sun/star/uno/Reference.h>
52 #include "TableConnectionData.hxx"
59 class OTableConnectionData
;
62 class OConnectionLine
;
64 DBG_NAMEEX(OTableConnection
)
65 class OTableConnection
: public Window
67 ::std::vector
<OConnectionLine
*> m_vConnLine
;
68 TTableConnectionData::value_type
70 OJoinTableView
* m_pParent
;
75 /** clearLineData loops through the vector and deletes all lines
80 OConnectionLine
* CreateConnLine( const OConnectionLine
& rConnLine
);
83 OTableConnection( OJoinTableView
* pContainer
, const TTableConnectionData::value_type
& pTabConnData
);
84 OTableConnection( const OTableConnection
& rConn
);
85 // WICHTIG : normalerweise bekomme ich von aussen einen Zeiger auf OTableConnectionData mitgegeben, hier aber muss ich
86 // mir (ueber OTableConnectionData::NewInstance) selber eine INstanz anlegen, die ich aber - wie in allen anderen Faellen auch -
87 // NIE loesche. Der Aufrufer ist also bei Benutzung dieses Constructors dafuer verantwortlich, meine Daten abzufragen und
88 // sich irgendwo zu merken, um sie dann irgendwann zu loeschen.
89 virtual ~OTableConnection();
91 OTableConnection
& operator=( const OTableConnection
& rConn
);
96 BOOL
IsSelected() const { return m_bSelected
; }
97 BOOL
CheckHit( const Point
& rMousePos
) const;
98 bool InvalidateConnection();
99 void UpdateLineList();
101 OTableWindow
* GetSourceWin() const;
102 OTableWindow
* GetDestWin() const;
105 /** isTableConnection
106 @param _pTable the table where we should check if we belongs to it
108 @return true when the source or the destination window are equal
110 bool isTableConnection(const OTableWindow
* _pTable
)
112 return (_pTable
== GetSourceWin() || _pTable
== GetDestWin());
115 Rectangle
GetBoundingRect() const;
117 inline TTableConnectionData::value_type
GetData() const { return m_pData
; }
118 const ::std::vector
<OConnectionLine
*>* GetConnLineList() const { return &m_vConnLine
; }
119 inline OJoinTableView
* GetParent() const { return m_pParent
; }
120 virtual void Draw( const Rectangle
& rRect
);
122 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
125 #endif // DBAUI_TABLECONNECTION_HXX