diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-15 10:31:10 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-15 10:31:10 +0100 |
commit | 4a7d3e0c752e3d1a10de8c4a2a1ccd1f00ada3fc (patch) | |
tree | 814c85d7673480e087b7d5757def9db53fd8a74e /dbaccess/inc | |
parent | 933795c27b41b3f8f66725a6d814d5fc608a8359 (diff) | |
parent | ac6e971d8a5f715f716b6bdcaf6cb535104df32c (diff) |
dba34d: pulled and merged CWS dba34c, thus implicitly rebasing to m100
Diffstat (limited to 'dbaccess/inc')
-rw-r--r-- | dbaccess/inc/AsyncronousLink.hxx | 2 | ||||
-rw-r--r-- | dbaccess/inc/IEnvironment.hxx | 77 | ||||
-rw-r--r-- | dbaccess/inc/dataview.hxx | 17 | ||||
-rwxr-xr-x | dbaccess/inc/dbaundomanager.hxx | 103 | ||||
-rw-r--r-- | dbaccess/inc/dbsubcomponentcontroller.hxx (renamed from dbaccess/inc/singledoccontroller.hxx) | 59 |
5 files changed, 128 insertions, 130 deletions
diff --git a/dbaccess/inc/AsyncronousLink.hxx b/dbaccess/inc/AsyncronousLink.hxx index 2b2bbb597c7e..576f1a1a90af 100644 --- a/dbaccess/inc/AsyncronousLink.hxx +++ b/dbaccess/inc/AsyncronousLink.hxx @@ -49,7 +49,7 @@ namespace dbaui protected: ::osl::Mutex m_aEventSafety; ::osl::Mutex m_aDestructionSafety; - ULONG m_nEventId; + sal_uLong m_nEventId; public: /** constructs the object diff --git a/dbaccess/inc/IEnvironment.hxx b/dbaccess/inc/IEnvironment.hxx deleted file mode 100644 index bc6766c91ebb..000000000000 --- a/dbaccess/inc/IEnvironment.hxx +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBAUI_IENVIRONMENT_HXX -#define DBAUI_IENVIRONMENT_HXX - -#include <com/sun/star/sdbc/SQLException.hpp> - -#include <connectivity/standardsqlstate.hxx> - -namespace dbtools -{ - class SQLExceptionInfo; -} - -namespace dbaui -{ - // interface class for a generell environment - class IEnvironment - { - public: - /** appends an error in the current environment. - */ - virtual void appendError( - const ::rtl::OUString& _rErrorMessage, - const ::dbtools::StandardSQLState _eSQLState = ::dbtools::SQL_GENERAL_ERROR, - const sal_Int32 _nErrorCode = 1000 - ) = 0; - - /** clears the error state. - */ - virtual void clearError() = 0; - - /** @retrun - returns <TRUE/> when an error was set otherwise <FALSE/> - */ - virtual sal_Bool hasError() const = 0; - - /** returns the current error - */ - virtual const ::dbtools::SQLExceptionInfo& getError() const = 0; - - /** displays the current error, or does nothing if there is no current error - */ - virtual void displayError() = 0; - - /** gives access to the currently used connection - @return - the currently used connection. - */ - virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& getConnection() const = 0; - }; -} -#endif // DBAUI_IENVIRONMENT_HXX diff --git a/dbaccess/inc/dataview.hxx b/dbaccess/inc/dataview.hxx index ae93fa1d3284..fdb99014433a 100644 --- a/dbaccess/inc/dataview.hxx +++ b/dbaccess/inc/dataview.hxx @@ -27,17 +27,13 @@ #ifndef DBAUI_DATAVIEW_HXX #define DBAUI_DATAVIEW_HXX -#ifndef _SV_WINDOW_HXX -#include <vcl/window.hxx> -#endif -#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include "dbaccessdllapi.h" + #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#endif -#ifndef INCLUDED_SVTOOLS_ACCELERATOREXECUTE_HXX #include <svtools/acceleratorexecute.hxx> -#endif +#include <vcl/fixed.hxx> + #include <memory> -#include "dbaccessdllapi.h" class FixedLine; class SvtMiscOptions; @@ -50,7 +46,7 @@ namespace dbaui protected: IController& m_rController; // the controller in where we resides in - FixedLine* m_pSeparator; // our separator above the toolbox (may be NULL) + FixedLine m_aSeparator; ::std::auto_ptr< ::svt::AcceleratorExecute> m_pAccel; public: @@ -75,9 +71,6 @@ namespace dbaui */ virtual void resizeControls(const Size& /*_rDiff*/) { Resize(); } - void enableSeparator( const sal_Bool _bEnable = sal_True ); - sal_Bool isSeparatorEnabled() const { return NULL != m_pSeparator; } - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() { return m_xServiceFactory;} // the default implementation simply calls resizeAll( GetSizePixel() ) diff --git a/dbaccess/inc/dbaundomanager.hxx b/dbaccess/inc/dbaundomanager.hxx new file mode 100755 index 000000000000..1b8627f66326 --- /dev/null +++ b/dbaccess/inc/dbaundomanager.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef DBACCESS_DBAUNDOMANAGER_HXX +#define DBACCESS_DBAUNDOMANAGER_HXX + +#include "dbaccessdllapi.h" + +/** === begin UNO includes === **/ +#include <com/sun/star/document/XUndoManager.hpp> +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> + +#include <boost/scoped_ptr.hpp> + +class SfxUndoManager; + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + //================================================================================================================== + //= UndoManager + //================================================================================================================== + struct UndoManager_Impl; + typedef ::cppu::ImplHelper1< ::com::sun::star::document::XUndoManager > UndoManager_Base; + class DBACCESS_DLLPUBLIC UndoManager : public UndoManager_Base + { + public: + UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ); + virtual ~UndoManager(); + + SfxUndoManager& GetSfxUndoManager() const; + + // XInterface + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + // XComponent equivalents + void disposing(); + + // XUndoManager + virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); + + // XLockable (base of XUndoManager) + virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException); + + // XChild (base of XUndoManager) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + private: + ::boost::scoped_ptr< UndoManager_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... + +#endif // DBACCESS_DBAUNDOMANAGER_HXX diff --git a/dbaccess/inc/singledoccontroller.hxx b/dbaccess/inc/dbsubcomponentcontroller.hxx index 5bda31fb4608..cd93a29df321 100644 --- a/dbaccess/inc/singledoccontroller.hxx +++ b/dbaccess/inc/dbsubcomponentcontroller.hxx @@ -25,11 +25,10 @@ * ************************************************************************/ -#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX -#define DBAUI_SINGLEDOCCONTROLLER_HXX +#ifndef DBAUI_SUBCOMPONENTCONTROLLER_HXX +#define DBAUI_SUBCOMPONENTCONTROLLER_HXX #include "genericcontroller.hxx" -#include "IEnvironment.hxx" /** === begin UNO includes === **/ #include <com/sun/star/document/XScriptInvocationContext.hpp> @@ -45,7 +44,6 @@ #include <comphelper/propertycontainer.hxx> #include <connectivity/dbmetadata.hxx> #include <cppuhelper/implbase2.hxx> -#include <svl/undo.hxx> #include <memory> @@ -55,25 +53,20 @@ namespace dbaui //........................................................................ //==================================================================== - //= OSingleDocumentController + //= DBSubComponentController //==================================================================== - class OSingleDocumentController; + class DBSubComponentController; typedef ::cppu::ImplInheritanceHelper2 < OGenericUnoController , ::com::sun::star::document::XScriptInvocationContext , ::com::sun::star::util::XModifiable - > OSingleDocumentController_Base; + > DBSubComponentController_Base; - struct OSingleDocumentControllerImpl; - class DBACCESS_DLLPUBLIC OSingleDocumentController - :public OSingleDocumentController_Base - ,public IEnvironment + struct DBSubComponentController_Impl; + class DBACCESS_DLLPUBLIC DBSubComponentController : public DBSubComponentController_Base { private: - ::std::auto_ptr<OSingleDocumentControllerImpl> m_pImpl; - - protected: - SfxUndoManager m_aUndoManager; + ::std::auto_ptr<DBSubComponentController_Impl> m_pImpl; private: /** forces usage of a connection which we do not own @@ -85,9 +78,7 @@ namespace dbaui // OGenericUnoController - initialization virtual void impl_initialize(); - // 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; - // execute a feature + // OGenericUnoController virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > getPrivateModel() const; @@ -101,14 +92,6 @@ namespace dbaui sal_Bool isEditable() const; void setEditable(sal_Bool _bEditable); - // need for undo's and redo's - SfxUndoManager* getUndoMgr(); - - /** addUndoActionAndInvalidate adds an undo action to the undoManager, - additionally invalidates the UNDO and REDO slot - @param pAction the undo action to add - */ - void addUndoActionAndInvalidate(SfxUndoAction *pAction); // ---------------------------------------------------------------- // asking for connection-related stuff @@ -131,10 +114,9 @@ namespace dbaui */ const ::dbtools::DatabaseMetaData& getSdbMetaData() const; - // IEnvironment /** appends an error in the current environment. */ - virtual void appendError( + void appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState = ::dbtools::SQL_GENERAL_ERROR, const sal_Int32 _nErrorCode = 1000 @@ -142,20 +124,20 @@ namespace dbaui /** clears the error state. */ - virtual void clearError(); + void clearError(); /** @return <TRUE/> when an error was set otherwise <FALSE/> */ - virtual sal_Bool hasError() const; + sal_Bool hasError() const; /** returns the current error */ - virtual const ::dbtools::SQLExceptionInfo& getError() const; + const ::dbtools::SQLExceptionInfo& getError() const; /** displays the current error, or does nothing if there is no current error */ - virtual void displayError(); + void displayError(); /** shows an info box with the string conntection lost. */ @@ -165,7 +147,7 @@ namespace dbaui @return the currently used connection. */ - virtual const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& getConnection() const; /** returns the number formatter @@ -191,8 +173,8 @@ namespace dbaui virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException); protected: - OSingleDocumentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB); - virtual ~OSingleDocumentController(); + DBSubComponentController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB); + virtual ~DBSubComponentController(); virtual void disconnect(); virtual void reconnect( sal_Bool _bUI ); @@ -203,9 +185,6 @@ namespace dbaui */ virtual void losingConnection( ); - // late construction - virtual sal_Bool Construct(Window* pParent); - protected: // XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); @@ -223,12 +202,12 @@ namespace dbaui sal_Int32 getCurrentStartNumber() const; private: - OSingleDocumentController(); // never implemented + DBSubComponentController(); // never implemented }; //........................................................................ } // namespace dbaui //........................................................................ -#endif // DBAUI_SINGLEDOCCONTROLLER_HXX +#endif // DBAUI_SUBCOMPONENTCONTROLLER_HXX |