2001-07-16 06:55:47 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* $RCSfile: cmdlineargs.cxx,v $
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2007-10-26 05:55:47 -05:00
|
|
|
* $Revision: 1.33 $
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2007-10-26 05:55:47 -05:00
|
|
|
* last change: $Author: vg $ $Date: 2007-10-26 11:55:47 $
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* 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.
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* 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.
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
2005-09-08 11:05:40 -05:00
|
|
|
* 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
|
2001-07-16 06:55:47 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 03:35:10 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_desktop.hxx"
|
|
|
|
|
2001-07-16 06:55:47 -05:00
|
|
|
#ifndef _DESKTOP_COMMANDLINEARGS_HXX_
|
|
|
|
#include <cmdlineargs.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _SV_SVAPP_HXX
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _RTL_URI_HXX_
|
|
|
|
#include <rtl/uri.hxx>
|
|
|
|
#endif
|
2005-03-11 03:47:18 -06:00
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
#include <com/sun/star/uri/XExternalUriReferenceTranslator.hpp>
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
|
|
|
|
using namespace rtl;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::uri;
|
|
|
|
using namespace com::sun::star::uno;
|
2001-07-16 06:55:47 -05:00
|
|
|
|
|
|
|
namespace desktop
|
|
|
|
{
|
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
class ExtCommandLineSupplier: public CommandLineArgs::Supplier {
|
|
|
|
public:
|
|
|
|
explicit ExtCommandLineSupplier(vos::OExtCommandLine & commandLine):
|
|
|
|
m_commandLine(commandLine), m_count(commandLine.getCommandArgCount()),
|
|
|
|
m_index(0) {}
|
|
|
|
|
|
|
|
virtual ~ExtCommandLineSupplier() {}
|
|
|
|
|
|
|
|
virtual bool next(rtl::OUString * argument) {
|
|
|
|
OSL_ASSERT(argument != NULL);
|
|
|
|
if (m_index < m_count) {
|
|
|
|
if (!m_commandLine.getCommandArg(m_index++, *argument)) {
|
|
|
|
OSL_ASSERT(false);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
vos::OExtCommandLine & m_commandLine;
|
|
|
|
sal_uInt32 m_count;
|
|
|
|
sal_uInt32 m_index;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2002-10-24 09:39:22 -05:00
|
|
|
static CommandLineArgs::BoolParam aModuleGroupDefinition[] =
|
|
|
|
{
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_WRITER,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_CALC,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_DRAW,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_IMPRESS,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_GLOBAL,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_MATH,
|
2004-08-02 08:39:15 -05:00
|
|
|
CommandLineArgs::CMD_BOOLPARAM_WEB,
|
|
|
|
CommandLineArgs::CMD_BOOLPARAM_BASE
|
2002-10-24 09:39:22 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
CommandLineArgs::GroupDefinition CommandLineArgs::m_pGroupDefinitions[ CommandLineArgs::CMD_GRPID_COUNT ] =
|
|
|
|
{
|
2004-08-02 08:39:15 -05:00
|
|
|
{ 8, aModuleGroupDefinition }
|
2002-10-24 09:39:22 -05:00
|
|
|
};
|
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
CommandLineArgs::Supplier::Exception::Exception() {}
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::Exception::Exception(Exception const &) {}
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::Exception::~Exception() {}
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::Exception &
|
|
|
|
CommandLineArgs::Supplier::Exception::operator =(Exception const &)
|
|
|
|
{ return *this; }
|
|
|
|
|
|
|
|
CommandLineArgs::Supplier::~Supplier() {}
|
|
|
|
|
2001-07-20 03:37:43 -05:00
|
|
|
CommandLineArgs::CommandLineArgs()
|
2001-07-16 06:55:47 -05:00
|
|
|
{
|
2001-07-20 03:37:43 -05:00
|
|
|
ResetParamValues();
|
2001-07-16 06:55:47 -05:00
|
|
|
}
|
|
|
|
|
2001-07-20 03:37:43 -05:00
|
|
|
// intialize class with command line parameters from process environment
|
2005-04-22 05:28:59 -05:00
|
|
|
CommandLineArgs::CommandLineArgs( ::vos::OExtCommandLine& aExtCmdLine )
|
2001-07-16 06:55:47 -05:00
|
|
|
{
|
2001-07-20 03:37:43 -05:00
|
|
|
ResetParamValues();
|
2007-10-26 05:55:47 -05:00
|
|
|
ExtCommandLineSupplier s( aExtCmdLine );
|
|
|
|
ParseCommandLine_Impl( s, true );
|
2001-07-16 06:55:47 -05:00
|
|
|
}
|
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
CommandLineArgs::CommandLineArgs( Supplier& supplier )
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
|
|
|
ResetParamValues();
|
2007-10-26 05:55:47 -05:00
|
|
|
ParseCommandLine_Impl( supplier, false );
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2001-07-16 06:55:47 -05:00
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier, bool convert )
|
2001-07-16 06:55:47 -05:00
|
|
|
{
|
2005-04-22 05:28:59 -05:00
|
|
|
Reference<XMultiServiceFactory> xMS(comphelper::getProcessServiceFactory(), UNO_QUERY);
|
|
|
|
OSL_ENSURE(xMS.is(), "CommandLineArgs: no ProcessServiceFactory.");
|
|
|
|
|
2005-03-11 03:47:18 -06:00
|
|
|
Reference< XExternalUriReferenceTranslator > xTranslator(
|
|
|
|
xMS->createInstance(
|
|
|
|
OUString::createFromAscii(
|
|
|
|
"com.sun.star.uri.ExternalUriReferenceTranslator")),
|
|
|
|
UNO_QUERY);
|
|
|
|
|
2001-07-20 03:37:43 -05:00
|
|
|
// parse command line arguments
|
2001-12-04 09:05:32 -06:00
|
|
|
sal_Bool bPrintEvent = sal_False;
|
|
|
|
sal_Bool bOpenEvent = sal_True;
|
2002-10-17 04:46:33 -05:00
|
|
|
sal_Bool bViewEvent = sal_False;
|
2003-05-16 08:21:09 -05:00
|
|
|
sal_Bool bStartEvent = sal_False;
|
2001-12-04 09:05:32 -06:00
|
|
|
sal_Bool bPrintToEvent = sal_False;
|
|
|
|
sal_Bool bPrinterName = sal_False;
|
2002-02-26 09:39:22 -06:00
|
|
|
sal_Bool bForceOpenEvent = sal_False;
|
|
|
|
sal_Bool bForceNewEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
sal_Bool bDisplaySpec = sal_False;
|
2001-07-20 03:37:43 -05:00
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
m_eArgumentCount = NONE;
|
2003-04-24 07:35:12 -05:00
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
for (;;)
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
2007-10-26 05:55:47 -05:00
|
|
|
::rtl::OUString aArg;
|
|
|
|
if ( !supplier.next( &aArg ) )
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ( convert )
|
|
|
|
{
|
|
|
|
// convert file URLs to internal form #112849#
|
|
|
|
if (aArg.indexOf(OUString::createFromAscii("file:"))==0 &&
|
|
|
|
xTranslator.is())
|
|
|
|
{
|
|
|
|
OUString tmp(xTranslator->translateToInternal(aArg));
|
|
|
|
if (tmp.getLength() > 0)
|
|
|
|
aArg = tmp;
|
|
|
|
}
|
|
|
|
}
|
2001-07-20 03:37:43 -05:00
|
|
|
String aArgStr = aArg;
|
|
|
|
|
|
|
|
if ( aArg.getLength() > 0 )
|
|
|
|
{
|
2007-10-26 05:55:47 -05:00
|
|
|
m_eArgumentCount = m_eArgumentCount == NONE ? ONE : MANY;
|
2001-07-20 03:37:43 -05:00
|
|
|
if ( !InterpretCommandLineParameter( aArg ))
|
|
|
|
{
|
|
|
|
if ( aArgStr.GetChar(0) == '-' )
|
|
|
|
{
|
|
|
|
// handle this argument as an option
|
2002-02-26 01:18:25 -06:00
|
|
|
if ( aArgStr.EqualsIgnoreCaseAscii( "-n" ))
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
2002-02-26 01:18:25 -06:00
|
|
|
// force new documents based on the following documents
|
|
|
|
bForceNewEvent = sal_True;
|
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bForceOpenEvent = sal_False;
|
2002-02-26 09:39:22 -06:00
|
|
|
bPrintToEvent = sal_False;
|
|
|
|
bPrintEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
bViewEvent = sal_False;
|
|
|
|
bStartEvent = sal_False;
|
|
|
|
bDisplaySpec = sal_False;
|
|
|
|
}
|
2002-02-26 01:18:25 -06:00
|
|
|
else if ( aArgStr.EqualsIgnoreCaseAscii( "-o" ))
|
|
|
|
{
|
|
|
|
// force open documents regards if they are templates or not
|
|
|
|
bForceOpenEvent = sal_True;
|
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bForceNewEvent = sal_False;
|
2002-02-26 09:39:22 -06:00
|
|
|
bPrintToEvent = sal_False;
|
|
|
|
bPrintEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
bViewEvent = sal_False;
|
|
|
|
bStartEvent = sal_False;
|
|
|
|
bDisplaySpec = sal_False;
|
|
|
|
}
|
2001-12-04 09:05:32 -06:00
|
|
|
else if ( aArgStr.EqualsIgnoreCaseAscii( "-pt" ))
|
|
|
|
{
|
2002-02-26 01:18:25 -06:00
|
|
|
// Print to special printer
|
2002-02-26 09:39:22 -06:00
|
|
|
bPrintToEvent = sal_True;
|
|
|
|
bPrinterName = sal_True;
|
|
|
|
bPrintEvent = sal_False;
|
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bForceNewEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
bViewEvent = sal_False;
|
|
|
|
bStartEvent = sal_False;
|
|
|
|
bDisplaySpec = sal_False;
|
|
|
|
bForceOpenEvent = sal_False;
|
2001-12-04 09:05:32 -06:00
|
|
|
}
|
2002-02-26 01:18:25 -06:00
|
|
|
else if ( aArgStr.EqualsIgnoreCaseAscii( "-p" ))
|
|
|
|
{
|
|
|
|
// Print to default printer
|
2002-02-26 09:39:22 -06:00
|
|
|
bPrintEvent = sal_True;
|
|
|
|
bPrintToEvent = sal_False;
|
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bForceNewEvent = sal_False;
|
|
|
|
bForceOpenEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
bViewEvent = sal_False;
|
|
|
|
bStartEvent = sal_False;
|
|
|
|
bDisplaySpec = sal_False;
|
|
|
|
}
|
2002-10-17 04:46:33 -05:00
|
|
|
else if ( aArgStr.EqualsIgnoreCaseAscii( "-view" ))
|
|
|
|
{
|
2003-03-25 06:52:54 -06:00
|
|
|
// open in viewmode
|
2002-10-17 04:46:33 -05:00
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bPrintEvent = sal_False;
|
|
|
|
bPrintToEvent = sal_False;
|
|
|
|
bForceNewEvent = sal_False;
|
|
|
|
bForceOpenEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
bViewEvent = sal_True;
|
|
|
|
bStartEvent = sal_False;
|
|
|
|
bDisplaySpec = sal_False;
|
|
|
|
}
|
2003-05-27 04:29:23 -05:00
|
|
|
else if ( aArgStr.EqualsIgnoreCaseAscii( "-show" ))
|
2003-05-16 08:21:09 -05:00
|
|
|
{
|
|
|
|
// open in viewmode
|
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bViewEvent = sal_False;
|
|
|
|
bStartEvent = sal_True;
|
|
|
|
bPrintEvent = sal_False;
|
|
|
|
bPrintToEvent = sal_False;
|
|
|
|
bForceNewEvent = sal_False;
|
|
|
|
bForceOpenEvent = sal_False;
|
2003-06-10 03:12:23 -05:00
|
|
|
bDisplaySpec = sal_False;
|
|
|
|
}
|
|
|
|
else if ( aArgStr.EqualsIgnoreCaseAscii( "-display" ))
|
|
|
|
{
|
|
|
|
// open in viewmode
|
|
|
|
bOpenEvent = sal_False;
|
|
|
|
bPrintEvent = sal_False;
|
|
|
|
bForceOpenEvent = sal_False;
|
|
|
|
bPrintToEvent = sal_False;
|
|
|
|
bForceNewEvent = sal_False;
|
|
|
|
bViewEvent = sal_False;
|
|
|
|
bStartEvent = sal_False;
|
|
|
|
bDisplaySpec = sal_True;
|
2003-05-16 08:21:09 -05:00
|
|
|
}
|
2003-06-10 03:12:23 -05:00
|
|
|
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-12-04 09:05:32 -06:00
|
|
|
if ( bPrinterName && bPrintToEvent )
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
2001-12-04 09:05:32 -06:00
|
|
|
// first argument after "-pt" this must be the printer name
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTERNAME, aArgStr );
|
2001-12-04 09:05:32 -06:00
|
|
|
bPrinterName = sal_False;
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
2001-12-04 09:05:32 -06:00
|
|
|
else
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
2001-12-04 09:05:32 -06:00
|
|
|
// handle this argument as a filename
|
|
|
|
if ( bOpenEvent )
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_OPENLIST, aArgStr );
|
2003-03-25 06:52:54 -06:00
|
|
|
else if ( bViewEvent )
|
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_VIEWLIST, aArgStr );
|
2003-05-16 08:21:09 -05:00
|
|
|
else if ( bStartEvent )
|
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_STARTLIST, aArgStr );
|
2001-12-04 09:05:32 -06:00
|
|
|
else if ( bPrintEvent )
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTLIST, aArgStr );
|
2002-02-26 01:18:25 -06:00
|
|
|
else if ( bPrintToEvent )
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PRINTTOLIST, aArgStr );
|
2002-02-26 01:18:25 -06:00
|
|
|
else if ( bForceNewEvent )
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_FORCENEWLIST, aArgStr );
|
2002-02-26 01:18:25 -06:00
|
|
|
else if ( bForceOpenEvent )
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_FORCEOPENLIST, aArgStr );
|
2003-06-10 03:12:23 -05:00
|
|
|
else if ( bDisplaySpec ){
|
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_DISPLAY, aArgStr );
|
|
|
|
bDisplaySpec = sal_False; // only one display, not a lsit
|
|
|
|
bOpenEvent = sal_True; // set back to standard
|
|
|
|
}
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-10-26 05:55:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::AddStringListParam_Impl( StringParam eParam, const rtl::OUString& aParam )
|
|
|
|
{
|
|
|
|
OSL_ASSERT( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT );
|
|
|
|
if ( m_aStrParams[eParam].getLength() )
|
|
|
|
m_aStrParams[eParam] += ::rtl::OUString::valueOf( (sal_Unicode)APPEVENT_PARAM_DELIMITER );
|
|
|
|
m_aStrParams[eParam] += aParam;
|
|
|
|
m_aStrSetParams[eParam] = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::SetBoolParam_Impl( BoolParam eParam, sal_Bool bValue )
|
|
|
|
{
|
|
|
|
OSL_ASSERT( eParam >= 0 && eParam < CMD_BOOLPARAM_COUNT );
|
|
|
|
m_aBoolParams[eParam] = bValue;
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::InterpretCommandLineParameter( const ::rtl::OUString& aArg )
|
|
|
|
{
|
|
|
|
String aArgStr( aArg );
|
|
|
|
|
|
|
|
if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-minimized" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_MINIMIZED, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-invisible" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2001-09-10 08:00:16 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-norestore" )) == sal_True )
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NORESTORE, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2003-03-25 06:52:54 -06:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nodefault" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NODEFAULT, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2001-07-20 03:37:43 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-bean" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_BEAN, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-plugin" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_PLUGIN, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-server" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_SERVER, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-headless" )) == sal_True )
|
|
|
|
{
|
2002-10-15 02:12:30 -05:00
|
|
|
// Headless means also invisibile, so set this parameter to true!
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HEADLESS, sal_True );
|
2002-10-15 02:12:30 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_INVISIBLE, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
|
|
|
|
{
|
2007-09-20 09:35:43 -05:00
|
|
|
#if defined(WNT) || defined(OS2)
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
|
2005-03-11 03:47:18 -06:00
|
|
|
#endif
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-terminate_after_init" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_TERMINATEAFTERINIT, sal_True );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2006-08-04 05:13:05 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nofirststartwizard" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOFIRSTSTARTWIZARD, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2002-07-08 23:21:23 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nologo" )) == sal_True )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOLOGO, sal_True );
|
2002-07-08 23:21:23 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2002-10-24 07:15:14 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-nolockcheck" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_NOLOCKCHECK, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2003-03-25 06:52:54 -06:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-help" ))
|
|
|
|
|| aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ))
|
|
|
|
|| aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-?" )))
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELP, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2003-06-27 03:42:22 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpwriter" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPWRITER, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpcalc" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPCALC, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpdraw" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPDRAW, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpimpress" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPIMPRESS, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2004-08-02 08:39:15 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpbase" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPBASE, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2003-06-27 03:42:22 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpbasic" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPBASIC, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-helpmath" )) == sal_True )
|
|
|
|
{
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_HELPMATH, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2001-07-20 03:37:43 -05:00
|
|
|
else if ( aArgStr.Copy(0, 8).EqualsIgnoreCaseAscii( "-accept=" ))
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_ACCEPT, aArgStr.Copy( 8 ) );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2003-03-25 06:52:54 -06:00
|
|
|
else if ( aArgStr.Copy(0, 10).EqualsIgnoreCaseAscii( "-unaccept=" ))
|
|
|
|
{
|
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_UNACCEPT, aArgStr.Copy( 10 ) );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2001-07-20 03:37:43 -05:00
|
|
|
else if ( aArgStr.CompareIgnoreCaseToAscii( "-portal," ,
|
|
|
|
RTL_CONSTASCII_LENGTH( "-portal," )) == COMPARE_EQUAL )
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_PORTAL, aArgStr.Copy( RTL_CONSTASCII_LENGTH( "-portal," )) );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArgStr.Copy( 0, 7 ).EqualsIgnoreCaseAscii( "-userid" ))
|
|
|
|
{
|
2003-03-25 06:52:54 -06:00
|
|
|
if ( aArgStr.Len() > 8 )
|
2001-07-20 03:37:43 -05:00
|
|
|
{
|
2003-03-25 06:52:54 -06:00
|
|
|
rtl::OUString aUserDir = aArgStr;
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl(
|
|
|
|
CMD_STRINGPARAM_USERDIR,
|
2003-03-25 06:52:54 -06:00
|
|
|
::rtl::Uri::decode( aUserDir.copy( 8 ),
|
2002-09-23 06:44:00 -05:00
|
|
|
rtl_UriDecodeWithCharset,
|
|
|
|
RTL_TEXTENCODING_UTF8 ) );
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArgStr.Copy( 0, 15).EqualsIgnoreCaseAscii( "-clientdisplay=" ))
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_CLIENTDISPLAY, aArgStr.Copy( 15 ) );
|
2001-07-20 03:37:43 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2001-09-26 03:16:22 -05:00
|
|
|
else if ( aArgStr.Copy(0, 9).EqualsIgnoreCaseAscii( "-version=" ))
|
|
|
|
{
|
2002-09-23 06:44:00 -05:00
|
|
|
AddStringListParam_Impl( CMD_STRINGPARAM_VERSION, aArgStr.Copy( 15 ) );
|
2001-09-26 03:16:22 -05:00
|
|
|
return sal_True;
|
|
|
|
}
|
2002-10-24 09:39:22 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-writer" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WRITER );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_WRITER, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-calc" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_CALC );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_CALC, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-draw" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_DRAW );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_DRAW, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-impress" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_IMPRESS );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_IMPRESS, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2004-08-02 08:39:15 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-base" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_BASE );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_BASE, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
2002-10-24 09:39:22 -05:00
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-global" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_GLOBAL );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_GLOBAL, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-math" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_MATH );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_MATH, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-web" )) == sal_True )
|
|
|
|
{
|
|
|
|
sal_Bool bAlreadySet = CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_WEB );
|
|
|
|
if ( !bAlreadySet )
|
|
|
|
SetBoolParam_Impl( CMD_BOOLPARAM_WEB, sal_True );
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::CheckGroupMembers( GroupParamId nGroupId, BoolParam nExcludeMember ) const
|
|
|
|
{
|
|
|
|
// Check if at least one bool param out of a group is set. An exclude member can be provided.
|
|
|
|
for ( int i = 0; i < m_pGroupDefinitions[nGroupId].nCount; i++ )
|
|
|
|
{
|
|
|
|
BoolParam nParam = m_pGroupDefinitions[nGroupId].pGroupMembers[i];
|
|
|
|
if ( nParam != nExcludeMember && m_aBoolParams[nParam] )
|
|
|
|
return sal_True;
|
|
|
|
}
|
2001-07-20 03:37:43 -05:00
|
|
|
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::ResetParamValues()
|
|
|
|
{
|
2003-12-01 11:05:33 -06:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for ( i = 0; i < CMD_BOOLPARAM_COUNT; i++ )
|
2002-09-23 06:44:00 -05:00
|
|
|
m_aBoolParams[i] = sal_False;
|
2002-10-15 02:12:30 -05:00
|
|
|
for ( i = 0; i < CMD_STRINGPARAM_COUNT; i++ )
|
|
|
|
m_aStrSetParams[i] = sal_False;
|
2007-10-26 05:55:47 -05:00
|
|
|
m_eArgumentCount = NONE;
|
2002-09-23 06:44:00 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetBoolParam( BoolParam eParam ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
|
|
|
OSL_ASSERT( ( eParam >= 0 && eParam < CMD_BOOLPARAM_COUNT ) );
|
|
|
|
return m_aBoolParams[eParam];
|
|
|
|
}
|
|
|
|
|
|
|
|
void CommandLineArgs::SetBoolParam( BoolParam eParam, sal_Bool bNewValue )
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
|
|
|
OSL_ASSERT( ( eParam >= 0 && eParam < CMD_BOOLPARAM_COUNT ) );
|
|
|
|
m_aBoolParams[eParam] = bNewValue;
|
|
|
|
}
|
|
|
|
|
2006-10-12 08:04:29 -05:00
|
|
|
const rtl::OUString& CommandLineArgs::GetStringParam( StringParam eParam ) const
|
2002-09-23 06:44:00 -05:00
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
|
|
|
OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) );
|
|
|
|
return m_aStrParams[eParam];
|
|
|
|
}
|
|
|
|
|
2006-10-12 08:04:29 -05:00
|
|
|
void CommandLineArgs::SetStringParam( StringParam eParam, const rtl::OUString& aNewValue )
|
2002-09-23 06:44:00 -05:00
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
|
|
|
OSL_ASSERT( ( eParam >= 0 && eParam < CMD_STRINGPARAM_COUNT ) );
|
|
|
|
m_aStrParams[eParam] = aNewValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsMinimized() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_MINIMIZED ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsInvisible() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_INVISIBLE ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsNoRestore() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NORESTORE ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
sal_Bool CommandLineArgs::IsNoDefault() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NODEFAULT ];
|
|
|
|
}
|
|
|
|
|
2002-09-23 06:44:00 -05:00
|
|
|
sal_Bool CommandLineArgs::IsBean() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_BEAN ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsPlugin() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_PLUGIN ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsServer() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_SERVER ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHeadless() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HEADLESS ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsQuickstart() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_QUICKSTART ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsTerminateAfterInit() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_TERMINATEAFTERINIT ];
|
|
|
|
}
|
|
|
|
|
2006-08-04 05:13:05 -05:00
|
|
|
sal_Bool CommandLineArgs::IsNoFirstStartWizard() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NOFIRSTSTARTWIZARD ];
|
|
|
|
}
|
|
|
|
|
2002-09-23 06:44:00 -05:00
|
|
|
sal_Bool CommandLineArgs::IsNoLogo() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NOLOGO ];
|
|
|
|
}
|
|
|
|
|
2002-10-24 07:15:14 -05:00
|
|
|
sal_Bool CommandLineArgs::IsNoLockcheck() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_NOLOCKCHECK ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
sal_Bool CommandLineArgs::IsHelp() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELP ];
|
|
|
|
}
|
2003-06-27 03:42:22 -05:00
|
|
|
sal_Bool CommandLineArgs::IsHelpWriter() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPWRITER ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpCalc() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPCALC ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpDraw() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPDRAW ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpImpress() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPIMPRESS ];
|
|
|
|
}
|
2004-08-02 08:39:15 -05:00
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsHelpBase() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPBASE ];
|
|
|
|
}
|
2003-06-27 03:42:22 -05:00
|
|
|
sal_Bool CommandLineArgs::IsHelpMath() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPMATH ];
|
|
|
|
}
|
|
|
|
sal_Bool CommandLineArgs::IsHelpBasic() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_HELPBASIC ];
|
|
|
|
}
|
2003-03-25 06:52:54 -06:00
|
|
|
|
2002-10-24 09:39:22 -05:00
|
|
|
sal_Bool CommandLineArgs::IsWriter() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_WRITER ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsCalc() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_CALC ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsDraw() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_DRAW ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsImpress() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_IMPRESS ];
|
|
|
|
}
|
|
|
|
|
2004-08-02 08:39:15 -05:00
|
|
|
sal_Bool CommandLineArgs::IsBase() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_BASE ];
|
|
|
|
}
|
|
|
|
|
2002-10-24 09:39:22 -05:00
|
|
|
sal_Bool CommandLineArgs::IsGlobal() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_GLOBAL ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsMath() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_MATH ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsWeb() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return m_aBoolParams[ CMD_BOOLPARAM_WEB ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::HasModuleParam() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return CheckGroupMembers( CMD_GRPID_MODULE, CMD_BOOLPARAM_COUNT );
|
|
|
|
}
|
|
|
|
|
2002-09-23 06:44:00 -05:00
|
|
|
sal_Bool CommandLineArgs::GetPortalConnectString( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PORTAL ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PORTAL ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetAcceptString( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_ACCEPT ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_ACCEPT ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
sal_Bool CommandLineArgs::GetUnAcceptString( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_UNACCEPT ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_UNACCEPT ];
|
|
|
|
}
|
|
|
|
|
2002-09-23 06:44:00 -05:00
|
|
|
sal_Bool CommandLineArgs::GetUserDir( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_USERDIR ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_USERDIR ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetClientDisplay( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_CLIENTDISPLAY ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_CLIENTDISPLAY ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetOpenList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_OPENLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_OPENLIST ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
sal_Bool CommandLineArgs::GetViewList( ::rtl::OUString& rPara) const
|
2002-09-23 06:44:00 -05:00
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
2003-03-25 06:52:54 -06:00
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_VIEWLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_VIEWLIST ];
|
2002-09-23 06:44:00 -05:00
|
|
|
}
|
|
|
|
|
2003-05-16 08:21:09 -05:00
|
|
|
sal_Bool CommandLineArgs::GetStartList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_STARTLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_STARTLIST ];
|
|
|
|
}
|
|
|
|
|
2003-03-25 06:52:54 -06:00
|
|
|
sal_Bool CommandLineArgs::GetForceOpenList( ::rtl::OUString& rPara) const
|
2002-10-17 04:46:33 -05:00
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
2003-03-25 06:52:54 -06:00
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_FORCEOPENLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_FORCEOPENLIST ];
|
2002-10-17 04:46:33 -05:00
|
|
|
}
|
|
|
|
|
2002-09-23 06:44:00 -05:00
|
|
|
sal_Bool CommandLineArgs::GetForceNewList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_FORCENEWLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_FORCENEWLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetPrintList( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PRINTLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetVersionString( ::rtl::OUString& rPara) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_VERSION ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_VERSION ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetPrintToList( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PRINTTOLIST ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTTOLIST ];
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::GetPrinterName( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_PRINTERNAME ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_PRINTERNAME ];
|
2001-07-20 03:37:43 -05:00
|
|
|
}
|
|
|
|
|
2003-06-10 03:12:23 -05:00
|
|
|
sal_Bool CommandLineArgs::GetDisplay( ::rtl::OUString& rPara ) const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
rPara = m_aStrParams[ CMD_STRINGPARAM_DISPLAY ];
|
|
|
|
return m_aStrSetParams[ CMD_STRINGPARAM_DISPLAY ];
|
|
|
|
}
|
|
|
|
|
2003-04-24 07:35:12 -05:00
|
|
|
sal_Bool CommandLineArgs::IsPrinting() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
return( m_aStrParams[ CMD_STRINGPARAM_PRINTLIST ].getLength() > 0 ||
|
|
|
|
m_aStrParams[ CMD_STRINGPARAM_PRINTTOLIST ].getLength() > 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
sal_Bool CommandLineArgs::IsEmpty() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
2007-10-26 05:55:47 -05:00
|
|
|
return m_eArgumentCount == NONE;
|
2003-04-24 07:35:12 -05:00
|
|
|
}
|
|
|
|
|
2005-02-16 09:37:36 -06:00
|
|
|
sal_Bool CommandLineArgs::IsEmptyOrAcceptOnly() const
|
|
|
|
{
|
|
|
|
osl::MutexGuard aMutexGuard( m_aMutex );
|
|
|
|
|
2007-10-26 05:55:47 -05:00
|
|
|
return m_eArgumentCount == NONE || ( ( m_eArgumentCount == ONE ) && ( m_aStrParams[ CMD_STRINGPARAM_ACCEPT ].getLength() ) );
|
2005-02-16 09:37:36 -06:00
|
|
|
}
|
|
|
|
|
2001-07-16 06:55:47 -05:00
|
|
|
} // namespace desktop
|