xref: /trunk/main/ucb/source/core/ucbprops.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_ucb.hxx"
30*cdf0e10cSrcweir #include <osl/diagnose.h>
31*cdf0e10cSrcweir #include <com/sun/star/uno/Type.hxx>
32*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
33*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
34*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/ucb/CrossReference.hpp>
36*cdf0e10cSrcweir #include <com/sun/star/util/DateTime.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/ucb/DocumentHeaderField.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/ucb/RecipientInfo.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/ucb/RuleSet.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/ucb/SendInfo.hpp>
41*cdf0e10cSrcweir #include <com/sun/star/ucb/SendMediaTypes.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/ucb/XDataContainer.hpp>
43*cdf0e10cSrcweir #include "ucbprops.hxx"
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir using namespace rtl;
46*cdf0e10cSrcweir using namespace com::sun::star::beans;
47*cdf0e10cSrcweir using namespace com::sun::star::lang;
48*cdf0e10cSrcweir using namespace com::sun::star::ucb;
49*cdf0e10cSrcweir using namespace com::sun::star::uno;
50*cdf0e10cSrcweir using namespace com::sun::star::util;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir //=========================================================================
53*cdf0e10cSrcweir //
54*cdf0e10cSrcweir // struct PropertyTableEntry
55*cdf0e10cSrcweir //
56*cdf0e10cSrcweir //=========================================================================
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir struct PropertyTableEntry
59*cdf0e10cSrcweir {
60*cdf0e10cSrcweir     const char* pName;
61*cdf0e10cSrcweir     sal_Int32   nHandle;
62*cdf0e10cSrcweir     sal_Int16   nAttributes;
63*cdf0e10cSrcweir     const com::sun::star::uno::Type& (*pGetCppuType)();
64*cdf0e10cSrcweir };
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////
67*cdf0e10cSrcweir //
68*cdf0e10cSrcweir // CPPU type access functions.
69*cdf0e10cSrcweir //
70*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir static const com::sun::star::uno::Type& OUString_getCppuType()
73*cdf0e10cSrcweir {
74*cdf0e10cSrcweir     return getCppuType( static_cast< const rtl::OUString * >( 0 ) );
75*cdf0e10cSrcweir }
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir static const com::sun::star::uno::Type& sal_uInt16_getCppuType()
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir     // ! uInt -> Int, because of Java !!!
80*cdf0e10cSrcweir     return getCppuType( static_cast< const sal_Int16 * >( 0 ) );
81*cdf0e10cSrcweir }
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir static const com::sun::star::uno::Type& sal_uInt32_getCppuType()
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     // ! uInt -> Int, because of Java !!!
86*cdf0e10cSrcweir     return getCppuType( static_cast< const sal_Int32 * >( 0 ) );
87*cdf0e10cSrcweir }
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir static const com::sun::star::uno::Type& sal_uInt64_getCppuType()
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir     // ! uInt -> Int, because of Java !!!
92*cdf0e10cSrcweir     return getCppuType( static_cast< const sal_Int64 * >( 0 ) );
93*cdf0e10cSrcweir }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir static const com::sun::star::uno::Type& enum_getCppuType()
96*cdf0e10cSrcweir {
97*cdf0e10cSrcweir     // ! enum -> Int, because of Java !!!
98*cdf0e10cSrcweir     return getCppuType( static_cast< const sal_Int16 * >( 0 ) );
99*cdf0e10cSrcweir }
100*cdf0e10cSrcweir 
101*cdf0e10cSrcweir static const com::sun::star::uno::Type& sal_Bool_getCppuType()
102*cdf0e10cSrcweir {
103*cdf0e10cSrcweir     return getCppuBooleanType();
104*cdf0e10cSrcweir }
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir static const com::sun::star::uno::Type& byte_getCppuType()
107*cdf0e10cSrcweir {
108*cdf0e10cSrcweir     return getCppuType( static_cast< const sal_Int8 * >( 0 ) );
109*cdf0e10cSrcweir }
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir static const com::sun::star::uno::Type& Sequence_CrossReference_getCppuType()
112*cdf0e10cSrcweir {
113*cdf0e10cSrcweir     return getCppuType(
114*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Sequence<
115*cdf0e10cSrcweir                         com::sun::star::ucb::CrossReference > * >( 0 ) );
116*cdf0e10cSrcweir }
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir static const com::sun::star::uno::Type& DateTime_getCppuType()
119*cdf0e10cSrcweir {
120*cdf0e10cSrcweir     return getCppuType(
121*cdf0e10cSrcweir         static_cast< com::sun::star::util::DateTime * >( 0 ) );
122*cdf0e10cSrcweir }
123*cdf0e10cSrcweir 
124*cdf0e10cSrcweir static const com::sun::star::uno::Type& Sequence_byte_getCppuType()
125*cdf0e10cSrcweir {
126*cdf0e10cSrcweir     return getCppuType(
127*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Sequence< sal_Int8 > * >( 0 ) );
128*cdf0e10cSrcweir }
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir static const com::sun::star::uno::Type& Sequence_DocumentHeaderField_getCppuType()
131*cdf0e10cSrcweir {
132*cdf0e10cSrcweir     return getCppuType(
133*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Sequence<
134*cdf0e10cSrcweir                         com::sun::star::ucb::DocumentHeaderField > * >( 0 ) );
135*cdf0e10cSrcweir }
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir static const com::sun::star::uno::Type& XDataContainer_getCppuType()
138*cdf0e10cSrcweir {
139*cdf0e10cSrcweir     return getCppuType(
140*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Reference<
141*cdf0e10cSrcweir             com::sun::star::ucb::XDataContainer > * >( 0 ) );
142*cdf0e10cSrcweir }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir static const com::sun::star::uno::Type& Sequence_RecipientInfo_getCppuType()
145*cdf0e10cSrcweir {
146*cdf0e10cSrcweir     return getCppuType(
147*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Sequence<
148*cdf0e10cSrcweir                         com::sun::star::ucb::RecipientInfo > * >( 0 ) );
149*cdf0e10cSrcweir }
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir static const com::sun::star::uno::Type& RuleSet_getCppuType()
152*cdf0e10cSrcweir {
153*cdf0e10cSrcweir     return getCppuType(
154*cdf0e10cSrcweir         static_cast< com::sun::star::ucb::RuleSet * >( 0 ) );
155*cdf0e10cSrcweir }
156*cdf0e10cSrcweir 
157*cdf0e10cSrcweir static const com::sun::star::uno::Type& Sequence_SendInfo_getCppuType()
158*cdf0e10cSrcweir {
159*cdf0e10cSrcweir     return getCppuType(
160*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Sequence<
161*cdf0e10cSrcweir                         com::sun::star::ucb::SendInfo > * >( 0 ) );
162*cdf0e10cSrcweir }
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir static const com::sun::star::uno::Type& Sequence_SendMediaTypes_getCppuType()
165*cdf0e10cSrcweir {
166*cdf0e10cSrcweir     return getCppuType(
167*cdf0e10cSrcweir         static_cast< com::sun::star::uno::Sequence<
168*cdf0e10cSrcweir                         com::sun::star::ucb::SendMediaTypes > * >( 0 ) );
169*cdf0e10cSrcweir }
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////////////////
172*cdf0e10cSrcweir // A table with all well-known UCB properties.
173*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////////////////////////////////////
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir #define ATTR_DEFAULT ( PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID | PropertyAttribute::MAYBEDEFAULT )
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir static PropertyTableEntry __aPropertyTable[] =
178*cdf0e10cSrcweir {
179*cdf0e10cSrcweir     { "Account",            -1 /* WID_ACCOUNT */,               ATTR_DEFAULT,   &OUString_getCppuType },
180*cdf0e10cSrcweir     { "AutoUpdateInterval", -1 /* WID_AUTOUPDATE_INTERVAL */,   ATTR_DEFAULT,   &sal_uInt32_getCppuType },
181*cdf0e10cSrcweir     { "ConfirmEmpty",       -1 /* WID_TRASHCAN_FLAG_CONFIRMEMPTY */,
182*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &sal_Bool_getCppuType },
183*cdf0e10cSrcweir     { "ConnectionLimit",    -1 /* WID_HTTP_CONNECTION_LIMIT */, ATTR_DEFAULT,   &byte_getCppuType },
184*cdf0e10cSrcweir     { "ConnectionMode",     -1 /* WID_CONNECTION_MODE */,       ATTR_DEFAULT,   &enum_getCppuType },
185*cdf0e10cSrcweir     { "ContentCountLimit",  -1 /* WID_SHOW_MSGS_TIMELIMIT */,   ATTR_DEFAULT,   &sal_uInt16_getCppuType },
186*cdf0e10cSrcweir     { "ContentType",        -1 /* WID_CONTENT_TYPE */,          ATTR_DEFAULT,   &OUString_getCppuType },
187*cdf0e10cSrcweir     { "Cookie",             -1 /* WID_HTTP_COOKIE */,           ATTR_DEFAULT,   &OUString_getCppuType },
188*cdf0e10cSrcweir     { "CrossReferences",    -1 /* WID_NEWS_XREFLIST */,         ATTR_DEFAULT,   &Sequence_CrossReference_getCppuType },
189*cdf0e10cSrcweir     { "DateCreated",        -1 /* WID_DATE_CREATED */,          ATTR_DEFAULT,   &DateTime_getCppuType },
190*cdf0e10cSrcweir     { "DateModified",       -1 /* WID_DATE_MODIFIED */,         ATTR_DEFAULT,   &DateTime_getCppuType },
191*cdf0e10cSrcweir     { "DeleteOnServer",     -1 /* WID_DELETE_ON_SERVER */,      ATTR_DEFAULT,   &sal_Bool_getCppuType },
192*cdf0e10cSrcweir     { "DocumentBody",       -1 /* WID_DOCUMENT_BODY */,         ATTR_DEFAULT,   &Sequence_byte_getCppuType },
193*cdf0e10cSrcweir     { "DocumentCount",      -1 /* WID_TOTALCONTENTCOUNT */,     ATTR_DEFAULT | PropertyAttribute::READONLY,
194*cdf0e10cSrcweir                                                                                             &sal_uInt32_getCppuType },
195*cdf0e10cSrcweir     { "DocumentCountMarked",
196*cdf0e10cSrcweir                             -1 /* WID_MARKED_DOCUMENT_COUNT */, ATTR_DEFAULT | PropertyAttribute::READONLY,
197*cdf0e10cSrcweir                                                                                             &sal_uInt32_getCppuType },
198*cdf0e10cSrcweir     { "DocumentHeader",     -1 /* WID_DOCUMENT_HEADER */,       ATTR_DEFAULT,   &Sequence_DocumentHeaderField_getCppuType },
199*cdf0e10cSrcweir     { "DocumentStoreMode",  -1 /* WID_MESSAGE_STOREMODE */,     ATTR_DEFAULT,   &enum_getCppuType },
200*cdf0e10cSrcweir     { "DocumentViewMode",   -1 /* WID_MESSAGEVIEW_MODE */,      ATTR_DEFAULT,   &enum_getCppuType },
201*cdf0e10cSrcweir     { "FTPAccount",         -1 /* WID_FTP_ACCOUNT */,           ATTR_DEFAULT,   &OUString_getCppuType },
202*cdf0e10cSrcweir     { "Flags",              -1 /* WID_FSYS_FLAGS */,            ATTR_DEFAULT,   &sal_uInt32_getCppuType },
203*cdf0e10cSrcweir     { "FolderCount",        -1 /* WID_FOLDER_COUNT */,          ATTR_DEFAULT | PropertyAttribute::READONLY,
204*cdf0e10cSrcweir                                                                                             &sal_uInt32_getCppuType },
205*cdf0e10cSrcweir     { "FolderViewMode",     -1 /* WID_FOLDERVIEW_MODE */,       ATTR_DEFAULT,   &enum_getCppuType },
206*cdf0e10cSrcweir     { "FreeSpace",          -1 /* WID_FSYS_DISKSPACE_LEFT */,   ATTR_DEFAULT | PropertyAttribute::READONLY,
207*cdf0e10cSrcweir                                                                                             &sal_uInt64_getCppuType },
208*cdf0e10cSrcweir     { "HasDocuments",       -1 /* WID_FLAG_HAS_MESSAGES */,     ATTR_DEFAULT | PropertyAttribute::READONLY,
209*cdf0e10cSrcweir                                                                                             &sal_Bool_getCppuType },
210*cdf0e10cSrcweir     { "HasFolders",         -1 /* WID_FLAG_HAS_FOLDER */,       ATTR_DEFAULT | PropertyAttribute::READONLY,
211*cdf0e10cSrcweir                                                                                             &sal_Bool_getCppuType },
212*cdf0e10cSrcweir     { "IsAutoDelete",       -1 /* WID_TRASHCAN_FLAG_AUTODELETE */,
213*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &sal_Bool_getCppuType },
214*cdf0e10cSrcweir     { "IsAutoUpdate",       -1 /* WID_UPDATE_ENABLED */,        ATTR_DEFAULT,   &sal_Bool_getCppuType },
215*cdf0e10cSrcweir     { "IsDocument",         -1 /* WID_FLAG_IS_MESSAGE */,       ATTR_DEFAULT | PropertyAttribute::READONLY,
216*cdf0e10cSrcweir                                                                                             &sal_Bool_getCppuType },
217*cdf0e10cSrcweir     { "IsFolder",           -1 /* WID_FLAG_IS_FOLDER */,        ATTR_DEFAULT | PropertyAttribute::READONLY,
218*cdf0e10cSrcweir                                                                                             &sal_Bool_getCppuType },
219*cdf0e10cSrcweir     { "IsKeepExpired",      -1 /* WID_HTTP_KEEP_EXPIRED */,     ATTR_DEFAULT,   &sal_Bool_getCppuType },
220*cdf0e10cSrcweir     { "IsLimitedContentCount",
221*cdf0e10cSrcweir                             -1 /* WID_SHOW_MSGS_HAS_TIMELIMIT */,
222*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &sal_Bool_getCppuType },
223*cdf0e10cSrcweir     { "IsMarked",           -1 /* WID_IS_MARKED */,             ATTR_DEFAULT,   &sal_Bool_getCppuType },
224*cdf0e10cSrcweir     { "IsRead",             -1 /* WID_IS_READ */,               ATTR_DEFAULT,   &sal_Bool_getCppuType },
225*cdf0e10cSrcweir     { "IsReadOnly",         -1 /* WID_FLAG_READONLY */,         ATTR_DEFAULT,   &sal_Bool_getCppuType },
226*cdf0e10cSrcweir     { "IsSubscribed",       -1 /* WID_FLAG_SUBSCRIBED */,       ATTR_DEFAULT,   &sal_Bool_getCppuType },
227*cdf0e10cSrcweir //  { "IsThreaded",         -1 /* WID_THREADED */,              ATTR_DEFAULT,   &sal_Bool_getCppuType },
228*cdf0e10cSrcweir     { "IsTimeLimitedStore", -1 /* WID_STORE_MSGS_HAS_TIMELIMIT */,
229*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &sal_Bool_getCppuType },
230*cdf0e10cSrcweir     { "Keywords",           -1 /* WID_KEYWORDS */,              ATTR_DEFAULT,   &OUString_getCppuType },
231*cdf0e10cSrcweir     { "LocalBase",          -1 /* WID_LOCALBASE */,             ATTR_DEFAULT,   &OUString_getCppuType },
232*cdf0e10cSrcweir     { "MessageBCC",         -1 /* WID_BCC */,                   ATTR_DEFAULT,   &OUString_getCppuType },
233*cdf0e10cSrcweir     { "MessageBody",        -1 /* WID_MESSAGEBODY */,           ATTR_DEFAULT,   &XDataContainer_getCppuType },
234*cdf0e10cSrcweir     { "MessageCC",          -1 /* WID_CC */,                    ATTR_DEFAULT,   &OUString_getCppuType },
235*cdf0e10cSrcweir     { "MessageFrom",        -1 /* WID_FROM */,                  ATTR_DEFAULT,   &OUString_getCppuType },
236*cdf0e10cSrcweir     { "MessageId",          -1 /* WID_MESSAGE_ID */,            ATTR_DEFAULT,   &OUString_getCppuType },
237*cdf0e10cSrcweir     { "MessageInReplyTo",   -1 /* WID_IN_REPLY_TO */,           ATTR_DEFAULT,   &OUString_getCppuType },
238*cdf0e10cSrcweir     { "MessageReplyTo",     -1 /* WID_REPLY_TO */,              ATTR_DEFAULT,   &OUString_getCppuType },
239*cdf0e10cSrcweir     { "MessageTo",          -1 /* WID_TO */,                    ATTR_DEFAULT,   &OUString_getCppuType },
240*cdf0e10cSrcweir     { "NewsGroups",         -1 /* WID_NEWSGROUPS */,            ATTR_DEFAULT,   &OUString_getCppuType },
241*cdf0e10cSrcweir     { "NoCacheList",        -1 /* WID_HTTP_NOCACHE_LIST */,     ATTR_DEFAULT,   &OUString_getCppuType },
242*cdf0e10cSrcweir     { "Origin",             -1 /* WID_TRASH_ORIGIN */,          ATTR_DEFAULT | PropertyAttribute::READONLY,
243*cdf0e10cSrcweir                                                                                             &OUString_getCppuType },
244*cdf0e10cSrcweir     { "OutgoingMessageRecipients",
245*cdf0e10cSrcweir                             -1 /* WID_RECIPIENTLIST */,         ATTR_DEFAULT,   &Sequence_RecipientInfo_getCppuType },
246*cdf0e10cSrcweir     { "OutgoingMessageState",
247*cdf0e10cSrcweir                             -1 /* WID_OUTMSGINTERNALSTATE */,   ATTR_DEFAULT | PropertyAttribute::READONLY,
248*cdf0e10cSrcweir                                                                                             &enum_getCppuType },
249*cdf0e10cSrcweir     { "OutgoingMessageViewMode",
250*cdf0e10cSrcweir                             -1 /* WID_SENTMESSAGEVIEW_MODE */,
251*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &enum_getCppuType },
252*cdf0e10cSrcweir //  { "OwnURL",             -1 /* WID_OWN_URL */,               ATTR_DEFAULT,   &OUString_getCppuType },
253*cdf0e10cSrcweir     { "Password",           -1 /* WID_PASSWORD */,              ATTR_DEFAULT,   &OUString_getCppuType },
254*cdf0e10cSrcweir //  { "PresentationURL",    -1 /* WID_REAL_URL */,              ATTR_DEFAULT | PropertyAttribute::READONLY,
255*cdf0e10cSrcweir //                                                                                          &OUString_getCppuType },
256*cdf0e10cSrcweir     { "Priority",           -1 /* WID_PRIORITY */,              ATTR_DEFAULT,   &enum_getCppuType },
257*cdf0e10cSrcweir     { "References",         -1 /* WID_REFERENCES */,            ATTR_DEFAULT,   &OUString_getCppuType },
258*cdf0e10cSrcweir     { "Referer",            -1 /* WID_HTTP_REFERER */,          ATTR_DEFAULT,   &OUString_getCppuType },
259*cdf0e10cSrcweir     { "Rules",              -1 /* WID_RULES */,                 ATTR_DEFAULT,   &RuleSet_getCppuType },
260*cdf0e10cSrcweir     { "SearchCriteria",     -1 /* WID_SEARCH_CRITERIA */,       ATTR_DEFAULT,   &RuleSet_getCppuType },
261*cdf0e10cSrcweir     { "SearchIndirections", -1 /* WID_SEARCH_INDIRECTIONS */,   ATTR_DEFAULT,   &sal_Bool_getCppuType },
262*cdf0e10cSrcweir     { "SearchLocations",    -1 /* WID_SEARCH_LOCATIONS */,      ATTR_DEFAULT,   &OUString_getCppuType },
263*cdf0e10cSrcweir     { "SearchRecursive",    -1 /* WID_SEARCH_RECURSIVE */,      ATTR_DEFAULT,   &sal_Bool_getCppuType },
264*cdf0e10cSrcweir     { "SeenCount",          -1 /* WID_SEENCONTENTCOUNT */,      ATTR_DEFAULT | PropertyAttribute::READONLY,
265*cdf0e10cSrcweir                                                                                             &sal_uInt32_getCppuType },
266*cdf0e10cSrcweir     { "SendCopyTarget",     -1 /* WID_SEND_COPY_TARGET */,      ATTR_DEFAULT,   &Sequence_SendInfo_getCppuType },
267*cdf0e10cSrcweir     { "SendFormats",        -1 /* WID_SEND_FORMATS */,          ATTR_DEFAULT,   &Sequence_SendMediaTypes_getCppuType },
268*cdf0e10cSrcweir     { "SendFroms",          -1 /* WID_SEND_FROM_DEFAULT */,     ATTR_DEFAULT,   &Sequence_SendInfo_getCppuType },
269*cdf0e10cSrcweir     { "SendPasswords",      -1 /* WID_SEND_PASSWORD */,         ATTR_DEFAULT,   &Sequence_SendInfo_getCppuType },
270*cdf0e10cSrcweir     { "SendProtocolPrivate",-1 /* WID_SEND_PRIVATE_PROT_ID */,  ATTR_DEFAULT,   &sal_uInt16_getCppuType },
271*cdf0e10cSrcweir     { "SendProtocolPublic", -1 /* WID_SEND_PUBLIC_PROT_ID */,   ATTR_DEFAULT,   &sal_uInt16_getCppuType },
272*cdf0e10cSrcweir     { "SendReplyTos",       -1 /* WID_SEND_REPLY_TO_DEFAULT */, ATTR_DEFAULT,   &Sequence_SendInfo_getCppuType },
273*cdf0e10cSrcweir     { "SendServerNames",    -1 /* WID_SEND_SERVERNAME */,       ATTR_DEFAULT,   &Sequence_SendInfo_getCppuType },
274*cdf0e10cSrcweir     { "SendUserNames",      -1 /* WID_SEND_USERNAME */,         ATTR_DEFAULT,   &Sequence_SendInfo_getCppuType },
275*cdf0e10cSrcweir     { "SendVIMPostOfficePath",
276*cdf0e10cSrcweir                             -1 /* WID_SEND_VIM_POPATH */,       ATTR_DEFAULT,   &OUString_getCppuType },
277*cdf0e10cSrcweir     { "ServerBase",         -1 /* WID_SERVERBASE */,            ATTR_DEFAULT,   &OUString_getCppuType },
278*cdf0e10cSrcweir     { "ServerName",         -1 /* WID_SERVERNAME */,            ATTR_DEFAULT,   &OUString_getCppuType },
279*cdf0e10cSrcweir     { "ServerPort",         -1 /* WID_SERVERPORT */,            ATTR_DEFAULT,   &sal_uInt16_getCppuType },
280*cdf0e10cSrcweir     { "Size",               -1 /* WID_DOCUMENT_SIZE */,         ATTR_DEFAULT | PropertyAttribute::READONLY,
281*cdf0e10cSrcweir                                                                                             &sal_uInt64_getCppuType },
282*cdf0e10cSrcweir     { "SizeLimit",          -1 /* WID_SIZE_LIMIT */,            ATTR_DEFAULT,   &sal_uInt64_getCppuType },
283*cdf0e10cSrcweir     { "SubscribedCount",    -1 /* WID_SUBSCRNEWSGROUPCOUNT */,  ATTR_DEFAULT | PropertyAttribute::READONLY,
284*cdf0e10cSrcweir                                                                                             &sal_uInt32_getCppuType },
285*cdf0e10cSrcweir     { "SynchronizePolicy",  -1 /* WID_WHO_IS_MASTER */,         ATTR_DEFAULT,   &enum_getCppuType },
286*cdf0e10cSrcweir     { "TargetFrames",       -1 /* WID_TARGET_FRAMES */,         ATTR_DEFAULT,   &OUString_getCppuType },
287*cdf0e10cSrcweir     { "TargetURL",          -1 /* WID_TARGET_URL */,            ATTR_DEFAULT,   &OUString_getCppuType },
288*cdf0e10cSrcweir //  { "ThreadingInfo",      -1 /* WID_THREADING */,             ATTR_DEFAULT,   &Sequence_ThreadingInfo_getCppuType },
289*cdf0e10cSrcweir     { "TimeLimitStore",     -1 /* WID_STORE_MSGS_TIMELIMIT */,  ATTR_DEFAULT,   &sal_uInt16_getCppuType },
290*cdf0e10cSrcweir     { "Title",              -1 /* WID_TITLE */,                 ATTR_DEFAULT,   &OUString_getCppuType },
291*cdf0e10cSrcweir     { "UpdateOnOpen",       -1 /* WID_FLAG_UPDATE_ON_OPEN */,   ATTR_DEFAULT,   &sal_Bool_getCppuType },
292*cdf0e10cSrcweir     { "UseOutBoxPrivateProtocolSettings",
293*cdf0e10cSrcweir                             -1 /* WID_SEND_PRIVATE_OUTBOXPROPS */,
294*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &sal_Bool_getCppuType },
295*cdf0e10cSrcweir     { "UseOutBoxPublicProtocolSettings",
296*cdf0e10cSrcweir                             -1 /* WID_SEND_PUBLIC_OUTBOXPROPS */,
297*cdf0e10cSrcweir                                                                 ATTR_DEFAULT,   &sal_Bool_getCppuType },
298*cdf0e10cSrcweir     { "UserName",           -1 /* WID_USERNAME */,              ATTR_DEFAULT,   &OUString_getCppuType },
299*cdf0e10cSrcweir     { "UserSortCriterium",  -1 /* WID_USER_SORT_CRITERIUM */,   ATTR_DEFAULT,   &OUString_getCppuType },
300*cdf0e10cSrcweir     { "VIMPostOfficePath",  -1 /* WID_VIM_POPATH */,            ATTR_DEFAULT,   &OUString_getCppuType },
301*cdf0e10cSrcweir     { "VerificationMode",   -1 /* WID_HTTP_VERIFY_MODE */,      ATTR_DEFAULT,   &enum_getCppuType },
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir     //////////////////////////////////////////////////////////////////////////////////////////////////////////////
304*cdf0e10cSrcweir     // EOT.
305*cdf0e10cSrcweir     //////////////////////////////////////////////////////////////////////////////////////////////////////////////
306*cdf0e10cSrcweir 
307*cdf0e10cSrcweir     { 0, 0, 0, 0 }
308*cdf0e10cSrcweir };
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir //=========================================================================
311*cdf0e10cSrcweir //=========================================================================
312*cdf0e10cSrcweir //
313*cdf0e10cSrcweir // UcbPropertiesManager Implementation.
314*cdf0e10cSrcweir //
315*cdf0e10cSrcweir //=========================================================================
316*cdf0e10cSrcweir //=========================================================================
317*cdf0e10cSrcweir 
318*cdf0e10cSrcweir UcbPropertiesManager::UcbPropertiesManager(
319*cdf0e10cSrcweir                         const Reference< XMultiServiceFactory >& )
320*cdf0e10cSrcweir : m_pProps( 0 )
321*cdf0e10cSrcweir {
322*cdf0e10cSrcweir }
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir //=========================================================================
325*cdf0e10cSrcweir // virtual
326*cdf0e10cSrcweir UcbPropertiesManager::~UcbPropertiesManager()
327*cdf0e10cSrcweir {
328*cdf0e10cSrcweir     delete m_pProps;
329*cdf0e10cSrcweir }
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir //=========================================================================
332*cdf0e10cSrcweir //
333*cdf0e10cSrcweir // XInterface methods.
334*cdf0e10cSrcweir //
335*cdf0e10cSrcweir //=========================================================================
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir XINTERFACE_IMPL_3( UcbPropertiesManager,
338*cdf0e10cSrcweir                    XTypeProvider,
339*cdf0e10cSrcweir                    XServiceInfo,
340*cdf0e10cSrcweir                    XPropertySetInfo );
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir //=========================================================================
343*cdf0e10cSrcweir //
344*cdf0e10cSrcweir // XTypeProvider methods.
345*cdf0e10cSrcweir //
346*cdf0e10cSrcweir //=========================================================================
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir XTYPEPROVIDER_IMPL_3( UcbPropertiesManager,
349*cdf0e10cSrcweir                       XTypeProvider,
350*cdf0e10cSrcweir                       XServiceInfo,
351*cdf0e10cSrcweir                       XPropertySetInfo );
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir //=========================================================================
354*cdf0e10cSrcweir //
355*cdf0e10cSrcweir // XServiceInfo methods.
356*cdf0e10cSrcweir //
357*cdf0e10cSrcweir //=========================================================================
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir XSERVICEINFO_IMPL_1( UcbPropertiesManager,
360*cdf0e10cSrcweir                      OUString::createFromAscii(
361*cdf0e10cSrcweir                         "com.sun.star.comp.ucb.UcbPropertiesManager" ),
362*cdf0e10cSrcweir                      OUString::createFromAscii(
363*cdf0e10cSrcweir                         PROPERTIES_MANAGER_SERVICE_NAME ) );
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir //=========================================================================
366*cdf0e10cSrcweir //
367*cdf0e10cSrcweir // Service factory implementation.
368*cdf0e10cSrcweir //
369*cdf0e10cSrcweir //=========================================================================
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir ONE_INSTANCE_SERVICE_FACTORY_IMPL( UcbPropertiesManager );
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir //=========================================================================
374*cdf0e10cSrcweir //
375*cdf0e10cSrcweir // XPropertySetInfo methods.
376*cdf0e10cSrcweir //
377*cdf0e10cSrcweir //=========================================================================
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir // virtual
380*cdf0e10cSrcweir Sequence< Property > SAL_CALL UcbPropertiesManager::getProperties()
381*cdf0e10cSrcweir     throw( RuntimeException )
382*cdf0e10cSrcweir {
383*cdf0e10cSrcweir     osl::Guard< osl::Mutex > aGuard( m_aMutex );
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir     if ( !m_pProps )
386*cdf0e10cSrcweir     {
387*cdf0e10cSrcweir         m_pProps = new Sequence< Property >( 128 );
388*cdf0e10cSrcweir         Property* pProps = m_pProps->getArray();
389*cdf0e10cSrcweir         sal_Int32 nPos  = 0;
390*cdf0e10cSrcweir         sal_Int32 nSize = m_pProps->getLength();
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir         //////////////////////////////////////////////////////////////////
393*cdf0e10cSrcweir         // Get info for well-known properties.
394*cdf0e10cSrcweir         //////////////////////////////////////////////////////////////////
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir         const PropertyTableEntry* pCurr = &__aPropertyTable[ 0 ];
397*cdf0e10cSrcweir         while ( pCurr->pName )
398*cdf0e10cSrcweir         {
399*cdf0e10cSrcweir             if ( nSize <= nPos )
400*cdf0e10cSrcweir             {
401*cdf0e10cSrcweir                 OSL_ENSURE( sal_False,
402*cdf0e10cSrcweir                             "UcbPropertiesManager::getProperties - "
403*cdf0e10cSrcweir                             "Initial size of property sequence too small!" );
404*cdf0e10cSrcweir 
405*cdf0e10cSrcweir                 m_pProps->realloc( 128 );
406*cdf0e10cSrcweir                 nSize += 128;
407*cdf0e10cSrcweir             }
408*cdf0e10cSrcweir 
409*cdf0e10cSrcweir             Property& rProp = pProps[ nPos ];
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir             rProp.Name       = OUString::createFromAscii( pCurr->pName );
412*cdf0e10cSrcweir             rProp.Handle     = pCurr->nHandle;
413*cdf0e10cSrcweir             rProp.Type       = pCurr->pGetCppuType();
414*cdf0e10cSrcweir             rProp.Attributes = pCurr->nAttributes;
415*cdf0e10cSrcweir 
416*cdf0e10cSrcweir             nPos++;
417*cdf0e10cSrcweir             pCurr++;
418*cdf0e10cSrcweir         }
419*cdf0e10cSrcweir 
420*cdf0e10cSrcweir         if ( nPos > 0 )
421*cdf0e10cSrcweir         {
422*cdf0e10cSrcweir             m_pProps->realloc( nPos );
423*cdf0e10cSrcweir             nSize = m_pProps->getLength();
424*cdf0e10cSrcweir         }
425*cdf0e10cSrcweir     }
426*cdf0e10cSrcweir     return *m_pProps;
427*cdf0e10cSrcweir }
428*cdf0e10cSrcweir 
429*cdf0e10cSrcweir //=========================================================================
430*cdf0e10cSrcweir // virtual
431*cdf0e10cSrcweir Property SAL_CALL UcbPropertiesManager::getPropertyByName( const OUString& aName )
432*cdf0e10cSrcweir     throw( UnknownPropertyException, RuntimeException )
433*cdf0e10cSrcweir {
434*cdf0e10cSrcweir     Property aProp;
435*cdf0e10cSrcweir     if ( queryProperty( aName, aProp ) )
436*cdf0e10cSrcweir         return aProp;
437*cdf0e10cSrcweir 
438*cdf0e10cSrcweir     throw UnknownPropertyException();
439*cdf0e10cSrcweir }
440*cdf0e10cSrcweir 
441*cdf0e10cSrcweir //=========================================================================
442*cdf0e10cSrcweir // virtual
443*cdf0e10cSrcweir sal_Bool SAL_CALL UcbPropertiesManager::hasPropertyByName( const OUString& Name )
444*cdf0e10cSrcweir     throw( RuntimeException )
445*cdf0e10cSrcweir {
446*cdf0e10cSrcweir     Property aProp;
447*cdf0e10cSrcweir     return queryProperty( Name, aProp );
448*cdf0e10cSrcweir }
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir //=========================================================================
451*cdf0e10cSrcweir //
452*cdf0e10cSrcweir // Non-Interface methods.
453*cdf0e10cSrcweir //
454*cdf0e10cSrcweir //=========================================================================
455*cdf0e10cSrcweir 
456*cdf0e10cSrcweir sal_Bool UcbPropertiesManager::queryProperty(
457*cdf0e10cSrcweir                                 const OUString& rName, Property& rProp )
458*cdf0e10cSrcweir {
459*cdf0e10cSrcweir     osl::Guard< osl::Mutex > aGuard( m_aMutex );
460*cdf0e10cSrcweir 
461*cdf0e10cSrcweir     getProperties();
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir     const Property* pProps = m_pProps->getConstArray();
464*cdf0e10cSrcweir     sal_Int32 nCount = m_pProps->getLength();
465*cdf0e10cSrcweir     for ( sal_Int32 n = 0; n < nCount; ++n )
466*cdf0e10cSrcweir     {
467*cdf0e10cSrcweir         const Property& rCurrProp = pProps[ n ];
468*cdf0e10cSrcweir         if ( rCurrProp.Name == rName )
469*cdf0e10cSrcweir         {
470*cdf0e10cSrcweir             rProp = rCurrProp;
471*cdf0e10cSrcweir             return sal_True;
472*cdf0e10cSrcweir         }
473*cdf0e10cSrcweir     }
474*cdf0e10cSrcweir 
475*cdf0e10cSrcweir     return sal_False;
476*cdf0e10cSrcweir }
477*cdf0e10cSrcweir 
478