Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef DBAUI_QTABLECONNECTIONDATA_HXX
20 : #define DBAUI_QTABLECONNECTIONDATA_HXX
21 :
22 : #include "TableConnectionData.hxx"
23 : #include "TableFieldDescription.hxx"
24 : #include "QEnumTypes.hxx"
25 : #include <tools/rtti.hxx>
26 :
27 : namespace dbaui
28 : {
29 : class OQueryTableConnectionData : public OTableConnectionData
30 : {
31 : sal_Int32 m_nFromEntryIndex;
32 : sal_Int32 m_nDestEntryIndex;
33 : EJoinType m_eJoinType;
34 : bool m_bNatural;
35 :
36 : ETableFieldType m_eFromType;
37 : ETableFieldType m_eDestType;
38 :
39 : protected:
40 : // for creation and duplication of lines of own type
41 : virtual OConnectionLineDataRef CreateLineDataObj();
42 : virtual OConnectionLineDataRef CreateLineDataObj( const OConnectionLineData& rConnLineData );
43 :
44 : OQueryTableConnectionData& operator=( const OQueryTableConnectionData& rConnData );
45 : public:
46 : OQueryTableConnectionData();
47 : OQueryTableConnectionData( const OQueryTableConnectionData& rConnData );
48 : OQueryTableConnectionData( const TTableWindowData::value_type& _pReferencingTable,const TTableWindowData::value_type& _pReferencedTable,
49 : const ::rtl::OUString& rConnName=::rtl::OUString());
50 : virtual ~OQueryTableConnectionData();
51 :
52 : virtual void CopyFrom(const OTableConnectionData& rSource);
53 : virtual OTableConnectionData* NewInstance() const;
54 :
55 :
56 : /** Update create a new connection
57 :
58 : @return true if successful
59 : */
60 : virtual sal_Bool Update();
61 :
62 : ::rtl::OUString GetAliasName(EConnectionSide nWhich) const;
63 :
64 0 : sal_Int32 GetFieldIndex(EConnectionSide nWhich) const { return nWhich==JTCS_TO ? m_nDestEntryIndex : m_nFromEntryIndex; }
65 0 : void SetFieldIndex(EConnectionSide nWhich, sal_Int32 nVal) { if (nWhich==JTCS_TO) m_nDestEntryIndex=nVal; else m_nFromEntryIndex=nVal; }
66 :
67 : ETableFieldType GetFieldType(EConnectionSide nWhich) const { return nWhich==JTCS_TO ? m_eDestType : m_eFromType; }
68 0 : void SetFieldType(EConnectionSide nWhich, ETableFieldType eType) { if (nWhich==JTCS_TO) m_eDestType=eType; else m_eFromType=eType; }
69 :
70 : void InitFromDrag(const OTableFieldDescRef& rDragLeft, const OTableFieldDescRef& rDragRight);
71 :
72 0 : EJoinType GetJoinType() const { return m_eJoinType; };
73 0 : void SetJoinType(const EJoinType& eJT) { m_eJoinType = eJT; };
74 :
75 0 : inline void setNatural(bool _bNatural) { m_bNatural = _bNatural; }
76 0 : inline bool isNatural() const { return m_bNatural; }
77 : };
78 :
79 : }
80 : #endif // DBAUI_QTABLECONNECTIONDATA_HXX
81 :
82 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|