LibreOffice Module dbaccess (master) 1
QueryTableView.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 "JoinTableView.hxx"
23
24namespace dbaui
25{
26 class OQueryTabWinUndoAct;
27 class OQueryTableConnection;
28 class OQueryTableWindow;
29 class OQueryDesignView;
30
32 {
33 protected:
34 virtual void ConnDoubleClicked(VclPtr<OTableConnection>& rConnection) override;
35
36 virtual VclPtr<OTableWindow> createWindow(const TTableWindowData::value_type& _pData) override;
37
41 virtual void onNoColumns_throw() override;
42
43 virtual bool suppressCrossNaturalJoin(const TTableConnectionData::value_type& _pData) const override;
44
45 public:
47
50 bool ContainsTabWin(const OTableWindow& rTabWin); // #i122589# Allow to check if OTableWindow is registered
51 virtual void AddTabWin( const OUString& _rTableName, const OUString& _rAliasName, bool bNewTable = false ) override;
52 virtual void RemoveTabWin(OTableWindow* pTabWin) override;
53
55 void AddTabWin(const OUString& strDatabase, const OUString& strTableName, const OUString& strAlias, bool bNewTable);
57 OQueryTableWindow* FindTable(const OUString& rAliasName);
58 bool FindTableFromField(const OUString& rFieldName, OTableFieldDescRef const & rInfo, sal_uInt16& rCnt);
59
61 virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest) override;
62
63 virtual bool RemoveConnection(VclPtr<OTableConnection>& rConn, bool bDelete) override;
64
65 // transfer of connections from and to UndoAction
66
75
76 // show and hide TabWin (NOT create or delete)
77 bool ShowTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction, bool _bAppend);
78 void HideTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction);
79
81 virtual void EnsureVisible(const OTableWindow* _pWin) override;
82
84 sal_Int32 CountTableAlias(const OUString& rName, sal_Int32& rMax);
85
87 void InsertField(const OTableFieldDescRef& rInfo);
88
91 virtual void ReSync() override;
92
94 virtual void ClearAll() override;
95
96 // used by AddTabDlg to see if tables can still be added
97 //virtual sal_Bool IsAddAllowed();
98
100 void NotifyTabConnection(const OQueryTableConnection& rNewConn, bool _bCreateUndoAction = true);
101
102 bool ExistsAVisitedConn(const OQueryTableWindow* pFrom) const;
103
104 virtual std::shared_ptr<OTableWindowData> CreateImpl(const OUString& _rComposedName
105 ,const OUString& _sTableName
106 ,const OUString& _rWinName) override;
107
109 void createNewConnection();
110
111 private:
113 };
114}
115
116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void EnsureVisible(const OTableWindow *_pWin)
virtual void onNoColumns_throw() override
called when init fails at the tablewindowdata because the m_xTable object could not provide columns,...
virtual void ReSync() override
rebuild everything (TabWins, Connections) (PRECONDITION: ClearAll was called previously)
virtual bool RemoveConnection(VclPtr< OTableConnection > &rConn, bool bDelete) override
RemoveConnection allows to remove connections from join table view.
bool FindTableFromField(const OUString &rFieldName, OTableFieldDescRef const &rInfo, sal_uInt16 &rCnt)
void GetConnection(OQueryTableConnection *pConn)
Inserting a Connection the structure.
bool ShowTabWin(OQueryTableWindow *pTabWin, OQueryTabWinUndoAct *pUndoAction, bool _bAppend)
void NotifyTabConnection(const OQueryTableConnection &rNewConn, bool _bCreateUndoAction=true)
announce new Connection and insert it, if not existing yet
bool ExistsAVisitedConn(const OQueryTableWindow *pFrom) const
virtual std::shared_ptr< OTableWindowData > CreateImpl(const OUString &_rComposedName, const OUString &_sTableName, const OUString &_rWinName) override
virtual bool suppressCrossNaturalJoin(const TTableConnectionData::value_type &_pData) const override
OQueryTableWindow * FindTable(const OUString &rAliasName)
search TabWin
virtual void EnsureVisible(const OTableWindow *_pWin) override
ensure visibility of TabWins (+ and invalidate connections)
virtual void ConnDoubleClicked(VclPtr< OTableConnection > &rConnection) override
bool ContainsTabWin(const OTableWindow &rTabWin)
base class overwritten: create and delete windows (not really delete, as it becomes an UndoAction)
void HideTabWin(OQueryTableWindow *pTabWin, OQueryTabWinUndoAct *pUndoAction)
virtual VclPtr< OTableWindow > createWindow(const TTableWindowData::value_type &_pData) override
factory method to create table windows
void createNewConnection()
opens the join dialog and allows to create a new join connection
void InsertField(const OTableFieldDescRef &rInfo)
insert field (simply passed to parents)
virtual void AddTabWin(const OUString &_rTableName, const OUString &_rAliasName, bool bNewTable=false) override
virtual void RemoveTabWin(OTableWindow *pTabWin) override
virtual void ClearAll() override
delete everything hard (TabWins, Connections), without any notifications
OQueryTableView(vcl::Window *pParent, OQueryDesignView *pView)
sal_Int32 CountTableAlias(const OUString &rName, sal_Int32 &rMax)
how many tables with a certain alias do I already have?
virtual void AddConnection(const OJoinExchangeData &jxdSource, const OJoinExchangeData &jxdDest) override
base class overwritten: create and delete Connections
void DropConnection(VclPtr< OQueryTableConnection > const &rConn)
Removing a Connection from the structure.