LibreOffice Module dbaccess (master) 1
TableConnection.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
21#include <vector>
22#include <vcl/window.hxx>
23#include <com/sun/star/uno/Reference.h>
25
26class Point;
27namespace tools { class Rectangle; }
28
29namespace dbaui
30{
31 class OTableConnectionData;
32 class OTableWindow;
33 class OJoinTableView;
34 class OConnectionLine;
35
37 {
38 std::vector<std::unique_ptr<OConnectionLine>> m_vConnLine;
39 TTableConnectionData::value_type
42
44
45 void Init();
47 void clearLineData();
48
49 public:
50 OTableConnection( OJoinTableView* pContainer, TTableConnectionData::value_type aTabConnData );
51 OTableConnection( const OTableConnection& rConn );
61 virtual ~OTableConnection() override;
62 virtual void dispose() override;
63
65
66 void Select();
67 void Deselect();
68 bool IsSelected() const { return m_bSelected; }
69 bool CheckHit( const Point& rMousePos ) const;
71 void UpdateLineList();
72
74 OTableWindow* GetDestWin() const;
75
76 void RecalcLines();
82 bool isTableConnection(const OTableWindow* _pTable)
83 {
84 return (_pTable == GetSourceWin() || _pTable == GetDestWin());
85 }
86
88
89 const TTableConnectionData::value_type& GetData() const { return m_pData; }
90 const std::vector<std::unique_ptr<OConnectionLine>>& GetConnLineList() const { return m_vConnLine; }
91 OJoinTableView* GetParent() const { return m_pParent; }
92 virtual void Draw(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect);
93 using Window::Draw;
94 virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
95 };
96}
97
98/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~OTableConnection() override
destructor
std::vector< std::unique_ptr< OConnectionLine > > m_vConnLine
const TTableConnectionData::value_type & GetData() const
TTableConnectionData::value_type m_pData
bool isTableConnection(const OTableWindow *_pTable)
isTableConnection
OTableWindow * GetDestWin() const
OTableWindow * GetSourceWin() const
virtual void dispose() override
OTableConnection & operator=(const OTableConnection &rConn)
tools::Rectangle GetBoundingRect() const
void clearLineData()
loops through the vector and deletes all lines
OJoinTableView * GetParent() const
VclPtr< OJoinTableView > m_pParent
const std::vector< std::unique_ptr< OConnectionLine > > & GetConnLineList() const
bool CheckHit(const Point &rMousePos) const
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
OTableConnection(OJoinTableView *pContainer, TTableConnectionData::value_type aTabConnData)
virtual void Draw(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
virtual void Draw(::OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags)