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