2001-08-10 05:55:14 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: statusindicator.hxx,v $
|
|
|
|
*
|
2005-02-02 06:49:31 -06:00
|
|
|
* $Revision: 1.2 $
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2005-02-02 06:49:31 -06:00
|
|
|
* last change: $Author: rt $ $Date: 2005-02-02 13:49:31 $
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library 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 for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (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.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRUNTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRUNTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc..
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
|
|
|
|
#define __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//_______________________________________________
|
|
|
|
// include files of own module
|
2001-08-10 05:55:14 -05:00
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_HELPER_STATUSINDICATORFACTORY_HXX_
|
|
|
|
#include <helper/statusindicatorfactory.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
|
|
|
|
#include <threadhelp/threadhelpbase.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_
|
|
|
|
#include <macros/xinterface.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
|
|
|
|
#include <macros/xtypeprovider.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_
|
|
|
|
#include <macros/debug.hxx>
|
|
|
|
#endif
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_
|
|
|
|
#include <macros/generic.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//_______________________________________________
|
|
|
|
// include UNO interfaces
|
2001-08-10 05:55:14 -05:00
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
|
|
|
|
#include <com/sun/star/task/XStatusIndicator.hpp>
|
|
|
|
#endif
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//_______________________________________________
|
|
|
|
// include all others
|
2001-08-10 05:55:14 -05:00
|
|
|
|
|
|
|
#ifndef _CPPUHELPER_WEAK_HXX_
|
|
|
|
#include <cppuhelper/weak.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _CPPUHELPER_WEAKREF_HXX_
|
|
|
|
#include <cppuhelper/weakref.hxx>
|
|
|
|
#endif
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//_______________________________________________
|
|
|
|
// namespace
|
2001-08-10 05:55:14 -05:00
|
|
|
|
|
|
|
namespace framework{
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//_______________________________________________
|
|
|
|
// definitions
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//_______________________________________________
|
|
|
|
/**
|
|
|
|
@short implement a status indicator object
|
2001-08-10 05:55:14 -05:00
|
|
|
|
|
|
|
@descr With this indicator you can show a message and a progress ...
|
2005-02-02 06:49:31 -06:00
|
|
|
but you share the output device with other indicator objects,
|
|
|
|
if this instances was created by the same factory.
|
2001-08-10 05:55:14 -05:00
|
|
|
Then the last created object has full access to device.
|
2005-02-02 06:49:31 -06:00
|
|
|
All others change her internal data structure only.
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
All objects of this StatusIndicator class calls a c++ interface
|
|
|
|
on the StatusIndicatorFactory (where they was created).
|
|
|
|
The factory holds all data structures and paints the progress.
|
2001-08-10 05:55:14 -05:00
|
|
|
|
|
|
|
@devstatus ready to use
|
|
|
|
@threadsafe yes
|
2005-02-02 06:49:31 -06:00
|
|
|
*/
|
|
|
|
class StatusIndicator : public css::lang::XTypeProvider
|
|
|
|
, public css::task::XStatusIndicator
|
|
|
|
, private ThreadHelpBase // Order of baseclasses is neccessary for right initializaton!
|
|
|
|
, public ::cppu::OWeakObject // => XInterface
|
2001-08-10 05:55:14 -05:00
|
|
|
{
|
2005-02-02 06:49:31 -06:00
|
|
|
//-------------------------------------------
|
|
|
|
// member
|
|
|
|
private:
|
|
|
|
|
|
|
|
/** @short weak reference to our factory
|
|
|
|
@descr All our interface calls will be forwarded
|
|
|
|
to a suitable c++ interface on this factory.
|
|
|
|
But we dont hold our factory alive. They
|
|
|
|
correspond with e.g. with a Frame service and
|
|
|
|
will be owned by him. If the frame will be closed
|
|
|
|
he close our factory too ...
|
|
|
|
*/
|
|
|
|
css::uno::WeakReference< css::task::XStatusIndicatorFactory > m_xFactory;
|
|
|
|
|
|
|
|
//-------------------------------------------
|
|
|
|
// c++ interface
|
2001-08-10 05:55:14 -05:00
|
|
|
public:
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//----------------------------------------
|
|
|
|
/** @short initialize new instance of this class.
|
|
|
|
|
|
|
|
@param pFactory
|
|
|
|
pointer to our factory
|
|
|
|
*/
|
|
|
|
StatusIndicator(StatusIndicatorFactory* pFactory);
|
|
|
|
|
|
|
|
//----------------------------------------
|
|
|
|
/** @short does nothing real ....
|
|
|
|
*/
|
|
|
|
virtual ~StatusIndicator();
|
|
|
|
|
|
|
|
//-------------------------------------------
|
|
|
|
// uno interface
|
|
|
|
public:
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//---------------------------------------
|
|
|
|
// XInterface, XTypeProvider
|
2001-08-10 05:55:14 -05:00
|
|
|
DECLARE_XINTERFACE
|
|
|
|
DECLARE_XTYPEPROVIDER
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//---------------------------------------
|
|
|
|
// XStatusIndicator
|
|
|
|
virtual void SAL_CALL start(const ::rtl::OUString& sText ,
|
|
|
|
sal_Int32 nRange)
|
|
|
|
throw(css::uno::RuntimeException);
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
virtual void SAL_CALL end()
|
|
|
|
throw(css::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual void SAL_CALL reset()
|
|
|
|
throw(css::uno::RuntimeException);
|
|
|
|
|
|
|
|
virtual void SAL_CALL setText(const ::rtl::OUString& sText)
|
|
|
|
throw(css::uno::RuntimeException);
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
virtual void SAL_CALL setValue(sal_Int32 nValue)
|
|
|
|
throw(css::uno::RuntimeException);
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
}; // class StatusIndicator
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
} // namespace framework
|
2001-08-10 05:55:14 -05:00
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
#endif // __FRAMEWORK_HELPER_STATUSINDICATOR_HXX_
|