/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: sfx2_shutdownicon.cxx,v $
 *
 *  $Revision: 1.7 $
 *
 *  last change: $Author: vg $ $Date: 2006/11/22 10:17:45 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 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
 *
 ************************************************************************/

#include <shutdownicon.hxx>
#include <app.hrc>
#include <app.hxx>
#include <vos/mutex.hxx>
#include <svtools/imagemgr.hxx>
// #include <cmdlineargs.hxx>

#ifndef _COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP_
#include <com/sun/star/task/XInteractionHandler.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XDISPATCHRESULTLISTENER_HPP_
#include <com/sun/star/frame/XDispatchResultListener.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XNOTIFYINGDISPATCH_HPP_
#include <com/sun/star/frame/XNotifyingDispatch.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XFRAMESSUPPLIER_HPP_
#include <com/sun/star/frame/XFramesSupplier.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
#include <com/sun/star/frame/XComponentLoader.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
#include <com/sun/star/frame/XFrame.hpp>
#endif
#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
#include <com/sun/star/util/XURLTransformer.hpp>
#endif
#ifndef _COM_SUN_STAR_FRAME_XFRAMESSUPPLIER_HPP_
#include <com/sun/star/frame/XFramesSupplier.hpp>
#endif
//#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_
//#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
//#endif
//#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERMANAGER_HPP_
//#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
//#endif
//#ifndef _COM_SUN_STAR_UI_DIALOGS_EXTENDEDFILEPICKERELEMENTIDS_HPP_
//#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
//#endif
//#ifndef _COM_SUN_STAR_UI_DIALOGS_COMMONFILEPICKERELEMENTIDS_HPP_
//#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
//#endif
//#ifndef _COM_SUN_STAR_UI_DIALOGS_CONTROLACTIONS_HPP_
//#include <com/sun/star/ui/dialogs/ControlActions.hpp>
//#endif
#ifndef _COM_SUN_STAR_DOCUMENT_MACROEXECMODE_HPP_
#include <com/sun/star/document/MacroExecMode.hpp>
#endif
#ifndef _COM_SUN_STAR_DOCUMENT_UPDATEDOCMODE_HPP_
#include <com/sun/star/document/UpdateDocMode.hpp>
#endif
//#ifndef _FILEDLGHELPER_HXX
//#include <filedlghelper.hxx>
//#endif
#ifndef _SFX_FCONTNR_HXX
#include "fcontnr.hxx"
#endif
#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
#include <comphelper/processfactory.hxx>
#endif
#ifndef _CPPUHELPER_COMPBASE1_HXX_
#include <cppuhelper/compbase1.hxx>
#endif
#include "dispatch.hxx"
#include <comphelper/extract.hxx>
#ifndef _URLOBJ_HXX
#include <tools/urlobj.hxx>
#endif

#ifndef _LEGACYBINFILTERMGR_HXX
#include <legacysmgr/legacy_binfilters_smgr.hxx>	//STRIP002
#endif
namespace binfilter {

using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::util;
//using namespace ::com::sun::star::ui::dialogs;
using namespace ::vos;
using namespace ::rtl;
//using namespace sfx2;




/*N*/ SFX_IMPL_XSERVICEINFO( ShutdownIcon, "com.sun.star.office.Quickstart", "com.sun.star.comp.desktop.QuickstartWrapper" )	\
/*N*/ SFX_IMPL_ONEINSTANCEFACTORY( ShutdownIcon );

ShutdownIcon* ShutdownIcon::pShutdownIcon = 0;

/*?*/ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) :
/*?*/ 	ShutdownIconServiceBase( m_aMutex ),
/*?*/ 	m_xServiceManager( aSMgr ),
/*?*/ 	m_pResMgr( 0 ),
/*?*/ 	m_bVeto ( false )
/*?*/ {
/*?*/ }

/*?*/ ShutdownIcon::~ShutdownIcon()
/*?*/ {DBG_BF_ASSERT(0, "STRIP");//STRIP001
/*?*/ #ifdef WNT
/*?*/ #endif
/*?*/ }

// ---------------------------------------------------------------------------

/*?*/ bool ShutdownIcon::GetAutostart( )
/*?*/ {DBG_BF_ASSERT(0, "STRIP"); return false;//STRIP001
/*?*/ }


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------

/*N*/ void SAL_CALL ShutdownIcon::disposing()
/*N*/ {
/*N*/ 	m_xServiceManager = Reference< XMultiServiceFactory >();
/*N*/ 	m_xDesktop = Reference< XDesktop >();
/*N*/ }

// ---------------------------------------------------------------------------

// XEventListener
/*?*/ void SAL_CALL ShutdownIcon::disposing( const ::com::sun::star::lang::EventObject& Source )
/*?*/ 	throw(::com::sun::star::uno::RuntimeException)
/*?*/ {
/*?*/ }

// ---------------------------------------------------------------------------

// XTerminateListener
/*?*/ void SAL_CALL ShutdownIcon::queryTermination( const ::com::sun::star::lang::EventObject& aEvent )
/*?*/ throw(::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException)
/*?*/ {DBG_BF_ASSERT(0, "STRIP"); //STRIP001
/*?*/ }


// ---------------------------------------------------------------------------

/*?*/ void SAL_CALL ShutdownIcon::notifyTermination( const ::com::sun::star::lang::EventObject& aEvent )
/*?*/ throw(::com::sun::star::uno::RuntimeException)
/*?*/ {
/*?*/ }


// ---------------------------------------------------------------------------

/*N*/ void SAL_CALL ShutdownIcon::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& aArguments )
/*N*/ 	throw( ::com::sun::star::uno::Exception )
/*N*/ {
/*N*/ 	::osl::ClearableMutexGuard	aGuard(	m_aMutex );
/*N*/
/*N*/ 	if ( aArguments.getLength() > 0 )
/*N*/ 	{
/*N*/ 		if ( !ShutdownIcon::pShutdownIcon )
/*N*/ 		{
/*N*/ 			try
/*N*/ 			{
/*N*/ 				sal_Bool bQuickstart = sal_False;
/*N*/ 				bQuickstart = ::cppu::any2bool( aArguments[0] );
/*N*/ 				if( !bQuickstart && !GetAutostart() )
/*N*/ 					return;
/*N*/				DBG_BF_ASSERT(0, "STRIP"); //STRIP001
/*?*/ 			}
/*?*/ 			catch(const ::com::sun::star::lang::IllegalArgumentException&)
/*?*/ 			{
/*?*/ 			}
/*N*/ 		}
/*N*/ 	}
/*N*/ }
}
