Files
libreoffice/dbaccess/source/ui/inc/JoinController.hxx

158 lines
6.5 KiB
C++
Raw Normal View History

2010-10-27 12:33:13 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-14 17:39:53 +01:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_JOINCONTROLLER_HXX
#define INCLUDED_DBACCESS_SOURCE_UI_INC_JOINCONTROLLER_HXX
2001-02-28 09:09:17 +00:00
#include "singledoccontroller.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
#include "moduledbu.hxx"
2001-02-28 09:09:17 +00:00
#include "JoinTableView.hxx"
#include "JoinDesignView.hxx"
#include "TableConnectionData.hxx"
#include "TableWindowData.hxx"
2001-02-28 09:09:17 +00:00
#include <memory>
namespace comphelper
{
class NamedValueCollection;
}
2001-02-28 09:09:17 +00:00
namespace dbaui
{
class OAddTableDlg;
class AddTableDialogContext;
2001-02-28 09:09:17 +00:00
class OTableWindow;
typedef OSingleDocumentController OJoinController_BASE;
class OJoinController : public OJoinController_BASE
2001-02-28 09:09:17 +00:00
{
OModuleClient m_aModuleClient;
2001-02-28 09:09:17 +00:00
protected:
TTableConnectionData m_vTableConnectionData;
TTableWindowData m_vTableData;
2001-02-28 09:09:17 +00:00
Fraction m_aZoom;
::dbtools::SQLExceptionInfo m_aExceptionInfo;
2001-02-28 09:09:17 +00:00
OAddTableDlg* m_pAddTableDialog;
::std::auto_ptr< AddTableDialogContext > m_pDialogContext;
Point m_aMinimumTableViewSize;
2001-02-28 09:09:17 +00:00
// state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot.
virtual FeatureState GetState(sal_uInt16 nId) const SAL_OVERRIDE;
2001-02-28 09:09:17 +00:00
// execute a feature
virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) SAL_OVERRIDE;
2001-02-28 09:09:17 +00:00
/** loads the information for the windows.
@param i_rViewSettings
The properties which comes from the layout information.
*/
void loadTableWindows( const ::comphelper::NamedValueCollection& i_rViewSettings );
/** loads the information for one window.
@param _rTable
The properties which comes from the layout information.
*/
void loadTableWindow( const ::comphelper::NamedValueCollection& i_rTableWindowSettings );
/** saves the TableWindows structure in a sequence of property values
@param _rViewProps
Contains the new sequence.
*/
void saveTableWindows( ::comphelper::NamedValueCollection& o_rViewSettings ) const;
2002-02-19 13:16:17 +00:00
virtual ~OJoinController();
2001-02-28 09:09:17 +00:00
public:
OJoinController(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rM);
2001-02-28 09:09:17 +00:00
// attribute access
inline TTableWindowData* getTableWindowData() { return &m_vTableData; }
inline TTableConnectionData* getTableConnectionData() { return &m_vTableConnectionData;}
inline OAddTableDlg* getAddTableDialog()const { return m_pAddTableDialog; }
// OSingleDocumentController overridables
virtual void reconnect( sal_Bool _bUI ) SAL_OVERRIDE;
virtual void impl_onModifyChanged() SAL_OVERRIDE;
// own overridables
/** determines whether or not it's allowed for database views to participate in the game
*/
virtual bool allowViews() const = 0;
/** determines whether or not it's allowed for queries to participate in the game
*/
virtual bool allowQueries() const = 0;
/** provides access to the OJoinDesignView belonging to the controller, which might
or might not be the direct view (getView)
*/
virtual OJoinDesignView* getJoinView();
2002-02-19 13:16:17 +00:00
/** erase the data in the data vector
@param _pData
the data whioch should be erased
*/
void removeConnectionData(const TTableConnectionData::value_type& _pData);
2001-02-28 09:09:17 +00:00
void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY );
2001-02-28 09:09:17 +00:00
void SaveTabWinPosSize(OTableWindow* pTabWin, long nOffsetX, long nOffsetY);
2001-02-28 09:09:17 +00:00
// UNO interface overridables
2001-02-28 09:09:17 +00:00
// XEventListener
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
2001-02-28 09:09:17 +00:00
// ::com::sun::star::lang::XComponent
virtual void SAL_CALL disposing() SAL_OVERRIDE;
2001-10-23 11:30:27 +00:00
// ::com::sun::star::frame::XController
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
2001-10-23 11:30:27 +00:00
// misc
/** only defines a method to save a SQLException in d&d methods to show the error at a later state
set the internal member m_aExceptionInfo to _rInfo
*/
2010-12-04 12:33:49 +09:00
void setErrorOccurred(const ::dbtools::SQLExceptionInfo& _rInfo)
{
m_aExceptionInfo = _rInfo;
}
/**
just returns the internal member and clears it
*/
2010-12-04 12:33:49 +09:00
::dbtools::SQLExceptionInfo clearOccurredError()
{
::dbtools::SQLExceptionInfo aInfo = m_aExceptionInfo;
m_aExceptionInfo = ::dbtools::SQLExceptionInfo();
return aInfo;
}
2001-03-01 12:29:19 +00:00
protected:
TTableWindowData::value_type createTableWindowData(const OUString& _sComposedName,const OUString& _sTableName,const OUString& _sWindowName);
2001-10-23 11:30:27 +00:00
// ask the user if the design should be saved when it is modified
virtual short saveModified() = 0;
// called when the orignal state should be reseted (first time load)
virtual void reset() = 0;
virtual void describeSupportedFeatures() SAL_OVERRIDE;
AddTableDialogContext& impl_getDialogContext() const;
2001-02-28 09:09:17 +00:00
};
}
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_JOINCONTROLLER_HXX
2001-02-28 09:09:17 +00:00
2010-10-27 12:33:13 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */