LibreOffice Module ucb (master) 1
ucb.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21/**************************************************************************
22 TODO
23 **************************************************************************
24
25 *************************************************************************/
26
27#include <sal/config.h>
28
29#include <string_view>
30
31#include <osl/diagnose.h>
32#include <sal/log.hxx>
33#include <rtl/ustrbuf.hxx>
36#include <com/sun/star/lang/IllegalArgumentException.hpp>
37#include <com/sun/star/ucb/DuplicateProviderException.hpp>
38#include <com/sun/star/ucb/GlobalTransferCommandArgument2.hpp>
39#include <com/sun/star/ucb/UnsupportedCommandException.hpp>
40#include <com/sun/star/ucb/XCommandInfo.hpp>
41#include <com/sun/star/ucb/XContentProviderSupplier.hpp>
42#include <com/sun/star/configuration/theDefaultProvider.hpp>
43#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
44#include <com/sun/star/container/XNameAccess.hpp>
45#include <com/sun/star/uno/Any.hxx>
47#include <cppuhelper/weak.hxx>
50#include "identify.hxx"
51#include "ucbcmds.hxx"
52
53#include "ucb.hxx"
54
55using namespace comphelper;
56using namespace com::sun::star::uno;
57using namespace com::sun::star::lang;
58using namespace com::sun::star::ucb;
59using namespace ucb_impl;
60using namespace com::sun::star;
61using namespace ucbhelper;
62
63namespace {
64
65bool fillPlaceholders(OUString const & rInput,
66 uno::Sequence< uno::Any > const & rReplacements,
67 OUString * pOutput)
68{
69 sal_Unicode const * p = rInput.getStr();
70 sal_Unicode const * pEnd = p + rInput.getLength();
71 sal_Unicode const * pCopy = p;
72 OUStringBuffer aBuffer;
73 while (p != pEnd)
74 switch (*p++)
75 {
76 case '&':
77 if (pEnd - p >= 4
78 && p[0] == 'a' && p[1] == 'm' && p[2] == 'p'
79 && p[3] == ';')
80 {
81 aBuffer.append(pCopy, p - 1 - pCopy);
82 aBuffer.append('&');
83 p += 4;
84 pCopy = p;
85 }
86 else if (pEnd - p >= 3
87 && p[0] == 'l' && p[1] == 't' && p[2] == ';')
88 {
89 aBuffer.append(pCopy, p - 1 - pCopy);
90 aBuffer.append('<');
91 p += 3;
92 pCopy = p;
93 }
94 else if (pEnd - p >= 3
95 && p[0] == 'g' && p[1] == 't' && p[2] == ';')
96 {
97 aBuffer.append(pCopy, p - 1 - pCopy);
98 aBuffer.append('>');
99 p += 3;
100 pCopy = p;
101 }
102 break;
103
104 case '<':
105 sal_Unicode const * q = p;
106 while (q != pEnd && *q != '>')
107 ++q;
108 if (q == pEnd)
109 break;
110 OUString aKey(p, q - p);
111 OUString aValue;
112 bool bFound = false;
113 for (sal_Int32 i = 2; i + 1 < rReplacements.getLength();
114 i += 2)
115 {
116 OUString aReplaceKey;
117 if ((rReplacements[i] >>= aReplaceKey)
118 && aReplaceKey == aKey
119 && (rReplacements[i + 1] >>= aValue))
120 {
121 bFound = true;
122 break;
123 }
124 }
125 if (!bFound)
126 return false;
127 aBuffer.append(pCopy, p - 1 - pCopy);
128 aBuffer.append(aValue);
129 p = q + 1;
130 pCopy = p;
131 break;
132 }
133 aBuffer.append(pCopy, pEnd - pCopy);
134 *pOutput = aBuffer.makeStringAndClear();
135 return true;
136}
137
138void makeAndAppendXMLName(
139 OUStringBuffer & rBuffer, std::u16string_view rIn )
140{
141 size_t nCount = rIn.size();
142 for ( size_t n = 0; n < nCount; ++n )
143 {
144 const sal_Unicode c = rIn[ n ];
145 switch ( c )
146 {
147 case '&':
148 rBuffer.append( "&amp;" );
149 break;
150
151 case '"':
152 rBuffer.append( "&quot;" );
153 break;
154
155 case '\'':
156 rBuffer.append( "&apos;" );
157 break;
158
159 case '<':
160 rBuffer.append( "&lt;" );
161 break;
162
163 case '>':
164 rBuffer.append( "&gt;" );
165 break;
166
167 default:
168 rBuffer.append( c );
169 break;
170 }
171 }
172}
173
174bool createContentProviderData(
175 std::u16string_view rProvider,
176 const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess,
177 ContentProviderData & rInfo)
178{
179 // Obtain service name.
180
181 OUString aValue;
182 try
183 {
184 if ( !( rxHierNameAccess->getByHierarchicalName(
185 OUString::Concat(rProvider) + "/ServiceName" ) >>= aValue ) )
186 {
187 OSL_FAIL( "UniversalContentBroker::getContentProviderData - "
188 "Error getting item value!" );
189 }
190 }
191 catch (const container::NoSuchElementException&)
192 {
193 return false;
194 }
195
196 rInfo.ServiceName = aValue;
197
198 // Obtain URL Template.
199
200 if ( !( rxHierNameAccess->getByHierarchicalName(
201 OUString::Concat(rProvider) + "/URLTemplate" ) >>= aValue ) )
202 {
203 OSL_FAIL( "UniversalContentBroker::getContentProviderData - "
204 "Error getting item value!" );
205 }
206
207 rInfo.URLTemplate = aValue;
208
209 // Obtain Arguments.
210
211 if ( !( rxHierNameAccess->getByHierarchicalName(
212 OUString::Concat(rProvider) + "/Arguments" ) >>= aValue ) )
213 {
214 OSL_FAIL( "UniversalContentBroker::getContentProviderData - "
215 "Error getting item value!" );
216 }
217
218 rInfo.Arguments = aValue;
219 return true;
220}
221
222}
223
224
225// UniversalContentBroker Implementation.
226
227
230: m_xContext( xContext ),
231 m_nCommandId( 0 )
232{
233 OSL_ENSURE( m_xContext.is(),
234 "UniversalContentBroker ctor: No service manager" );
235}
236
237
238// virtual
240{
241}
242
243
244// XComponent methods.
245
246
247// virtual
249{
251 {
252 EventObject aEvt;
253 aEvt.Source = static_cast< XComponent* >(this);
254 m_pDisposeEventListeners->disposeAndClear( aEvt );
255 }
256
257 if ( m_xNotifier.is() )
258 m_xNotifier->removeChangesListener( this );
259}
260
261
262// virtual
264 const Reference< XEventListener >& Listener )
265{
268
269 m_pDisposeEventListeners->addInterface( Listener );
270}
271
272
273// virtual
275 const Reference< XEventListener >& Listener )
276{
278 m_pDisposeEventListeners->removeInterface( Listener );
279
280 // Note: Don't want to delete empty container here -> performance.
281}
282
283
284// XServiceInfo methods.
285
287{
288 return "com.sun.star.comp.ucb.UniversalContentBroker";
289}
290sal_Bool SAL_CALL UniversalContentBroker::supportsService( const OUString& ServiceName )
291{
292 return cppu::supportsService( this, ServiceName );
293}
294css::uno::Sequence< OUString > SAL_CALL UniversalContentBroker::getSupportedServiceNames()
295{
296 return { "com.sun.star.ucb.UniversalContentBroker" };
297}
298
299
300extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
302 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
303{
304 return cppu::acquire(new UniversalContentBroker(context));
305}
306
307
308// XInitialization methods.
309
310
311// virtual
312void SAL_CALL UniversalContentBroker::initialize( const css::uno::Sequence< Any >& aArguments )
313{
314 {
315 osl::MutexGuard aGuard(m_aMutex);
316 if (m_aArguments.hasElements())
317 {
318 if (aArguments.hasElements()
319 && !(m_aArguments.getLength() == 2
320 && aArguments.getLength() == 2
321 && m_aArguments[0] == aArguments[0]
322 && m_aArguments[1] == aArguments[1]))
323 {
324 throw IllegalArgumentException(
325 "UCB reinitialized with different arguments",
326 static_cast< cppu::OWeakObject * >(this), 0);
327 }
328 return;
329 }
330 if (!aArguments.hasElements())
331 {
332 m_aArguments = { Any(OUString("Local")), Any(OUString("Office")) };
333 }
334 else
335 {
337 }
338 }
339 configureUcb();
340}
341
342
343// XContentProviderManager methods.
344
345
346// virtual
349 const Reference< XContentProvider >& Provider,
350 const OUString& Scheme,
351 sal_Bool ReplaceExisting )
352{
353 osl::MutexGuard aGuard(m_aMutex);
354
356 try
357 {
358 aIt = m_aProviders.find(Scheme);
359 }
360 catch (const IllegalArgumentException&)
361 {
362 return nullptr; //@@@
363 }
364
366 if (aIt == m_aProviders.end())
367 {
368 ProviderList_Impl aList;
369 aList.push_front( ProviderListEntry_Impl(Provider) );
370 try
371 {
372 m_aProviders.add(Scheme, aList);
373 }
374 catch (const IllegalArgumentException&)
375 {
376 return nullptr; //@@@
377 }
378 }
379 else
380 {
381 if (!ReplaceExisting)
382 throw DuplicateProviderException();
383
384 ProviderList_Impl & rList = aIt->getValue();
385 xPrevious = rList.front().getProvider();
386 rList.push_front( ProviderListEntry_Impl(Provider) );
387 }
388
389 return xPrevious;
390}
391
392
393// virtual
395 const Reference< XContentProvider >& Provider,
396 const OUString& Scheme )
397{
398 osl::MutexGuard aGuard(m_aMutex);
399
401 try
402 {
403 aMapIt = m_aProviders.find(Scheme);
404 }
405 catch (const IllegalArgumentException&)
406 {
407 return; //@@@
408 }
409
410 if (aMapIt != m_aProviders.end())
411 {
412 ProviderList_Impl & rList = aMapIt->getValue();
413
414 auto aListIt = std::find_if(rList.begin(), rList.end(),
415 [&Provider](const ProviderListEntry_Impl& rEntry) { return rEntry.getProvider() == Provider; });
416 if (aListIt != rList.end())
417 rList.erase(aListIt);
418
419 if (rList.empty())
420 m_aProviders.erase(aMapIt);
421 }
422}
423
424
425// virtual
426css::uno::Sequence< ContentProviderInfo > SAL_CALL
428{
429 // Return a list with information about active(!) content providers.
430
431 osl::MutexGuard aGuard(m_aMutex);
432
433 css::uno::Sequence< ContentProviderInfo > aSeq( m_aProviders.size() );
434 ContentProviderInfo* pInfo = aSeq.getArray();
435
438 ++it)
439 {
440 // Note: Active provider is always the first list element.
441 pInfo->ContentProvider = it->getValue().front().getProvider();
442 pInfo->Scheme = it->getRegexp();
443 ++pInfo;
444 }
445
446 return aSeq;
447}
448
449
450// virtual
453 Identifier )
454{
455 return queryContentProvider( Identifier, false );
456}
457
458
459// XContentProvider methods.
460
461
462// virtual
464 const Reference< XContentIdentifier >& Identifier )
465{
466
467 // Let the content provider for the scheme given with the content
468 // identifier create the XContent instance.
469
470
471 if ( !Identifier.is() )
472 return Reference< XContent >();
473
475 queryContentProvider( Identifier->getContentIdentifier(), true );
476 if ( xProv.is() )
477 return xProv->queryContent( Identifier );
478
479 return Reference< XContent >();
480}
481
482
483// virtual
487{
488 OUString aURI1( Id1->getContentIdentifier() );
489 OUString aURI2( Id2->getContentIdentifier() );
490
492 = queryContentProvider( aURI1, true );
494 = queryContentProvider( aURI2, true );
495
496 // When both identifiers belong to the same provider, let that provider
497 // compare them; otherwise, simply compare the URI strings (which must
498 // be different):
499 if ( xProv1.is() && ( xProv1 == xProv2 ) )
500 return xProv1->compareContentIds( Id1, Id2 );
501 else
502 return aURI1.compareTo( aURI2 );
503}
504
505
506// XContentIdentifierFactory methods.
507
508
509// virtual
512 const OUString& ContentId )
513{
514
515 // Let the content provider for the scheme given with content
516 // identifier create the XContentIdentifier instance, if he supports
517 // the XContentIdentifierFactory interface. Otherwise create standard
518 // implementation object for XContentIdentifier.
519
520
522
524 = queryContentProvider( ContentId, true );
525 if ( xProv.is() )
526 {
527 Reference< XContentIdentifierFactory > xFac( xProv, UNO_QUERY );
528 if ( xFac.is() )
529 xIdentifier = xFac->createContentIdentifier( ContentId );
530 }
531
532 if ( !xIdentifier.is() )
533 xIdentifier = new ContentIdentifier( ContentId );
534
535 return xIdentifier;
536}
537
538
539// XCommandProcessor methods.
540
541
542// virtual
544{
545 osl::MutexGuard aGuard( m_aMutex );
546
547 // Just increase counter on every call to generate an identifier.
548 return ++m_nCommandId;
549}
550
551
552// virtual
554 const Command& aCommand,
555 sal_Int32,
556 const Reference< XCommandEnvironment >& Environment )
557{
558 Any aRet;
559
560
561 // Note: Don't forget to adapt ucb_commands::CommandProcessorInfo
562 // ctor in ucbcmds.cxx when adding new commands!
563
564
565 if ( ( aCommand.Handle == GETCOMMANDINFO_HANDLE ) || aCommand.Name == GETCOMMANDINFO_NAME )
566 {
567
568 // getCommandInfo
569
570
571 aRet <<= getCommandInfo();
572 }
573 else if ( ( aCommand.Handle == GLOBALTRANSFER_HANDLE ) || aCommand.Name == GLOBALTRANSFER_NAME )
574 {
575
576 // globalTransfer
577
578
579 GlobalTransferCommandArgument2 aTransferArg;
580 if ( !( aCommand.Argument >>= aTransferArg ) )
581 {
582 GlobalTransferCommandArgument aArg;
583 if ( !( aCommand.Argument >>= aArg ) )
584 {
586 Any( IllegalArgumentException(
587 "Wrong argument type!",
588 static_cast< cppu::OWeakObject * >( this ),
589 -1 ) ),
590 Environment );
591 // Unreachable
592 }
593
594 // Copy infos into the new structure
595 aTransferArg.Operation = aArg.Operation;
596 aTransferArg.SourceURL = aArg.SourceURL;
597 aTransferArg.TargetURL = aArg.TargetURL;
598 aTransferArg.NewTitle = aArg.NewTitle;
599 aTransferArg.NameClash = aArg.NameClash;
600 }
601
602 globalTransfer( aTransferArg, Environment );
603 }
604 else if ( ( aCommand.Handle == CHECKIN_HANDLE ) || aCommand.Name == CHECKIN_NAME )
605 {
606 ucb::CheckinArgument aCheckinArg;
607 if ( !( aCommand.Argument >>= aCheckinArg ) )
608 {
610 Any( IllegalArgumentException(
611 "Wrong argument type!",
612 static_cast< cppu::OWeakObject * >( this ),
613 -1 ) ),
614 Environment );
615 // Unreachable
616 }
617 aRet = checkIn( aCheckinArg, Environment );
618 }
619 else
620 {
621
622 // Unknown command
623
624
626 Any( UnsupportedCommandException(
627 OUString(),
628 static_cast< cppu::OWeakObject * >( this ) ) ),
629 Environment );
630 // Unreachable
631 }
632
633 return aRet;
634}
635
636
637// XCommandProcessor2 methods.
638
639
640// virtual
641void SAL_CALL UniversalContentBroker::releaseCommandIdentifier(sal_Int32 /*aCommandId*/)
642{
643 // @@@ Not implemented ( yet).
644}
645
646
647// virtual
648void SAL_CALL UniversalContentBroker::abort( sal_Int32 )
649{
650 // @@@ Not implemented ( yet).
651}
652
653
654// XChangesListener methods
655
656
657// virtual
658void SAL_CALL UniversalContentBroker::changesOccurred( const util::ChangesEvent& Event )
659{
660 if ( !Event.Changes.hasElements() )
661 return;
662
663 uno::Reference< container::XHierarchicalNameAccess > xHierNameAccess;
664 Event.Base >>= xHierNameAccess;
665
666 OSL_ASSERT( xHierNameAccess.is() );
667
669 for ( const util::ElementChange& rElem : Event.Changes )
670 {
671 OUString aKey;
672 rElem.Accessor >>= aKey;
673
675
676 // Removal of UCPs from the configuration leads to changesOccurred
677 // notifications, too, but it is hard to tell for a given
678 // ElementChange whether it is an addition or a removal, so as a
679 // heuristic consider as removals those that cause a
680 // NoSuchElementException in createContentProviderData.
681
682 // For now, removal of UCPs from the configuration is simply ignored
683 // (and not reflected in the UCB's data structures):
684 if (createContentProviderData(aKey, xHierNameAccess, aInfo))
685 {
686 aData.push_back(aInfo);
687 }
688 }
689
691}
692
693
694// XEventListener methods
695
696
697// virtual
698void SAL_CALL UniversalContentBroker::disposing(const lang::EventObject&)
699{
700 if ( m_xNotifier.is() )
701 {
702 osl::Guard< osl::Mutex > aGuard( m_aMutex );
703
704 if ( m_xNotifier.is() )
705 m_xNotifier.clear();
706 }
707}
708
709
710// Non-interface methods
711
712
714 const OUString& Identifier,
715 bool bResolved )
716{
717 osl::MutexGuard aGuard( m_aMutex );
718
719 ProviderList_Impl const * pList = m_aProviders.map( Identifier );
720 return pList ? bResolved ? pList->front().getResolvedProvider()
721 : pList->front().getProvider()
723}
724
726{
727 OUString aKey1;
728 OUString aKey2;
729 if (m_aArguments.getLength() < 2
730 || !(m_aArguments[0] >>= aKey1) || !(m_aArguments[1] >>= aKey2))
731 {
732 OSL_FAIL("UniversalContentBroker::configureUcb(): Bad arguments");
733 return;
734 }
735
737 if (!getContentProviderData(aKey1, aKey2, aData))
738 {
739 SAL_WARN( "ucb", "No configuration");
740 return;
741 }
742
744}
745
747 const ContentProviderDataList& rData)
748{
749 for (const auto& rContentProviderData : rData)
750 {
751 OUString aProviderArguments;
752 if (fillPlaceholders(rContentProviderData.Arguments,
754 &aProviderArguments))
755 {
756 registerAtUcb(this,
758 rContentProviderData.ServiceName,
759 aProviderArguments,
760 rContentProviderData.URLTemplate);
761
762 }
763 else
764 OSL_FAIL("UniversalContentBroker::prepareAndRegister(): Bad argument placeholders");
765 }
766}
767
768
770 std::u16string_view rKey1,
771 std::u16string_view rKey2,
772 ContentProviderDataList & rListToFill )
773{
774 if ( !m_xContext.is() || rKey1.empty() || rKey2.empty() )
775 {
776 OSL_FAIL( "UniversalContentBroker::getContentProviderData - Invalid argument!" );
777 return false;
778 }
779
780 try
781 {
782 uno::Reference< lang::XMultiServiceFactory > xConfigProv =
783 configuration::theDefaultProvider::get( m_xContext );
784
785 OUStringBuffer aFullPath(128);
786 aFullPath.append(
787 "/org.openoffice.ucb.Configuration/ContentProviders"
788 "/['" );
789 makeAndAppendXMLName( aFullPath, rKey1 );
790 aFullPath.append( "']/SecondaryKeys/['" );
791 makeAndAppendXMLName( aFullPath, rKey2 );
792 aFullPath.append( "']/ProviderData" );
793
794 uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
795 {
796 {"nodepath", uno::Any(aFullPath.makeStringAndClear())}
797 }));
798
799 uno::Reference< uno::XInterface > xInterface(
800 xConfigProv->createInstanceWithArguments(
801 "com.sun.star.configuration.ConfigurationAccess",
802 aArguments ) );
803
804 if ( !m_xNotifier.is() )
805 {
806 m_xNotifier.set( xInterface, uno::UNO_QUERY_THROW );
807
808 m_xNotifier->addChangesListener( this );
809 }
810
811 uno::Reference< container::XNameAccess > xNameAccess(
812 xInterface, uno::UNO_QUERY_THROW );
813
814 const uno::Sequence< OUString > aElems = xNameAccess->getElementNames();
815
816 if ( aElems.hasElements() )
817 {
818 uno::Reference< container::XHierarchicalNameAccess >
819 xHierNameAccess( xInterface, uno::UNO_QUERY_THROW );
820
821 // Iterate over children.
822 for ( const auto& rElem : aElems )
823 {
824
825 try
826 {
827
829
830 OUStringBuffer aElemBuffer;
831 aElemBuffer.append( "['" );
832 makeAndAppendXMLName( aElemBuffer, rElem );
833 aElemBuffer.append( "']" );
834
835 OSL_VERIFY(
836 createContentProviderData(
837 aElemBuffer, xHierNameAccess,
838 aInfo));
839
840 rListToFill.push_back( aInfo );
841 }
842 catch (const container::NoSuchElementException&)
843 {
844 // getByHierarchicalName
845 OSL_FAIL( "UniversalContentBroker::getContentProviderData - "
846 "caught NoSuchElementException!" );
847 }
848 }
849 }
850 }
851 catch (const uno::RuntimeException&)
852 {
853 TOOLS_WARN_EXCEPTION( "ucb", "" );
854 return false;
855 }
856 catch (const uno::Exception&)
857 {
858 // createInstance, createInstanceWithArguments
859
860 TOOLS_WARN_EXCEPTION( "ucb", "" );
861 return false;
862 }
863
864 return true;
865}
866
867
868// ProviderListEntry_Impl implementation.
869
870
872{
873 if ( !m_xResolvedProvider.is() )
874 {
876 m_xProvider, UNO_QUERY );
877 if ( xSupplier.is() )
878 m_xResolvedProvider = xSupplier->getContentProvider();
879
880 if ( !m_xResolvedProvider.is() )
882 }
883
884 return m_xResolvedProvider;
885}
886
887/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XComponentContext > m_xContext
css::uno::Reference< css::ucb::XContentProvider > const & resolveProvider() const
Definition: ucb.cxx:871
css::uno::Reference< css::ucb::XContentProvider > m_xResolvedProvider
Definition: providermap.hxx:36
css::uno::Reference< css::ucb::XContentProvider > m_xProvider
Definition: providermap.hxx:34
virtual void SAL_CALL deregisterContentProvider(const css::uno::Reference< css::ucb::XContentProvider > &Provider, const OUString &Scheme) override
Definition: ucb.cxx:394
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: ucb.cxx:274
UniversalContentBroker(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Definition: ucb.cxx:228
virtual ~UniversalContentBroker() override
Definition: ucb.cxx:239
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: ucb.cxx:263
static css::uno::Reference< css::ucb::XCommandInfo > getCommandInfo()
Definition: ucbcmds.cxx:1526
css::uno::Reference< css::util::XChangesNotifier > m_xNotifier
Definition: ucb.hxx:149
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: ucb.hxx:146
sal_Int32 m_nCommandId
Definition: ucb.hxx:155
virtual void SAL_CALL releaseCommandIdentifier(sal_Int32 aCommandId) override
Definition: ucb.cxx:641
virtual OUString SAL_CALL getImplementationName() override
Definition: ucb.cxx:286
void globalTransfer(const css::ucb::GlobalTransferCommandArgument2 &rArg, const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)
Definition: ucbcmds.cxx:1532
virtual sal_Int32 SAL_CALL createCommandIdentifier() override
Definition: ucb.cxx:543
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL registerContentProvider(const css::uno::Reference< css::ucb::XContentProvider > &Provider, const OUString &Scheme, sal_Bool ReplaceExisting) override
Definition: ucb.cxx:348
ProviderMap_Impl m_aProviders
Definition: ucb.hxx:152
virtual void SAL_CALL abort(sal_Int32 CommandId) override
Definition: ucb.cxx:648
virtual void SAL_CALL dispose() override
Definition: ucb.cxx:248
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: ucb.cxx:294
virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent &Event) override
Definition: ucb.cxx:658
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::lang::XEventListener > > m_pDisposeEventListeners
Definition: ucb.hxx:154
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
Definition: ucb.cxx:312
bool getContentProviderData(std::u16string_view rKey1, std::u16string_view rKey2, ucbhelper::ContentProviderDataList &rListToFill)
Definition: ucb.cxx:769
void prepareAndRegister(const ucbhelper::ContentProviderDataList &rData)
Definition: ucb.cxx:746
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
Definition: ucb.cxx:463
virtual css::uno::Sequence< css::ucb::ContentProviderInfo > SAL_CALL queryContentProviders() override
Definition: ucb.cxx:427
css::uno::Any checkIn(const css::ucb::CheckinArgument &rArg, const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)
Definition: ucbcmds.cxx:1846
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: ucb.cxx:698
osl::Mutex m_aMutex
Definition: ucb.hxx:153
virtual sal_Int32 SAL_CALL compareContentIds(const css::uno::Reference< css::ucb::XContentIdentifier > &Id1, const css::uno::Reference< css::ucb::XContentIdentifier > &Id2) override
Definition: ucb.cxx:484
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL createContentIdentifier(const OUString &ContentId) override
Definition: ucb.cxx:511
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: ucb.cxx:290
virtual css::uno::Any SAL_CALL execute(const css::ucb::Command &aCommand, sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &Environment) override
Definition: ucb.cxx:553
css::uno::Sequence< css::uno::Any > m_aArguments
Definition: ucb.hxx:151
virtual css::uno::Reference< css::ucb::XContentProvider > SAL_CALL queryContentProvider(const OUString &Identifier) override
Definition: ucb.cxx:452
Val const * map(OUString const &rString) const
Definition: regexpmap.hxx:401
size_type size() const
Definition: regexpmap.hxx:392
void add(OUString const &rKey, Val const &rValue)
Definition: regexpmap.hxx:301
iterator find(OUString const &rKey)
Definition: regexpmap.hxx:330
void erase(iterator const &rPos)
Definition: regexpmap.hxx:353
int nCount
#define TOOLS_WARN_EXCEPTION(area, stream)
Sequence< PropertyValue > aArguments
void * p
sal_Int64 n
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
end
void cancelCommandExecution(const uno::Any &rException, const uno::Reference< ucb::XCommandEnvironment > &xEnv)
UCBHELPER_DLLPUBLIC bool registerAtUcb(css::uno::Reference< css::ucb::XContentProviderManager > const &rManager, css::uno::Reference< css::uno::XComponentContext > const &rxContext, OUString const &rName, OUString const &rArguments, OUString const &rTemplate)
std::vector< ContentProviderData > ContentProviderDataList
std::deque< ProviderListEntry_Impl > ProviderList_Impl
Definition: providermap.hxx:58
OUString aCommand
unsigned char sal_Bool
sal_uInt16 sal_Unicode
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ucb_UniversalContentBroker_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: ucb.cxx:301
constexpr OUStringLiteral GLOBALTRANSFER_NAME
Definition: ucbcmds.hxx:30
constexpr OUStringLiteral CHECKIN_NAME
Definition: ucbcmds.hxx:33
#define GLOBALTRANSFER_HANDLE
Definition: ucbcmds.hxx:31
#define CHECKIN_HANDLE
Definition: ucbcmds.hxx:34
constexpr OUStringLiteral GETCOMMANDINFO_NAME
Definition: ucbcmds.hxx:27
#define GETCOMMANDINFO_HANDLE
Definition: ucbcmds.hxx:28
std::unique_ptr< char[]> aBuffer