LibreOffice Module dbaccess (master) 1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
dbaui::DBSubComponentController Class Reference

#include <dbsubcomponentcontroller.hxx>

Inheritance diagram for dbaui::DBSubComponentController:
[legend]
Collaboration diagram for dbaui::DBSubComponentController:
[legend]

Public Member Functions

bool isReadOnly () const
 
bool isEditable () const
 
void setEditable (bool _bEditable)
 
bool isConnected () const
 
css::uno::Reference< css::sdbc::XDatabaseMetaData > getMetaData () const
 
OUString getDataSourceName () const
 
const css::uno::Reference< css::beans::XPropertySet > & getDataSource () const
 
bool haveDataSource () const
 
css::uno::Reference< css::frame::XModel > getDatabaseDocument () const
 
const ::dbtools::DatabaseMetaDatagetSdbMetaData () const
 provides access to the SDB-level database meta data of the current connection More...
 
void appendError (const OUString &_rErrorMessage)
 appends an error in the current environment. More...
 
void clearError ()
 clears the error state. More...
 
bool hasError () const
 
const ::dbtools::SQLExceptionInfogetError () const
 returns the current error More...
 
void displayError ()
 displays the current error, or does nothing if there is no current error More...
 
void connectionLostMessage () const
 shows an info box with the string conntection lost. More...
 
const css::uno::Reference< css::sdbc::XConnection > & getConnection () const
 gives access to the currently used connection More...
 
css::uno::Reference< css::util::XNumberFormatter > const & getNumberFormatter () const
 returns the number formatter More...
 
virtual sal_Bool SAL_CALL suspend (sal_Bool bSuspend) override
 
virtual sal_Bool SAL_CALL attachModel (const css::uno::Reference< css::frame::XModel > &xModel) override
 
virtual css::uno::Reference< css::document::XEmbeddedScripts > SAL_CALL getScriptContainer () override
 
virtual sal_Bool SAL_CALL isModified () override
 
virtual void SAL_CALL setModified (sal_Bool bModified) override
 
virtual void SAL_CALL addModifyListener (const css::uno::Reference< css::util::XModifyListener > &aListener) override
 
virtual void SAL_CALL removeModifyListener (const css::uno::Reference< css::util::XModifyListener > &aListener) override
 
virtual OUString SAL_CALL getTitle () override
 

Protected Member Functions

virtual void impl_initialize () override
 
virtual void Execute (sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
 
virtual css::uno::Reference< css::frame::XModel > getPrivateModel () const override
 
bool impl_isModified () const
 
virtual void impl_onModifyChanged ()
 
 DBSubComponentController (const css::uno::Reference< css::uno::XComponentContext > &_rxORB)
 
virtual ~DBSubComponentController () override
 
void disconnect ()
 
virtual void reconnect (bool _bUI)
 
bool ensureConnected ()
 
virtual void losingConnection ()
 called when our connection is being disposed More...
 
virtual void SAL_CALL disposing (const css::lang::EventObject &Source) override
 
virtual void SAL_CALL disposing () override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &_rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
sal_Int32 getCurrentStartNumber () const
 

Private Member Functions

void initializeConnection (const css::uno::Reference< css::sdbc::XConnection > &_rxForeignConn)
 forces usage of a connection which we do not own More...
 

Private Attributes

::std::unique_ptr< DBSubComponentController_Implm_pImpl
 

Detailed Description

Definition at line 65 of file dbsubcomponentcontroller.hxx.

Constructor & Destructor Documentation

◆ DBSubComponentController()

dbaui::DBSubComponentController::DBSubComponentController ( const css::uno::Reference< css::uno::XComponentContext > &  _rxORB)
protected

Definition at line 169 of file dbsubcomponentcontroller.cxx.

References getMutex(), and m_pImpl.

◆ ~DBSubComponentController()

dbaui::DBSubComponentController::~DBSubComponentController ( )
overrideprotectedvirtual

Definition at line 175 of file dbsubcomponentcontroller.cxx.

Member Function Documentation

◆ addModifyListener()

void SAL_CALL dbaui::DBSubComponentController::addModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  aListener)
overridevirtual

Definition at line 558 of file dbsubcomponentcontroller.cxx.

References getMutex(), and m_pImpl.

◆ appendError()

void dbaui::DBSubComponentController::appendError ( const OUString &  _rErrorMessage)

appends an error in the current environment.

Definition at line 370 of file dbsubcomponentcontroller.cxx.

References getStandardSQLState(), m_pImpl, and dbtools::SQLExceptionInfo::SQLException.

◆ attachModel()

sal_Bool SAL_CALL dbaui::DBSubComponentController::attachModel ( const css::uno::Reference< css::frame::XModel > &  xModel)
overridevirtual

Definition at line 405 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ clearError()

void dbaui::DBSubComponentController::clearError ( )

clears the error state.

Definition at line 376 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ connectionLostMessage()

void dbaui::DBSubComponentController::connectionLostMessage ( ) const

shows an info box with the string conntection lost.

Definition at line 444 of file dbsubcomponentcontroller.cxx.

References Application::CreateMessageDialog(), DBA_RES, vcl::Window::GetFrameWeld(), getView(), and VCLUnoHelper::GetWindow().

Referenced by impl_initialize().

◆ disconnect()

void dbaui::DBSubComponentController::disconnect ( )
protected

Definition at line 320 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

Referenced by disposing(), and initializeConnection().

◆ displayError()

void dbaui::DBSubComponentController::displayError ( )

displays the current error, or does nothing if there is no current error

Definition at line 391 of file dbsubcomponentcontroller.cxx.

References m_pImpl, and showError().

◆ disposing() [1/2]

void SAL_CALL dbaui::DBSubComponentController::disposing ( )
overrideprotectedvirtual

Definition at line 336 of file dbsubcomponentcontroller.cxx.

References disconnect(), and m_pImpl.

◆ disposing() [2/2]

virtual void SAL_CALL dbaui::DBSubComponentController::disposing ( const css::lang::EventObject &  Source)
overrideprotectedvirtual

References queryInterface().

◆ ensureConnected()

bool dbaui::DBSubComponentController::ensureConnected ( )
inlineprotected

Definition at line 175 of file dbsubcomponentcontroller.hxx.

◆ Execute()

void dbaui::DBSubComponentController::Execute ( sal_uInt16  nId,
const css::uno::Sequence< css::beans::PropertyValue > &  aArgs 
)
overrideprotectedvirtual

Definition at line 424 of file dbsubcomponentcontroller.cxx.

References ID_BROWSER_CLOSE.

◆ getConnection()

const Reference< XConnection > & dbaui::DBSubComponentController::getConnection ( ) const

gives access to the currently used connection

Returns
the currently used connection.

Definition at line 458 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ getCurrentStartNumber()

sal_Int32 dbaui::DBSubComponentController::getCurrentStartNumber ( ) const
protected

Definition at line 544 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ getDatabaseDocument()

Reference< XModel > dbaui::DBSubComponentController::getDatabaseDocument ( ) const

Definition at line 513 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

Referenced by getPrivateModel(), getScriptContainer(), and initializeConnection().

◆ getDataSource()

const Reference< XPropertySet > & dbaui::DBSubComponentController::getDataSource ( ) const

Definition at line 503 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ getDataSourceName()

OUString dbaui::DBSubComponentController::getDataSourceName ( ) const

Definition at line 436 of file dbsubcomponentcontroller.cxx.

References m_pImpl, PROPERTY_NAME(), and sName.

◆ getError()

const ::dbtools::SQLExceptionInfo & dbaui::DBSubComponentController::getError ( ) const

returns the current error

Definition at line 386 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ getMetaData()

Reference< XDatabaseMetaData > dbaui::DBSubComponentController::getMetaData ( ) const

◆ getNumberFormatter()

Reference< XNumberFormatter > const & dbaui::DBSubComponentController::getNumberFormatter ( ) const

returns the number formatter

Definition at line 518 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ getPrivateModel()

Reference< XModel > dbaui::DBSubComponentController::getPrivateModel ( ) const
overrideprotectedvirtual

Definition at line 523 of file dbsubcomponentcontroller.cxx.

References getDatabaseDocument().

Referenced by getTitle().

◆ getScriptContainer()

Reference< XEmbeddedScripts > SAL_CALL dbaui::DBSubComponentController::getScriptContainer ( )
overridevirtual

Definition at line 549 of file dbsubcomponentcontroller.cxx.

References getDatabaseDocument(), getMutex(), and m_pImpl.

◆ getSdbMetaData()

const ::dbtools::DatabaseMetaData & dbaui::DBSubComponentController::getSdbMetaData ( ) const

provides access to the SDB-level database meta data of the current connection

Definition at line 478 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ getTitle()

OUString SAL_CALL dbaui::DBSubComponentController::getTitle ( )
overridevirtual

Definition at line 528 of file dbsubcomponentcontroller.cxx.

References getMutex(), and getPrivateModel().

◆ getTypes()

Sequence< Type > SAL_CALL dbaui::DBSubComponentController::getTypes ( )
overrideprotectedvirtual

◆ hasError()

bool dbaui::DBSubComponentController::hasError ( ) const
Returns
<TRUE> when an error was set otherwise <FALSE>

Definition at line 381 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ haveDataSource()

bool dbaui::DBSubComponentController::haveDataSource ( ) const

Definition at line 508 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ impl_initialize()

void dbaui::DBSubComponentController::impl_initialize ( )
overrideprotectedvirtual

◆ impl_isModified()

bool dbaui::DBSubComponentController::impl_isModified ( ) const
protected

Definition at line 591 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

Referenced by isModified().

◆ impl_onModifyChanged()

void dbaui::DBSubComponentController::impl_onModifyChanged ( )
protectedvirtual

Definition at line 596 of file dbsubcomponentcontroller.cxx.

References ID_BROWSER_SAVEASDOC, and ID_BROWSER_SAVEDOC.

Referenced by setModified().

◆ initializeConnection()

void dbaui::DBSubComponentController::initializeConnection ( const css::uno::Reference< css::sdbc::XConnection > &  _rxForeignConn)
private

forces usage of a connection which we do not own

To be used from within XInitialization::initialize, resp. impl_initialize, only.

Definition at line 234 of file dbsubcomponentcontroller.cxx.

References DBG_ASSERT, DBG_UNHANDLED_EXCEPTION, disconnect(), Exception, getDatabaseDocument(), isConnected(), m_pImpl, utl::SharedUNOComponent< css::sdbc::XConnection >::NoTakeOwnership, PROPERTY_NAME(), and SAL_WARN_IF.

Referenced by impl_initialize().

◆ isConnected()

bool dbaui::DBSubComponentController::isConnected ( ) const

Definition at line 483 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

Referenced by getMetaData(), impl_initialize(), initializeConnection(), and suspend().

◆ isEditable()

bool dbaui::DBSubComponentController::isEditable ( ) const

Definition at line 468 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ isModified()

sal_Bool SAL_CALL dbaui::DBSubComponentController::isModified ( )
overridevirtual

Definition at line 570 of file dbsubcomponentcontroller.cxx.

References getMutex(), and impl_isModified().

◆ isReadOnly()

bool dbaui::DBSubComponentController::isReadOnly ( ) const

Definition at line 463 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ losingConnection()

void dbaui::DBSubComponentController::losingConnection ( )
protectedvirtual

called when our connection is being disposed

The default implementation does a reconnect

Definition at line 329 of file dbsubcomponentcontroller.cxx.

References reconnect().

◆ queryInterface()

Any SAL_CALL dbaui::DBSubComponentController::queryInterface ( const css::uno::Type &  _rType)
overrideprotectedvirtual

Definition at line 208 of file dbsubcomponentcontroller.cxx.

References Any, and m_pImpl.

◆ reconnect()

void dbaui::DBSubComponentController::reconnect ( bool  _bUI)
protectedvirtual

◆ removeModifyListener()

void SAL_CALL dbaui::DBSubComponentController::removeModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  aListener)
overridevirtual

Definition at line 564 of file dbsubcomponentcontroller.cxx.

References getMutex(), and m_pImpl.

◆ setEditable()

void dbaui::DBSubComponentController::setEditable ( bool  _bEditable)

Definition at line 473 of file dbsubcomponentcontroller.cxx.

References m_pImpl.

◆ setModified()

void SAL_CALL dbaui::DBSubComponentController::setModified ( sal_Bool  bModified)
overridevirtual

Definition at line 576 of file dbsubcomponentcontroller.cxx.

References aEvent, getMutex(), impl_onModifyChanged(), and m_pImpl.

◆ suspend()

sal_Bool SAL_CALL dbaui::DBSubComponentController::suspend ( sal_Bool  bSuspend)
overridevirtual

Definition at line 396 of file dbsubcomponentcontroller.cxx.

References isConnected(), m_pImpl, and reconnect().

Member Data Documentation

◆ m_pImpl

::std::unique_ptr<DBSubComponentController_Impl> dbaui::DBSubComponentController::m_pImpl
private

The documentation for this class was generated from the following files: