2004-04-13 11:07:59 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 03:10:21 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
2008-04-11 03:10:21 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
2008-04-11 03:10:21 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
2008-04-11 03:10:21 +00: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.
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
2008-04-11 03:10:21 +00: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).
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
2008-04-11 03:10:21 +00: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.
|
2004-04-13 11:07:59 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 08:42:56 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_desktop.hxx"
|
|
|
|
|
2004-04-13 11:07:59 +00:00
|
|
|
#include "dp_backend.h"
|
|
|
|
#include "dp_ucb.h"
|
|
|
|
#include "rtl/uri.hxx"
|
2010-04-19 11:33:33 +02:00
|
|
|
#include "rtl/bootstrap.hxx"
|
2010-03-25 10:32:07 +01:00
|
|
|
#include "osl/file.hxx"
|
2004-04-13 11:07:59 +00:00
|
|
|
#include "cppuhelper/exc_hlp.hxx"
|
2006-03-06 09:21:41 +00:00
|
|
|
#include "comphelper/servicedecl.hxx"
|
|
|
|
#include "comphelper/unwrapargs.hxx"
|
2004-08-12 11:09:42 +00:00
|
|
|
#include "ucbhelper/content.hxx"
|
2004-04-13 11:07:59 +00:00
|
|
|
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
|
2010-03-22 12:35:33 +01:00
|
|
|
#include "com/sun/star/deployment/InvalidRemovedParameterException.hpp"
|
2010-03-25 10:32:07 +01:00
|
|
|
#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
|
|
|
|
#include "com/sun/star/ucb/IOErrorCode.hpp"
|
2008-06-06 07:10:59 +00:00
|
|
|
#include "com/sun/star/beans/StringPair.hpp"
|
2010-03-25 10:32:07 +01:00
|
|
|
#include "com/sun/star/sdbc/XResultSet.hpp"
|
|
|
|
#include "com/sun/star/sdbc/XRow.hpp"
|
2004-04-13 11:07:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
using namespace ::dp_misc;
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::ucb;
|
|
|
|
using ::rtl::OUString;
|
|
|
|
|
2004-08-12 11:09:42 +00:00
|
|
|
namespace dp_registry {
|
|
|
|
namespace backend {
|
2004-04-13 11:07:59 +00:00
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
PackageRegistryBackend::~PackageRegistryBackend()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
void PackageRegistryBackend::disposing( lang::EventObject const & event )
|
|
|
|
throw (RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2004-06-11 11:11:31 +00:00
|
|
|
Reference<deployment::XPackage> xPackage(
|
|
|
|
event.Source, UNO_QUERY_THROW );
|
|
|
|
OUString url( xPackage->getURL() );
|
|
|
|
::osl::MutexGuard guard( getMutex() );
|
2006-10-12 13:09:59 +00:00
|
|
|
if ( m_bound.erase( url ) != 1 )
|
|
|
|
{
|
|
|
|
OSL_ASSERT( false );
|
|
|
|
}
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
PackageRegistryBackend::PackageRegistryBackend(
|
2004-08-12 11:09:42 +00:00
|
|
|
Sequence<Any> const & args,
|
2006-03-06 09:21:41 +00:00
|
|
|
Reference<XComponentContext> const & xContext )
|
2004-06-11 11:11:31 +00:00
|
|
|
: t_BackendBase( getMutex() ),
|
|
|
|
m_xComponentContext( xContext ),
|
|
|
|
m_eContext( CONTEXT_UNKNOWN ),
|
2004-11-09 13:10:41 +00:00
|
|
|
m_readOnly( false )
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2006-03-06 09:21:41 +00:00
|
|
|
boost::optional<OUString> cachePath;
|
|
|
|
boost::optional<bool> readOnly;
|
|
|
|
comphelper::unwrapArgs( args, m_context, cachePath, readOnly );
|
|
|
|
if (cachePath)
|
|
|
|
m_cachePath = *cachePath;
|
|
|
|
if (readOnly)
|
|
|
|
m_readOnly = *readOnly;
|
2004-08-12 11:09:42 +00:00
|
|
|
|
|
|
|
if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("user") ))
|
|
|
|
m_eContext = CONTEXT_USER;
|
|
|
|
else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") ))
|
|
|
|
m_eContext = CONTEXT_SHARED;
|
2010-05-04 12:37:01 +02:00
|
|
|
else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bundled") ))
|
|
|
|
m_eContext = CONTEXT_BUNDLED;
|
|
|
|
else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("tmp") ))
|
|
|
|
m_eContext = CONTEXT_TMP;
|
2004-08-12 11:09:42 +00:00
|
|
|
else if (m_context.matchIgnoreAsciiCaseAsciiL(
|
|
|
|
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.tdoc:/") ))
|
|
|
|
m_eContext = CONTEXT_DOCUMENT;
|
|
|
|
else
|
|
|
|
m_eContext = CONTEXT_UNKNOWN;
|
2004-06-11 11:11:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void PackageRegistryBackend::check()
|
|
|
|
{
|
|
|
|
::osl::MutexGuard guard( getMutex() );
|
2004-08-12 11:09:42 +00:00
|
|
|
if (rBHelper.bInDispose || rBHelper.bDisposed) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw lang::DisposedException(
|
|
|
|
OUSTR("PackageRegistryBackend instance has already been disposed!"),
|
|
|
|
static_cast<OWeakObject *>(this) );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
2004-06-11 11:11:31 +00:00
|
|
|
}
|
2004-04-13 11:07:59 +00:00
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void PackageRegistryBackend::disposing()
|
|
|
|
{
|
2004-08-12 11:09:42 +00:00
|
|
|
try {
|
2004-04-13 11:07:59 +00:00
|
|
|
m_xComponentContext.clear();
|
2004-06-11 11:11:31 +00:00
|
|
|
WeakComponentImplHelperBase::disposing();
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (RuntimeException &) {
|
2004-04-13 11:07:59 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (Exception &) {
|
2004-04-13 11:07:59 +00:00
|
|
|
Any exc( ::cppu::getCaughtException() );
|
|
|
|
throw lang::WrappedTargetRuntimeException(
|
|
|
|
OUSTR("caught unexpected exception while disposing!"),
|
2004-06-11 11:11:31 +00:00
|
|
|
static_cast<OWeakObject *>(this), exc );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// XPackageRegistry
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
Reference<deployment::XPackage> PackageRegistryBackend::bindPackage(
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString const & url, OUString const & mediaType, sal_Bool bRemoved,
|
|
|
|
OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
|
|
|
|
throw (deployment::DeploymentException,
|
|
|
|
deployment::InvalidRemovedParameterException,
|
|
|
|
ucb::CommandFailedException,
|
2004-06-11 11:11:31 +00:00
|
|
|
lang::IllegalArgumentException, RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2004-06-11 11:11:31 +00:00
|
|
|
::osl::ResettableMutexGuard guard( getMutex() );
|
|
|
|
check();
|
2010-03-22 12:35:33 +01:00
|
|
|
|
|
|
|
t_string2ref::const_iterator const iFind( m_bound.find( url ) );
|
|
|
|
if (iFind != m_bound.end())
|
2010-05-04 12:37:01 +02:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
Reference<deployment::XPackage> xPackage( iFind->second );
|
|
|
|
if (xPackage.is())
|
2010-05-04 12:37:01 +02:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (mediaType.getLength() &&
|
|
|
|
mediaType != xPackage->getPackageType()->getMediaType())
|
|
|
|
throw lang::IllegalArgumentException
|
|
|
|
(OUSTR("XPackageRegistry::bindPackage: media type does not match"),
|
|
|
|
static_cast<OWeakObject*>(this), 1);
|
|
|
|
if (xPackage->isRemoved() != bRemoved)
|
|
|
|
throw deployment::InvalidRemovedParameterException(
|
|
|
|
OUSTR("XPackageRegistry::bindPackage: bRemoved parameter does not match"),
|
|
|
|
static_cast<OWeakObject*>(this), xPackage->isRemoved(), xPackage);
|
|
|
|
return xPackage;
|
2010-05-04 12:37:01 +02:00
|
|
|
}
|
2004-06-11 11:11:31 +00:00
|
|
|
}
|
2010-03-22 12:35:33 +01:00
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
guard.clear();
|
|
|
|
|
|
|
|
Reference<deployment::XPackage> xNewPackage;
|
2004-08-12 11:09:42 +00:00
|
|
|
try {
|
2010-04-19 11:33:33 +02:00
|
|
|
xNewPackage = bindPackage_( url, mediaType, bRemoved,
|
|
|
|
identifier, xCmdEnv );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (RuntimeException &) {
|
2004-04-13 11:07:59 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (lang::IllegalArgumentException &) {
|
2004-04-13 11:07:59 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (CommandFailedException &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw;
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (deployment::DeploymentException &) {
|
2004-04-13 11:07:59 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (Exception &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
Any exc( ::cppu::getCaughtException() );
|
|
|
|
throw deployment::DeploymentException(
|
|
|
|
OUSTR("Error binding package: ") + url,
|
|
|
|
static_cast<OWeakObject *>(this), exc );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
guard.reset();
|
2010-03-22 12:35:33 +01:00
|
|
|
|
|
|
|
::std::pair< t_string2ref::iterator, bool > insertion(
|
|
|
|
m_bound.insert( t_string2ref::value_type( url, xNewPackage ) ) );
|
|
|
|
if (insertion.second)
|
|
|
|
{ // first insertion
|
|
|
|
OSL_ASSERT( Reference<XInterface>(insertion.first->second)
|
|
|
|
== xNewPackage );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
2010-03-22 12:35:33 +01:00
|
|
|
else
|
|
|
|
{ // found existing entry
|
|
|
|
Reference<deployment::XPackage> xPackage( insertion.first->second );
|
|
|
|
if (xPackage.is())
|
|
|
|
return xPackage;
|
|
|
|
insertion.first->second = xNewPackage;
|
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
guard.clear();
|
|
|
|
xNewPackage->addEventListener( this ); // listen for disposing events
|
|
|
|
return xNewPackage;
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
2010-03-25 10:32:07 +01:00
|
|
|
OUString PackageRegistryBackend::createFolder(
|
|
|
|
OUString const & relUrl,
|
|
|
|
Reference<ucb::XCommandEnvironment> const & xCmdEnv)
|
|
|
|
{
|
|
|
|
OUString sDataFolder = makeURL(getCachePath(), relUrl);
|
|
|
|
//make sure the folder exist
|
|
|
|
ucbhelper::Content dataContent;
|
|
|
|
::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv);
|
|
|
|
|
|
|
|
OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder);
|
|
|
|
|
|
|
|
OUString tempEntry;
|
|
|
|
if (::osl::File::createTempFile(
|
|
|
|
&sDataFolderURL, 0, &tempEntry ) != ::osl::File::E_None)
|
|
|
|
throw RuntimeException(
|
|
|
|
OUSTR("::osl::File::createTempFile() failed!"), 0 );
|
|
|
|
tempEntry = tempEntry.copy( tempEntry.lastIndexOf( '/' ) + 1 );
|
|
|
|
OUString destFolder= makeURL(sDataFolder, tempEntry) + OUSTR("_");
|
|
|
|
::ucbhelper::Content destFolderContent;
|
|
|
|
dp_misc::create_folder( &destFolderContent, destFolder, xCmdEnv );
|
|
|
|
|
|
|
|
return destFolder;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PackageRegistryBackend::deleteUnusedFolders(
|
|
|
|
OUString const & relUrl,
|
|
|
|
::std::list< OUString> const & usedFolders)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
const OUString sDataFolder = makeURL(getCachePath(), relUrl);
|
|
|
|
::ucbhelper::Content tempFolder(
|
|
|
|
sDataFolder, Reference<ucb::XCommandEnvironment>());
|
|
|
|
Reference<sdbc::XResultSet> xResultSet(
|
|
|
|
tempFolder.createCursor(
|
|
|
|
Sequence<OUString>( &StrTitle::get(), 1 ),
|
|
|
|
::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
|
|
|
|
// get all temp directories:
|
|
|
|
::std::vector<OUString> tempEntries;
|
|
|
|
|
|
|
|
char tmp[] = ".tmp";
|
|
|
|
|
|
|
|
while (xResultSet->next())
|
|
|
|
{
|
|
|
|
OUString title(
|
|
|
|
Reference<sdbc::XRow>(
|
|
|
|
xResultSet, UNO_QUERY_THROW )->getString(
|
|
|
|
1 /* Title */ ) );
|
|
|
|
|
|
|
|
if (title.endsWithAsciiL(tmp, sizeof(tmp) - 1))
|
|
|
|
tempEntries.push_back(
|
|
|
|
makeURLAppendSysPathSegment(sDataFolder, title));
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( ::std::size_t pos = 0; pos < tempEntries.size(); ++pos )
|
|
|
|
{
|
|
|
|
//usedFolders contains the urls to the folders which have
|
|
|
|
//a trailing underscore
|
|
|
|
const OUString tempFile = tempEntries[ pos ];
|
|
|
|
const OUString tempFolder = tempFile + OUSTR("_");
|
|
|
|
|
|
|
|
if (::std::find( usedFolders.begin(), usedFolders.end(), tempFolder ) ==
|
|
|
|
usedFolders.end())
|
|
|
|
{
|
|
|
|
erase_path( tempFolder, Reference<XCommandEnvironment>(),
|
|
|
|
false /* no throw: ignore errors */ );
|
|
|
|
erase_path( tempFile, Reference<XCommandEnvironment>(),
|
|
|
|
false /* no throw: ignore errors */ );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (ucb::InteractiveAugmentedIOException& e)
|
|
|
|
{
|
|
|
|
//In case the folder containing all the data folder does not
|
|
|
|
//exist yet, we ignore the exception
|
|
|
|
if (e.Code != ucb::IOErrorCode_NOT_EXISTING)
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-04-13 11:07:59 +00:00
|
|
|
//##############################################################################
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
Package::~Package()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
Package::Package( ::rtl::Reference<PackageRegistryBackend> const & myBackend,
|
|
|
|
OUString const & url,
|
|
|
|
OUString const & name,
|
|
|
|
OUString const & displayName,
|
2010-05-04 12:37:01 +02:00
|
|
|
Reference<deployment::XPackageTypeInfo> const & xPackageType,
|
2010-03-22 12:35:33 +01:00
|
|
|
bool bRemoved,
|
|
|
|
OUString const & identifier)
|
2004-06-11 11:11:31 +00:00
|
|
|
: t_PackageBase( getMutex() ),
|
|
|
|
m_myBackend( myBackend ),
|
|
|
|
m_url( url ),
|
|
|
|
m_name( name ),
|
|
|
|
m_displayName( displayName ),
|
2010-05-04 12:37:01 +02:00
|
|
|
m_xPackageType( xPackageType ),
|
2010-03-22 12:35:33 +01:00
|
|
|
m_bRemoved(bRemoved),
|
|
|
|
m_identifier(identifier)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2010-04-19 11:33:33 +02:00
|
|
|
if (m_bRemoved)
|
|
|
|
{
|
|
|
|
//We use the last segment of the URL
|
|
|
|
OSL_ASSERT(m_name.getLength() == 0);
|
|
|
|
OUString name = m_url;
|
|
|
|
rtl::Bootstrap::expandMacros(name);
|
|
|
|
sal_Int32 index = name.lastIndexOf('/');
|
|
|
|
if (index != -1 && index < name.getLength())
|
|
|
|
m_name = name.copy(index + 1);
|
|
|
|
}
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::disposing()
|
|
|
|
{
|
|
|
|
m_myBackend.clear();
|
2004-06-11 11:11:31 +00:00
|
|
|
WeakComponentImplHelperBase::disposing();
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2008-05-20 13:33:14 +00:00
|
|
|
void Package::check() const
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
|
|
|
::osl::MutexGuard guard( getMutex() );
|
2004-08-12 11:09:42 +00:00
|
|
|
if (rBHelper.bInDispose || rBHelper.bDisposed) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw lang::DisposedException(
|
|
|
|
OUSTR("Package instance has already been disposed!"),
|
2008-05-20 13:33:14 +00:00
|
|
|
static_cast<OWeakObject *>(const_cast<Package *>(this)));
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
// XComponent
|
2004-04-13 11:07:59 +00:00
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
void Package::dispose() throw (RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2004-06-11 11:11:31 +00:00
|
|
|
check();
|
|
|
|
WeakComponentImplHelperBase::dispose();
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
void Package::addEventListener(
|
|
|
|
Reference<lang::XEventListener> const & xListener ) throw (RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2004-06-11 11:11:31 +00:00
|
|
|
check();
|
|
|
|
WeakComponentImplHelperBase::addEventListener( xListener );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
void Package::removeEventListener(
|
|
|
|
Reference<lang::XEventListener> const & xListener ) throw (RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2004-06-11 11:11:31 +00:00
|
|
|
check();
|
|
|
|
WeakComponentImplHelperBase::removeEventListener( xListener );
|
|
|
|
}
|
|
|
|
|
|
|
|
// XModifyBroadcaster
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::addModifyListener(
|
|
|
|
Reference<util::XModifyListener> const & xListener )
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
check();
|
|
|
|
rBHelper.addListener( ::getCppuType( &xListener ), xListener );
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::removeModifyListener(
|
|
|
|
Reference<util::XModifyListener> const & xListener )
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
check();
|
|
|
|
rBHelper.removeListener( ::getCppuType( &xListener ), xListener );
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::checkAborted(
|
|
|
|
::rtl::Reference<AbortChannel> const & abortChannel )
|
|
|
|
{
|
2004-11-09 13:10:41 +00:00
|
|
|
if (abortChannel.is() && abortChannel->isAborted()) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw CommandAbortedException(
|
|
|
|
OUSTR("abort!"), static_cast<OWeakObject *>(this) );
|
2004-11-09 13:10:41 +00:00
|
|
|
}
|
2004-06-11 11:11:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// XPackage
|
|
|
|
//______________________________________________________________________________
|
|
|
|
Reference<task::XAbortChannel> Package::createAbortChannel()
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
check();
|
|
|
|
return new AbortChannel;
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
sal_Bool Package::isBundle() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return false; // default
|
|
|
|
}
|
|
|
|
|
2009-08-06 09:32:55 +00:00
|
|
|
//______________________________________________________________________________
|
2010-04-19 11:33:33 +02:00
|
|
|
::sal_Int32 Package::checkPrerequisites(
|
2006-10-12 13:09:59 +00:00
|
|
|
const css::uno::Reference< css::task::XAbortChannel >&,
|
2006-12-20 13:30:03 +00:00
|
|
|
const css::uno::Reference< css::ucb::XCommandEnvironment >&,
|
2010-04-19 11:33:33 +02:00
|
|
|
sal_Bool)
|
2006-07-13 16:06:05 +00:00
|
|
|
throw (css::deployment::DeploymentException,
|
2010-03-22 12:35:33 +01:00
|
|
|
css::deployment::ExtensionRemovedException,
|
|
|
|
css::ucb::CommandFailedException,
|
|
|
|
css::ucb::CommandAbortedException,
|
|
|
|
css::uno::RuntimeException)
|
2006-07-13 16:06:05 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2010-04-19 11:33:33 +02:00
|
|
|
return 0;
|
2006-07-13 16:06:05 +00:00
|
|
|
}
|
|
|
|
|
2009-08-06 09:32:55 +00:00
|
|
|
//______________________________________________________________________________
|
|
|
|
::sal_Bool Package::checkDependencies(
|
|
|
|
const css::uno::Reference< css::ucb::XCommandEnvironment >& )
|
|
|
|
throw (css::deployment::DeploymentException,
|
2010-03-22 12:35:33 +01:00
|
|
|
css::deployment::ExtensionRemovedException,
|
|
|
|
css::ucb::CommandFailedException,
|
|
|
|
css::uno::RuntimeException)
|
2009-08-06 09:32:55 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2009-08-06 09:32:55 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-07-13 16:06:05 +00:00
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
//______________________________________________________________________________
|
|
|
|
Sequence< Reference<deployment::XPackage> > Package::getBundle(
|
2006-10-12 13:09:59 +00:00
|
|
|
Reference<task::XAbortChannel> const &,
|
|
|
|
Reference<XCommandEnvironment> const & )
|
2004-06-11 11:11:31 +00:00
|
|
|
throw (deployment::DeploymentException,
|
|
|
|
CommandFailedException, CommandAbortedException,
|
|
|
|
lang::IllegalArgumentException, RuntimeException)
|
|
|
|
{
|
|
|
|
return Sequence< Reference<deployment::XPackage> >();
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
OUString Package::getName() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return m_name;
|
|
|
|
}
|
|
|
|
|
2006-12-20 13:30:03 +00:00
|
|
|
beans::Optional<OUString> Package::getIdentifier() throw (RuntimeException)
|
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
return beans::Optional<OUString>(true, m_identifier);
|
|
|
|
|
2006-12-20 13:30:03 +00:00
|
|
|
return beans::Optional<OUString>();
|
|
|
|
}
|
|
|
|
|
2006-10-04 15:55:05 +00:00
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString Package::getVersion() throw (
|
|
|
|
deployment::ExtensionRemovedException,
|
|
|
|
RuntimeException)
|
2006-10-04 15:55:05 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2006-10-04 15:55:05 +00:00
|
|
|
return OUString();
|
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
//______________________________________________________________________________
|
|
|
|
OUString Package::getURL() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return m_url;
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString Package::getDisplayName() throw (
|
|
|
|
deployment::ExtensionRemovedException, RuntimeException)
|
2004-06-11 11:11:31 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2004-06-11 11:11:31 +00:00
|
|
|
return m_displayName;
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString Package::getDescription() throw (
|
|
|
|
deployment::ExtensionRemovedException,RuntimeException)
|
2004-06-11 11:11:31 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2008-07-17 10:47:48 +00:00
|
|
|
return OUString();
|
2004-06-11 11:11:31 +00:00
|
|
|
}
|
|
|
|
|
2006-12-20 13:30:03 +00:00
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
Sequence<OUString> Package::getUpdateInformationURLs() throw (
|
|
|
|
deployment::ExtensionRemovedException, RuntimeException)
|
2006-12-20 13:30:03 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2006-12-20 13:30:03 +00:00
|
|
|
return Sequence<OUString>();
|
|
|
|
}
|
|
|
|
|
2008-06-06 07:10:59 +00:00
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
css::beans::StringPair Package::getPublisherInfo() throw (
|
|
|
|
deployment::ExtensionRemovedException, RuntimeException)
|
2008-06-06 07:10:59 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2008-06-06 07:10:59 +00:00
|
|
|
css::beans::StringPair aEmptyPair;
|
|
|
|
return aEmptyPair;
|
|
|
|
}
|
|
|
|
|
2008-06-16 11:55:58 +00:00
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
uno::Reference< css::graphic::XGraphic > Package::getIcon( sal_Bool /*bHighContrast*/ )
|
|
|
|
throw (deployment::ExtensionRemovedException, RuntimeException )
|
2008-06-16 11:55:58 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
|
|
|
|
2008-06-16 11:55:58 +00:00
|
|
|
uno::Reference< css::graphic::XGraphic > aEmpty;
|
|
|
|
return aEmpty;
|
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
//______________________________________________________________________________
|
2004-11-09 13:10:41 +00:00
|
|
|
Reference<deployment::XPackageTypeInfo> Package::getPackageType()
|
|
|
|
throw (RuntimeException)
|
2004-06-11 11:11:31 +00:00
|
|
|
{
|
2004-11-09 13:10:41 +00:00
|
|
|
return m_xPackageType;
|
2004-06-11 11:11:31 +00:00
|
|
|
}
|
|
|
|
|
2004-08-12 11:09:42 +00:00
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::exportTo(
|
|
|
|
OUString const & destFolderURL, OUString const & newTitle,
|
|
|
|
sal_Int32 nameClashAction, Reference<XCommandEnvironment> const & xCmdEnv )
|
2010-03-22 12:35:33 +01:00
|
|
|
throw (deployment::ExtensionRemovedException,
|
|
|
|
CommandFailedException, CommandAbortedException, RuntimeException)
|
2004-08-12 11:09:42 +00:00
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
|
|
|
|
2007-06-05 14:06:01 +00:00
|
|
|
::ucbhelper::Content destFolder( destFolderURL, xCmdEnv );
|
|
|
|
::ucbhelper::Content sourceContent( getURL(), xCmdEnv );
|
2004-08-12 11:09:42 +00:00
|
|
|
if (! destFolder.transferContent(
|
2007-06-05 14:06:01 +00:00
|
|
|
sourceContent, ::ucbhelper::InsertOperation_COPY,
|
2004-08-12 11:09:42 +00:00
|
|
|
newTitle, nameClashAction ))
|
|
|
|
throw RuntimeException( OUSTR("UCB transferContent() failed!"), 0 );
|
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::fireModified()
|
|
|
|
{
|
|
|
|
::cppu::OInterfaceContainerHelper * container = rBHelper.getContainer(
|
|
|
|
::getCppuType( static_cast<Reference<
|
|
|
|
util::XModifyListener> const *>(0) ) );
|
2004-08-12 11:09:42 +00:00
|
|
|
if (container != 0) {
|
2004-06-11 11:11:31 +00:00
|
|
|
Sequence< Reference<XInterface> > elements(
|
|
|
|
container->getElements() );
|
|
|
|
lang::EventObject evt( static_cast<OWeakObject *>(this) );
|
2004-11-09 13:10:41 +00:00
|
|
|
for ( sal_Int32 pos = 0; pos < elements.getLength(); ++pos )
|
|
|
|
{
|
2004-06-11 11:11:31 +00:00
|
|
|
Reference<util::XModifyListener> xListener(
|
|
|
|
elements[ pos ], UNO_QUERY );
|
|
|
|
if (xListener.is())
|
|
|
|
xListener->modified( evt );
|
|
|
|
}
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-11 11:11:31 +00:00
|
|
|
// XPackage
|
2004-04-13 11:07:59 +00:00
|
|
|
//______________________________________________________________________________
|
2004-08-12 11:09:42 +00:00
|
|
|
beans::Optional< beans::Ambiguous<sal_Bool> > Package::isRegistered(
|
2004-06-11 11:11:31 +00:00
|
|
|
Reference<task::XAbortChannel> const & xAbortChannel,
|
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv )
|
|
|
|
throw (deployment::DeploymentException,
|
2004-08-12 11:09:42 +00:00
|
|
|
CommandFailedException, CommandAbortedException, RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2004-08-12 11:09:42 +00:00
|
|
|
try {
|
2004-04-13 11:07:59 +00:00
|
|
|
::osl::ResettableMutexGuard guard( getMutex() );
|
2004-08-12 11:09:42 +00:00
|
|
|
return isRegistered_( guard,
|
|
|
|
AbortChannel::get(xAbortChannel),
|
|
|
|
xCmdEnv );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (RuntimeException &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (CommandFailedException &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (CommandAbortedException &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (deployment::DeploymentException &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-08-12 11:09:42 +00:00
|
|
|
catch (Exception &) {
|
2004-06-11 11:11:31 +00:00
|
|
|
Any exc( ::cppu::getCaughtException() );
|
|
|
|
throw deployment::DeploymentException(
|
|
|
|
OUSTR("unexpected exception occured!"),
|
|
|
|
static_cast<OWeakObject *>(this), exc );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2006-10-12 13:09:59 +00:00
|
|
|
void Package::processPackage_impl(
|
|
|
|
bool doRegisterPackage,
|
2010-04-21 16:04:34 +02:00
|
|
|
bool startup,
|
2004-06-11 11:11:31 +00:00
|
|
|
Reference<task::XAbortChannel> const & xAbortChannel,
|
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv )
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
|
|
|
check();
|
2004-11-09 13:10:41 +00:00
|
|
|
bool action = false;
|
2004-06-11 11:11:31 +00:00
|
|
|
|
2004-08-12 11:09:42 +00:00
|
|
|
try {
|
2004-11-09 13:10:41 +00:00
|
|
|
try {
|
|
|
|
::osl::ResettableMutexGuard guard( getMutex() );
|
|
|
|
beans::Optional< beans::Ambiguous<sal_Bool> > option(
|
|
|
|
isRegistered_( guard, AbortChannel::get(xAbortChannel),
|
|
|
|
xCmdEnv ) );
|
|
|
|
action = (option.IsPresent &&
|
|
|
|
(option.Value.IsAmbiguous ||
|
2006-10-12 13:09:59 +00:00
|
|
|
(doRegisterPackage ? !option.Value.Value
|
2004-11-09 13:10:41 +00:00
|
|
|
: option.Value.Value)));
|
|
|
|
if (action) {
|
2010-03-22 12:35:33 +01:00
|
|
|
|
|
|
|
OUString displayName = isRemoved() ? getName() : getDisplayName();
|
2004-11-09 13:10:41 +00:00
|
|
|
ProgressLevel progress(
|
|
|
|
xCmdEnv,
|
2006-10-12 13:09:59 +00:00
|
|
|
(doRegisterPackage
|
2004-11-09 13:10:41 +00:00
|
|
|
? PackageRegistryBackend::StrRegisteringPackage::get()
|
|
|
|
: PackageRegistryBackend::StrRevokingPackage::get())
|
|
|
|
+ displayName );
|
|
|
|
processPackage_( guard,
|
2006-10-12 13:09:59 +00:00
|
|
|
doRegisterPackage,
|
2010-04-21 16:04:34 +02:00
|
|
|
startup,
|
2004-11-09 13:10:41 +00:00
|
|
|
AbortChannel::get(xAbortChannel),
|
|
|
|
xCmdEnv );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (RuntimeException &) {
|
|
|
|
OSL_ENSURE( 0, "### unexpected RuntimeException!" );
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
catch (CommandFailedException &) {
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
catch (CommandAbortedException &) {
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
catch (deployment::DeploymentException &) {
|
|
|
|
throw;
|
|
|
|
}
|
|
|
|
catch (Exception &) {
|
|
|
|
Any exc( ::cppu::getCaughtException() );
|
|
|
|
throw deployment::DeploymentException(
|
2006-10-12 13:09:59 +00:00
|
|
|
(doRegisterPackage
|
2004-11-09 13:10:41 +00:00
|
|
|
? getResourceString(RID_STR_ERROR_WHILE_REGISTERING)
|
|
|
|
: getResourceString(RID_STR_ERROR_WHILE_REVOKING))
|
|
|
|
+ getDisplayName(), static_cast<OWeakObject *>(this), exc );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
}
|
2004-11-09 13:10:41 +00:00
|
|
|
catch (...) {
|
|
|
|
if (action)
|
|
|
|
fireModified();
|
2004-04-13 11:07:59 +00:00
|
|
|
throw;
|
|
|
|
}
|
2004-11-09 13:10:41 +00:00
|
|
|
if (action)
|
2004-06-11 11:11:31 +00:00
|
|
|
fireModified();
|
2004-11-09 13:10:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
void Package::registerPackage(
|
2010-04-21 16:04:34 +02:00
|
|
|
sal_Bool startup,
|
2004-11-09 13:10:41 +00:00
|
|
|
Reference<task::XAbortChannel> const & xAbortChannel,
|
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv )
|
|
|
|
throw (deployment::DeploymentException,
|
2010-03-22 12:35:33 +01:00
|
|
|
deployment::ExtensionRemovedException,
|
2004-11-09 13:10:41 +00:00
|
|
|
CommandFailedException, CommandAbortedException,
|
|
|
|
lang::IllegalArgumentException, RuntimeException)
|
|
|
|
{
|
2010-03-22 12:35:33 +01:00
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
2010-04-21 16:04:34 +02:00
|
|
|
processPackage_impl( true /* register */, startup, xAbortChannel, xCmdEnv );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2004-06-11 11:11:31 +00:00
|
|
|
void Package::revokePackage(
|
|
|
|
Reference<task::XAbortChannel> const & xAbortChannel,
|
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv )
|
|
|
|
throw (deployment::DeploymentException,
|
|
|
|
CommandFailedException, CommandAbortedException,
|
|
|
|
lang::IllegalArgumentException, RuntimeException)
|
2004-04-13 11:07:59 +00:00
|
|
|
{
|
2010-04-21 16:04:34 +02:00
|
|
|
processPackage_impl( false /* revoke */, false, xAbortChannel, xCmdEnv );
|
2010-05-04 12:37:01 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
PackageRegistryBackend * Package::getMyBackend() const
|
|
|
|
{
|
|
|
|
PackageRegistryBackend * pBackend = m_myBackend.get();
|
|
|
|
if (NULL == pBackend)
|
|
|
|
{
|
|
|
|
//May throw a DisposedException
|
|
|
|
check();
|
|
|
|
//We should never get here...
|
|
|
|
throw RuntimeException(
|
|
|
|
OUSTR("Failed to get the BackendImpl"),
|
|
|
|
static_cast<OWeakObject*>(const_cast<Package *>(this)));
|
|
|
|
}
|
|
|
|
return pBackend;
|
2004-11-09 13:10:41 +00:00
|
|
|
}
|
2010-05-04 12:37:01 +02:00
|
|
|
OUString Package::getRepositoryName()
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
PackageRegistryBackend * backEnd = getMyBackend();
|
|
|
|
return backEnd->getContext();
|
2010-03-22 12:35:33 +01:00
|
|
|
}
|
|
|
|
|
2010-04-06 17:15:01 +02:00
|
|
|
beans::Optional< OUString > Package::getRegistrationDataURL()
|
|
|
|
throw (deployment::ExtensionRemovedException,
|
|
|
|
css::uno::RuntimeException)
|
|
|
|
{
|
|
|
|
if (m_bRemoved)
|
|
|
|
throw deployment::ExtensionRemovedException();
|
|
|
|
return beans::Optional<OUString>();
|
|
|
|
}
|
|
|
|
|
2010-03-22 12:35:33 +01:00
|
|
|
sal_Bool Package::isRemoved()
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return m_bRemoved;
|
|
|
|
}
|
2004-06-11 11:11:31 +00:00
|
|
|
|
2004-11-09 13:10:41 +00:00
|
|
|
//##############################################################################
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
Package::TypeInfo::~TypeInfo()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// XPackageTypeInfo
|
|
|
|
//______________________________________________________________________________
|
|
|
|
OUString Package::TypeInfo::getMediaType() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return m_mediaType;
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString Package::TypeInfo::getDescription()
|
|
|
|
throw (deployment::ExtensionRemovedException, RuntimeException)
|
2004-11-09 13:10:41 +00:00
|
|
|
{
|
|
|
|
return getShortDescription();
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString Package::TypeInfo::getShortDescription()
|
|
|
|
throw (deployment::ExtensionRemovedException, RuntimeException)
|
2004-11-09 13:10:41 +00:00
|
|
|
{
|
|
|
|
return m_shortDescr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
OUString Package::TypeInfo::getFileFilter() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return m_fileFilter;
|
|
|
|
}
|
|
|
|
|
|
|
|
//______________________________________________________________________________
|
|
|
|
Any Package::TypeInfo::getIcon( sal_Bool highContrast, sal_Bool smallIcon )
|
|
|
|
throw (RuntimeException)
|
|
|
|
{
|
|
|
|
if (! smallIcon)
|
|
|
|
return Any();
|
2005-01-21 16:12:57 +00:00
|
|
|
const sal_uInt16 nIconId = (highContrast ? m_smallIcon_HC : m_smallIcon);
|
|
|
|
return Any( &nIconId, getCppuType( static_cast<sal_uInt16 const *>(0) ) );
|
2004-04-13 11:07:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|