Files
libreoffice/UnoControls/inc/basecontainercontrol.hxx

564 lines
17 KiB
C++
Raw Normal View History

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
#ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
#define _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XContainer.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/container/XSet.hpp>
#include <com/sun/star/container/ContainerEvent.hpp>
#include <com/sun/star/container/XIndexReplace.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <vector>
2000-09-18 15:18:56 +00:00
#include "basecontrol.hxx"
//____________________________________________________________________________________________________________
// "namespaces"
//____________________________________________________________________________________________________________
namespace unocontrols{
//____________________________________________________________________________________________________________
// structs, types, forwards
//____________________________________________________________________________________________________________
struct IMPL_ControlInfo
{
2012-02-21 13:54:41 +01:00
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xControl ;
OUString sName ;
2000-09-18 15:18:56 +00:00
};
2012-02-21 13:54:41 +01:00
class BaseContainerControl : public ::com::sun::star::awt::XControlModel
, public ::com::sun::star::awt::XControlContainer
2000-09-18 15:18:56 +00:00
, public BaseControl
{
//____________________________________________________________________________________________________________
// public methods
//____________________________________________________________________________________________________________
public:
//________________________________________________________________________________________________________
// construct/destruct
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
BaseContainerControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
virtual ~BaseContainerControl();
//________________________________________________________________________________________________________
// XInterface
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short give answer, if interface is supported
@descr The interfaces are searched by type.
@seealso XInterface
@param "rType" is the type of searched interface.
@return Any information about found interface
@onerror A RuntimeException is thrown.
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
const ::com::sun::star::uno::Type& aType
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XTypeProvider
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short get information about supported interfaces
@descr -
@seealso XTypeProvider
@param -
@return Sequence of types of all supported interfaces
@onerror A RuntimeException is thrown.
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XAggregation
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(
const ::com::sun::star::uno::Type& aType
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XControl
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL createPeer(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& xToolkit ,
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual sal_Bool SAL_CALL setModel(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XComponent
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XEventListener
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XControlContainer
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL addControl(
const OUString& sName ,
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& xControl
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL addContainerListener(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL removeControl(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& xControl
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL removeContainerListener(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL setStatusText(
const OUString& sStatusText
2012-02-21 13:54:41 +01:00
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > SAL_CALL getControl(
const OUString& sName
2012-02-21 13:54:41 +01:00
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls()
throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XUnoControlContainer
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL addTabController(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController >& xTabController
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL removeTabController(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController >& xTabController
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2010-10-31 21:34:25 -07:00
virtual void SAL_CALL setTabControllers(
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > >& xTabControllers
) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > > SAL_CALL getTabControllers()
throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//________________________________________________________________________________________________________
// XWindow
//________________________________________________________________________________________________________
/**_______________________________________________________________________________________________________
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*/
2012-02-21 13:54:41 +01:00
virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw( ::com::sun::star::uno::RuntimeException );
2000-09-18 15:18:56 +00:00
//____________________________________________________________________________________________________________
// protected methods
//____________________________________________________________________________________________________________
protected:
using OComponentHelper::disposing;
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
2012-02-21 13:54:41 +01:00
virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
2010-10-31 21:34:25 -07:00
);
2000-09-18 15:18:56 +00:00
/**_______________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
2010-10-31 21:34:25 -07:00
virtual void impl_paint(
sal_Int32 nX ,
sal_Int32 nY ,
2012-02-21 13:54:41 +01:00
const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics
2010-10-31 21:34:25 -07:00
);
2000-09-18 15:18:56 +00:00
//____________________________________________________________________________________________________________
// private methods
//____________________________________________________________________________________________________________
private:
/**_______________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
void impl_activateTabControllers();
/**_______________________________________________________________________________________________________
@short
@descr
@seealso
@param
@return
@onerror
*/
void impl_cleanMemory();
//____________________________________________________________________________________________________________
// private variables
//____________________________________________________________________________________________________________
private:
2010-10-31 21:34:25 -07:00
// list of pointer of "struct IMPL_ControlInfo" to hold child-controls
::std::vector< IMPL_ControlInfo* > maControlInfoList;
2000-09-18 15:18:56 +00:00
2010-10-31 21:34:25 -07:00
// list of references of XTabController to hold tab-order in this container
2012-02-21 13:54:41 +01:00
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > > m_xTabControllerList ;
2010-10-31 21:34:25 -07:00
::cppu::OMultiTypeInterfaceContainerHelper m_aListeners ;
2000-09-18 15:18:56 +00:00
}; // class BaseContainerControl
} // namespace unocontrols
#endif // ifndef _UNOCONTROLS_BASECONTAINERCONTROL_CTRL_HXX
2010-10-27 12:45:03 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */