LibreOffice Module dbaccess (master) 1
TableConnectionData.hxx
Go to the documentation of this file.
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#pragma once
20
22#include "TableWindowData.hxx"
23#include <vector>
24#include <memory>
25
26namespace dbaui
27{
28 //===========================================//
29 // ConnData ---------->* ConnLineData //
30 // ^1 ^1 //
31 // | | //
32 // Conn ---------->* ConnLine //
33 //===========================================//
34
37 {
38 protected:
39 TTableWindowData::value_type m_pReferencingTable;
40 TTableWindowData::value_type m_pReferencedTable;
41 OUString m_aConnName;
42
44
45 void Init();
46
48 public:
50 OTableConnectionData( TTableWindowData::value_type _aReferencingTable,
51 TTableWindowData::value_type _aReferencedTable );
53 virtual ~OTableConnectionData();
54
56 virtual void CopyFrom(const OTableConnectionData& rSource);
57
64 virtual std::shared_ptr<OTableConnectionData> NewInstance() const;
65
66 void SetConnLine( sal_uInt16 nIndex, const OUString& rSourceFieldName, const OUString& rDestFieldName );
67 bool AppendConnLine( const OUString& rSourceFieldName, const OUString& rDestFieldName );
70 void ResetConnLines();
71
79 OConnectionLineDataVec::size_type normalizeLines();
80
83
84 const TTableWindowData::value_type& getReferencingTable() const { return m_pReferencingTable; }
85 const TTableWindowData::value_type& getReferencedTable() const { return m_pReferencedTable; }
86
87 void setReferencingTable(const TTableWindowData::value_type& _pTable) { m_pReferencingTable = _pTable; }
88 void setReferencedTable(const TTableWindowData::value_type& _pTable) { m_pReferencedTable = _pTable; }
89
94 virtual bool Update(){ return true; }
95 };
96
97 typedef std::vector< std::shared_ptr<OTableConnectionData> > TTableConnectionData;
98
99}
100
101/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Contains all connection data which exists between two windows.
const TTableWindowData::value_type & getReferencingTable() const
void setReferencedTable(const TTableWindowData::value_type &_pTable)
OConnectionLineDataVec & GetConnLineDataList()
TTableWindowData::value_type m_pReferencedTable
virtual void CopyFrom(const OTableConnectionData &rSource)
initialise from a source (more comfortable than a virtual assignment operator)
virtual std::shared_ptr< OTableConnectionData > NewInstance() const
deliver a new instance of my own type
TTableWindowData::value_type m_pReferencingTable
virtual bool Update()
Update create a new connection.
void ResetConnLines()
Deletes list of ConnLines.
bool AppendConnLine(const OUString &rSourceFieldName, const OUString &rDestFieldName)
const OConnectionLineDataVec & GetConnLineDataList() const
const TTableWindowData::value_type & getReferencedTable() const
void SetConnLine(sal_uInt16 nIndex, const OUString &rSourceFieldName, const OUString &rDestFieldName)
OConnectionLineDataVec::size_type normalizeLines()
moves the empty lines to the back removes duplicated empty lines
void setReferencingTable(const TTableWindowData::value_type &_pTable)
OConnectionLineDataVec m_vConnLineData
OTableConnectionData & operator=(const OTableConnectionData &rConnData)
std::vector< OConnectionLineDataRef > OConnectionLineDataVec
std::vector< std::shared_ptr< OTableConnectionData > > TTableConnectionData