2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-02 17:12:00 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2014-04-18 22:47:44 +02:00
|
|
|
#ifndef INCLUDED_UNOCONTROLS_SOURCE_INC_FRAMECONTROL_HXX
|
|
|
|
#define INCLUDED_UNOCONTROLS_SOURCE_INC_FRAMECONTROL_HXX
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/frame/XFrameActionListener.hpp>
|
|
|
|
#include <com/sun/star/frame/XComponentLoader.hpp>
|
2013-03-22 09:24:15 +02:00
|
|
|
#include <com/sun/star/frame/XFrame2.hpp>
|
2000-09-18 15:18:56 +00:00
|
|
|
#include <com/sun/star/frame/FrameActionEvent.hpp>
|
|
|
|
#include <com/sun/star/frame/FrameAction.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceName.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/lang/XConnectionPointContainer.hpp>
|
|
|
|
#include <cppuhelper/propshlp.hxx>
|
2016-05-26 16:02:39 +02:00
|
|
|
#include <rtl/ref.hxx>
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
#include "basecontrol.hxx"
|
|
|
|
#include "OConnectionPointContainerHelper.hxx"
|
|
|
|
|
|
|
|
// namespaces
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
namespace unocontrols{
|
|
|
|
|
2013-07-24 14:41:35 +02:00
|
|
|
#define SERVICENAME_FRAMECONTROL "com.sun.star.frame.FrameControl"
|
|
|
|
#define IMPLEMENTATIONNAME_FRAMECONTROL "stardiv.UnoControls.FrameControl"
|
|
|
|
#define PROPERTYNAME_LOADERARGUMENTS "LoaderArguments"
|
|
|
|
#define PROPERTYNAME_COMPONENTURL "ComponentURL"
|
|
|
|
#define PROPERTYNAME_FRAME "Frame"
|
2015-02-28 14:52:55 +01:00
|
|
|
#define PROPERTY_COUNT 3 // you must count the properties
|
|
|
|
#define PROPERTYHANDLE_COMPONENTURL 0 // Id must be the index into the array
|
2013-07-24 14:41:35 +02:00
|
|
|
#define PROPERTYHANDLE_FRAME 1
|
|
|
|
#define PROPERTYHANDLE_LOADERARGUMENTS 2
|
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// class
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
class FrameControl : public css::awt::XControlModel
|
|
|
|
, public css::lang::XConnectionPointContainer
|
2013-03-03 17:11:39 +01:00
|
|
|
, public BaseControl // This order is necessary for right initialization of m_aMutex!
|
2010-10-31 21:34:25 -07:00
|
|
|
, public ::cppu::OBroadcastHelper
|
|
|
|
, public ::cppu::OPropertySetHelper
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
// public methods
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
// construct/destruct
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
FrameControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~FrameControl() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XInterface
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::uno::Any SAL_CALL queryInterface(
|
|
|
|
const css::uno::Type& aType
|
|
|
|
) throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
/**_______________________________________________________________________________________________________
|
|
|
|
@short increment refcount
|
|
|
|
@seealso XInterface
|
|
|
|
@seealso release()
|
|
|
|
@onerror A RuntimeException is thrown.
|
|
|
|
*/
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL acquire() throw() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
/**_______________________________________________________________________________________________________
|
|
|
|
@short decrement refcount
|
|
|
|
@seealso XInterface
|
|
|
|
@seealso acquire()
|
|
|
|
@onerror A RuntimeException is thrown.
|
|
|
|
*/
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL release() throw() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XTypeProvider
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes()
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XAggregation
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
css::uno::Any SAL_CALL queryAggregation(
|
|
|
|
const css::uno::Type& aType
|
|
|
|
) throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-03-17 12:25:11 +01:00
|
|
|
OUString SAL_CALL getImplementationName()
|
2015-10-12 16:04:04 +02:00
|
|
|
throw (css::uno::RuntimeException, std::exception) override;
|
2015-03-17 12:25:11 +01:00
|
|
|
|
|
|
|
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
|
2015-10-12 16:04:04 +02:00
|
|
|
throw (css::uno::RuntimeException, std::exception) override;
|
2015-03-17 12:25:11 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// XControl
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual void SAL_CALL createPeer(
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Reference< css::awt::XToolkit >& xToolkit ,
|
|
|
|
const css::uno::Reference< css::awt::XWindowPeer >& xParent
|
|
|
|
) throw ( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual sal_Bool SAL_CALL setModel(
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Reference< css::awt::XControlModel >& xModel
|
|
|
|
) throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::uno::Reference< css::awt::XControlModel > SAL_CALL getModel()
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XComponent
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual void SAL_CALL dispose() throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XView
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual sal_Bool SAL_CALL setGraphics(
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Reference< css::awt::XGraphics >& xDevice
|
|
|
|
) throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::uno::Reference< css::awt::XGraphics > SAL_CALL getGraphics()
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XConnectionPointContainer
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getConnectionPointTypes()
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::uno::Reference< css::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
|
|
|
|
const css::uno::Type& aType
|
|
|
|
) throw ( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual void SAL_CALL advise(
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Type& aType ,
|
|
|
|
const css::uno::Reference< css::uno::XInterface >& xListener
|
|
|
|
) throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual void SAL_CALL unadvise(
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Type& aType ,
|
|
|
|
const css::uno::Reference< css::uno::XInterface >& xListener
|
|
|
|
) throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// impl but public methods to register service!
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
static const css::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2012-09-11 12:58:00 -03:00
|
|
|
static const OUString impl_getStaticImplementationName();
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// protected methods
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
protected:
|
2006-06-19 22:10:13 +00:00
|
|
|
using OPropertySetHelper::getFastPropertyValue;
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// OPropertySetHelper
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual sal_Bool SAL_CALL convertFastPropertyValue(
|
2015-11-11 11:19:43 +02:00
|
|
|
css::uno::Any& rConvertedValue ,
|
|
|
|
css::uno::Any& rOldValue ,
|
2010-10-31 21:34:25 -07:00
|
|
|
sal_Int32 nHandle ,
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Any& rValue
|
|
|
|
) throw( css::lang::IllegalArgumentException ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2010-10-31 21:34:25 -07:00
|
|
|
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
|
|
|
|
sal_Int32 nHandle ,
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Any& rValue
|
|
|
|
) throw ( css::uno::Exception, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual void SAL_CALL getFastPropertyValue( css::uno::Any& rValue ,
|
2015-10-12 16:04:04 +02:00
|
|
|
sal_Int32 nHandle ) const override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// XPropertySet
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
|
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// BaseControl
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
virtual css::awt::WindowDescriptor* impl_getWindowDescriptor(
|
|
|
|
const css::uno::Reference< css::awt::XWindowPeer >& xParentPeer
|
2015-10-12 16:04:04 +02:00
|
|
|
) override;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// private methods
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
private:
|
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
void impl_createFrame( const css::uno::Reference< css::awt::XWindowPeer >& xPeer ,
|
2012-09-11 12:58:00 -03:00
|
|
|
const OUString& sURL ,
|
2015-11-11 11:19:43 +02:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& seqArguments );
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
void impl_deleteFrame();
|
|
|
|
|
2016-07-18 09:22:27 +02:00
|
|
|
static const css::uno::Sequence< css::beans::Property >& impl_getStaticPropertyDescriptor();
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
// private variables
|
2014-02-25 22:41:38 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
private:
|
|
|
|
|
2015-11-11 11:19:43 +02:00
|
|
|
css::uno::Reference< css::frame::XFrame2 > m_xFrame;
|
|
|
|
OUString m_sComponentURL;
|
|
|
|
css::uno::Sequence< css::beans::PropertyValue > m_seqLoaderArguments;
|
2016-05-26 16:02:39 +02:00
|
|
|
rtl::Reference<OConnectionPointContainerHelper> m_aConnectionPointContainer;
|
2000-09-18 15:18:56 +00:00
|
|
|
|
|
|
|
}; // class FrameControl
|
|
|
|
|
|
|
|
} // namespace unocontrols
|
|
|
|
|
2014-04-18 22:47:44 +02:00
|
|
|
#endif // INCLUDED_UNOCONTROLS_SOURCE_INC_FRAMECONTROL_HXX
|
2010-10-27 12:45:03 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|