Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / querydesign / QTableConnectionData.hxx
blob878455f82190997bb66b7e0d25eddc74d83b4cf9
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QTABLECONNECTIONDATA_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QTABLECONNECTIONDATA_HXX
22 #include "TableConnectionData.hxx"
23 #include "TableFieldDescription.hxx"
24 #include "QEnumTypes.hxx"
26 namespace dbaui
28 class OQueryTableConnectionData : public OTableConnectionData
30 sal_Int32 m_nFromEntryIndex;
31 sal_Int32 m_nDestEntryIndex;
32 EJoinType m_eJoinType;
33 bool m_bNatural;
35 ETableFieldType m_eFromType;
36 ETableFieldType m_eDestType;
38 protected:
39 // for creation and duplication of lines of own type
40 virtual OConnectionLineDataRef CreateLineDataObj() override;
42 OQueryTableConnectionData& operator=( const OQueryTableConnectionData& rConnData );
43 public:
44 OQueryTableConnectionData();
45 OQueryTableConnectionData( const OQueryTableConnectionData& rConnData );
46 OQueryTableConnectionData( const TTableWindowData::value_type& _pReferencingTable,const TTableWindowData::value_type& _pReferencedTable,
47 const OUString& rConnName=OUString());
48 virtual ~OQueryTableConnectionData();
50 virtual void CopyFrom(const OTableConnectionData& rSource) override;
51 virtual OTableConnectionData* NewInstance() const override;
54 /** Update create a new connection
56 @return true if successful
58 virtual bool Update() override;
60 OUString GetAliasName(EConnectionSide nWhich) const;
62 sal_Int32 GetFieldIndex(EConnectionSide nWhich) const { return nWhich==JTCS_TO ? m_nDestEntryIndex : m_nFromEntryIndex; }
63 void SetFieldIndex(EConnectionSide nWhich, sal_Int32 nVal) { if (nWhich==JTCS_TO) m_nDestEntryIndex=nVal; else m_nFromEntryIndex=nVal; }
65 void SetFieldType(EConnectionSide nWhich, ETableFieldType eType) { if (nWhich==JTCS_TO) m_eDestType=eType; else m_eFromType=eType; }
67 void InitFromDrag(const OTableFieldDescRef& rDragLeft, const OTableFieldDescRef& rDragRight);
69 EJoinType GetJoinType() const { return m_eJoinType; };
70 void SetJoinType(const EJoinType& eJT) { m_eJoinType = eJT; };
72 inline void setNatural(bool _bNatural) { m_bNatural = _bNatural; }
73 inline bool isNatural() const { return m_bNatural; }
77 #endif // INCLUDED_DBACCESS_SOURCE_UI_QUERYDESIGN_QTABLECONNECTIONDATA_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */