LibreOffice Module dbaccess (master) 1
JoinController.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 "JoinTableView.hxx"
23#include "JoinDesignView.hxx"
25#include "TableWindowData.hxx"
26#include <memory>
27
28namespace comphelper
29{
30 class NamedValueCollection;
31}
32
33namespace dbaui
34{
35 class OAddTableDlg;
36 class AddTableDialogContext;
37 class OTableWindow;
39
41 {
42 protected:
45
47
48 std::shared_ptr<OAddTableDlg> m_xAddTableDialog;
49 std::unique_ptr< AddTableDialogContext > m_pDialogContext;
51
52 // state of a feature. 'feature' may be the handle of a css::util::URL somebody requested a dispatch interface for OR a toolbar slot.
53 virtual FeatureState GetState(sal_uInt16 nId) const override;
54 // execute a feature
55 virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) override;
56
61 void loadTableWindows( const ::comphelper::NamedValueCollection& i_rViewSettings );
62
67 void loadTableWindow( const ::comphelper::NamedValueCollection& i_rTableWindowSettings );
68
73 void saveTableWindows( ::comphelper::NamedValueCollection& o_rViewSettings ) const;
74
75 virtual ~OJoinController() override;
76 public:
77 OJoinController(const css::uno::Reference< css::uno::XComponentContext >& _rM);
78
79 // attribute access
83
84 // OSingleDocumentController overridables
85 virtual void reconnect( bool _bUI ) override;
86 virtual void impl_onModifyChanged() override;
87
88 // own overridables
91 virtual bool allowViews() const = 0;
92
95 virtual bool allowQueries() const = 0;
96
100 virtual OJoinDesignView* getJoinView();
101
106 void removeConnectionData(const TTableConnectionData::value_type& _pData);
107
108 void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, tools::Long nOffsetX, tools::Long nOffsetY );
109
110 static void SaveTabWinPosSize(OTableWindow const * pTabWin, tools::Long nOffsetX, tools::Long nOffsetY);
111
112 // UNO interface overridables
113 // XEventListener
115
116 // css::lang::XComponent
117 virtual void SAL_CALL disposing() override;
118 // css::frame::XController
119 virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override;
120
121 // misc
125 void setErrorOccurred(const ::dbtools::SQLExceptionInfo& _rInfo)
126 {
127 m_aExceptionInfo = _rInfo;
128 }
133 {
136 return aInfo;
137 }
138
139 // show the dialog
140 void runDialogAsync();
141
142 protected:
143 TTableWindowData::value_type createTableWindowData(const OUString& _sComposedName,const OUString& _sTableName,const OUString& _sWindowName);
144 // ask the user if the design should be saved when it is modified
145 virtual short saveModified() = 0;
146 // called when the original state should be reset (first time load)
147 virtual void reset() = 0;
148 virtual void describeSupportedFeatures() override;
149
151 };
152}
153
154/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< AddTableDialogContext > m_pDialogContext
::dbtools::SQLExceptionInfo m_aExceptionInfo
void removeConnectionData(const TTableConnectionData::value_type &_pData)
erase the data in the data vector
void loadTableWindows(const ::comphelper::NamedValueCollection &i_rViewSettings)
loads the information for the windows.
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
std::shared_ptr< OAddTableDlg > m_xAddTableDialog
virtual void reset()=0
TTableWindowData::value_type createTableWindowData(const OUString &_sComposedName, const OUString &_sTableName, const OUString &_sWindowName)
virtual ~OJoinController() override
void loadTableWindow(const ::comphelper::NamedValueCollection &i_rTableWindowSettings)
loads the information for one window.
OJoinController(const css::uno::Reference< css::uno::XComponentContext > &_rM)
::dbtools::SQLExceptionInfo clearOccurredError()
just returns the internal member and clears it
virtual bool allowQueries() const =0
determines whether or not it's allowed for queries to participate in the game
TTableWindowData & getTableWindowData()
virtual short saveModified()=0
TTableConnectionData & getTableConnectionData()
void saveTableWindows(::comphelper::NamedValueCollection &o_rViewSettings) const
saves the TableWindows structure in a sequence of property values
virtual void reconnect(bool _bUI) override
void SaveTabWinsPosSize(OJoinTableView::OTableWindowMap *pTabWinList, tools::Long nOffsetX, tools::Long nOffsetY)
virtual FeatureState GetState(sal_uInt16 nId) const override
virtual void impl_onModifyChanged() override
static void SaveTabWinPosSize(OTableWindow const *pTabWin, tools::Long nOffsetX, tools::Long nOffsetY)
virtual void describeSupportedFeatures() override
virtual void SAL_CALL disposing() override
AddTableDialogContext & impl_getDialogContext() const
TTableConnectionData m_vTableConnectionData
void setErrorOccurred(const ::dbtools::SQLExceptionInfo &_rInfo)
only defines a method to save a SQLException in d&d methods to show the error at a later state set th...
OAddTableDlg * getAddTableDialog() const
virtual OJoinDesignView * getJoinView()
provides access to the OJoinDesignView belonging to the controller, which might or might not be the d...
virtual bool allowViews() const =0
determines whether or not it's allowed for database views to participate in the game
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
TTableWindowData m_vTableData
std::map< OUString, VclPtr< OTableWindow > > OTableWindowMap
virtual void SAL_CALL disposing() override
std::vector< std::shared_ptr< OTableConnectionData > > TTableConnectionData
std::vector< std::shared_ptr< OTableWindowData > > TTableWindowData
OSingleDocumentController OJoinController_BASE
long Long
describes the state of a feature
unsigned char sal_Bool