[Libreoffice-commits] core.git: 22 commits - avmedia/source framework/inc framework/source framework/util sfx2/source sfx2/util svtools/source xmlsecurity/source
Matúš Kukan
matus.kukan at collabora.com
Fri Jan 17 03:28:24 PST 2014
avmedia/source/vlc/vlcframegrabber.cxx | 3
avmedia/source/vlc/vlcmanager.cxx | 3
avmedia/source/vlc/vlcplayer.cxx | 3
avmedia/source/vlc/vlcwindow.cxx | 3
avmedia/source/win/framegrabber.cxx | 17
avmedia/source/win/manager.cxx | 13
avmedia/source/win/player.cxx | 55
avmedia/source/win/window.cxx | 3
framework/inc/dispatch/dispatchprovider.hxx | 4
framework/inc/dispatch/interceptionhelper.hxx | 2
framework/inc/dispatch/menudispatcher.hxx | 2
framework/inc/dispatch/popupmenudispatcher.hxx | 1
framework/inc/helper/statusindicatorfactory.hxx | 29
framework/inc/jobs/jobdispatch.hxx | 140 --
framework/inc/services/frame.hxx | 450 -------
framework/inc/services/layoutmanager.hxx | 28
framework/inc/services/modulemanager.hxx | 209 ---
framework/inc/services/tabwindowservice.hxx | 194 ---
framework/inc/services/urltransformer.hxx | 192 ---
framework/inc/uiconfiguration/imagemanager.hxx | 34
framework/inc/uiconfiguration/uiconfigurationmanager.hxx | 181 ---
framework/inc/uielement/controlmenucontroller.hxx | 98 -
framework/inc/uielement/langselectionstatusbarcontroller.hxx | 83 -
framework/inc/uielement/objectmenucontroller.hxx | 69 -
framework/inc/uielement/popuptoolbarcontroller.hxx | 100 -
framework/inc/uielement/recentfilesmenucontroller.hxx | 82 -
framework/inc/uifactory/addonstoolboxfactory.hxx | 71 -
framework/source/accelerators/globalacceleratorconfiguration.cxx | 116 +-
framework/source/dispatch/interceptionhelper.cxx | 2
framework/source/dispatch/menudispatcher.cxx | 1
framework/source/dispatch/popupmenudispatcher.cxx | 5
framework/source/helper/statusindicatorfactory.cxx | 28
framework/source/inc/accelerators/globalacceleratorconfiguration.hxx | 95 -
framework/source/jobs/jobdispatch.cxx | 141 ++
framework/source/layoutmanager/layoutmanager.cxx | 14
framework/source/register/registerservices.cxx | 36
framework/source/services/frame.cxx | 578 ++++++++--
framework/source/services/modulemanager.cxx | 199 ++-
framework/source/services/tabwindowservice.cxx | 192 ++-
framework/source/services/urltransformer.cxx | 95 +
framework/source/uiconfiguration/imagemanager.cxx | 27
framework/source/uiconfiguration/uiconfigurationmanager.cxx | 183 ++-
framework/source/uielement/controlmenucontroller.cxx | 113 +
framework/source/uielement/langselectionstatusbarcontroller.cxx | 112 +
framework/source/uielement/objectmenucontroller.cxx | 78 +
framework/source/uielement/popuptoolbarcontroller.cxx | 206 +++
framework/source/uielement/progressbarwrapper.cxx | 1
framework/source/uielement/recentfilesmenucontroller.cxx | 108 +
framework/source/uifactory/addonstoolboxfactory.cxx | 76 +
framework/util/fwk.component | 54
sfx2/source/appl/appuno.cxx | 30
sfx2/util/sfx.component | 2
svtools/source/hatchwindow/documentcloser.cxx | 73 -
xmlsecurity/source/framework/decryptorimpl.cxx | 11
xmlsecurity/source/framework/encryptorimpl.cxx | 11
xmlsecurity/source/framework/saxeventkeeperimpl.cxx | 11
xmlsecurity/source/framework/signaturecreatorimpl.cxx | 11
xmlsecurity/source/framework/signatureverifierimpl.cxx | 11
xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 11
59 files changed, 1997 insertions(+), 2703 deletions(-)
New commits:
commit 307878b6e2418e34478456e650d1f0fe1636bd8a
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 16 23:15:46 2014 +0100
fwk: Constructor feature for ControlMenuController.
Change-Id: I789205c1bc9ceefda003d9887ac4409625539537
diff --git a/framework/inc/uielement/controlmenucontroller.hxx b/framework/inc/uielement/controlmenucontroller.hxx
deleted file mode 100644
index 14f601e..0000000
--- a/framework/inc/uielement/controlmenucontroller.hxx
+++ /dev/null
@@ -1,98 +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_FRAMEWORK_INC_UIELEMENT_CONTROLMENUCONTROLLER_HXX
-#define INCLUDED_FRAMEWORK_INC_UIELEMENT_CONTROLMENUCONTROLLER_HXX
-
-#include <macros/xserviceinfo.hxx>
-#include <stdtypes.h>
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XStatusListener.hpp>
-#include <com/sun/star/frame/XPopupMenuController.hpp>
-#include <com/sun/star/frame/status/Verb.hpp>
-#include <com/sun/star/frame/XModel.hpp>
-
-#include <svtools/popupmenucontrollerbase.hxx>
-#include <toolkit/awt/vclxmenu.hxx>
-#include <cppuhelper/weak.hxx>
-#include <rtl/ustring.hxx>
-
-class PopupMenu;
-namespace framework
-{
- class ControlMenuController : public svt::PopupMenuControllerBase
- {
- using svt::PopupMenuControllerBase::disposing;
-
- public:
- ControlMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
- virtual ~ControlMenuController();
-
- // XServiceInfo
- DECLARE_XSERVICEINFO
-
- // XPopupMenuController
- virtual void SAL_CALL updatePopupMenu() throw (::com::sun::star::uno::RuntimeException);
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
-
- // XMenuListener
- virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- // XEventListener
- virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
-
- private:
- virtual void impl_setPopupMenu();
- virtual void impl_select(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& _xDispatch,const ::com::sun::star::util::URL& aURL);
-
- class UrlToDispatchMap : public ::boost::unordered_map< OUString,
- com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
- OUStringHash,
- ::std::equal_to< OUString > >
- {
- public:
- inline void free()
- {
- UrlToDispatchMap().swap( *this );
- }
- };
-
- void updateImagesPopupMenu( PopupMenu* pPopupMenu );
- void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
-
- sal_Bool m_bShowMenuImages : 1;
- PopupMenu* m_pResPopupMenu;
- UrlToDispatchMap m_aURLToDispatchMap;
- };
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_CONTROLMENUCONTROLLER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index 748da64..53efb71 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -37,7 +37,6 @@
#include <jobs/jobexecutor.hxx>
#include <uifactory/uielementfactorymanager.hxx>
#include <uifactory/uicontrollerfactory.hxx>
-#include <uielement/controlmenucontroller.hxx>
#include <uielement/uicommanddescription.hxx>
#include <uiconfiguration/moduleuicfgsupplier.hxx>
#include <uiconfiguration/moduleuiconfigurationmanager.hxx>
@@ -62,7 +61,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::JobExecutor ) else
IFFACTORY( ::framework::UIElementFactoryManager ) else
IFFACTORY( ::framework::PopupMenuControllerFactory ) else
- IFFACTORY( ::framework::ControlMenuController ) else
IFFACTORY( ::framework::UICommandDescription ) else
IFFACTORY( ::framework::ModuleUIConfigurationManagerSupplier ) else
IFFACTORY( ::framework::ModuleUIConfigurationManager ) else
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index b5e4302..a3846d4 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -17,29 +17,30 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <sal/macros.h>
-#include <uielement/controlmenucontroller.hxx>
+#include <sal/config.h>
#include <threadhelp/resetableguard.hxx>
-#include "services.h"
+#include <stdtypes.h>
-#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/awt/MenuItemStyle.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/frame/XPopupMenuController.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
#include <vcl/i18nhelp.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
#include <svl/solar.hrc>
#include <tools/rcid.h>
#include <vcl/image.hxx>
#include <svtools/menuoptions.hxx>
+#include <svtools/popupmenucontrollerbase.hxx>
#include <osl/mutex.hxx>
// Copied from svx
@@ -163,28 +164,82 @@ static const char* aCommands[] =
".uno:ConvertToSpinButton"
};
-//_________________________________________________________________________________________________________________
-// Defines
-//_________________________________________________________________________________________________________________
-
+using namespace css;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
using namespace com::sun::star::beans;
-using namespace com::sun::star::util;
-using namespace com::sun::star::style;
-using namespace com::sun::star::container;
-namespace framework
+namespace {
+
+class ControlMenuController : public svt::PopupMenuControllerBase
{
+ using svt::PopupMenuControllerBase::disposing;
+
+public:
+ ControlMenuController( const uno::Reference< uno::XComponentContext >& xContext );
+ virtual ~ControlMenuController();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.ControlMenuController");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.frame.PopupMenuController");
+ return aSeq;
+ }
+
+
+ // XPopupMenuController
+ virtual void SAL_CALL updatePopupMenu() throw (uno::RuntimeException);
-DEFINE_XSERVICEINFO_MULTISERVICE_2 ( ControlMenuController ,
- OWeakObject ,
- SERVICENAME_POPUPMENUCONTROLLER ,
- IMPLEMENTATIONNAME_CONTROLMENUCONTROLLER
- )
+ // XInitialization
+ virtual void SAL_CALL initialize( const uno::Sequence< uno::Any >& aArguments ) throw (uno::Exception, uno::RuntimeException);
-DEFINE_INIT_SERVICE ( ControlMenuController, {} )
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( uno::RuntimeException );
+
+ // XMenuListener
+ virtual void SAL_CALL itemActivated( const awt::MenuEvent& rEvent ) throw (uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw ( uno::RuntimeException );
+
+private:
+ virtual void impl_setPopupMenu();
+ virtual void impl_select(const uno::Reference< frame::XDispatch >& _xDispatch,const util::URL& aURL);
+
+ class UrlToDispatchMap : public ::boost::unordered_map< OUString,
+ uno::Reference< frame::XDispatch >,
+ OUStringHash,
+ ::std::equal_to< OUString > >
+ {
+ public:
+ inline void free()
+ {
+ UrlToDispatchMap().swap( *this );
+ }
+ };
+
+ void updateImagesPopupMenu( PopupMenu* pPopupMenu );
+ void fillPopupMenu( uno::Reference< awt::XPopupMenu >& rPopupMenu );
+
+ sal_Bool m_bShowMenuImages : 1;
+ PopupMenu* m_pResPopupMenu;
+ UrlToDispatchMap m_aURLToDispatchMap;
+};
ControlMenuController::ControlMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) :
svt::PopupMenuControllerBase( xContext ),
@@ -372,7 +427,7 @@ void SAL_CALL ControlMenuController::updatePopupMenu() throw (::com::sun::star::
if ( m_xFrame.is() && m_xPopupMenu.is() )
{
- URL aTargetURL;
+ css::util::URL aTargetURL;
Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY );
fillPopupMenu( m_xPopupMenu );
m_aURLToDispatchMap.free();
@@ -403,4 +458,14 @@ void SAL_CALL ControlMenuController::initialize( const Sequence< Any >& aArgumen
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_ControlMenuController_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ rtl::Reference<ControlMenuController> x(new ControlMenuController(context));
+ x->acquire();
+ return static_cast<cppu::OWeakObject *>(x.get());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 9dc825a..8121154 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -29,7 +29,8 @@
<implementation name="com.sun.star.comp.framework.AutoRecovery">
<service name="com.sun.star.frame.AutoRecovery"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.ControlMenuController">
+ <implementation name="com.sun.star.comp.framework.ControlMenuController"
+ constructor="com_sun_star_comp_framework_ControlMenuController_get_implementation">
<service name="com.sun.star.frame.PopupMenuController"/>
</implementation>
<implementation name="com.sun.star.comp.framework.Desktop">
commit 9622a8072c5ef2af537e492cdd242d85ee22d4d7
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 16 22:06:39 2014 +0100
fwk: Constructor feature for RecentFilesMenuController.
Change-Id: I7bb943a6fe7526264e8465faeb7e86adbf3cb737
diff --git a/framework/inc/uielement/recentfilesmenucontroller.hxx b/framework/inc/uielement/recentfilesmenucontroller.hxx
deleted file mode 100644
index 494f13c..0000000
--- a/framework/inc/uielement/recentfilesmenucontroller.hxx
+++ /dev/null
@@ -1,82 +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_FRAMEWORK_INC_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX
-#define INCLUDED_FRAMEWORK_INC_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX
-
-#include <macros/xserviceinfo.hxx>
-#include <svtools/popupmenucontrollerbase.hxx>
-
-namespace framework
-{
- struct LoadRecentFile
- {
- ::com::sun::star::util::URL aTargetURL;
- ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgSeq;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
- };
-
- class RecentFilesMenuController : public svt::PopupMenuControllerBase
- {
- using svt::PopupMenuControllerBase::disposing;
-
- public:
- RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext );
- virtual ~RecentFilesMenuController();
-
- // XServiceInfo
- DECLARE_XSERVICEINFO
-
- // XStatusListener
- virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
-
- // XMenuListener
- virtual void SAL_CALL itemSelected( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL itemActivated( const ::com::sun::star::awt::MenuEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException);
-
- // XDispatchProvider
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XDispatch
- virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqProperties ) throw( ::com::sun::star::uno::RuntimeException );
-
- // XEventListener
- virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
-
- DECL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile* );
-
- private:
- virtual void impl_setPopupMenu();
- struct RecentFile
- {
- OUString aURL;
- OUString aTitle;
- };
-
- void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
- void executeEntry( sal_Int32 nIndex );
-
- std::vector< RecentFile > m_aRecentFilesItems;
- sal_Bool m_bDisabled : 1;
- };
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_RECENTFILESMENUCONTROLLER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index b6c560d..748da64 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -47,7 +47,6 @@
#include <uifactory/toolboxfactory.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
#include <services/autorecovery.hxx>
-#include <uielement/recentfilesmenucontroller.hxx>
#include <uifactory/statusbarfactory.hxx>
#include <uiconfiguration/uicategorydescription.hxx>
#include <services/sessionlistener.hxx>
@@ -74,7 +73,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::ToolbarControllerFactory ) else
IFFACTORY( ::framework::AutoRecovery ) else
- IFFACTORY( ::framework::RecentFilesMenuController ) else
IFFACTORY( ::framework::StatusBarFactory ) else
IFFACTORY( ::framework::UICategoryDescription ) else
IFFACTORY( ::framework::SessionListener ) else
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 3866355..82136bf 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -17,61 +17,106 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <uielement/recentfilesmenucontroller.hxx>
-#include <threadhelp/resetableguard.hxx>
-#include "services.h"
-
#include <classes/resource.hrc>
#include <classes/fwkresid.hxx>
-#include <com/sun/star/util/XStringWidth.hpp>
-
#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/file.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
+#include <svtools/popupmenucontrollerbase.hxx>
#include <tools/urlobj.hxx>
#include <unotools/historyoptions.hxx>
#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
-#include <osl/mutex.hxx>
+using namespace css;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
+using namespace framework;
#define MAX_MENU_ITEMS 99
+namespace {
+
static const char CMD_CLEAR_LIST[] = ".uno:ClearRecentFileList";
static const char CMD_PREFIX[] = "vnd.sun.star.popup:RecentFileList?entry=";
static const char MENU_SHORTCUT[] = "~N. ";
-namespace framework
+struct LoadRecentFile
{
+ util::URL aTargetURL;
+ uno::Sequence< beans::PropertyValue > aArgSeq;
+ uno::Reference< frame::XDispatch > xDispatch;
+};
-class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XStringWidth >
+class RecentFilesMenuController : public svt::PopupMenuControllerBase
{
- public:
- RecentFilesStringLength() {}
- virtual ~RecentFilesStringLength() {}
+ using svt::PopupMenuControllerBase::disposing;
- // XStringWidth
- sal_Int32 SAL_CALL queryStringWidth( const OUString& aString )
- throw (::com::sun::star::uno::RuntimeException)
- {
- return aString.getLength();
- }
-};
+public:
+ RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext );
+ virtual ~RecentFilesMenuController();
+
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.RecentFilesMenuController");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
-DEFINE_XSERVICEINFO_MULTISERVICE_2 ( RecentFilesMenuController ,
- OWeakObject ,
- SERVICENAME_POPUPMENUCONTROLLER ,
- IMPLEMENTATIONNAME_RECENTFILESMENUCONTROLLER
- )
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.frame.PopupMenuController");
+ return aSeq;
+ }
+
+ // XStatusListener
+ virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( uno::RuntimeException );
+
+ // XMenuListener
+ virtual void SAL_CALL itemSelected( const awt::MenuEvent& rEvent ) throw (uno::RuntimeException);
+ virtual void SAL_CALL itemActivated( const awt::MenuEvent& rEvent ) throw (uno::RuntimeException);
-DEFINE_INIT_SERVICE ( RecentFilesMenuController, {} )
+ // XDispatchProvider
+ virtual uno::Reference< frame::XDispatch > SAL_CALL queryDispatch( const util::URL& aURL, const OUString& sTarget, sal_Int32 nFlags ) throw( uno::RuntimeException );
-RecentFilesMenuController::RecentFilesMenuController( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) :
+ // XDispatch
+ virtual void SAL_CALL dispatch( const util::URL& aURL, const uno::Sequence< beans::PropertyValue >& seqProperties ) throw( uno::RuntimeException );
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( uno::RuntimeException );
+
+ DECL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile* );
+
+private:
+ virtual void impl_setPopupMenu();
+ struct RecentFile
+ {
+ OUString aURL;
+ OUString aTitle;
+ };
+
+ void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu );
+ void executeEntry( sal_Int32 nIndex );
+
+ std::vector< RecentFile > m_aRecentFilesItems;
+ sal_Bool m_bDisabled : 1;
+};
+
+RecentFilesMenuController::RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext ) :
svt::PopupMenuControllerBase( xContext ),
m_bDisabled( sal_False )
{
@@ -96,7 +141,6 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
if ( pVCLPopupMenu )
{
Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST );
- Reference< XStringWidth > xStringLength( new RecentFilesStringLength );
int nPickListMenuItems = ( aHistoryList.getLength() > MAX_MENU_ITEMS ) ? MAX_MENU_ITEMS : aHistoryList.getLength();
m_aRecentFilesItems.clear();
@@ -377,4 +421,14 @@ IMPL_STATIC_LINK_NOINSTANCE( RecentFilesMenuController, ExecuteHdl_Impl, LoadRec
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_RecentFilesMenuController_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ rtl::Reference<RecentFilesMenuController> x(new RecentFilesMenuController(context));
+ x->acquire();
+ return static_cast<cppu::OWeakObject *>(x.get());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index c37310f..9dc825a 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -93,7 +93,8 @@
<implementation name="com.sun.star.comp.framework.PopupMenuControllerFactory">
<service name="com.sun.star.frame.PopupMenuControllerFactory"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.RecentFilesMenuController">
+ <implementation name="com.sun.star.comp.framework.RecentFilesMenuController"
+ constructor="com_sun_star_comp_framework_RecentFilesMenuController_get_implementation">
<service name="com.sun.star.frame.PopupMenuController"/>
</implementation>
<implementation name="com.sun.star.comp.framework.StatusBarControllerFactory">
commit 9f6534100c470fb7d15b5d72821ea33fcce01983
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 16 21:28:41 2014 +0100
Pass initialize arguments directly into ODocumentCloser' ctor.
Change-Id: I1bcfe6d59230a4137b0f78d072c895e596ff6f15
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index d7f9e8c..94058f2 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -23,13 +23,11 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx>
-#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
@@ -46,8 +44,7 @@ namespace {
// the service is implemented as a wrapper to be able to die by refcount
// the disposing mechanics is required for java related scenarios
-class ODocumentCloser : public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XComponent,
- ::com::sun::star::lang::XInitialization,
+class ODocumentCloser : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XComponent,
::com::sun::star::lang::XServiceInfo >
{
::osl::Mutex m_aMutex;
@@ -55,10 +52,9 @@ class ODocumentCloser : public ::cppu::WeakImplHelper3< ::com::sun::star::lang::
::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners
sal_Bool m_bDisposed;
- sal_Bool m_bInitialized;
public:
- ODocumentCloser();
+ ODocumentCloser(const uno::Sequence< uno::Any >& aArguments);
~ODocumentCloser();
// XComponent
@@ -66,9 +62,6 @@ public:
virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
-// XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
@@ -152,17 +145,26 @@ IMPL_STATIC_LINK( MainThreadFrameCloserRequest, worker, MainThreadFrameCloserReq
return 0;
}
-
-// ====================================================================
-// ODocumentCloser
-// ====================================================================
-
-// --------------------------------------------------------
-ODocumentCloser::ODocumentCloser()
+ODocumentCloser::ODocumentCloser(const uno::Sequence< uno::Any >& aArguments)
: m_pListenersContainer( NULL )
, m_bDisposed( sal_False )
-, m_bInitialized( sal_False )
{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_refCount )
+ throw uno::RuntimeException(); // the object must be refcounted already!
+
+ sal_Int32 nLen = aArguments.getLength();
+ if ( nLen != 1 )
+ throw lang::IllegalArgumentException(
+ OUString("Wrong count of parameters!" ),
+ uno::Reference< uno::XInterface >(),
+ 0 );
+
+ if ( !( aArguments[0] >>= m_xFrame ) || !m_xFrame.is() )
+ throw lang::IllegalArgumentException(
+ OUString("Nonempty reference is expected as the first argument!" ),
+ uno::Reference< uno::XInterface >(),
+ 0 );
}
// --------------------------------------------------------
@@ -223,37 +225,6 @@ void SAL_CALL ODocumentCloser::removeEventListener( const uno::Reference< lang::
m_pListenersContainer->removeInterface( xListener );
}
-// XInitialization
-// --------------------------------------------------------
-void SAL_CALL ODocumentCloser::initialize( const uno::Sequence< uno::Any >& aArguments )
- throw (uno::Exception, uno::RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if ( m_bInitialized )
- throw frame::DoubleInitializationException();
-
- if ( m_bDisposed )
- throw lang::DisposedException(); // TODO
-
- if ( !m_refCount )
- throw uno::RuntimeException(); // the object must be refcounted already!
-
- sal_Int32 nLen = aArguments.getLength();
- if ( nLen != 1 )
- throw lang::IllegalArgumentException(
- OUString("Wrong count of parameters!" ),
- uno::Reference< uno::XInterface >(),
- 0 );
-
- if ( !( aArguments[0] >>= m_xFrame ) || !m_xFrame.is() )
- throw lang::IllegalArgumentException(
- OUString("Nonempty reference is expected as the first argument!" ),
- uno::Reference< uno::XInterface >(),
- 0 );
-
- m_bInitialized = sal_True;
-}
-
// XServiceInfo
OUString SAL_CALL ODocumentCloser::getImplementationName( )
throw (uno::RuntimeException)
@@ -279,9 +250,9 @@ uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames()
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_embed_DocumentCloser_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
- css::uno::Sequence<css::uno::Any> const &)
+ css::uno::Sequence<css::uno::Any> const &arguments)
{
- rtl::Reference<ODocumentCloser> x(new ODocumentCloser);
+ rtl::Reference<ODocumentCloser> x(new ODocumentCloser(arguments));
x->acquire();
return static_cast<cppu::OWeakObject *>(x.get());
}
commit f36fba3b854e4b4e2a79084ae56d1037c159e160
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 9 20:53:32 2014 +0100
fwk: Use constructor feature for Frame.
Change-Id: I5f7ee46671b22d17c5cb060f96342727d566fa21
diff --git a/framework/inc/dispatch/dispatchprovider.hxx b/framework/inc/dispatch/dispatchprovider.hxx
index 741930a..6c6e928 100644
--- a/framework/inc/dispatch/dispatchprovider.hxx
+++ b/framework/inc/dispatch/dispatchprovider.hxx
@@ -20,8 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_DISPATCHPROVIDER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_DISPATCHPROVIDER_HXX
-#include <services/frame.hxx>
-
#include <classes/protocolhandlercache.hxx>
#include <threadhelp/threadhelpbase.hxx>
@@ -35,7 +33,9 @@
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weakref.hxx>
diff --git a/framework/inc/dispatch/interceptionhelper.hxx b/framework/inc/dispatch/interceptionhelper.hxx
index 529256b..cceb602 100644
--- a/framework/inc/dispatch/interceptionhelper.hxx
+++ b/framework/inc/dispatch/interceptionhelper.hxx
@@ -20,13 +20,11 @@
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_INTERCEPTIONHELPER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_INTERCEPTIONHELPER_HXX
-#include <services/frame.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/generic.hxx>
#include <general.h>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
diff --git a/framework/inc/dispatch/menudispatcher.hxx b/framework/inc/dispatch/menudispatcher.hxx
index 7a957d5..8a6c25a 100644
--- a/framework/inc/dispatch/menudispatcher.hxx
+++ b/framework/inc/dispatch/menudispatcher.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_FRAMEWORK_INC_DISPATCH_MENUDISPATCHER_HXX
#include <classes/taskcreator.hxx>
-#include <services/frame.hxx>
#include <macros/generic.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
@@ -40,6 +39,7 @@
#include <com/sun/star/frame/XLoadEventListener.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp>
#include <cppuhelper/implbase2.hxx>
diff --git a/framework/inc/dispatch/popupmenudispatcher.hxx b/framework/inc/dispatch/popupmenudispatcher.hxx
index c2fe7de..3ec5d83 100644
--- a/framework/inc/dispatch/popupmenudispatcher.hxx
+++ b/framework/inc/dispatch/popupmenudispatcher.hxx
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_POPUPMENUDISPATCHER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_POPUPMENUDISPATCHER_HXX
-#include <services/frame.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx
deleted file mode 100644
index ebd4001..0000000
--- a/framework/inc/services/frame.hxx
+++ /dev/null
@@ -1,450 +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_FRAMEWORK_INC_SERVICES_FRAME_HXX
-#define INCLUDED_FRAMEWORK_INC_SERVICES_FRAME_HXX
-
-#include <classes/framecontainer.hxx>
-#include <classes/propertysethelper.hxx>
-#include <threadhelp/resetableguard.hxx>
-#include <threadhelp/writeguard.hxx>
-#include <threadhelp/readguard.hxx>
-#include <threadhelp/threadhelpbase.hxx>
-
-#include <threadhelp/transactionbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-#include <general.h>
-
-#include <com/sun/star/awt/XTopWindowListener.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/awt/XTopWindow.hpp>
-#include <com/sun/star/awt/XWindowListener.hpp>
-#include <com/sun/star/awt/XFocusListener.hpp>
-#include <com/sun/star/awt/FocusEvent.hpp>
-#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
-#include <com/sun/star/document/XActionLockable.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
-#include <com/sun/star/frame/XFrame2.hpp>
-#include <com/sun/star/frame/XFrameActionListener.hpp>
-#include <com/sun/star/frame/XLayoutManager2.hpp>
-#include <com/sun/star/frame/XTitle.hpp>
-#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
-#include <com/sun/star/task/XStatusIndicator.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
-
-#include <unotools/cmdoptions.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
-#include <cppuhelper/weak.hxx>
-#include <rtl/string.hxx>
-
-namespace framework{
-
-// This enum can be used to set different active states of frames
-enum EActiveState
-{
- E_INACTIVE , // I'am not a member of active path in tree and i don't have the focus.
- E_ACTIVE , // I'am in the middle of an active path in tree and i don't have the focus.
- E_FOCUS // I have the focus now. I must a member of an active path!
-};
-
-class WindowCommandDispatch;
-
-/*-************************************************************************************************************//**
- @short implements a normal frame of hierarchy
- @descr An instance of these class can be a normal node in frame tree. A frame support influencing of his
- subtree, find of subframes, activate- and deactivate-mechanism as well as
- set/get of a frame window, component or controller.
-
- @attention This implementation supports three states: a)uninitialized, b)working, c)disposed
- If you call wrong methods in modes a) or c) ... you will get some exceptions.
- How you should work with this service:
- i) create it by using "xServiceManager->createInstance(...)"
- ii) call XInitialization::initialize() with a valid window reference or use createInstanceWithArguments() at i)
- iii) works with object
- iv) dispose object by calling XComponent::dispose()
- After iv) all further requests are rejected by exceptions! (DisposedException)
-
- @base ThreadHelpBase
- help to guarantee correct initialized lock member at startup
- @base TransactionBase
- help to implement unbreakable interface calls
- @base OBroadcastHelper
- OPropertySetHelper
- implements the property set
- @base OWeakObject
- provides the refcount and XInterface, XWeak
-
- @devstatus ready to use
- @threadsafe yes
-*//*-*************************************************************************************************************/
-class Frame : // interfaces
- public css::lang::XTypeProvider ,
- public css::lang::XServiceInfo ,
- public css::frame::XFrame2 ,
- public css::awt::XWindowListener , // => XEventListener
- public css::awt::XTopWindowListener ,
- public css::awt::XFocusListener ,
- public css::document::XActionLockable ,
- public css::util::XCloseable , // => XCloseBroadcaster
- public css::frame::XComponentLoader ,
- public css::frame::XTitle ,
- public css::frame::XTitleChangeBroadcaster ,
- // base classes
- // Order is necessary for right initialization of this class!
- public ThreadHelpBase ,
- public TransactionBase ,
- public PropertySetHelper , // helper implements ThreadHelpbase, TransactionBase, XPropertySet, XPropertySetInfo
- public ::cppu::OWeakObject // helper implements XInterface, XWeak
-{
- //-------------------------------------------------------------------------------------------------------------
- // public methods
- //-------------------------------------------------------------------------------------------------------------
-
- public:
-
- //---------------------------------------------------------------------------------------------------------
- // constructor / destructor
- //---------------------------------------------------------------------------------------------------------
- Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext );
- virtual ~Frame( );
-
- //---------------------------------------------------------------------------------------------------------
- // XInterface, XTypeProvider, XServiceInfo
- //---------------------------------------------------------------------------------------------------------
- FWK_DECLARE_XINTERFACE
- FWK_DECLARE_XTYPEPROVIDER
- DECLARE_XSERVICEINFO
-
- //---------------------------------------------------------------------------------------------------------
- // XComponentLoader
- //---------------------------------------------------------------------------------------------------------
- virtual css::uno::Reference< css::lang::XComponent > SAL_CALL loadComponentFromURL ( const OUString& sURL ,
- const OUString& sTargetFrameName ,
- sal_Int32 nSearchFlags ,
- const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) throw( css::io::IOException ,
- css::lang::IllegalArgumentException ,
- css::uno::RuntimeException );
-
-
- //---------------------------------------------------------------------------------------------------------
- // XFramesSupplier
- //---------------------------------------------------------------------------------------------------------
- virtual css::uno::Reference< css::frame::XFrames > SAL_CALL getFrames ( ) throw( css::uno::RuntimeException );
- virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getActiveFrame ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XFrame
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL initialize ( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException );
- virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL setCreator ( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException );
- virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator ( ) throw( css::uno::RuntimeException );
- virtual OUString SAL_CALL getName ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL setName ( const OUString& sName ) throw( css::uno::RuntimeException );
- virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame ( const OUString& sTargetFrameName ,
- sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException );
- virtual sal_Bool SAL_CALL isTop ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL activate ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL deactivate ( ) throw( css::uno::RuntimeException );
- virtual sal_Bool SAL_CALL isActive ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL contextChanged ( ) throw( css::uno::RuntimeException );
- virtual sal_Bool SAL_CALL setComponent ( const css::uno::Reference< css::awt::XWindow >& xComponentWindow ,
- const css::uno::Reference< css::frame::XController >& xController ) throw( css::uno::RuntimeException );
- virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow ( ) throw( css::uno::RuntimeException );
- virtual css::uno::Reference< css::frame::XController > SAL_CALL getController ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XComponent
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL dispose ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XStatusIndicatorFactory
- //---------------------------------------------------------------------------------------------------------
- virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL createStatusIndicator ( ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // 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 );
- virtual css::uno::Sequence<
- css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XDispatchProviderInterception
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL registerDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL releaseDispatchProviderInterceptor ( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XDispatchInformationProvider
- //---------------------------------------------------------------------------------------------------------
- virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups ( ) throw (css::uno::RuntimeException);
- virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(sal_Int16 nCommandGroup) throw (css::uno::RuntimeException);
-
- //---------------------------------------------------------------------------------------------------------
- // XWindowListener
- // Attention: windowResized() and windowShown() are implement only! All other are empty!
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL windowResized ( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL windowMoved ( const css::awt::WindowEvent& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
- virtual void SAL_CALL windowShown ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL windowHidden ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XFocusListener
- // Attention: focusLost() not implemented yet!
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL focusGained ( const css::awt::FocusEvent& aEvent ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL focusLost ( const css::awt::FocusEvent& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
-
- //---------------------------------------------------------------------------------------------------------
- // XTopWindowListener
- // Attention: windowActivated(), windowDeactivated() and windowClosing() are implement only! All other are empty!
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL windowActivated ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL windowDeactivated ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL windowOpened ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
- virtual void SAL_CALL windowClosing ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL windowClosed ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
- virtual void SAL_CALL windowMinimized ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
- virtual void SAL_CALL windowNormalized ( const css::lang::EventObject& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
-
- //---------------------------------------------------------------------------------------------------------
- // XEventListener
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL disposing ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XActionLockable
- //---------------------------------------------------------------------------------------------------------
- virtual sal_Bool SAL_CALL isActionLocked ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL addActionLock ( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL removeActionLock( ) throw( css::uno::RuntimeException );
- virtual void SAL_CALL setActionLocks ( sal_Int16 nLock ) throw( css::uno::RuntimeException );
- virtual sal_Int16 SAL_CALL resetActionLocks( ) throw( css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XCloseable
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL close( sal_Bool bDeliverOwnership ) throw( css::util::CloseVetoException,
- css::uno::RuntimeException );
-
- //---------------------------------------------------------------------------------------------------------
- // XCloseBroadcaster
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL addCloseListener ( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeCloseListener( const css::uno::Reference< css::util::XCloseListener >& xListener ) throw (css::uno::RuntimeException);
-
- //---------------------------------------------------------------------------------------------------------
- // XTitle
- //---------------------------------------------------------------------------------------------------------
- virtual OUString SAL_CALL getTitle( ) throw (css::uno::RuntimeException);
- virtual void SAL_CALL setTitle( const OUString& sTitle ) throw (css::uno::RuntimeException);
-
- //---------------------------------------------------------------------------------------------------------
- // XTitleChangeBroadcaster
- //---------------------------------------------------------------------------------------------------------
- virtual void SAL_CALL addTitleChangeListener ( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener) throw (css::uno::RuntimeException);
- virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListenr ) throw (css::uno::RuntimeException);
-
-
- //---------------------------------------------------------------------------------------------------------
- // XFrame2 attributes
- //---------------------------------------------------------------------------------------------------------
- virtual css::uno::Reference<css::container::XNameContainer> SAL_CALL getUserDefinedAttributes() throw (css::uno::RuntimeException);
-
- virtual css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL getDispatchRecorderSupplier() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setDispatchRecorderSupplier(const css::uno::Reference<css::frame::XDispatchRecorderSupplier>&) throw (css::uno::RuntimeException);
-
- virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getLayoutManager() throw (css::uno::RuntimeException);
- virtual void SAL_CALL setLayoutManager(const css::uno::Reference<css::uno::XInterface>&) throw (css::uno::RuntimeException);
-
-
- //---------------------------------------------------------------------------------------------------------
- // PropertySetHelper => XPropertySet, XPropertySetInfo
- //---------------------------------------------------------------------------------------------------------
- private:
-
- void impl_initializePropInfo();
-
- virtual void SAL_CALL impl_setPropertyValue(const OUString& sProperty,
- sal_Int32 nHandle ,
- const css::uno::Any& aValue );
-
- virtual css::uno::Any SAL_CALL impl_getPropertyValue(const OUString& sProperty,
- sal_Int32 nHandle );
-
- //-------------------------------------------------------------------------------------------------------------
- // private methods
- //-------------------------------------------------------------------------------------------------------------
-
- private:
-
- /*-****************************************************************************************************//**
- @short helper methods
- @descr Follow methods are needed at different points of our code (more then ones!).
-
- @attention Threadsafe methods are signed by "implts_..."!
- *//*-*****************************************************************************************************/
-
- // threadsafe
- void implts_sendFrameActionEvent ( const css::frame::FrameAction& aAction );
- void implts_resizeComponentWindow ( );
- void implts_setIconOnWindow ( );
- void implts_startWindowListening ( );
- void implts_stopWindowListening ( );
- void implts_saveWindowAttributes ( );
- void implts_checkSuicide ( );
- void implts_forgetSubFrames ( );
- DECL_LINK( implts_windowClosing, void* );
- css::uno::Reference< css::awt::XTopWindow > impl_searchTopWindow ( const css::uno::Reference< css::awt::XWindow >& xWindow );
-
- // non threadsafe
- void impl_checkMenuCloser ( );
- void impl_setCloser ( const css::uno::Reference< css::frame::XFrame2 >& xFrame ,
- sal_Bool bState );
- void impl_disposeContainerWindow ( css::uno::Reference< css::awt::XWindow >& xWindow );
- static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor( );
-
- //-------------------------------------------------------------------------------------------------------------
- // debug methods
- // (should be private everyway!)
- //-------------------------------------------------------------------------------------------------------------
-
- /*-****************************************************************************************************//**
- @short debug-method to check incoming parameter of some other mehods of this class
- @descr The following methods are used to check parameters for other methods
- of this class. The return value is used directly for an ASSERT(...).
-
- @attention This methods are static and can't use our member directly! It's better for threadsafe code...
- because we call it with references or pointer to check variables ... and must make it safe
- by himself!
-
- @seealso ASSERTs in implementation!
-
- @param references to checking variables
- @return sal_True ,on invalid parameter
- @return sal_False ,otherwise
-
- @onerror We return sal_True
- *//*-*****************************************************************************************************/
-
- private:
-
- static sal_Bool implcp_ctor ( const css::uno::Reference< css::uno::XComponentContext >& xContext );
- static sal_Bool implcp_setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame );
- static sal_Bool implcp_addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
- static sal_Bool implcp_removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener );
- static sal_Bool implcp_addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
- static sal_Bool implcp_removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener );
- static sal_Bool implcp_windowResized ( const css::awt::WindowEvent& aEvent );
- static sal_Bool implcp_focusGained ( const css::awt::FocusEvent& aEvent );
- static sal_Bool implcp_windowActivated ( const css::lang::EventObject& aEvent );
- static sal_Bool implcp_windowDeactivated ( const css::lang::EventObject& aEvent );
- static sal_Bool implcp_disposing ( const css::lang::EventObject& aEvent );
-
- //*************************************************************************************************************
- // variables
- // -threadsafe by own read/write lock "m_aLock"
- //*************************************************************************************************************
- private:
-
- css::uno::Reference< css::uno::XComponentContext > m_xContext ; /// reference to factory, which has create this instance
- css::uno::Reference< css::task::XStatusIndicatorFactory > m_xIndicatorFactoryHelper ; /// reference to factory helper to create status indicator objects
- css::uno::WeakReference< css::task::XStatusIndicator > m_xIndicatorInterception ; /// points to an external set progress, which should be used instead of the internal one.
- css::uno::Reference< css::frame::XDispatchProvider > m_xDispatchHelper ; /// helper for XDispatch/Provider and interception interfaces
- css::uno::Reference< css::frame::XFrames > m_xFramesHelper ; /// helper for XFrames, XIndexAccess and XElementAccess interfaces
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer ; /// container for ALL Listener
- css::uno::Reference< css::frame::XFramesSupplier > m_xParent ; /// parent of this frame
- css::uno::Reference< css::awt::XWindow > m_xContainerWindow ; /// containerwindow of this frame for embedded components
- css::uno::Reference< css::awt::XWindow > m_xComponentWindow ; /// window of the actual component
- css::uno::Reference< css::frame::XController > m_xController ; /// controller of the actual frame
- css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > m_xDropTargetListener ; /// listen to drag & drop
- EActiveState m_eActiveState ; /// state, if i'am a member of active path in tree or i have the focus or ...
- OUString m_sName ; /// name of this frame
- sal_Bool m_bIsFrameTop ; /// frame has no parent or the parent is a taskor the desktop
- sal_Bool m_bConnected ; /// due to FrameActionEvent
- sal_Int16 m_nExternalLockCount ;
- css::uno::Reference< css::frame::XDispatchRecorderSupplier > m_xDispatchRecorderSupplier ; /// is used for dispatch recording and will be set/get from outside. Frame provide it only!
- SvtCommandOptions m_aCommandOptions ; /// ref counted class to support disabling commands defined by configuration file
- sal_Bool m_bSelfClose ; /// in case of CloseVetoException on method close() wqs thrown by ourself - we must close ourself later if no internal processes are running
- sal_Bool m_bIsHidden ; /// indicates, if this frame is used in hidden mode or not
- static css::uno::WeakReference< css::frame::XFrame2 > m_xCloserFrame ; /// holds the only frame, which must show the special closer menu item (can be NULL!)
- css::uno::Reference< ::css::frame::XLayoutManager2 > m_xLayoutManager ; /// is used to layout the child windows of the frame.
- css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper ;
- css::uno::Reference< css::frame::XTitle > m_xTitleHelper ;
-
- WindowCommandDispatch* m_pWindowCommandDispatch ;
-
- protected:
-
- FrameContainer m_aChildFrameContainer ; /// array of child frames
-
- inline css::uno::Reference< css::uno::XComponentContext > impl_getComponentContext()
- {
- ReadGuard aReadLock( m_aLock );
- return m_xContext;
- }
-
- inline OUString impl_getName()
- {
- ReadGuard aReadLock( m_aLock );
- return m_sName;
- }
-
- inline css::uno::Reference< css::awt::XWindow > impl_getContainerWindow()
- {
- ReadGuard aReadLock( m_aLock );
- return m_xContainerWindow;
- }
-
- inline css::uno::Reference< css::frame::XDispatchProvider > impl_getDispatchHelper()
- {
- ReadGuard aReadLock( m_aLock );
- return m_xDispatchHelper;
- }
-
- inline css::uno::Reference< css::frame::XFramesSupplier > impl_getParent()
- {
- ReadGuard aReadLock( m_aLock );
- return m_xParent;
- }
-
-}; // class Frame
-
-} // namespace framework
-
-#endif // INCLUDED_FRAMEWORK_INC_SERVICES_FRAME_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx
index ca358e5..c782ec6 100644
--- a/framework/source/dispatch/interceptionhelper.cxx
+++ b/framework/source/dispatch/interceptionhelper.cxx
@@ -18,6 +18,8 @@
*/
#include <dispatch/interceptionhelper.hxx>
+#include <threadhelp/readguard.hxx>
+#include <threadhelp/writeguard.hxx>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx
index 751487a..fbf1ba1 100644
--- a/framework/source/dispatch/menudispatcher.cxx
+++ b/framework/source/dispatch/menudispatcher.cxx
@@ -21,6 +21,7 @@
#include <general.h>
#include <framework/menuconfiguration.hxx>
#include <framework/addonmenu.hxx>
+#include <threadhelp/resetableguard.hxx>
#include <services.h>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx
index c30629d..a360ed0 100644
--- a/framework/source/dispatch/popupmenudispatcher.cxx
+++ b/framework/source/dispatch/popupmenudispatcher.cxx
@@ -21,10 +21,14 @@
#include <general.h>
#include <framework/menuconfiguration.hxx>
#include <framework/addonmenu.hxx>
+#include <threadhelp/readguard.hxx>
+#include <threadhelp/resetableguard.hxx>
+#include <threadhelp/writeguard.hxx>
#include <services.h>
#include <properties.h>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#include <com/sun/star/frame/XLayoutManager2.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/awt/WindowDescriptor.hpp>
#include <com/sun/star/awt/PosSize.hpp>
@@ -34,6 +38,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <com/sun/star/ui/XUIElement.hpp>
#include <ucbhelper/content.hxx>
#include <osl/mutex.hxx>
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index e36f23a..b6c560d 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -34,7 +34,6 @@
)
=================================================================================================================*/
#include <services/desktop.hxx>
-#include <services/frame.hxx>
#include <jobs/jobexecutor.hxx>
#include <uifactory/uielementfactorymanager.hxx>
#include <uifactory/uicontrollerfactory.hxx>
@@ -61,7 +60,6 @@
COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::Desktop ) else
- IFFACTORY( ::framework::Frame ) else
IFFACTORY( ::framework::JobExecutor ) else
IFFACTORY( ::framework::UIElementFactoryManager ) else
IFFACTORY( ::framework::PopupMenuControllerFactory ) else
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 44221a0..09fd420 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -17,9 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <services/frame.hxx>
#include <dispatch/dispatchprovider.hxx>
-
#include <dispatch/interceptionhelper.hxx>
#include <dispatch/closedispatcher.hxx>
#include <dispatch/windowcommanddispatch.hxx>
@@ -32,45 +30,52 @@
#include <framework/framelistanalyzer.hxx>
#include <helper/dockingareadefaultacceptor.hxx>
#include <dispatch/dispatchinformationprovider.hxx>
+#include <classes/framecontainer.hxx>
+#include <classes/propertysethelper.hxx>
+#include <threadhelp/resetableguard.hxx>
+#include <threadhelp/writeguard.hxx>
+#include <threadhelp/readguard.hxx>
+#include <threadhelp/threadhelpbase.hxx>
#include <threadhelp/transactionguard.hxx>
+#include <threadhelp/transactionbase.hxx>
+#include <general.h>
+
#include <pattern/window.hxx>
-#include <services.h>
#include <properties.h>
#include <com/sun/star/awt/Toolkit.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/PosSize.hpp>
-#include <com/sun/star/awt/XWindowPeer.hpp>
-#include <com/sun/star/awt/XVclWindowPeer.hpp>
-#include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
-#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
+#include <com/sun/star/frame/XFrame2.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
#include <com/sun/star/frame/LayoutManager.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
#include <com/sun/star/task/StatusIndicatorFactory.hpp>
#include <com/sun/star/task/JobExecutor.hpp>
#include <com/sun/star/task/XJobExecutor.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/sequenceashashmap.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/proptypehlp.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
@@ -81,10 +86,400 @@
#include <comphelper/processfactory.hxx>
#include <unotools/moduleoptions.hxx>
#include <tools/diagnose_ex.h>
-
#include <vcl/menu.hxx>
+#include <unotools/cmdoptions.hxx>
+
+using namespace framework;
+
+namespace {
+
+// This enum can be used to set different active states of frames
+enum EActiveState
+{
+ E_INACTIVE , // I'am not a member of active path in tree and i don't have the focus.
+ E_ACTIVE , // I'am in the middle of an active path in tree and i don't have the focus.
+ E_FOCUS // I have the focus now. I must a member of an active path!
+};
+
+/*-************************************************************************************************************//**
+ @short implements a normal frame of hierarchy
+ @descr An instance of these class can be a normal node in frame tree. A frame support influencing of his
+ subtree, find of subframes, activate- and deactivate-mechanism as well as
+ set/get of a frame window, component or controller.
+
+ @attention This implementation supports three states: a)uninitialized, b)working, c)disposed
+ If you call wrong methods in modes a) or c) ... you will get some exceptions.
+ How you should work with this service:
+ i) create it by using "xServiceManager->createInstance(...)"
+ ii) call XInitialization::initialize() with a valid window reference or use createInstanceWithArguments() at i)
+ iii) works with object
+ iv) dispose object by calling XComponent::dispose()
+ After iv) all further requests are rejected by exceptions! (DisposedException)
+
+ @base ThreadHelpBase
+ help to guarantee correct initialized lock member at startup
+ @base TransactionBase
+ help to implement unbreakable interface calls
+ @base OBroadcastHelper
+ OPropertySetHelper
+ implements the property set
+ @base OWeakObject
+ provides the refcount and XInterface, XWeak
+
+ @devstatus ready to use
+ @threadsafe yes
+*//*-*************************************************************************************************************/
+class Frame : // interfaces
+ public css::lang::XTypeProvider ,
+ public css::lang::XServiceInfo ,
+ public css::frame::XFrame2 ,
+ public css::awt::XWindowListener , // => XEventListener
+ public css::awt::XTopWindowListener ,
+ public css::awt::XFocusListener ,
+ public css::document::XActionLockable ,
+ public css::util::XCloseable , // => XCloseBroadcaster
+ public css::frame::XComponentLoader ,
+ public css::frame::XTitle ,
+ public css::frame::XTitleChangeBroadcaster ,
+ // base classes
+ // Order is necessary for right initialization of this class!
+ public ThreadHelpBase ,
+ public TransactionBase ,
+ public PropertySetHelper , // helper implements ThreadHelpbase, TransactionBase, XPropertySet, XPropertySetInfo
+ public ::cppu::OWeakObject // helper implements XInterface, XWeak
+{
+public:
+
+ Frame( const css::uno::Reference< css::uno::XComponentContext >& xContext );
+ virtual ~Frame();
+
+ void onCreate();
+
+ FWK_DECLARE_XINTERFACE
+ FWK_DECLARE_XTYPEPROVIDER
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.Frame");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.frame.Frame");
+ return aSeq;
+ }
+
+ //---------------------------------------------------------------------------------------------------------
+ // XComponentLoader
+ //---------------------------------------------------------------------------------------------------------
+ virtual css::uno::Reference< css::lang::XComponent > SAL_CALL loadComponentFromURL(
+ const OUString& sURL,
+ const OUString& sTargetFrameName,
+ sal_Int32 nSearchFlags,
+ const css::uno::Sequence< css::beans::PropertyValue >& lArguments )
+ throw( css::io::IOException,
+ css::lang::IllegalArgumentException,
+ css::uno::RuntimeException );
+
+
+ //---------------------------------------------------------------------------------------------------------
+ // XFramesSupplier
+ //---------------------------------------------------------------------------------------------------------
+ virtual css::uno::Reference< css::frame::XFrames > SAL_CALL getFrames ( ) throw( css::uno::RuntimeException );
+ virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getActiveFrame ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL setActiveFrame ( const css::uno::Reference< css::frame::XFrame >& xFrame ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // XFrame
+ //---------------------------------------------------------------------------------------------------------
+ virtual void SAL_CALL initialize ( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException );
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL setCreator ( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException );
+ virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator ( ) throw( css::uno::RuntimeException );
+ virtual OUString SAL_CALL getName ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL setName ( const OUString& sName ) throw( css::uno::RuntimeException );
+ virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame ( const OUString& sTargetFrameName ,
+ sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL isTop ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL activate ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL deactivate ( ) throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL isActive ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL contextChanged ( ) throw( css::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL setComponent ( const css::uno::Reference< css::awt::XWindow >& xComponentWindow ,
+ const css::uno::Reference< css::frame::XController >& xController ) throw( css::uno::RuntimeException );
+ virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow ( ) throw( css::uno::RuntimeException );
+ virtual css::uno::Reference< css::frame::XController > SAL_CALL getController ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL addFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL removeFrameActionListener ( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // XComponent
+ //---------------------------------------------------------------------------------------------------------
+ virtual void SAL_CALL dispose ( ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL addEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL removeEventListener ( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // XStatusIndicatorFactory
+ //---------------------------------------------------------------------------------------------------------
+ virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL createStatusIndicator ( ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // 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 );
+ virtual css::uno::Sequence<
+ css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches ( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptor ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // XDispatchProviderInterception
+ //---------------------------------------------------------------------------------------------------------
+ virtual void SAL_CALL registerDispatchProviderInterceptor( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL releaseDispatchProviderInterceptor ( const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // XDispatchInformationProvider
+ //---------------------------------------------------------------------------------------------------------
+ virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups ( ) throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(sal_Int16 nCommandGroup) throw (css::uno::RuntimeException);
+
+ //---------------------------------------------------------------------------------------------------------
+ // XWindowListener
+ // Attention: windowResized() and windowShown() are implement only! All other are empty!
+ //---------------------------------------------------------------------------------------------------------
+ virtual void SAL_CALL windowResized ( const css::awt::WindowEvent& aEvent ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL windowMoved ( const css::awt::WindowEvent& /*aEvent*/ ) throw( css::uno::RuntimeException ) {};
+ virtual void SAL_CALL windowShown ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
+ virtual void SAL_CALL windowHidden ( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
+
+ //---------------------------------------------------------------------------------------------------------
+ // XFocusListener
+ // Attention: focusLost() not implemented yet!
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list