2001-08-10 05:55:14 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 01:04:57 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2008-04-11 01:04:57 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2008-04-11 01:04:57 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2008-04-11 01:04:57 -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.
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2008-04-11 01:04:57 -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).
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
2008-04-11 01:04:57 -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.
|
2001-08-10 05:55:14 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
#include <helper/statusindicatorfactory.hxx>
|
|
|
|
#include <threadhelp/threadhelpbase.hxx>
|
|
|
|
#include <macros/xinterface.hxx>
|
|
|
|
#include <macros/xtypeprovider.hxx>
|
|
|
|
#include <macros/debug.hxx>
|
2005-02-02 06:49:31 -06:00
|
|
|
#include <macros/generic.hxx>
|
|
|
|
|
|
|
|
//_______________________________________________
|
|
|
|
// include UNO interfaces
|
2001-08-10 05:55:14 -05:00
|
|
|
#include <com/sun/star/task/XStatusIndicator.hpp>
|
|
|
|
|
2005-02-02 06:49:31 -06:00
|
|
|
//_______________________________________________
|
|
|
|
// include all others
|
2001-08-10 05:55:14 -05:00
|
|
|
#include <cppuhelper/weak.hxx>
|
|
|
|
#include <cppuhelper/weakref.hxx>
|
|
|
|
|
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
|
2006-06-19 04:54:16 -05:00
|
|
|
FWK_DECLARE_XINTERFACE
|
|
|
|
FWK_DECLARE_XTYPEPROVIDER
|
2001-08-10 05:55:14 -05:00
|
|
|
|
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_
|