/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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_BRWCTRLR_HXX #define INCLUDED_DBACCESS_SOURCE_UI_INC_BRWCTRLR_HXX #include #include "moduledbu.hxx" #include "brwview.hxx" #include "sbagrid.hxx" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct FmFoundRecordInformation; struct FmSearchContext; namespace dbtools { class SQLExceptionInfo; } namespace dbaui { typedef ::cppu::ImplInheritanceHelper < OGenericUnoController , css::sdb::XSQLErrorListener , css::form::XDatabaseParameterListener , css::form::XConfirmDeleteListener , css::form::XLoadListener , css::form::XResetListener , css::awt::XFocusListener , css::container::XContainerListener , css::beans::XPropertyChangeListener , css::frame::XModule > SbaXDataBrowserController_Base; class SbaXDataBrowserController :public SbaXDataBrowserController_Base ,public SbaGridListener { // attributes private: // for implementing the XFormController class FormControllerImpl; friend class FormControllerImpl; OModuleClient m_aModuleClient; css::uno::Reference< css::sdbc::XRowSet > m_xRowSet; // our rowset css::uno::Reference< css::sdbcx::XColumnsSupplier > m_xColumnsSupplier; // queried from the rowset member css::uno::Reference< css::form::XLoadable > m_xLoadable; // queried from the rowset member as well css::uno::Reference< css::form::XFormComponent > m_xGridModel; // the model of our grid css::uno::Reference< css::util::XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier css::uno::Reference< css::uno::XAggregation > m_xFormControllerImpl; mutable css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xParser; // for sorting 'n filtering sal_Int32 m_nRowSetPrivileges; // cached Privileges property of m_xRowSet AutoTimer m_aInvalidateClipboard; // for testing the state of the CUT/COPY/PASTE-slots TransferableDataHelper m_aSystemClipboard; // content of the clipboard rtl::Reference m_pClipboardNotifier; // notifier for changes in the clipboard OAsynchronousLink m_aAsyncGetCellFocus; OAsynchronousLink m_aAsyncDisplayError; ::dbtools::SQLExceptionInfo m_aCurrentError; OUString m_sStateSaveRecord; OUString m_sStateUndoRecord; OUString m_sModuleIdentifier; // members for asynchronous load operations FormControllerImpl* m_pFormControllerImpl; // implementing the XFormController sal_uInt16 m_nFormActionNestingLevel; // see enter-/leaveFormAction bool m_bLoadCanceled : 1; // the load was canceled somehow bool m_bCannotSelectUnfiltered : 1; // received an DATA_CANNOT_SELECT_UNFILTERED error protected: class FormErrorHelper final { SbaXDataBrowserController* m_pOwner; public: FormErrorHelper(SbaXDataBrowserController* pOwner) : m_pOwner(pOwner) { m_pOwner->enterFormAction(); } ~FormErrorHelper() { m_pOwner->leaveFormAction(); } }; friend class FormErrorHelper; // attribute access protected: const css::uno::Reference< css::sdbc::XRowSet >& getRowSet() const { return m_xRowSet; } const css::uno::Reference< css::form::XLoadable >& getLoadable() const { return m_xLoadable; } const css::uno::Reference< css::form::XFormComponent >& getFormComponent() const { return m_xGridModel; } css::uno::Reference< css::awt::XControlModel > getControlModel() const { return css::uno::Reference< css::awt::XControlModel > (m_xGridModel, css::uno::UNO_QUERY); } const css::uno::Reference< css::util::XNumberFormatter >& getNumberFormatter()const { return m_xFormatter; } bool isValid() const { return m_xRowSet.is() && m_xGridModel.is(); } bool isValidCursor() const; // checks the css::data::XDatabaseCursor-interface of m_xRowSet bool isLoaded() const; bool loadingCancelled() const { return m_bLoadCanceled; } void onStartLoading( const css::uno::Reference< css::form::XLoadable >& _rxLoadable ); void setLoadingCancelled() { m_bLoadCanceled = true; } public: SbaXDataBrowserController(const css::uno::Reference< css::uno::XComponentContext >& _rM); UnoDataBrowserView* getBrowserView() const { return static_cast< UnoDataBrowserView*>(getView()); } // late construction virtual bool Construct(vcl::Window* pParent) override; // UNO virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type& _rType) throw (css::uno::RuntimeException, std::exception) override; // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw (css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (css::uno::RuntimeException, std::exception) override; // css::lang::XEventListener virtual void SAL_CALL disposing(const css::lang::EventObject& Source) throw( css::uno::RuntimeException, std::exception ) override; // css::util::XModifyListener virtual void SAL_CALL modified(const css::lang::EventObject& aEvent) throw( css::uno::RuntimeException, std::exception ) override; // css::container::XContainerListener virtual void SAL_CALL elementInserted(const css::container::ContainerEvent& Event) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent& Event) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent& Event) throw( css::uno::RuntimeException, std::exception ) override; // XPropertyChangeListener virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) throw (css::uno::RuntimeException, std::exception) override; // XModule virtual void SAL_CALL setIdentifier( const OUString& Identifier ) throw (css::uno::RuntimeException, std::exception) override; virtual OUString SAL_CALL getIdentifier( ) throw (css::uno::RuntimeException, std::exception) override; // css::awt::XFocusListener virtual void SAL_CALL focusGained(const css::awt::FocusEvent& e) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL focusLost(const css::awt::FocusEvent& e) throw( css::uno::RuntimeException, std::exception ) override; // css::frame::XController virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( css::uno::RuntimeException, std::exception ) override; // css::lang::XComponent virtual void SAL_CALL disposing() override; // css::frame::XFrameActionListener virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent) throw( css::uno::RuntimeException, std::exception ) override; // css::sdb::XSQLErrorListener virtual void SAL_CALL errorOccured(const css::sdb::SQLErrorEvent& aEvent) throw( css::uno::RuntimeException, std::exception ) override; // css::form::XDatabaseParameterListener virtual sal_Bool SAL_CALL approveParameter(const css::form::DatabaseParameterEvent& aEvent) throw( css::uno::RuntimeException, std::exception ) override; // css::form::XConfirmDeleteListener virtual sal_Bool SAL_CALL confirmDelete(const css::sdb::RowChangeEvent& aEvent) throw( css::uno::RuntimeException, std::exception ) override; // css::form::XLoadListener virtual void SAL_CALL loaded(const css::lang::EventObject& aEvent) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL unloading(const css::lang::EventObject& aEvent) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL unloaded(const css::lang::EventObject& aEvent) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL reloading(const css::lang::EventObject& aEvent) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL reloaded(const css::lang::EventObject& aEvent) throw( css::uno::RuntimeException, std::exception ) override; // css::form::XResetListener virtual sal_Bool SAL_CALL approveReset(const css::lang::EventObject& rEvent) throw( css::uno::RuntimeException, std::exception ) override; virtual void SAL_CALL resetted(const css::lang::EventObject& rEvent) throw( css::uno::RuntimeException, std::exception ) override; // SbaGridListener virtual void RowChanged() override; virtual void ColumnChanged() override; virtual void SelectionChanged() override; virtual void CellActivated() override; virtual void CellDeactivated() override; virtual void BeforeDrop() override; virtual void AfterDrop() override; public: protected: virtual ~SbaXDataBrowserController() override; // all the features which should be handled by this class virtual void describeSupportedFeatures() override; // state of a feature. 'feature' may be the handle of a css::util::URL somebody requested a dispatch interface for OR a toolbar slot. virtual FeatureState GetState(sal_uInt16 nId) const override; // execute a feature virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) override; virtual void startFrameListening( const css::uno::Reference< css::frame::XFrame >& _rxFrame ) override; virtual void stopFrameListening( const css::uno::Reference< css::frame::XFrame >& _rxFrame ) override; virtual css::uno::Reference< css::sdbc::XRowSet > CreateForm(); // our default implementation simply instantiates a stardiv.one.form.component.Form service // (probably this needs not to be overridden, but you may return anything you want as long as it // supports the css::form::DatabaseForm service. For instance you may want to create an adapter here which // is synchronized with a foreign css::form::DatabaseForm you got elsewhere) virtual bool InitializeForm( const css::uno::Reference< css::beans::XPropertySet >& i_formProperties ) = 0; // called immediately after a successful CreateForm // do any initialization (data source etc.) here. the form should be fully functional after that. // return sal_False if you didn't succeed (don't throw exceptions, they won't be caught) virtual bool InitializeGridModel(const css::uno::Reference< css::form::XFormComponent > & xGrid); css::uno::Reference< css::form::XFormComponent > CreateGridModel(); // our default implementation simply instantiates a stardiv.one.form.component.Grid service // you most probably don't want to override this behavior // the default implementation of disposing distributes the events to the following disposingXXX functions void disposingFormModel(const css::lang::EventObject& Source); void disposingColumnModel(const css::lang::EventObject& Source); // want to be a listener to the grid control ? use this ! void addControlListeners(const css::uno::Reference< css::awt::XControl > & _xGridControl); void removeControlListeners(const css::uno::Reference< css::awt::XControl > & _xGridControl); // want to be a listener to the grid model ? use this ! virtual void addModelListeners(const css::uno::Reference< css::awt::XControlModel > & _xGridControlModel); virtual void removeModelListeners(const css::uno::Reference< css::awt::XControlModel > & _xGridControlModel); // want to be a listener grid columns ? use this ! virtual void AddColumnListener(const css::uno::Reference< css::beans::XPropertySet > & xCol); virtual void RemoveColumnListener(const css::uno::Reference< css::beans::XPropertySet > & xCol); // call after "major changes" (e.g. the completion of the async load). // invalidates all toolbox slots and all supported features. virtual bool LoadForm(); // load the form // the default implementation does an direct load or starts a load thread, depending on the multithread capabilities // of the data source. // the default implementation also calls LoadFinished after a synchronous load, so be sure to do the same if you override // this method and don't call the base class' method virtual void LoadFinished(bool bWasSynch); // called if the loading (the _complete_ loading process) is done (no matter if synchron or asynchron). virtual void criticalFail(); // called whenever a reload operation on the rowset failed // (a "operation" is not only a simple reload: If the user sets a filter, an reloading the form // after setting this filter fails, the filter is reset and the form is reloaded, again. Only the // whole process (_both_ XLoadable::reload calls _together_) form the "reload operation" // empty the frame where our view resides bool CommitCurrent(); // commit the current column (i.e. cell) bool SaveModified(bool bAskFor = true); // save the modified record css::uno::Reference< css::beans::XPropertySet > getBoundField() const; // a PropertySet corresponding to the cursor field a column is bound to. // The field for the current column will be retrieved. void enterFormAction(); void leaveFormAction(); // init the formatter if form changes void initFormatter(); /// loads or reloads the form bool reloadForm(const css::uno::Reference< css::form::XLoadable >& _rxLoadable); virtual bool preReloadForm(){ return false; } virtual void postReloadForm(){} css::uno::Reference< css::sdb::XSingleSelectQueryComposer > createParser_nothrow(); private: void setCurrentModified( bool _bSet ); // execute the filter or sort slot void ExecuteFilterSortCrit(bool bFilter); // execute the search slot void ExecuteSearch(); void initializeParser() const; // changes the mutable member m_xParser void applyParserFilter(const OUString& _rOldFilter, bool _bOldFilterApplied,const ::OUString& _sOldHaving,const css::uno::Reference< css::sdb::XSingleSelectQueryComposer >& _xParser); void applyParserOrder(const OUString& _rOldOrder,const css::uno::Reference< css::sdb::XSingleSelectQueryComposer >& _xParser); sal_Int16 getCurrentColumnPosition(); void setCurrentColumnPosition( sal_Int16 _nPos ); void addColumnListeners(const css::uno::Reference< css::awt::XControlModel > & _xGridControlModel); void impl_checkForCannotSelectUnfiltered( const ::dbtools::SQLExceptionInfo& _rError ); // time to check the CUT/COPY/PASTE-slot-states DECL_LINK( OnInvalidateClipboard, Timer*, void ); DECL_LINK( OnClipboardChanged, TransferableDataHelper*, void ); // search callbacks DECL_LINK(OnSearchContextRequest, FmSearchContext&, sal_uInt32); DECL_LINK(OnFoundData, FmFoundRecordInformation&, void); DECL_LINK(OnCanceledNotFound, FmFoundRecordInformation&, void); DECL_LINK( OnAsyncGetCellFocus, void*, void ); DECL_LINK( OnAsyncDisplayError, void*, void ); }; } #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_BRWCTRLR_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-12-10canvas: DIRECTX_VERSION macro is obsoleteMichael Stahl
It was only checked by our own code, and only DirectX 9 is supported. Change-Id: I03035f87969301624df011cb4d76c6a9532f3c99
2014-12-10canvas: remove Windows SDK #ifdefs - all supported MSVC/SDK have DirectXMichael Stahl
Change-Id: I5106593ad5472992e3607665849fb35802b6e266
2014-07-29Accept also WINDOWS_SDK_VERSION == 81Tor Lillqvist
Change-Id: Id1a8f91b6c74c19c3b14b24a86580d06cec3dd97
2013-06-03re-base on ALv2 code. Includes:Michael Meeks
Patches contributed by Mathias Bauer gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1397337 http://svn.apache.org/viewvc?view=revision&revision=1397315 http://svn.apache.org/viewvc?view=revision&revision=1396797 Patches contributed by Andre Fischer Fixed getcsym.awk to handle #-comments that contain special regexp chars. http://svn.apache.org/viewvc?view=revision&revision=1230971 118778: Added ADDITIONAL_REPOSITORIES environment variable and its automatic setup in configure. http://svn.apache.org/viewvc?view=revision&revision=1232004 118160: Added external CoinMP library. http://svn.apache.org/viewvc?view=revision&revision=1233909 Patches contributed by Herbert Duerr #i119168# use generic LICENSE file for langpacks and sdks http://svn.apache.org/viewvc?view=revision&revision=1310178 macosxotoolhelper: need to quote perl regexp if it may contain regexp metachars http://svn.apache.org/viewvc?view=revision&revision=1183367 allow gbuild with empty sysroot on linux http://svn.apache.org/viewvc?view=revision&revision=1179186 Patches contributed by Ingo Schmidt native373: #164472# improvements for msi database http://svn.apache.org/viewvc?view=revision&revision=1167540 http://svn.apache.org/viewvc?view=revision&revision=1167539 Patches contributed by Jurgen Schmidt adapt setup package scripts to handle special DS_Store file for developer snapshot builds http://svn.apache.org/viewvc?view=revision&revision=1232430 imported patch extensions_i117681.patch http://svn.apache.org/viewvc?view=revision&revision=1172102 Patches contributed by Michael Stahl gbuild: RepositoryFixes.mk should be optional http://svn.apache.org/viewvc?view=revision&revision=1166123 xslt filter: remove the FLA horror wordml import filter: replace FLA usage with plain XSLT http://svn.apache.org/viewvc?view=revision&revision=1363727 Patch contributed by Oliver-Rainer Wittmann i#88652: applied patch, remove unicows deps http://svn.apache.org/viewvc?view=revision&revision=1177585 Remove lots of OS2 conditionals, re-extract Rhino Java, unwind cppunit pieces, cleanup Mac image bits, remove coin-mp and re-package lpsolve, Oxygen & Crystal, fixup qstart bits, expand MPLv2 subset checking. Change-Id: Iad5c8a76399620b892671633c0d8c29996db3564
2013-04-24canvas: remove obsolete include pathsMichael Stahl
Change-Id: I3d72be674526f4221de452ad4efc1e857bb25dc6
2013-04-05new module i18nlangtagEike Rathke
Moved portions from module i18npool, all of former i18nisolang1 library that now is i18nlangtag. Included are languagetag, isolang and mslangid. This i18nlangtag code is now even used by module comphelper, so disentangling i18npool and making this an own module was needed to not create circular module dependencies. Change-Id: Ib887c3d6dde667403fd22d382310ba5f1a9b0015
2013-01-26gbuild: do not copy boost headers aroundMichael Stahl
- do not use gb_UnpackedTarball_copy_header_files for boost - adapt the optimization in concat-deps.c for new path - use boost_headers in all LinkTargets that require it - add explicit include paths to mysqlc, mysqlcppconn, libvisio, liborcus Change-Id: I0c43e73ed43cc9d2e6bce8faf55e992d655a0bb9
2012-10-07fix canvas build with Win8 SDKPeter Foley
Change-Id: I17bd44ba8f5a6484d10bb64201ace8e030cf334d Reviewed-on: https://gerrit.libreoffice.org/789 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-09-28gbuild: invert handling of standard system libraries:Michael Stahl
Always link in gb_STDLIBS, except when the library explicitly opts out with gb_LinkTarget_disable_standard_system_libs. Change-Id: I489a99114fbfa46d0421a27cf6c7b899dc268a4a
2012-09-28gbuild: gb_Library_PLAINLIBS_NONE cleanup for WNT:Michael Stahl
add a new gb_LinkTarget_use_system_win32_libs to abstract different linker options on MSVC and GCC. Change-Id: Ic9bf2545f59bf7871e6fc06b290c486ddfbec03d
2012-09-28gbuild: replace direct gb_STDLIBS use with ...Michael Stahl
... new gb_LinkTarget_add_standard_system_libs Change-Id: Ib2bc843098db3d8c6822b45a3d21724e67f57d69
2012-09-28gbuild: split uwinapi out of gb_STDLIBSMichael Stahl
Change-Id: I53316e0b9369d806197bccb42cf22d3497af43e7
2012-07-02targetted improvement of UNO API includes / usageMichael Meeks
2012-04-08gbuild: "use" vs. "add":Michael Stahl
Naming convention for gbuild methods: - "add" is used for stuff that is logically a part of the target (i.e. not registered at the Module, but defined in the target's makefile) - "use" is used for stuff that is logically a different target (i.e. it is registered at the Module, has it's own makefile, may be in a different module than the target)
2012-03-14fdo#47246: canvas: split out static library directxcanvasMichael Stahl
2012-01-04canvas: work around NOMINMAX windows breakageMichael Stahl
2011-11-27remove pch from the include listNorbert Thiebaud
2011-09-22Always link with user32Tor Lillqvist
2011-08-26Bin USE_MINGWTor Lillqvist
Its alternative values as used by OOo is irrelevant to us as we don't intend to support building using MinGW on Windows itself. To us, MinGW always means cross-compilation. For us it is enough to look at $(OS)$(COM), and WNTGCC always implies cross-compilation. (OOo on the other hand attempts to support use of the Cygwin gcc with the -mno-cygwin option (which is practically considered an obsolete option), the normal MinGW compiler (but still from Cygwin), but not cros-compilation.)
2011-08-24Link with d3d9 and not ddraw which doesn't exist in current DirectXTor Lillqvist
2011-08-12fix build issues in canvas on windowsNorbert Thiebaud
2011-08-10prefer makefile-gmake-mode to plain makefile-modeTakeshi Abe
2011-08-04help windows build alongCaolán McNamara
2011-07-30Add consistent Emacs and vim mode linesTor Lillqvist
2011-07-26Removed weird VERBOSE overload in canvasThorsten Behrens
Now doing extra logging / graphical debug cues via OSL_DEBUG_LEVEL of 3. Also saves some lines in makefiles.
2011-07-22postmerge fixes for gnumake4Bjoern Michaelsen
2011-06-17gnumake4: #i116959#: kill ↵Michael Stahl
gb_LinkTarget_set_{defs,cflags,cxxflags,objcxxflags} [hg:389f5e8ec8cd]
2011-06-16CWS gnumake4: convert canvas to new build systemMathias Bauer