1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <TableConnectionData.hxx>
22 #include <TableFieldDescription.hxx>
23 #include <QEnumTypes.hxx>
27 class OQueryTableConnectionData final
: public OTableConnectionData
29 sal_Int32 m_nFromEntryIndex
;
30 sal_Int32 m_nDestEntryIndex
;
31 EJoinType m_eJoinType
;
34 OQueryTableConnectionData
& operator=( const OQueryTableConnectionData
& rConnData
);
36 OQueryTableConnectionData();
37 OQueryTableConnectionData( const OQueryTableConnectionData
& rConnData
);
38 OQueryTableConnectionData( const TTableWindowData::value_type
& _pReferencingTable
,const TTableWindowData::value_type
& _pReferencedTable
);
39 virtual ~OQueryTableConnectionData() override
;
41 virtual void CopyFrom(const OTableConnectionData
& rSource
) override
;
42 virtual std::shared_ptr
<OTableConnectionData
> NewInstance() const override
;
45 /** Update create a new connection
47 @return true if successful
49 virtual bool Update() override
;
51 OUString
const & GetAliasName(EConnectionSide nWhich
) const;
53 sal_Int32
GetFieldIndex(EConnectionSide nWhich
) const { return nWhich
==JTCS_TO
? m_nDestEntryIndex
: m_nFromEntryIndex
; }
54 void SetFieldIndex(EConnectionSide nWhich
, sal_Int32 nVal
) { if (nWhich
==JTCS_TO
) m_nDestEntryIndex
=nVal
; else m_nFromEntryIndex
=nVal
; }
56 void InitFromDrag(const OTableFieldDescRef
& rDragLeft
, const OTableFieldDescRef
& rDragRight
);
58 EJoinType
GetJoinType() const { return m_eJoinType
; };
59 void SetJoinType(const EJoinType
& eJT
) { m_eJoinType
= eJT
; };
61 void setNatural(bool _bNatural
) { m_bNatural
= _bNatural
; }
62 bool isNatural() const { return m_bNatural
; }
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */