office-gobmx/framework/inc/services/task.hxx

611 lines
26 KiB
C++
Raw Normal View History

2000-09-18 10:33:13 -05:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 10:33:13 -05:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 10:33:13 -05:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 10:33:13 -05:00
*
* This file is part of OpenOffice.org.
2000-09-18 10:33:13 -05:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 10:33:13 -05:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 10:33:13 -05:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 10:33:13 -05:00
*
************************************************************************/
#ifndef __FRAMEWORK_SERVICES_TASK_HXX_
#define __FRAMEWORK_SERVICES_TASK_HXX_
//_________________________________________________________________________________________________________________
// my own includes
//_________________________________________________________________________________________________________________
#include <services/frame.hxx>
#include <macros/generic.hxx>
#include <macros/debug.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx>
//_________________________________________________________________________________________________________________
// interface includes
//_________________________________________________________________________________________________________________
#include <com/sun/star/frame/XTask.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Size.hpp>
//_________________________________________________________________________________________________________________
// other includes
//_________________________________________________________________________________________________________________
#include <cppuhelper/weak.hxx>
#include <cppuhelper/propshlp.hxx>
#include <tools/link.hxx>
#include <vcl/evntpost.hxx>
//_________________________________________________________________________________________________________________
// namespace
//_________________________________________________________________________________________________________________
namespace framework{
//_________________________________________________________________________________________________________________
// exported const
//_________________________________________________________________________________________________________________
//_________________________________________________________________________________________________________________
// exported definitions
//_________________________________________________________________________________________________________________
/*-************************************************************************************************************//**
@short implements an special frame - a task frame
@descr -
@implements XTask
@base Frame
OPropertySet
*//*-*************************************************************************************************************/
2001-05-02 06:58:40 -05:00
class Task : public css::frame::XTask , // => XFrame => XComponent
public Frame // Order of baseclasses is neccessary for right initialization!
2000-09-18 10:33:13 -05:00
{
//-------------------------------------------------------------------------------------------------------------
// public methods
//-------------------------------------------------------------------------------------------------------------
public:
//---------------------------------------------------------------------------------------------------------
// constructor / destructor
//---------------------------------------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short standard constructor to create instance
@descr This constructor initialize a new instance of this class,
and will be set valid values on his member and baseclasses.
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
Task( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory );
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short standard destructor
@descr This method destruct an instance of this class and clear some member.
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual ~Task();
//---------------------------------------------------------------------------------------------------------
// XInterface, XTypeProvider, XServiceInfo
//---------------------------------------------------------------------------------------------------------
DECLARE_XINTERFACE
DECLARE_XTYPEPROVIDER
DECLARE_XSERVICEINFO
//---------------------------------------------------------------------------------------------------------
// XTask
//---------------------------------------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual sal_Bool SAL_CALL close() throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL tileWindows() throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL arrangeWindowsVertical() throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL arrangeWindowsHorizontal() throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
//---------------------------------------------------------------------------------------------------------
// XComponent
//---------------------------------------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short -
@descr We must overwrite this method, because baseclass Frame implements XFrame and XComponent.
XTask is derived from these classes to! The compiler don't know, which base is the right one.
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL dispose() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::dispose();
}
/*-*******************************************************************************************************/
virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::addEventListener( xListener );
}
/*-*******************************************************************************************************/
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::removeEventListener( xListener );
}
//---------------------------------------------------------------------------------------------------------
// XFrame
//---------------------------------------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short -
@descr We must overwrite this method, because baseclass Frame implements XFrame and XComponent.
XTask is derived from these classes to! The compiler don't know, which base is right.
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL initialize( const css::uno::Reference< css::awt::XWindow >& xWindow ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::initialize( xWindow );
}
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getContainerWindow() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::getContainerWindow();
}
virtual void SAL_CALL setCreator( const css::uno::Reference< css::frame::XFramesSupplier >& xCreator ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::setCreator( xCreator );
}
virtual css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL getCreator() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::getCreator();
}
virtual ::rtl::OUString SAL_CALL getName() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::getName();
}
virtual void SAL_CALL setName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::setName( sName );
}
virtual sal_Bool SAL_CALL isTop() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::isTop();
}
virtual void SAL_CALL activate() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::activate();
}
virtual void SAL_CALL deactivate() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::deactivate();
}
virtual sal_Bool SAL_CALL isActive() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::isActive();
}
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 )
2000-09-18 10:33:13 -05:00
{
return Frame::setComponent( xComponentWindow, xController );
}
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::getComponentWindow();
}
virtual css::uno::Reference< css::frame::XController > SAL_CALL getController() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
return Frame::getController();
}
virtual void SAL_CALL contextChanged() throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::contextChanged();
}
virtual void SAL_CALL addFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::addFrameActionListener( xListener );
}
virtual void SAL_CALL removeFrameActionListener( const css::uno::Reference< css::frame::XFrameActionListener >& xListener ) throw( css::uno::RuntimeException )
2000-09-18 10:33:13 -05:00
{
Frame::removeFrameActionListener( xListener );
}
virtual css::uno::Reference< css::frame::XFrame > SAL_CALL findFrame( const ::rtl::OUString& sTargetFrameName ,
sal_Int32 nSearchFlags ) throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
//---------------------------------------------------------------------------------------------------------
// XTopWindowListener
//---------------------------------------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL windowClosing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL windowActivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short -
@descr -
@seealso -
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL windowDeactivated( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
//---------------------------------------------------------------------------------------------------------
// XEventListener
//---------------------------------------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short -
@descr This object is forced to release all references to the interfaces given
by the parameter Source.
@seealso -
@param -
@return -
@onerror -
*//*-*****************************************************************************************************/
virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw( css::uno::RuntimeException );
2000-09-18 10:33:13 -05:00
//-------------------------------------------------------------------------------------------------------------
// protected methods
//-------------------------------------------------------------------------------------------------------------
protected:
//---------------------------------------------------------------------------
// OPropertySetHelper
//---------------------------------------------------------------------------
/*-****************************************************************************************************//**
@short try to convert a property value
@descr This method is calling from helperclass "OPropertySetHelper".
Don't use this directly!
You must try to convert the value of given propertyhandle and
return results of this operation. This will be use to ask vetoable
listener. If no listener have a veto, we will change value realy!
( in method setFastPropertyValue_NoBroadcast(...) )
@seealso OPropertySetHelper
@seealso setFastPropertyValue_NoBroadcast()
@param "aConvertedValue" new converted value of property
@param "aOldValue" old value of property
@param "nHandle" handle of property
@param "aValue" new value of property
@return sal_True if value will be changed, sal_FALSE otherway
@onerror IllegalArgumentException, if you call this with an invalid argument
*//*-*****************************************************************************************************/
2001-05-02 06:58:40 -05:00
/*
virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& aConvertedValue ,
css::uno::Any& aOldValue ,
sal_Int32 nHandle ,
const css::uno::Any& aValue ) throw( css::lang::IllegalArgumentException );
2001-05-02 06:58:40 -05:00
*/
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short set value of a transient property
@descr This method is calling from helperclass "OPropertySetHelper".
Don't use this directly!
Handle and value are valid everyway! You must set the new value only.
After this, baseclass send messages to all listener automaticly.
@seealso OPropertySetHelper
@param "nHandle" handle of property to change
@param "aValue" new value of property
@return -
@onerror An exception is thrown.
*//*-*****************************************************************************************************/
2001-05-02 06:58:40 -05:00
/*
virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
const css::uno::Any& aValue ) throw( css::uno::Exception );
2001-05-02 06:58:40 -05:00
*/
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short get value of a transient property
@descr This method is calling from helperclass "OPropertySetHelper".
Don't use this directly!
@seealso OPropertySetHelper
@param "nHandle" handle of property to change
@param "aValue" current value of property
@return -
@onerror -
*//*-*****************************************************************************************************/
2001-05-02 06:58:40 -05:00
/*
virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue ,
sal_Int32 nHandle ) const;
2001-05-02 06:58:40 -05:00
*/
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short return structure and information about transient properties
@descr This method is calling from helperclass "OPropertySetHelper".
Don't use this directly!
@seealso OPropertySetHelper
@param -
@return structure with property-informations
@onerror -
*//*-*****************************************************************************************************/
2001-05-02 06:58:40 -05:00
/*
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
2001-05-02 06:58:40 -05:00
*/
2000-09-18 10:33:13 -05:00
/*-****************************************************************************************************//**
@short return propertysetinfo
@descr You can call this method to get information about transient properties
of this object.
@seealso OPropertySetHelper
@seealso XPropertySet
@seealso XMultiPropertySet
@param -
@return reference to object with information [XPropertySetInfo]
@onerror -
*//*-*****************************************************************************************************/
2001-05-02 06:58:40 -05:00
/*
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo();
2001-05-02 06:58:40 -05:00
*/
2000-09-18 10:33:13 -05:00
//-------------------------------------------------------------------------------------------------------------
// private methods
//-------------------------------------------------------------------------------------------------------------
private:
DECL_LINK( Close_Impl, void* );
2000-09-18 10:33:13 -05:00
// void impl_SaveWindowAttributes();
2001-05-02 06:58:40 -05:00
/* sal_Bool impl_tryToChangeProperty( sal_Bool bProperty ,
const css::uno::Any& aValue ,
css::uno::Any& aOldValue ,
css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException );
sal_Bool impl_tryToChangeProperty( const ::rtl::OUString& sProperty ,
const css::uno::Any& aValue ,
css::uno::Any& aOldValue ,
css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException );
sal_Bool impl_tryToChangeProperty( const css::awt::Point& aProperty ,
const css::uno::Any& aValue ,
css::uno::Any& aOldValue ,
css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException );
sal_Bool impl_tryToChangeProperty( const css::awt::Size& aProperty ,
const css::uno::Any& aValue ,
css::uno::Any& aOldValue ,
css::uno::Any& aConvertedValue ) throw( css::lang::IllegalArgumentException );
2000-09-18 10:33:13 -05:00
static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor();
2001-05-02 06:58:40 -05:00
*/
2000-09-18 10:33:13 -05:00
//-------------------------------------------------------------------------------------------------------------
// 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(...).
@seealso ASSERTs in implementation!
@param references to checking variables
@return sal_False on invalid parameter<BR>
sal_True otherway
@onerror -
*//*-*****************************************************************************************************/
#ifdef ENABLE_ASSERTIONS
private:
// Not used in the moment!
#endif // #ifdef ENABLE_ASSERTIONS
//-------------------------------------------------------------------------------------------------------------
// variables
// (should be private everyway!)
//-------------------------------------------------------------------------------------------------------------
protected:
// But some values are neede by derived classes!
// sal_Bool m_bIsPlugIn ; /// In objects of these class this member is set to FALSE.
/// But in derived class PlugInFrame it's overwrited with TRUE!
2000-09-18 10:33:13 -05:00
private:
// Properties
sal_Bool m_bIsAlwaysVisible ;
sal_Bool m_bIsFloating ;
css::awt::Point m_aPosition ;
css::awt::Size m_aSize ;
2000-09-18 10:33:13 -05:00
::vcl::EventPoster m_aPoster ;
}; // class Tasks
} // namespace framework
#endif // #ifndef __FRAMEWORK_SERVICES_TASKS_HXX_