Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / RelationTableView.hxx
blob28f45f6e00003e93cea34429969fdaedfcb96827
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_RELATIONTABLEVIEW_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONTABLEVIEW_HXX
22 #include "JoinTableView.hxx"
23 #include <comphelper/containermultiplexer.hxx>
24 #include <cppuhelper/basemutex.hxx>
25 #include <rtl/ref.hxx>
27 namespace dbaui
29 class ORelationDesignView;
31 class ORelationTableView : public ::cppu::BaseMutex,
32 public OJoinTableView,
33 public ::comphelper::OContainerListener
35 VclPtr<OTableConnection> m_pExistingConnection; ///< is set when a connection was draged on an existing connection
36 TTableConnectionData::value_type m_pCurrentlyTabConnData; ///< set when we creating a connection with more than one keycolumn
37 ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener;
38 bool m_bInRemove;
40 virtual void ConnDoubleClicked(VclPtr<OTableConnection>& rConnection) override;
41 virtual void AddTabWin(const OUString& _rComposedName, const OUString& rWinName, bool bNewTable = false) override;
43 virtual VclPtr<OTableWindow> createWindow(const TTableWindowData::value_type& _pData) override;
45 /** determines whether the classes Init method should accept a query
46 name, or only table names */
47 virtual bool allowQueries() const override;
49 // OContainerListener
50 virtual void _elementInserted( const css::container::ContainerEvent& _rEvent ) throw(css::uno::RuntimeException, std::exception) override;
51 virtual void _elementRemoved( const css::container::ContainerEvent& _rEvent ) throw(css::uno::RuntimeException, std::exception) override;
52 virtual void _elementReplaced( const css::container::ContainerEvent& _rEvent ) throw(css::uno::RuntimeException, std::exception) override;
54 public:
55 ORelationTableView( vcl::Window* pParent, ORelationDesignView* pView );
56 virtual ~ORelationTableView();
57 virtual void dispose() override;
59 virtual void RemoveTabWin( OTableWindow* pTabWin ) override;
60 virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest) override;
61 virtual bool RemoveConnection(VclPtr<OTableConnection>& rConn, bool _bDelete) override;
63 virtual void ReSync() override;
65 /// Creates a dialogue for a completely new relation.
66 void AddNewRelation();
68 /// used by AddTabDlg to check if tables can be added
69 virtual bool IsAddAllowed() override;
71 virtual void lookForUiActivities() override;
74 #endif
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */