Kaydet (Commit) 95ec16b5 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert frame::LayoutManager service to new sty;e

Change-Id: I46c3950aee336548d6e0acc6a7d1da655c158175
üst 1d1825db
......@@ -37,7 +37,6 @@ namespace framework{
#define SERVICENAME_CONTENTHANDLERFACTORY DECLARE_ASCII("com.sun.star.frame.ContentHandlerFactory" )
#define SERVICENAME_JOB DECLARE_ASCII("com.sun.star.task.Job" )
#define SERVICENAME_PROTOCOLHANDLER DECLARE_ASCII("com.sun.star.frame.ProtocolHandler" )
#define SERVICENAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.frame.LayoutManager" )
#define SERVICENAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.frame.PopupMenuControllerFactory" )
#define SERVICENAME_POPUPMENUCONTROLLER DECLARE_ASCII("com.sun.star.frame.PopupMenuController" )
#define SERVICENAME_MODULEUICONFIGURATIONMANAGER DECLARE_ASCII("com.sun.star.ui.ModuleUIConfigurationManager" )
......@@ -76,7 +75,6 @@ namespace framework{
#define IMPLEMENTATIONNAME_SUBSTITUTEPATHVARIABLES DECLARE_ASCII("com.sun.star.comp.framework.PathSubstitution" )
#define IMPLEMENTATIONNAME_JOBDISPATCH DECLARE_ASCII("com.sun.star.comp.framework.jobs.JobDispatch" )
#define IMPLEMENTATIONNAME_DISPATCHHELPER DECLARE_ASCII("com.sun.star.comp.framework.services.DispatchHelper" )
#define IMPLEMENTATIONNAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.comp.framework.LayoutManager" )
#define IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.PopupMenuControllerFactory" )
#define IMPLEMENTATIONNAME_MACROSMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.MacrosMenuController" )
#define IMPLEMENTATIONNAME_FONTMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.FontMenuController" )
......
......@@ -50,7 +50,7 @@
#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/XLayoutManager.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>
......@@ -406,7 +406,7 @@ class Frame : // interfaces
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::XLayoutManager > m_xLayoutManager ; /// is used to layout the child windows of the frame.
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 ;
......
......@@ -43,7 +43,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XLayoutManager2.hpp>
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
#include <com/sun/star/frame/XModuleManager2.hpp>
......@@ -60,7 +60,7 @@
#include <com/sun/star/frame/XLayoutManagerEventBroadcaster.hpp>
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/implbase7.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/propertycontainer.hxx>
#include <tools/wintypes.hxx>
......@@ -77,13 +77,9 @@ namespace framework
{
class InfoHelperBuilder;
}
typedef ::cppu::WeakImplHelper7 < ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::frame::XLayoutManager
typedef ::cppu::WeakImplHelper3 < ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::frame::XLayoutManager2
, ::com::sun::star::awt::XWindowListener
, ::com::sun::star::frame::XFrameActionListener
, ::com::sun::star::ui::XUIConfigurationListener
, ::com::sun::star::frame::XMenuBarMergingAcceptor
, ::com::sun::star::frame::XLayoutManagerEventBroadcaster
> LayoutManager_Base;
typedef ::comphelper::OPropertyContainer LayoutManager_PBase;
class LayoutManager : public LayoutManager_Base ,
......
......@@ -381,7 +381,7 @@ void PopupMenuDispatcher::impl_RetrievePopupControllerQuery()
{
if ( !m_xPopupCtrlQuery.is() )
{
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager;
css::uno::Reference< css::frame::XFrame > xFrame( m_xWeakFrame );
if ( xFrame.is() )
......
......@@ -36,7 +36,7 @@
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <com/sun/star/frame/XLayoutManager2.hpp>
#include <toolkit/unohlp.hxx>
......@@ -382,7 +382,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY);
if (xPropSet.is())
{
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager;
xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
if (xLayoutManager.is())
{
......@@ -468,7 +468,7 @@ void StatusIndicatorFactory::impl_createProgress()
css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY);
if (xPropSet.is())
{
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager;
xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
if (xLayoutManager.is())
{
......@@ -513,7 +513,7 @@ void StatusIndicatorFactory::impl_showProgress()
css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY);
if (xPropSet.is())
{
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager;
xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
if (xLayoutManager.is())
{
......@@ -557,7 +557,7 @@ void StatusIndicatorFactory::impl_hideProgress()
css::uno::Reference< css::beans::XPropertySet > xPropSet(xFrame, css::uno::UNO_QUERY);
if (xPropSet.is())
{
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager;
xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
if (xLayoutManager.is())
xLayoutManager->hideElement( OUString(PROGRESS_RESOURCE) );
......
......@@ -101,6 +101,9 @@ static const sal_Int32 DOCKWIN_ID_BASE = 9800;
static const char STATUS_BAR_ALIAS[] = "private:resource/statusbar/statusbar";
static const char PROGRESS_BAR_ALIAS[] = "private:resource/progressbar/progressbar";
#define SERVICENAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.frame.LayoutManager" )
#define IMPLEMENTATIONNAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.comp.framework.LayoutManager" )
namespace framework
{
......
......@@ -38,34 +38,34 @@
#include <services.h>
#include <properties.h>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/DisposedException.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/awt/Toolkit.hpp>
#include <com/sun/star/awt/XDevice.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/awt/XWindowPeer.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <com/sun/star/task/XStatusIndicatorSupplier.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/frame/XModel.hpp>
#include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
#include <com/sun/star/awt/WindowAttribute.hpp>
#include <com/sun/star/container/XIndexAccess.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/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 <comphelper/sequenceashashmap.hxx>
#include <cppuhelper/queryinterface.hxx>
......@@ -208,7 +208,7 @@ DEFINE_INIT_SERVICE ( Frame,
//-------------------------------------------------------------------------------------------------------------
// Create an initial layout manager
// Create layout manager and connect it to the newly created frame
m_xLayoutManager.set(m_xContext->getServiceManager()->createInstanceWithContext(SERVICENAME_LAYOUTMANAGER, m_xContext), css::uno::UNO_QUERY);
m_xLayoutManager = css::frame::LayoutManager::create(m_xContext);
//-------------------------------------------------------------------------------------------------------------
// set information about all supported properties at the base class helper PropertySetHelper
......@@ -479,14 +479,13 @@ void SAL_CALL Frame::setActiveFrame( const css::uno::Reference< css::frame::XFra
/*-****************************************************************************************************//**
initialize new created layout manager
**/
void lcl_enableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager >& xLayoutManager,
void lcl_enableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager2 >& xLayoutManager,
const css::uno::Reference< css::frame::XFrame >& xFrame )
{
// Provide container window to our layout manager implementation
xLayoutManager->attachFrame(xFrame);
css::uno::Reference< css::frame::XFrameActionListener > xListen(xLayoutManager, css::uno::UNO_QUERY_THROW);
xFrame->addFrameActionListener(xListen);
xFrame->addFrameActionListener(xLayoutManager);
DockingAreaDefaultAcceptor* pAcceptor = new DockingAreaDefaultAcceptor(xFrame);
css::uno::Reference< css::ui::XDockingAreaAcceptor > xDockingAreaAcceptor( static_cast< ::cppu::OWeakObject* >(pAcceptor), css::uno::UNO_QUERY_THROW);
......@@ -496,11 +495,10 @@ void lcl_enableLayoutManager(const css::uno::Reference< css::frame::XLayoutManag
/*-****************************************************************************************************//**
deinitialize layout manager
**/
void lcl_disableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager >& xLayoutManager,
void lcl_disableLayoutManager(const css::uno::Reference< css::frame::XLayoutManager2 >& xLayoutManager,
const css::uno::Reference< css::frame::XFrame >& xFrame )
{
css::uno::Reference< css::frame::XFrameActionListener > xListen(xLayoutManager, css::uno::UNO_QUERY_THROW);
xFrame->removeFrameActionListener(xListen);
xFrame->removeFrameActionListener(xLayoutManager);
xLayoutManager->setDockingAreaAcceptor(css::uno::Reference< css::ui::XDockingAreaAcceptor >());
xLayoutManager->attachFrame(css::uno::Reference< css::frame::XFrame >());
}
......@@ -554,7 +552,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >&
m_bIsHidden = sal_False;
css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager = m_xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xLayoutManager = m_xLayoutManager;
// Release lock ... because we call some impl methods, which are threadsafe by himself.
// If we hold this lock - we will produce our own deadlock!
......@@ -2621,8 +2619,8 @@ void SAL_CALL Frame::impl_setPropertyValue(const OUString& /*sProperty*/,
case FRAME_PROPHANDLE_LAYOUTMANAGER :
{
css::uno::Reference< css::frame::XLayoutManager > xOldLayoutManager = m_xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager > xNewLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xOldLayoutManager = m_xLayoutManager;
css::uno::Reference< css::frame::XLayoutManager2 > xNewLayoutManager;
aValue >>= xNewLayoutManager;
if (xOldLayoutManager != xNewLayoutManager)
......
......@@ -194,6 +194,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\
DocumentTemplates \
Frame \
GlobalEventBroadcaster \
LayoutManager \
MediaTypeDetectionHelper \
ModuleManager \
SessionListener \
......@@ -939,7 +940,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/frame,\
FrameLoader \
FrameLoaderFactory \
FramesContainer \
LayoutManager \
PopupMenuController \
PopupMenuControllerFactory \
ProtocolHandler \
......@@ -2597,6 +2597,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/frame,\
XGlobalEventBroadcaster \
XInterceptorInfo \
XLayoutManager \
XLayoutManager2 \
XLayoutManagerEventBroadcaster \
XLayoutManagerListener \
XLoadEventListener \
......
......@@ -20,12 +20,7 @@
#ifndef __com_sun_star_frame_LayoutManager_idl__
#define __com_sun_star_frame_LayoutManager_idl__
#include <com/sun/star/frame/XLayoutManager.idl>
#include <com/sun/star/frame/XFrameActionListener.idl>
#include <com/sun/star/ui/XUIConfigurationListener.idl>
#include <com/sun/star/beans/XPropertySet.idl>
#include <com/sun/star/frame/XMenuBarMergingAcceptor.idl>
#include <com/sun/star/frame/XLayoutManagerEventBroadcaster.idl>
#include <com/sun/star/frame/XLayoutManager2.idl>
module com { module sun { module star { module frame {
......@@ -44,51 +39,7 @@
@since OOo 2.0
*/
service LayoutManager
{
/** central interface to query for, create, destroy and manipulate user
interface elements which are bound to a frame.
@see ::com::sun::star::frame::XLayoutManager;
*/
interface ::com::sun::star::frame::XLayoutManager;
/** notification interface to receive status information about the state
of the connected frame.
<p>
E.g., you can receive events of instantiation/destruction and
activation/deactivation of a frame.
</p>
@see XFrame::addFrameActionListener()
@see XFrame::removeFrameActionListener()
*/
interface ::com::sun::star::frame::XFrameActionListener;
/** notification interface to receive change messages of user interface
elements which are part of the layout manager.
<p>
E.g., you can receive events of insertion/replacing and
removing of settings data of user interface elements.
</p>
@see com::sun::star::ui::XUIConfiguration
*/
interface ::com::sun::star::ui::XUIConfigurationListener;
/** provides functions to merge menus for inplace editing of components
inside OpenOffice.org.
*/
interface ::com::sun::star::frame::XMenuBarMergingAcceptor;
/** registers listeners that want to receive layout manager
events.
*/
[optional] interface ::com::sun::star::frame::XLayoutManagerEventBroadcaster;
};
service LayoutManager : XLayoutManager2;
}; }; }; };
......
/* -*- 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 __com_sun_star_frame_XLayoutManager2_idl__
#define __com_sun_star_frame_XLayoutManager2_idl__
#include <com/sun/star/frame/XLayoutManager.idl>
#include <com/sun/star/frame/XFrameActionListener.idl>
#include <com/sun/star/ui/XUIConfigurationListener.idl>
#include <com/sun/star/beans/XPropertySet.idl>
#include <com/sun/star/frame/XMenuBarMergingAcceptor.idl>
#include <com/sun/star/frame/XLayoutManagerEventBroadcaster.idl>
module com { module sun { module star { module frame {
/**
Unified interface for LayoutManager service.
@since LibreOffice 4.2
*/
interface XLayoutManager2
{
/** central interface to query for, create, destroy and manipulate user
interface elements which are bound to a frame.
@see ::com::sun::star::frame::XLayoutManager;
*/
interface ::com::sun::star::frame::XLayoutManager;
/** notification interface to receive status information about the state
of the connected frame.
<p>
E.g., you can receive events of instantiation/destruction and
activation/deactivation of a frame.
</p>
@see XFrame::addFrameActionListener()
@see XFrame::removeFrameActionListener()
*/
interface ::com::sun::star::frame::XFrameActionListener;
/** notification interface to receive change messages of user interface
elements which are part of the layout manager.
<p>
E.g., you can receive events of insertion/replacing and
removing of settings data of user interface elements.
</p>
@see com::sun::star::ui::XUIConfiguration
*/
interface ::com::sun::star::ui::XUIConfigurationListener;
/** provides functions to merge menus for inplace editing of components
inside OpenOffice.org.
*/
interface ::com::sun::star::frame::XMenuBarMergingAcceptor;
/** registers listeners that want to receive layout manager
events.
*/
interface ::com::sun::star::frame::XLayoutManagerEventBroadcaster;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment