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: QTableConnectionData.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_QTABLECONNECTIONDATA_HXX
31 #define DBAUI_QTABLECONNECTIONDATA_HXX
33 #ifndef DBAUI_TABLECONNECTIONDATA_HXX
34 #include "TableConnectionData.hxx"
36 #ifndef DBAUI_TABLEFIELDDESC_HXX
37 #include "TableFieldDescription.hxx"
39 #ifndef DBAUI_ENUMTYPES_HXX
40 #include "QEnumTypes.hxx"
43 #include <tools/rtti.hxx>
45 //#ifndef DBAUI_QUERYCONTROLLER_HXX
46 //#include "querycontroller.hxx"
51 class OQueryTableConnectionData
: public OTableConnectionData
53 sal_Int32 m_nFromEntryIndex
;
54 sal_Int32 m_nDestEntryIndex
;
55 EJoinType m_eJoinType
;
58 ETableFieldType m_eFromType
;
59 ETableFieldType m_eDestType
;
62 // fuer das Anlegen und Duplizieren von Lines vom eigenen Typ
63 virtual OConnectionLineDataRef
CreateLineDataObj();
64 virtual OConnectionLineDataRef
CreateLineDataObj( const OConnectionLineData
& rConnLineData
);
66 OQueryTableConnectionData
& operator=( const OQueryTableConnectionData
& rConnData
);
68 OQueryTableConnectionData();
69 OQueryTableConnectionData( const OQueryTableConnectionData
& rConnData
);
70 OQueryTableConnectionData( const TTableWindowData::value_type
& _pReferencingTable
,const TTableWindowData::value_type
& _pReferencedTable
,
71 const ::rtl::OUString
& rConnName
=::rtl::OUString());
72 virtual ~OQueryTableConnectionData();
74 virtual void CopyFrom(const OTableConnectionData
& rSource
);
75 virtual OTableConnectionData
* NewInstance() const;
78 /** Update create a new connection
80 @return true if successful
82 virtual BOOL
Update();
84 ::rtl::OUString
GetAliasName(EConnectionSide nWhich
) const;
86 sal_Int32
GetFieldIndex(EConnectionSide nWhich
) const { return nWhich
==JTCS_TO
? m_nDestEntryIndex
: m_nFromEntryIndex
; }
87 void SetFieldIndex(EConnectionSide nWhich
, sal_Int32 nVal
) { if (nWhich
==JTCS_TO
) m_nDestEntryIndex
=nVal
; else m_nFromEntryIndex
=nVal
; }
89 ETableFieldType
GetFieldType(EConnectionSide nWhich
) const { return nWhich
==JTCS_TO
? m_eDestType
: m_eFromType
; }
90 void SetFieldType(EConnectionSide nWhich
, ETableFieldType eType
) { if (nWhich
==JTCS_TO
) m_eDestType
=eType
; else m_eFromType
=eType
; }
92 void InitFromDrag(const OTableFieldDescRef
& rDragLeft
, const OTableFieldDescRef
& rDragRight
);
94 EJoinType
GetJoinType() const { return m_eJoinType
; };
95 void SetJoinType(const EJoinType
& eJT
) { m_eJoinType
= eJT
; };
97 inline void setNatural(bool _bNatural
) { m_bNatural
= _bNatural
; }
98 inline bool isNatural() const { return m_bNatural
; }
102 #endif // DBAUI_QTABLECONNECTIONDATA_HXX