2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-04 11:25:41 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
#include <osl/diagnose.h>
|
|
|
|
#include <com/sun/star/uno/Type.hxx>
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
|
|
|
#include <com/sun/star/ucb/CrossReference.hpp>
|
|
|
|
#include <com/sun/star/util/DateTime.hpp>
|
|
|
|
#include <com/sun/star/ucb/DocumentHeaderField.hpp>
|
|
|
|
#include <com/sun/star/ucb/RecipientInfo.hpp>
|
|
|
|
#include <com/sun/star/ucb/RuleSet.hpp>
|
|
|
|
#include <com/sun/star/ucb/SendInfo.hpp>
|
|
|
|
#include <com/sun/star/ucb/SendMediaTypes.hpp>
|
|
|
|
#include <com/sun/star/ucb/XDataContainer.hpp>
|
|
|
|
#include "ucbprops.hxx"
|
|
|
|
|
|
|
|
using namespace com::sun::star::beans;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::ucb;
|
|
|
|
using namespace com::sun::star::uno;
|
|
|
|
using namespace com::sun::star::util;
|
|
|
|
|
2011-02-26 22:39:23 +01:00
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// struct PropertyTableEntry
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
struct PropertyTableEntry
|
|
|
|
{
|
|
|
|
const char* pName;
|
|
|
|
sal_Int32 nHandle;
|
|
|
|
sal_Int16 nAttributes;
|
|
|
|
const com::sun::star::uno::Type& (*pGetCppuType)();
|
|
|
|
};
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// CPPU type access functions.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& OUString_getCppuType()
|
|
|
|
{
|
2014-05-10 23:51:21 +02:00
|
|
|
return cppu::UnoType<OUString>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& sal_uInt16_getCppuType()
|
|
|
|
{
|
|
|
|
// ! uInt -> Int, because of Java !!!
|
2014-05-10 23:51:21 +02:00
|
|
|
return cppu::UnoType<sal_Int16>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& sal_uInt32_getCppuType()
|
|
|
|
{
|
|
|
|
// ! uInt -> Int, because of Java !!!
|
2014-05-10 23:51:21 +02:00
|
|
|
return cppu::UnoType<sal_Int32>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& sal_uInt64_getCppuType()
|
|
|
|
{
|
|
|
|
// ! uInt -> Int, because of Java !!!
|
2014-05-10 23:51:21 +02:00
|
|
|
return cppu::UnoType<sal_Int64>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& enum_getCppuType()
|
|
|
|
{
|
|
|
|
// ! enum -> Int, because of Java !!!
|
2014-05-10 23:51:21 +02:00
|
|
|
return cppu::UnoType<sal_Int16>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& sal_Bool_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<bool>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& byte_getCppuType()
|
|
|
|
{
|
2014-05-10 23:51:21 +02:00
|
|
|
return cppu::UnoType<sal_Int8>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& Sequence_CrossReference_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Sequence<
|
|
|
|
com::sun::star::ucb::CrossReference >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& DateTime_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::util::DateTime>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& Sequence_byte_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Sequence< sal_Int8 >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& Sequence_DocumentHeaderField_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Sequence<
|
|
|
|
com::sun::star::ucb::DocumentHeaderField >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& XDataContainer_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::ucb::XDataContainer >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& Sequence_RecipientInfo_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Sequence<
|
|
|
|
com::sun::star::ucb::RecipientInfo >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& RuleSet_getCppuType()
|
|
|
|
{
|
2014-05-23 22:11:27 +02:00
|
|
|
return cppu::UnoType<com::sun::star::ucb::RuleSet>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& Sequence_SendInfo_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Sequence<
|
|
|
|
com::sun::star::ucb::SendInfo >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const com::sun::star::uno::Type& Sequence_SendMediaTypes_getCppuType()
|
|
|
|
{
|
2015-04-01 08:42:49 +02:00
|
|
|
return cppu::UnoType<
|
|
|
|
com::sun::star::uno::Sequence<
|
|
|
|
com::sun::star::ucb::SendMediaTypes >>::get();
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// A table with all well-known UCB properties.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
#define ATTR_DEFAULT ( PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID | PropertyAttribute::MAYBEDEFAULT )
|
|
|
|
|
2013-08-28 04:53:50 +09:00
|
|
|
static const PropertyTableEntry __aPropertyTable[] =
|
2000-10-16 13:56:13 +00:00
|
|
|
{
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "Account", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "AutoUpdateInterval", -1, ATTR_DEFAULT, &sal_uInt32_getCppuType },
|
|
|
|
{ "ConfirmEmpty", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "ConnectionLimit", -1, ATTR_DEFAULT, &byte_getCppuType },
|
|
|
|
{ "ConnectionMode", -1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "ContentCountLimit", -1, ATTR_DEFAULT, &sal_uInt16_getCppuType },
|
|
|
|
{ "ContentType", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "Cookie", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "CrossReferences", -1, ATTR_DEFAULT, &Sequence_CrossReference_getCppuType },
|
|
|
|
{ "DateCreated", -1, ATTR_DEFAULT, &DateTime_getCppuType },
|
|
|
|
{ "DateModified", -1, ATTR_DEFAULT, &DateTime_getCppuType },
|
|
|
|
{ "DeleteOnServer", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "DocumentBody", -1, ATTR_DEFAULT, &Sequence_byte_getCppuType },
|
|
|
|
{ "DocumentCount", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt32_getCppuType },
|
|
|
|
{ "DocumentCountMarked",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt32_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "DocumentHeader", -1, ATTR_DEFAULT, &Sequence_DocumentHeaderField_getCppuType },
|
|
|
|
{ "DocumentStoreMode", -1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "DocumentViewMode", -1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "FTPAccount", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "Flags", -1, ATTR_DEFAULT, &sal_uInt32_getCppuType },
|
|
|
|
{ "FolderCount", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt32_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "FolderViewMode", -1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "FreeSpace", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt64_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "HasDocuments", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_Bool_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "HasFolders", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_Bool_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "IsAutoDelete", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsAutoUpdate", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsDocument", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_Bool_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "IsFolder", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_Bool_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "IsKeepExpired", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
2000-10-16 13:56:13 +00:00
|
|
|
{ "IsLimitedContentCount",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsMarked", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsRead", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsReadOnly", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsSubscribed", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "IsTimeLimitedStore", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "Keywords", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "LocalBase", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageBCC", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageBody", -1, ATTR_DEFAULT, &XDataContainer_getCppuType },
|
|
|
|
{ "MessageCC", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageFrom", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageId", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageInReplyTo", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageReplyTo", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "MessageTo", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "NewsGroups", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "NoCacheList", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "Origin", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&OUString_getCppuType },
|
|
|
|
{ "OutgoingMessageRecipients",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT, &Sequence_RecipientInfo_getCppuType },
|
2000-10-16 13:56:13 +00:00
|
|
|
{ "OutgoingMessageState",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&enum_getCppuType },
|
|
|
|
{ "OutgoingMessageViewMode",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "Password", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "Priority", -1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "References", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "Referer", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "Rules", -1, ATTR_DEFAULT, &RuleSet_getCppuType },
|
|
|
|
{ "SearchCriteria", -1, ATTR_DEFAULT, &RuleSet_getCppuType },
|
|
|
|
{ "SearchIndirections", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "SearchLocations", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "SearchRecursive", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "SeenCount", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt32_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "SendCopyTarget", -1, ATTR_DEFAULT, &Sequence_SendInfo_getCppuType },
|
|
|
|
{ "SendFormats", -1, ATTR_DEFAULT, &Sequence_SendMediaTypes_getCppuType },
|
|
|
|
{ "SendFroms", -1, ATTR_DEFAULT, &Sequence_SendInfo_getCppuType },
|
|
|
|
{ "SendPasswords", -1, ATTR_DEFAULT, &Sequence_SendInfo_getCppuType },
|
|
|
|
{ "SendProtocolPrivate",-1, ATTR_DEFAULT, &sal_uInt16_getCppuType },
|
|
|
|
{ "SendProtocolPublic", -1, ATTR_DEFAULT, &sal_uInt16_getCppuType },
|
|
|
|
{ "SendReplyTos", -1, ATTR_DEFAULT, &Sequence_SendInfo_getCppuType },
|
|
|
|
{ "SendServerNames", -1, ATTR_DEFAULT, &Sequence_SendInfo_getCppuType },
|
|
|
|
{ "SendUserNames", -1, ATTR_DEFAULT, &Sequence_SendInfo_getCppuType },
|
2000-10-16 13:56:13 +00:00
|
|
|
{ "SendVIMPostOfficePath",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "ServerBase", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "ServerName", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "ServerPort", -1, ATTR_DEFAULT, &sal_uInt16_getCppuType },
|
|
|
|
{ "Size", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt64_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "SizeLimit", -1, ATTR_DEFAULT, &sal_uInt64_getCppuType },
|
|
|
|
{ "SubscribedCount", -1, ATTR_DEFAULT | PropertyAttribute::READONLY,
|
2000-10-16 13:56:13 +00:00
|
|
|
&sal_uInt32_getCppuType },
|
2013-08-08 13:30:40 +03:00
|
|
|
{ "SynchronizePolicy", -1, ATTR_DEFAULT, &enum_getCppuType },
|
|
|
|
{ "TargetFrames", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "TargetURL", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "TimeLimitStore", -1, ATTR_DEFAULT, &sal_uInt16_getCppuType },
|
|
|
|
{ "Title", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "UpdateOnOpen", -1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
2000-10-16 13:56:13 +00:00
|
|
|
{ "UseOutBoxPrivateProtocolSettings",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
2000-10-16 13:56:13 +00:00
|
|
|
{ "UseOutBoxPublicProtocolSettings",
|
2013-08-08 13:30:40 +03:00
|
|
|
-1, ATTR_DEFAULT, &sal_Bool_getCppuType },
|
|
|
|
{ "UserName", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "UserSortCriterium", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "VIMPostOfficePath", -1, ATTR_DEFAULT, &OUString_getCppuType },
|
|
|
|
{ "VerificationMode", -1, ATTR_DEFAULT, &enum_getCppuType },
|
2000-10-16 13:56:13 +00:00
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// EOT.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
{ 0, 0, 0, 0 }
|
|
|
|
};
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// UcbPropertiesManager Implementation.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
UcbPropertiesManager::UcbPropertiesManager(
|
2006-06-20 04:17:00 +00:00
|
|
|
const Reference< XMultiServiceFactory >& )
|
|
|
|
: m_pProps( 0 )
|
2000-10-16 13:56:13 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// virtual
|
|
|
|
UcbPropertiesManager::~UcbPropertiesManager()
|
|
|
|
{
|
|
|
|
delete m_pProps;
|
|
|
|
}
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// XServiceInfo methods.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
XSERVICEINFO_IMPL_1( UcbPropertiesManager,
|
2012-05-31 20:45:03 -05:00
|
|
|
OUString( "com.sun.star.comp.ucb.UcbPropertiesManager" ),
|
2014-12-18 13:37:12 +01:00
|
|
|
PROPERTIES_MANAGER_SERVICE_NAME );
|
2000-10-16 13:56:13 +00:00
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// Service factory implementation.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
ONE_INSTANCE_SERVICE_FACTORY_IMPL( UcbPropertiesManager );
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// XPropertySetInfo methods.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
// virtual
|
|
|
|
Sequence< Property > SAL_CALL UcbPropertiesManager::getProperties()
|
2014-02-25 21:31:58 +01:00
|
|
|
throw( RuntimeException, std::exception )
|
2000-10-16 13:56:13 +00:00
|
|
|
{
|
|
|
|
osl::Guard< osl::Mutex > aGuard( m_aMutex );
|
|
|
|
|
|
|
|
if ( !m_pProps )
|
|
|
|
{
|
|
|
|
m_pProps = new Sequence< Property >( 128 );
|
|
|
|
Property* pProps = m_pProps->getArray();
|
|
|
|
sal_Int32 nPos = 0;
|
|
|
|
sal_Int32 nSize = m_pProps->getLength();
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// Get info for well-known properties.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
|
|
|
const PropertyTableEntry* pCurr = &__aPropertyTable[ 0 ];
|
|
|
|
while ( pCurr->pName )
|
|
|
|
{
|
|
|
|
if ( nSize <= nPos )
|
|
|
|
{
|
2011-03-19 14:09:49 +01:00
|
|
|
OSL_FAIL( "UcbPropertiesManager::getProperties - "
|
2000-10-16 13:56:13 +00:00
|
|
|
"Initial size of property sequence too small!" );
|
|
|
|
|
|
|
|
m_pProps->realloc( 128 );
|
|
|
|
nSize += 128;
|
|
|
|
}
|
|
|
|
|
|
|
|
Property& rProp = pProps[ nPos ];
|
|
|
|
|
|
|
|
rProp.Name = OUString::createFromAscii( pCurr->pName );
|
|
|
|
rProp.Handle = pCurr->nHandle;
|
|
|
|
rProp.Type = pCurr->pGetCppuType();
|
|
|
|
rProp.Attributes = pCurr->nAttributes;
|
|
|
|
|
|
|
|
nPos++;
|
|
|
|
pCurr++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nPos > 0 )
|
|
|
|
{
|
|
|
|
m_pProps->realloc( nPos );
|
|
|
|
nSize = m_pProps->getLength();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return *m_pProps;
|
|
|
|
}
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// virtual
|
|
|
|
Property SAL_CALL UcbPropertiesManager::getPropertyByName( const OUString& aName )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw( UnknownPropertyException, RuntimeException, std::exception )
|
2000-10-16 13:56:13 +00:00
|
|
|
{
|
|
|
|
Property aProp;
|
|
|
|
if ( queryProperty( aName, aProp ) )
|
|
|
|
return aProp;
|
|
|
|
|
|
|
|
throw UnknownPropertyException();
|
|
|
|
}
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// virtual
|
|
|
|
sal_Bool SAL_CALL UcbPropertiesManager::hasPropertyByName( const OUString& Name )
|
2014-02-25 21:31:58 +01:00
|
|
|
throw( RuntimeException, std::exception )
|
2000-10-16 13:56:13 +00:00
|
|
|
{
|
|
|
|
Property aProp;
|
|
|
|
return queryProperty( Name, aProp );
|
|
|
|
}
|
|
|
|
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
// Non-Interface methods.
|
2014-02-25 22:38:20 +01:00
|
|
|
|
|
|
|
|
2000-10-16 13:56:13 +00:00
|
|
|
|
2014-04-30 08:36:18 +02:00
|
|
|
bool UcbPropertiesManager::queryProperty(
|
2000-10-16 13:56:13 +00:00
|
|
|
const OUString& rName, Property& rProp )
|
|
|
|
{
|
|
|
|
osl::Guard< osl::Mutex > aGuard( m_aMutex );
|
|
|
|
|
|
|
|
getProperties();
|
|
|
|
|
|
|
|
const Property* pProps = m_pProps->getConstArray();
|
|
|
|
sal_Int32 nCount = m_pProps->getLength();
|
|
|
|
for ( sal_Int32 n = 0; n < nCount; ++n )
|
|
|
|
{
|
|
|
|
const Property& rCurrProp = pProps[ n ];
|
|
|
|
if ( rCurrProp.Name == rName )
|
|
|
|
{
|
|
|
|
rProp = rCurrProp;
|
2014-04-30 08:36:18 +02:00
|
|
|
return true;
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-30 08:36:18 +02:00
|
|
|
return false;
|
2000-10-16 13:56:13 +00:00
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|