build fix: no comphelper/profilezone.hxx in this branch
[LibreOffice.git] / dbaccess / source / ui / inc / ConnectionLineData.hxx
blob9717c6014878ef479bfea562109d2e10ec23dca2
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_INC_CONNECTIONLINEDATA_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEDATA_HXX
22 #include "QEnumTypes.hxx"
23 #include <vector>
25 #include <rtl/ref.hxx>
26 #include <salhelper/simplereferenceobject.hxx>
27 #include <rtl/ustring.hxx>
29 namespace dbaui
32 // ConnData ---------->* ConnLineData
33 // ^1 ^1
34 // | |
35 // Conn ---------->* ConnLine
37 /**
38 the class OConnectionLineData contains the data of a connection
39 e.g. the source and the destination field
40 **/
41 class OConnectionLineData : public ::salhelper::SimpleReferenceObject
43 OUString m_aSourceFieldName;
44 OUString m_aDestFieldName;
46 friend bool operator==(const OConnectionLineData& lhs, const OConnectionLineData& rhs);
47 friend bool operator!=(const OConnectionLineData& lhs, const OConnectionLineData& rhs) { return !(lhs == rhs); }
48 protected:
49 virtual ~OConnectionLineData() override;
50 public:
51 OConnectionLineData();
52 OConnectionLineData( const OUString& rSourceFieldName, const OUString& rDestFieldName );
53 OConnectionLineData( const OConnectionLineData& rConnLineData );
54 // provide a copy of own instance (this is somehow more acceptable for me compared to a virtual assignment operator
55 void CopyFrom(const OConnectionLineData& rSource);
57 // member access (write)
58 void SetFieldName(EConnectionSide nWhich, const OUString& strFieldName)
60 if (nWhich==JTCS_FROM)
61 m_aSourceFieldName = strFieldName;
62 else
63 m_aDestFieldName = strFieldName;
65 void SetSourceFieldName( const OUString& rSourceFieldName){ SetFieldName(JTCS_FROM, rSourceFieldName); }
66 void SetDestFieldName( const OUString& rDestFieldName ){ SetFieldName(JTCS_TO, rDestFieldName); }
68 // member access (read)
69 const OUString& GetFieldName(EConnectionSide nWhich) const { return (nWhich == JTCS_FROM) ? m_aSourceFieldName : m_aDestFieldName; }
70 OUString GetSourceFieldName() const { return GetFieldName(JTCS_FROM); }
71 OUString GetDestFieldName() const { return GetFieldName(JTCS_TO); }
73 void Reset();
74 OConnectionLineData& operator=( const OConnectionLineData& rConnLineData );
77 typedef ::rtl::Reference< OConnectionLineData > OConnectionLineDataRef;
78 typedef ::std::vector< OConnectionLineDataRef > OConnectionLineDataVec;
80 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_CONNECTIONLINEDATA_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */