summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-12-21 14:30:05 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-12-21 14:30:05 +0100
commit2d22bd0fca8570ddbe03391d7588aa5e7caf521b (patch)
treea066eb2774243cf3cf0bfcee7f71cb3f2f3afaa5 /svx
parent0ca0a9f2e2661b52428aa117e78570583a872a04 (diff)
Merge tbunosearchcontrollers.hxx into .cxx
Change-Id: Ic577e2dd4d6cc1d62c3c6f54e73ba891f8bad4a2
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/tbunosearchcontrollers.hxx365
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx358
2 files changed, 328 insertions, 395 deletions
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx
deleted file mode 100644
index 2b0de95c021d..000000000000
--- a/svx/inc/tbunosearchcontrollers.hxx
+++ /dev/null
@@ -1,365 +0,0 @@
-/* -*- 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_SVX_INC_TBUNOSEARCHCONTROLLERS_HXX
-#define INCLUDED_SVX_INC_TBUNOSEARCHCONTROLLERS_HXX
-
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/frame/DispatchDescriptor.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XDispatchHelper.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/frame/XStatusListener.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-
-#include <cppuhelper/weak.hxx>
-#include <svtools/toolboxcontroller.hxx>
-#include <vcl/button.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/window.hxx>
-
-#include <map>
-#include <vector>
-
-namespace {
-
-class FindTextFieldControl : public ComboBox
-{
-public:
- FindTextFieldControl( vcl::Window* pParent, WinBits nStyle,
- css::uno::Reference< css::frame::XFrame >& xFrame,
- const css::uno::Reference< css::uno::XComponentContext >& xContext );
-
- virtual bool PreNotify( NotifyEvent& rNEvt ) override;
-
- void Remember_Impl(const OUString& rStr);
- void SetTextToSelected_Impl();
-
-private:
-
- css::uno::Reference< css::frame::XFrame > m_xFrame;
- css::uno::Reference< css::uno::XComponentContext > m_xContext;
-};
-
-class SearchToolbarControllersManager
-{
-public:
-
- SearchToolbarControllersManager();
- ~SearchToolbarControllersManager();
-
- static SearchToolbarControllersManager& createControllersManager();
-
- void registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL );
- void freeController ( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL );
- css::uno::Reference< css::frame::XStatusListener > findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL );
-
- void saveSearchHistory(const FindTextFieldControl* m_pFindTextFieldControl);
- void loadSearchHistory(FindTextFieldControl* m_pFindTextFieldControl);
-
-private:
-
- typedef ::std::vector< css::beans::PropertyValue > SearchToolbarControllersVec;
- typedef ::std::map< css::uno::Reference< css::frame::XFrame >, SearchToolbarControllersVec > SearchToolbarControllersMap;
- SearchToolbarControllersMap aSearchToolbarControllersMap;
- std::vector<OUString> m_aSearchStrings;
-
-};
-
-class FindTextToolbarController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
-
- FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
- virtual ~FindTextToolbarController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override;
-
- // XToolbarController
- virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- DECL_LINK(EditModifyHdl, Edit&, void);
-
-private:
-
- void textfieldChanged();
-
- VclPtr<FindTextFieldControl> m_pFindTextFieldControl;
-
- sal_uInt16 m_nDownSearchId; // item position of findbar
- sal_uInt16 m_nUpSearchId; // item position of findbar
-
-};
-
-class ExitSearchToolboxController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
- ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- virtual ~ExitSearchToolboxController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
-
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
-};
-
-class UpDownSearchToolboxController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
- enum Type { UP, DOWN };
-
- UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
- virtual ~UpDownSearchToolboxController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
-
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
-private:
- Type meType;
-};
-
-class MatchCaseToolboxController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
- MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- virtual ~MatchCaseToolboxController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
-
- // XToolbarController
- virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
-private:
- VclPtr<CheckBox> m_pMatchCaseControl;
-};
-
-class SearchFormattedToolboxController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
- SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- virtual ~SearchFormattedToolboxController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
-
- // XToolbarController
- virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
-private:
- VclPtr<CheckBox> m_pSearchFormattedControl;
-};
-
-class FindAllToolboxController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
- FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- virtual ~FindAllToolboxController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
-
- // XToolbarController
- virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
-};
-
-class SearchLabelToolboxController : public svt::ToolboxController,
- public css::lang::XServiceInfo
-{
-public:
- SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- virtual ~SearchLabelToolboxController() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw () override;
- virtual void SAL_CALL release() throw () override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XComponent
- virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
-
- // XToolbarController
- virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
-};
-
-// protocol handler for "vnd.sun.star.findbar:*" URLs
-// The dispatch object will be used for shortcut commands for findbar
-class FindbarDispatcher : public css::lang::XServiceInfo,
- public css::lang::XInitialization,
- public css::frame::XDispatchProvider,
- public css::frame::XDispatch,
- public ::cppu::OWeakObject
-{
-public:
-
- FindbarDispatcher();
- virtual ~FindbarDispatcher() override;
-
- // XInterface
- virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL acquire() throw() override;
- virtual void SAL_CALL release() throw() override;
-
- // XServiceInfo
- virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
- virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
-
- // XInitialization
- virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override;
-
- // XDispatchProvider
- virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& sTargetFrameName , sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) throw( css::uno::RuntimeException, std::exception ) override;
-
- // XDispatch
- virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) throw( css::uno::RuntimeException, std::exception ) override;
- virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) throw( css::uno::RuntimeException, std::exception ) override;
-
-private:
-
- css::uno::Reference< css::frame::XFrame > m_xFrame;
-
-};
-
-}
-
-#endif // INCLUDED_SVX_INC_TBUNOSEARCHCONTROLLERS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index b411c6cf18b2..3baf15615724 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -17,7 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <tbunosearchcontrollers.hxx>
+#include <sal/config.h>
+
+#include <map>
+#include <vector>
#include <config_features.h>
@@ -27,10 +30,19 @@
#include <comphelper/processfactory.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchHelper.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
#include <com/sun/star/util/URL.hpp>
@@ -38,6 +50,7 @@
#include <svl/ctloptions.hxx>
#include <svl/srchitem.hxx>
+#include <svtools/toolboxcontroller.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/svapp.hxx>
@@ -45,8 +58,10 @@
#include <rtl/ref.hxx>
#include <rtl/instance.hxx>
#include <svx/srchdlg.hxx>
-
+#include <vcl/button.hxx>
+#include <vcl/combobox.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/window.hxx>
using namespace css;
@@ -130,6 +145,24 @@ void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext
}
}
+class FindTextFieldControl : public ComboBox
+{
+public:
+ FindTextFieldControl( vcl::Window* pParent, WinBits nStyle,
+ css::uno::Reference< css::frame::XFrame >& xFrame,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext );
+
+ virtual bool PreNotify( NotifyEvent& rNEvt ) override;
+
+ void Remember_Impl(const OUString& rStr);
+ void SetTextToSelected_Impl();
+
+private:
+
+ css::uno::Reference< css::frame::XFrame > m_xFrame;
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+};
+
FindTextFieldControl::FindTextFieldControl( vcl::Window* pParent, WinBits nStyle,
css::uno::Reference< css::frame::XFrame >& xFrame,
const css::uno::Reference< css::uno::XComponentContext >& xContext) :
@@ -257,6 +290,31 @@ bool FindTextFieldControl::PreNotify( NotifyEvent& rNEvt )
return bRet;
}
+class SearchToolbarControllersManager
+{
+public:
+
+ SearchToolbarControllersManager();
+ ~SearchToolbarControllersManager();
+
+ static SearchToolbarControllersManager& createControllersManager();
+
+ void registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL );
+ void freeController ( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL );
+ css::uno::Reference< css::frame::XStatusListener > findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL );
+
+ void saveSearchHistory(const FindTextFieldControl* m_pFindTextFieldControl);
+ void loadSearchHistory(FindTextFieldControl* m_pFindTextFieldControl);
+
+private:
+
+ typedef ::std::vector< css::beans::PropertyValue > SearchToolbarControllersVec;
+ typedef ::std::map< css::uno::Reference< css::frame::XFrame >, SearchToolbarControllersVec > SearchToolbarControllersMap;
+ SearchToolbarControllersMap aSearchToolbarControllersMap;
+ std::vector<OUString> m_aSearchStrings;
+
+};
+
SearchToolbarControllersManager::SearchToolbarControllersManager()
{
}
@@ -361,6 +419,48 @@ css::uno::Reference< css::frame::XStatusListener > SearchToolbarControllersManag
return xStatusListener;
}
+class FindTextToolbarController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+
+ FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override;
+
+ // XToolbarController
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ DECL_LINK(EditModifyHdl, Edit&, void);
+
+private:
+
+ void textfieldChanged();
+
+ VclPtr<FindTextFieldControl> m_pFindTextFieldControl;
+
+ sal_uInt16 m_nDownSearchId; // item position of findbar
+ sal_uInt16 m_nUpSearchId; // item position of findbar
+
+};
+
FindTextToolbarController::FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
: svt::ToolboxController(rxContext, css::uno::Reference< css::frame::XFrame >(), OUString(COMMAND_FINDTEXT))
, m_pFindTextFieldControl(nullptr)
@@ -369,10 +469,6 @@ FindTextToolbarController::FindTextToolbarController( const css::uno::Reference<
{
}
-FindTextToolbarController::~FindTextToolbarController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL FindTextToolbarController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -501,6 +597,40 @@ void FindTextToolbarController::textfieldChanged() {
}
}
+class UpDownSearchToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ enum Type { UP, DOWN };
+
+ UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+private:
+ Type meType;
+};
+
UpDownSearchToolboxController::UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
@@ -509,10 +639,6 @@ UpDownSearchToolboxController::UpDownSearchToolboxController( const css::uno::Re
{
}
-UpDownSearchToolboxController::~UpDownSearchToolboxController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL UpDownSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -592,6 +718,38 @@ void SAL_CALL UpDownSearchToolboxController::statusChanged( const css::frame::Fe
{
}
+class MatchCaseToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
+
+ // XToolbarController
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+private:
+ VclPtr<CheckBox> m_pMatchCaseControl;
+};
+
MatchCaseToolboxController::MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
@@ -600,10 +758,6 @@ MatchCaseToolboxController::MatchCaseToolboxController( const css::uno::Referenc
{
}
-MatchCaseToolboxController::~MatchCaseToolboxController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL MatchCaseToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -684,6 +838,38 @@ void SAL_CALL MatchCaseToolboxController::statusChanged( const css::frame::Featu
{
}
+class SearchFormattedToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
+
+ // XToolbarController
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+private:
+ VclPtr<CheckBox> m_pSearchFormattedControl;
+};
+
SearchFormattedToolboxController::SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
@@ -692,10 +878,6 @@ SearchFormattedToolboxController::SearchFormattedToolboxController( const css::u
{
}
-SearchFormattedToolboxController::~SearchFormattedToolboxController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL SearchFormattedToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -776,6 +958,35 @@ void SAL_CALL SearchFormattedToolboxController::statusChanged( const css::frame:
{
}
+class FindAllToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+};
+
FindAllToolboxController::FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
@@ -783,10 +994,6 @@ FindAllToolboxController::FindAllToolboxController( const css::uno::Reference< c
{
}
-FindAllToolboxController::~FindAllToolboxController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL FindAllToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -859,6 +1066,35 @@ void SAL_CALL FindAllToolboxController::statusChanged( const css::frame::Feature
{
}
+class ExitSearchToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
+
+ // XToolbarController
+ virtual void SAL_CALL execute( sal_Int16 KeyModifier ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+};
+
ExitSearchToolboxController::ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
@@ -866,10 +1102,6 @@ ExitSearchToolboxController::ExitSearchToolboxController( const css::uno::Refere
{
}
-ExitSearchToolboxController::~ExitSearchToolboxController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL ExitSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -953,6 +1185,35 @@ void SAL_CALL ExitSearchToolboxController::statusChanged( const css::frame::Feat
{
}
+class SearchLabelToolboxController : public svt::ToolboxController,
+ public css::lang::XServiceInfo
+{
+public:
+ SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw () override;
+ virtual void SAL_CALL release() throw () override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception) override;
+
+ // XToolbarController
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception ) override;
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) override;
+};
+
SearchLabelToolboxController::SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
: svt::ToolboxController( rxContext,
css::uno::Reference< css::frame::XFrame >(),
@@ -960,10 +1221,6 @@ SearchLabelToolboxController::SearchLabelToolboxController( const css::uno::Refe
{
}
-SearchLabelToolboxController::~SearchLabelToolboxController()
-{
-}
-
// XInterface
css::uno::Any SAL_CALL SearchLabelToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception )
{
@@ -1031,6 +1288,47 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::
return VCLUnoHelper::GetInterface(pSL);
}
+// protocol handler for "vnd.sun.star.findbar:*" URLs
+// The dispatch object will be used for shortcut commands for findbar
+class FindbarDispatcher : public css::lang::XServiceInfo,
+ public css::lang::XInitialization,
+ public css::frame::XDispatchProvider,
+ public css::frame::XDispatch,
+ public ::cppu::OWeakObject
+{
+public:
+
+ FindbarDispatcher();
+ virtual ~FindbarDispatcher() override;
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL acquire() throw() override;
+ virtual void SAL_CALL release() throw() override;
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override;
+
+ // XDispatchProvider
+ virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& sTargetFrameName , sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) throw( css::uno::RuntimeException, std::exception ) override;
+
+ // XDispatch
+ virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) throw( css::uno::RuntimeException, std::exception ) override;
+ virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) throw( css::uno::RuntimeException, std::exception ) override;
+
+private:
+
+ css::uno::Reference< css::frame::XFrame > m_xFrame;
+
+};
+
FindbarDispatcher::FindbarDispatcher()
{
}