LibreOffice Module ucb (master)  1
bc.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 #include <rtl/uri.hxx>
21 #include <rtl/ustrbuf.hxx>
22 #include <rtl/ref.hxx>
23 
24 #include <tools/diagnose_ex.h>
25 #include <com/sun/star/lang/NoSupportException.hpp>
26 #include <com/sun/star/sdbc/SQLException.hpp>
27 #include <com/sun/star/ucb/IllegalIdentifierException.hpp>
28 #include <com/sun/star/ucb/OpenMode.hpp>
29 #include <com/sun/star/beans/IllegalTypeException.hpp>
30 #include <com/sun/star/io/XActiveDataStreamer.hpp>
31 #include <com/sun/star/io/XOutputStream.hpp>
32 #include <com/sun/star/io/XActiveDataSink.hpp>
33 #include <com/sun/star/ucb/NameClash.hpp>
34 #include <comphelper/fileurl.hxx>
38 #include "filglob.hxx"
39 #include "filid.hxx"
40 #include "filrow.hxx"
41 #include "bc.hxx"
42 #include "prov.hxx"
43 #include "filerror.hxx"
44 #include "filinsreq.hxx"
45 
46 using namespace fileaccess;
47 using namespace com::sun::star;
48 using namespace com::sun::star::uno;
49 using namespace com::sun::star::ucb;
50 
51 #if OSL_DEBUG_LEVEL > 0
52 #define THROW_WHERE SAL_WHERE
53 #else
54 #define THROW_WHERE ""
55 #endif
56 
58 {
60  osl::Mutex& rMutex;
61  std::unordered_map<OUString, ContainerHelper> m_aMap;
62 public:
63  explicit PropertyListeners( ::osl::Mutex& aMutex )
64  : rMutex( aMutex )
65  {
66  }
67  void disposeAndClear(const lang::EventObject& rEvt)
68  {
69  // create a copy, because do not fire event in a guarded section
70  std::unordered_map<OUString, ContainerHelper> tempMap;
71  {
72  ::osl::MutexGuard aGuard(rMutex);
73  tempMap = std::move(m_aMap);
74  }
75  for (auto& rPair : tempMap)
76  rPair.second.disposeAndClear(rEvt);
77  }
78  void addInterface(const OUString& rKey, const uno::Reference<beans::XPropertiesChangeListener>& rListener)
79  {
80  ::osl::MutexGuard aGuard(rMutex);
81  auto iter = m_aMap.find(rKey);
82  if (iter == m_aMap.end())
83  {
84  auto ret = m_aMap.emplace(rKey, rMutex);
85  ret.first->second.addInterface(rListener);
86  }
87  else
88  iter->second.addInterface(rListener);
89  }
90  void removeInterface(const OUString& rKey, const uno::Reference<beans::XPropertiesChangeListener>& rListener)
91  {
92  ::osl::MutexGuard aGuard(rMutex);
93 
94  // search container with id rKey
95  auto iter = m_aMap.find(rKey);
96  // container found?
97  if (iter != m_aMap.end())
98  iter->second.removeInterface(rListener);
99  }
100  std::vector< OUString > getContainedTypes() const
101  {
102  ::osl::MutexGuard aGuard(rMutex);
103  std::vector<OUString> aInterfaceTypes;
104  aInterfaceTypes.reserve(m_aMap.size());
105  for (const auto& rPair : m_aMap)
106  // are interfaces added to this container?
107  if (rPair.second.getLength())
108  // yes, put the type in the array
109  aInterfaceTypes.push_back(rPair.first);
110  return aInterfaceTypes;
111  }
113  {
114  ::osl::MutexGuard aGuard(rMutex);
115 
116  auto iter = m_aMap.find(rKey);
117  if (iter != m_aMap.end())
118  return &iter->second;
119  return nullptr;
120  }
121 };
122 
123 
124 /****************************************************************************************/
125 /* */
126 /* BaseContent */
127 /* */
128 /****************************************************************************************/
129 
130 
131 // Private Constructor for just inserted Contents
132 
134  const OUString& parentName,
135  bool bFolder )
136  : m_pMyShell( pMyShell ),
137  m_aUncPath( parentName ),
138  m_bFolder( bFolder ),
139  m_nState( JustInserted )
140 {
141  m_pMyShell->m_pProvider->acquire();
142  // No registering, since we have no name
143 }
144 
145 
146 // Constructor for full featured Contents
147 
149  const Reference< XContentIdentifier >& xContentIdentifier,
150  const OUString& aUncPath )
151  : m_pMyShell( pMyShell ),
152  m_xContentIdentifier( xContentIdentifier ),
153  m_aUncPath( aUncPath ),
154  m_bFolder( false ),
155  m_nState( FullFeatured )
156 {
157  m_pMyShell->m_pProvider->acquire();
160 }
161 
162 
164 {
165  if( ( m_nState & FullFeatured ) || ( m_nState & Deleted ) )
166  {
168  }
169  m_pMyShell->m_pProvider->release();
170 }
171 
172 
173 // XComponent
174 
175 
176 void SAL_CALL
178 {
179  osl::MutexGuard aGuard( m_aMutex );
180 
181  if ( ! m_pDisposeEventListeners )
184 
185  m_pDisposeEventListeners->addInterface( Listener );
186 }
187 
188 
189 void SAL_CALL
191 {
192  osl::MutexGuard aGuard( m_aMutex );
193 
195  m_pDisposeEventListeners->removeInterface( Listener );
196 }
197 
198 
199 void SAL_CALL
201 {
202  lang::EventObject aEvt;
203  std::unique_ptr<comphelper::OInterfaceContainerHelper3<lang::XEventListener>> pDisposeEventListeners;
204  std::unique_ptr<comphelper::OInterfaceContainerHelper3<XContentEventListener>> pContentEventListeners;
205  std::unique_ptr<comphelper::OInterfaceContainerHelper3<beans::XPropertySetInfoChangeListener>> pPropertySetInfoChangeListeners;
206  std::unique_ptr<PropertyListeners> pPropertyListener;
207 
208  {
209  osl::MutexGuard aGuard( m_aMutex );
210  aEvt.Source = static_cast< XContent* >( this );
211 
212  pDisposeEventListeners = std::move(m_pDisposeEventListeners);
213  pContentEventListeners = std::move(m_pContentEventListeners);
214  pPropertySetInfoChangeListeners = std::move(m_pPropertySetInfoChangeListeners);
215  pPropertyListener = std::move(m_pPropertyListener);
216  }
217 
218  if ( pDisposeEventListeners && pDisposeEventListeners->getLength() )
219  pDisposeEventListeners->disposeAndClear( aEvt );
220 
221  if ( pContentEventListeners && pContentEventListeners->getLength() )
222  pContentEventListeners->disposeAndClear( aEvt );
223 
224  if( pPropertyListener )
225  pPropertyListener->disposeAndClear( aEvt );
226 
227  if( pPropertySetInfoChangeListeners )
228  pPropertySetInfoChangeListeners->disposeAndClear( aEvt );
229 }
230 
231 // XServiceInfo
232 OUString SAL_CALL
234 {
235  return "com.sun.star.comp.ucb.FileContent";
236 }
237 
238 sal_Bool SAL_CALL
239 BaseContent::supportsService( const OUString& ServiceName )
240 {
241  return cppu::supportsService( this, ServiceName );
242 }
243 
244 Sequence< OUString > SAL_CALL
246 {
247  Sequence<OUString> ret { "com.sun.star.ucb.FileContent" };
248  return ret;
249 }
250 
251 // XCommandProcessor
252 
253 
254 sal_Int32 SAL_CALL
256 {
257  return m_pMyShell->getCommandId();
258 }
259 
260 
261 void SAL_CALL
262 BaseContent::abort( sal_Int32 /*CommandId*/ )
263 {
264 }
265 
266 
267 Any SAL_CALL
268 BaseContent::execute( const Command& aCommand,
269  sal_Int32 CommandId,
270  const Reference< XCommandEnvironment >& Environment )
271 {
272  if( ! CommandId )
273  // A Command with commandid zero cannot be aborted
274  CommandId = createCommandIdentifier();
275 
276  m_pMyShell->startTask( CommandId,
277  Environment );
278 
279  Any aAny;
280 
281  if (aCommand.Name == "getPropertySetInfo") // No exceptions
282  {
283  aAny <<= getPropertySetInfo();
284  }
285  else if (aCommand.Name == "getCommandInfo") // no exceptions
286  {
287  aAny <<= getCommandInfo();
288  }
289  else if ( aCommand.Name == "setPropertyValues" )
290  {
291  Sequence< beans::PropertyValue > sPropertyValues;
292 
293  if( ! ( aCommand.Argument >>= sPropertyValues ) )
294  m_pMyShell->installError( CommandId,
296  else
297  aAny <<= setPropertyValues( CommandId,sPropertyValues ); // calls endTask by itself
298  }
299  else if ( aCommand.Name == "getPropertyValues" )
300  {
301  Sequence< beans::Property > ListOfRequestedProperties;
302 
303  if( ! ( aCommand.Argument >>= ListOfRequestedProperties ) )
304  m_pMyShell->installError( CommandId,
306  else
307  aAny <<= getPropertyValues( CommandId,
308  ListOfRequestedProperties );
309  }
310  else if ( aCommand.Name == "open" )
311  {
312  OpenCommandArgument2 aOpenArgument;
313  if( ! ( aCommand.Argument >>= aOpenArgument ) )
314  m_pMyShell->installError( CommandId,
316  else
317  {
318  Reference< XDynamicResultSet > result = open( CommandId,aOpenArgument );
319  if( result.is() )
320  aAny <<= result;
321  }
322  }
323  else if ( aCommand.Name == "delete" )
324  {
325  if( ! aCommand.Argument.has< bool >() )
326  m_pMyShell->installError( CommandId,
328  else
329  deleteContent( CommandId );
330  }
331  else if ( aCommand.Name == "transfer" )
332  {
333  TransferInfo aTransferInfo;
334  if( ! ( aCommand.Argument >>= aTransferInfo ) )
335  m_pMyShell->installError( CommandId,
337  else
338  transfer( CommandId, aTransferInfo );
339  }
340  else if ( aCommand.Name == "insert" )
341  {
342  InsertCommandArgument aInsertArgument;
343  if( ! ( aCommand.Argument >>= aInsertArgument ) )
344  m_pMyShell->installError( CommandId,
346  else
347  insert( CommandId,aInsertArgument );
348  }
349  else if ( aCommand.Name == "getCasePreservingURL" )
350  {
351  Reference< sdbc::XRow > xRow = getPropertyValues( CommandId, { { "CasePreservingURL", -1, cppu::UnoType<sal_Bool>::get(), 0 } });
352  OUString CasePreservingURL = xRow->getString(1);
353  if(!xRow->wasNull())
354  aAny <<= CasePreservingURL;
355  }
356  else if ( aCommand.Name == "createNewContent" )
357  {
358  ucb::ContentInfo aArg;
359  if ( !( aCommand.Argument >>= aArg ) )
360  m_pMyShell->installError( CommandId,
362  else
363  aAny <<= createNewContent( aArg );
364  }
365  else
366  m_pMyShell->installError( CommandId,
368 
369 
370  // This is the only function allowed to throw an exception
371  endTask( CommandId );
372 
373  return aAny;
374 }
375 
376 
377 void SAL_CALL
379  const Sequence< OUString >& PropertyNames,
381 {
382  if( ! Listener.is() )
383  return;
384 
385  osl::MutexGuard aGuard( m_aMutex );
386 
387  if( ! m_pPropertyListener )
389 
390 
391  if( !PropertyNames.hasElements() )
392  m_pPropertyListener->addInterface( OUString(),Listener );
393  else
394  {
396  for( const auto& rName : PropertyNames )
397  if( xProp->hasPropertyByName( rName ) )
398  m_pPropertyListener->addInterface( rName,Listener );
399  }
400 }
401 
402 
403 void SAL_CALL
406 {
407  if( ! Listener.is() )
408  return;
409 
410  osl::MutexGuard aGuard( m_aMutex );
411 
412  if( ! m_pPropertyListener )
413  return;
414 
415  for( const auto& rName : PropertyNames )
416  m_pPropertyListener->removeInterface( rName,Listener );
417 
418  m_pPropertyListener->removeInterface( OUString(), Listener );
419 }
420 
421 
422 // XContent
423 
424 
427 {
428  return m_xContentIdentifier;
429 }
430 
431 
432 OUString SAL_CALL
434 {
435  if( !( m_nState & Deleted ) )
436  {
437  if( m_nState & JustInserted )
438  {
439  if ( m_bFolder )
441  else
443  }
444  else
445  {
446  try
447  {
448  // Who am I ?
449  Reference< sdbc::XRow > xRow = getPropertyValues( -1, { { "IsDocument", -1, cppu::UnoType<sal_Bool>::get(), 0 } });
450  bool IsDocument = xRow->getBoolean( 1 );
451 
452  if ( !xRow->wasNull() )
453  {
454  if ( IsDocument )
456  else
458  }
459  else
460  {
461  OSL_FAIL( "BaseContent::getContentType - Property value was null!" );
462  }
463  }
464  catch (const sdbc::SQLException&)
465  {
466  TOOLS_WARN_EXCEPTION("ucb.ucp.file", "");
467  }
468  }
469  }
470 
471  return OUString();
472 }
473 
474 
475 void SAL_CALL
477  const Reference< XContentEventListener >& Listener )
478 {
479  osl::MutexGuard aGuard( m_aMutex );
480 
481  if ( ! m_pContentEventListeners )
484 
485 
486  m_pContentEventListeners->addInterface( Listener );
487 }
488 
489 
490 void SAL_CALL
492  const Reference< XContentEventListener >& Listener )
493 {
494  osl::MutexGuard aGuard( m_aMutex );
495 
497  m_pContentEventListeners->removeInterface( Listener );
498 }
499 
500 
501 // XPropertyContainer
502 
503 
504 void SAL_CALL
506  const OUString& Name,
507  sal_Int16 Attributes,
508  const Any& DefaultValue )
509 {
510  if( ( m_nState & JustInserted ) || ( m_nState & Deleted ) || Name.isEmpty() )
511  {
512  throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 );
513  }
514 
515  m_pMyShell->associate( m_aUncPath,Name,DefaultValue,Attributes );
516 }
517 
518 
519 void SAL_CALL
520 BaseContent::removeProperty( const OUString& Name )
521 {
522 
523  if( m_nState & Deleted )
524  throw beans::UnknownPropertyException( Name );
525 
527 }
528 
529 
530 // XContentCreator
531 
532 
535 {
537 }
538 
539 
540 Reference< XContent > SAL_CALL
542 {
543  // Check type.
544  if ( Info.Type.isEmpty() )
545  return Reference< XContent >();
546 
547  bool bFolder = Info.Type == TaskManager::FolderContentType;
548  if ( !bFolder )
549  {
550  if ( Info.Type != TaskManager::FileContentType )
551  {
552  // Neither folder nor file to create!
553  return Reference< XContent >();
554  }
555  }
556 
557  // Who am I ?
558  bool IsDocument = false;
559 
560  try
561  {
562  Reference< sdbc::XRow > xRow = getPropertyValues( -1, { { "IsDocument", -1, cppu::UnoType<sal_Bool>::get(), 0 } });
563  IsDocument = xRow->getBoolean( 1 );
564 
565  if ( xRow->wasNull() )
566  {
567  IsDocument = false;
568 // OSL_FAIL( // "BaseContent::createNewContent - Property value was null!" );
569 // return Reference< XContent >();
570  }
571  }
572  catch (const sdbc::SQLException&)
573  {
574  TOOLS_WARN_EXCEPTION("ucb.ucp.file", "");
575  return Reference< XContent >();
576  }
577 
578  OUString dstUncPath;
579 
580  if( IsDocument )
581  {
582  // KSO: Why is a document a XContentCreator? This is quite unusual.
583  dstUncPath = getParentName( m_aUncPath );
584  }
585  else
586  dstUncPath = m_aUncPath;
587 
588  return new BaseContent( m_pMyShell, dstUncPath, bFolder );
589 }
590 
591 
592 // XPropertySetInfoChangeNotifier
593 
594 
595 void SAL_CALL
598 {
599  osl::MutexGuard aGuard( m_aMutex );
602 
603  m_pPropertySetInfoChangeListeners->addInterface( Listener );
604 }
605 
606 
607 void SAL_CALL
610 {
611  osl::MutexGuard aGuard( m_aMutex );
612 
614  m_pPropertySetInfoChangeListeners->removeInterface( Listener );
615 }
616 
617 
618 // XChild
619 
620 
623 {
624  OUString ParentUnq = getParentName( m_aUncPath );
625  OUString ParentUrl;
626 
627 
628  bool err = fileaccess::TaskManager::getUrlFromUnq( ParentUnq, ParentUrl );
629  if( err )
630  return Reference< XInterface >( nullptr );
631 
633 
634  try
635  {
636  return Reference<XInterface>( m_pMyShell->m_pProvider->queryContent( Identifier ), UNO_QUERY );
637  }
638  catch (const IllegalIdentifierException&)
639  {
640  return Reference< XInterface >();
641  }
642 }
643 
644 
645 void SAL_CALL
647  const Reference< XInterface >& )
648 {
649  throw lang::NoSupportException( THROW_WHERE );
650 }
651 
652 
653 // Private Methods
654 
655 
658 {
659  if( m_nState & Deleted )
660  return Reference< XCommandInfo >();
661 
662  return m_pMyShell->info_c();
663 }
664 
665 
668 {
669  if( m_nState & Deleted )
671 
672  return m_pMyShell->info_p( m_aUncPath );
673 }
674 
677  sal_Int32 nMyCommandIdentifier,
678  const Sequence< beans::Property >& PropertySet )
679 {
680  sal_Int32 nProps = PropertySet.getLength();
681  if ( !nProps )
682  return Reference< sdbc::XRow >();
683 
684  if( m_nState & Deleted )
685  {
686  Sequence< Any > aValues( nProps );
687  return Reference< sdbc::XRow >( new XRow_impl( m_pMyShell, aValues ) );
688  }
689 
690  if( m_nState & JustInserted )
691  {
692  Sequence< Any > aValues( nProps );
693  Any* pValues = aValues.getArray();
694 
695  const beans::Property* pProps = PropertySet.getConstArray();
696 
697  for ( sal_Int32 n = 0; n < nProps; ++n )
698  {
699  const beans::Property& rProp = pProps[ n ];
700  Any& rValue = pValues[ n ];
701 
702  if ( rProp.Name == "ContentType" )
703  {
704  rValue <<= (m_bFolder ? OUString(TaskManager::FolderContentType)
705  : OUString(TaskManager::FileContentType));
706  }
707  else if ( rProp.Name == "IsFolder" )
708  {
709  rValue <<= m_bFolder;
710  }
711  else if ( rProp.Name == "IsDocument" )
712  {
713  rValue <<= !m_bFolder;
714  }
715  }
716 
718  new XRow_impl( m_pMyShell, aValues ) );
719  }
720 
721  return m_pMyShell->getv( nMyCommandIdentifier,
722  m_aUncPath,
723  PropertySet );
724 }
725 
726 
729  sal_Int32 nMyCommandIdentifier,
730  const Sequence< beans::PropertyValue >& Values )
731 {
732  if( m_nState & Deleted )
733  { // To do
734  return Sequence< Any >( Values.getLength() );
735  }
736 
737  static const OUStringLiteral Title(u"Title");
738 
739  // Special handling for files which have to be inserted
740  if( m_nState & JustInserted )
741  {
742  for( const auto& rValue : Values )
743  {
744  if( rValue.Name == Title )
745  {
746  OUString NewTitle;
747  if( rValue.Value >>= NewTitle )
748  {
750  {
751  // User wants to set another Title before "insert".
752  // m_aUncPath contains previous own URI.
753 
754  sal_Int32 nLastSlash = m_aUncPath.lastIndexOf( '/' );
755  bool bTrailingSlash = false;
756  if ( nLastSlash == m_aUncPath.getLength() - 1 )
757  {
758  bTrailingSlash = true;
759  nLastSlash
760  = m_aUncPath.lastIndexOf( '/', nLastSlash );
761  }
762 
763  OSL_ENSURE( nLastSlash != -1,
764  "BaseContent::setPropertyValues: "
765  "Invalid URL!" );
766 
767  OUStringBuffer aBuf(
768  m_aUncPath.subView( 0, nLastSlash + 1 ) );
769 
770  if ( !NewTitle.isEmpty() )
771  {
772  aBuf.append( NewTitle );
773  if ( bTrailingSlash )
774  aBuf.append( '/' );
775  }
776  else
777  {
778  m_nState &= ~NameForInsertionSet;
779  }
780 
781  m_aUncPath = aBuf.makeStringAndClear();
782  }
783  else
784  {
785  if ( !NewTitle.isEmpty() )
786  {
787  // Initial Title before "insert".
788  // m_aUncPath contains parent's URI.
789 
790  if( !m_aUncPath.endsWith( "/" ) )
791  m_aUncPath += "/";
792 
793  m_aUncPath += rtl::Uri::encode( NewTitle,
794  rtl_UriCharClassPchar,
795  rtl_UriEncodeIgnoreEscapes,
796  RTL_TEXTENCODING_UTF8 );
798  }
799  }
800  }
801  }
802  }
803 
804  return Sequence< Any >( Values.getLength() );
805  }
806  else
807  {
808  Sequence< Any > ret = m_pMyShell->setv( m_aUncPath, // Does not handle Title
809  Values );
810  auto retRange = asNonConstRange(ret);
811 
812  // Special handling Title: Setting Title is equivalent to a renaming of the underlying file
813  for( sal_Int32 i = 0; i < Values.getLength(); ++i )
814  {
815  if( Values[i].Name != Title )
816  continue; // handled by setv
817 
818  OUString NewTitle;
819  if( !( Values[i].Value >>= NewTitle ) )
820  {
821  retRange[i] <<= beans::IllegalTypeException( THROW_WHERE );
822  break;
823  }
824  else if( NewTitle.isEmpty() )
825  {
826  retRange[i] <<= lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 0 );
827  break;
828  }
829 
830 
831  OUString aDstName = getParentName( m_aUncPath );
832  if( !aDstName.endsWith("/") )
833  aDstName += "/";
834 
835  aDstName += rtl::Uri::encode( NewTitle,
836  rtl_UriCharClassPchar,
837  rtl_UriEncodeIgnoreEscapes,
838  RTL_TEXTENCODING_UTF8 );
839 
840  m_pMyShell->move( nMyCommandIdentifier, // move notifies the children also;
841  m_aUncPath,
842  aDstName,
843  NameClash::KEEP );
844 
845  try
846  {
847  endTask( nMyCommandIdentifier );
848  }
849  catch(const Exception& e)
850  {
851  retRange[i] <<= e;
852  }
853 
854  // NameChanges come back through a ContentEvent
855  break; // only handling Title
856  } // end for
857 
858  return ret;
859  }
860 }
861 
862 
865  sal_Int32 nMyCommandIdentifier,
866  const OpenCommandArgument2& aCommandArgument )
867 {
869 
870  if( m_nState & Deleted )
871  {
872  m_pMyShell->installError( nMyCommandIdentifier,
874  }
875  else if( m_nState & JustInserted )
876  {
877  m_pMyShell->installError( nMyCommandIdentifier,
879  }
880  else
881  {
882  if( aCommandArgument.Mode == OpenMode::DOCUMENT ||
883  aCommandArgument.Mode == OpenMode::DOCUMENT_SHARE_DENY_NONE )
884 
885  {
886  Reference< io::XOutputStream > outputStream( aCommandArgument.Sink,UNO_QUERY );
887  if( outputStream.is() )
888  {
889  m_pMyShell->page( nMyCommandIdentifier,
890  m_aUncPath,
891  outputStream );
892  }
893 
894  bool bLock = ( aCommandArgument.Mode != OpenMode::DOCUMENT_SHARE_DENY_NONE );
895 
896  Reference< io::XActiveDataSink > activeDataSink( aCommandArgument.Sink,UNO_QUERY );
897  if( activeDataSink.is() )
898  {
899  activeDataSink->setInputStream( m_pMyShell->open( nMyCommandIdentifier,
900  m_aUncPath,
901  bLock ) );
902  }
903 
904  Reference< io::XActiveDataStreamer > activeDataStreamer( aCommandArgument.Sink,UNO_QUERY );
905  if( activeDataStreamer.is() )
906  {
907  activeDataStreamer->setStream( m_pMyShell->open_rw( nMyCommandIdentifier,
908  m_aUncPath,
909  bLock ) );
910  }
911  }
912  else if ( aCommandArgument.Mode == OpenMode::ALL ||
913  aCommandArgument.Mode == OpenMode::FOLDERS ||
914  aCommandArgument.Mode == OpenMode::DOCUMENTS )
915  {
916  retValue = m_pMyShell->ls( nMyCommandIdentifier,
917  m_aUncPath,
918  aCommandArgument.Mode,
919  aCommandArgument.Properties,
920  aCommandArgument.SortingInfo );
921  }
922 // else if( aCommandArgument.Mode ==
923 // OpenMode::DOCUMENT_SHARE_DENY_NONE ||
924 // aCommandArgument.Mode ==
925 // OpenMode::DOCUMENT_SHARE_DENY_WRITE )
926 // m_pMyShell->installError( nMyCommandIdentifier,
927 // TASKHANDLING_UNSUPPORTED_OPEN_MODE,
928 // aCommandArgument.Mode);
929  else
930  m_pMyShell->installError( nMyCommandIdentifier,
932  aCommandArgument.Mode);
933  }
934 
935  return retValue;
936 }
937 
938 
939 void
940 BaseContent::deleteContent( sal_Int32 nMyCommandIdentifier )
941 {
942  if( m_nState & Deleted )
943  return;
944 
945  if( m_pMyShell->remove( nMyCommandIdentifier,m_aUncPath ) )
946  {
947  osl::MutexGuard aGuard( m_aMutex );
948  m_nState |= Deleted;
949  }
950 }
951 
952 
953 void
954 BaseContent::transfer( sal_Int32 nMyCommandIdentifier,
955  const TransferInfo& aTransferInfo )
956 {
957  if( m_nState & Deleted )
958  return;
959 
960  if( !comphelper::isFileUrl(aTransferInfo.SourceURL) )
961  {
962  m_pMyShell->installError( nMyCommandIdentifier,
964  return;
965  }
966 
967  OUString srcUnc;
968  if( fileaccess::TaskManager::getUnqFromUrl( aTransferInfo.SourceURL,srcUnc ) )
969  {
970  m_pMyShell->installError( nMyCommandIdentifier,
972  return;
973  }
974 
975  OUString srcUncPath = srcUnc;
976 
977  // Determine the new title !
978  OUString NewTitle;
979  if( !aTransferInfo.NewTitle.isEmpty() )
980  NewTitle = rtl::Uri::encode( aTransferInfo.NewTitle,
981  rtl_UriCharClassPchar,
982  rtl_UriEncodeIgnoreEscapes,
983  RTL_TEXTENCODING_UTF8 );
984  else
985  NewTitle = srcUncPath.copy( 1 + srcUncPath.lastIndexOf( '/' ) );
986 
987  // Is destination a document or a folder ?
988  Reference< sdbc::XRow > xRow = getPropertyValues( nMyCommandIdentifier,{ { "IsDocument", -1, cppu::UnoType<sal_Bool>::get(), 0 } } );
989  bool IsDocument = xRow->getBoolean( 1 );
990  if( xRow->wasNull() )
991  { // Destination file type could not be determined
992  m_pMyShell->installError( nMyCommandIdentifier,
994  return;
995  }
996 
997  OUString dstUncPath;
998  if( IsDocument )
999  { // as sibling
1000  sal_Int32 lastSlash = m_aUncPath.lastIndexOf( '/' );
1001  dstUncPath = m_aUncPath.copy(0,lastSlash );
1002  }
1003  else
1004  // as child
1005  dstUncPath = m_aUncPath;
1006 
1007  dstUncPath += "/" + NewTitle;
1008 
1009  sal_Int32 NameClash = aTransferInfo.NameClash;
1010 
1011  if( aTransferInfo.MoveData )
1012  m_pMyShell->move( nMyCommandIdentifier,srcUncPath,dstUncPath,NameClash );
1013  else
1014  m_pMyShell->copy( nMyCommandIdentifier,srcUncPath,dstUncPath,NameClash );
1015 }
1016 
1017 
1018 void BaseContent::insert( sal_Int32 nMyCommandIdentifier,
1019  const InsertCommandArgument& aInsertArgument )
1020 {
1021  if( m_nState & FullFeatured )
1022  {
1023  m_pMyShell->write( nMyCommandIdentifier,
1024  m_aUncPath,
1025  aInsertArgument.ReplaceExisting,
1026  aInsertArgument.Data );
1027  return;
1028  }
1029 
1030  if( ! ( m_nState & JustInserted ) )
1031  {
1032  m_pMyShell->installError( nMyCommandIdentifier,
1034  return;
1035  }
1036 
1037  // Inserts the content, which has the flag m_bIsFresh
1038 
1039  if( ! (m_nState & NameForInsertionSet) )
1040  {
1041  m_pMyShell->installError( nMyCommandIdentifier,
1043  return;
1044  }
1045 
1046  // Inserting a document or a file?
1047  bool bDocument = false;
1048 
1049  Reference< sdbc::XRow > xRow = getPropertyValues( -1, { { "IsDocument", -1, cppu::UnoType<sal_Bool>::get(), 0 } });
1050 
1051  bool contentTypeSet = true; // is set to false, if contentType not set
1052  try
1053  {
1054  bDocument = xRow->getBoolean( 1 );
1055  if( xRow->wasNull() )
1056  contentTypeSet = false;
1057 
1058  }
1059  catch (const sdbc::SQLException&)
1060  {
1061  TOOLS_WARN_EXCEPTION("ucb.ucp.file", "");
1062  contentTypeSet = false;
1063  }
1064 
1065  if( ! contentTypeSet )
1066  {
1067  m_pMyShell->installError( nMyCommandIdentifier,
1069  return;
1070  }
1071 
1072 
1073  bool success = false;
1074  if( bDocument )
1075  success = m_pMyShell->mkfil( nMyCommandIdentifier,
1076  m_aUncPath,
1077  aInsertArgument.ReplaceExisting,
1078  aInsertArgument.Data );
1079  else
1080  {
1081  while( ! success )
1082  {
1083  success = m_pMyShell->mkdir( nMyCommandIdentifier,
1084  m_aUncPath,
1085  aInsertArgument.ReplaceExisting );
1086  if( success )
1087  break;
1088 
1089  XInteractionRequestImpl aRequestImpl(
1090  rtl::Uri::decode(
1092  rtl_UriDecodeWithCharset,
1093  RTL_TEXTENCODING_UTF8),
1094  static_cast<cppu::OWeakObject*>(this),
1095  m_pMyShell,nMyCommandIdentifier);
1096  uno::Reference<task::XInteractionRequest> const& xReq(aRequestImpl.getRequest());
1097 
1098  m_pMyShell->handleTask( nMyCommandIdentifier, xReq );
1099  if (aRequestImpl.aborted() || aRequestImpl.newName().isEmpty())
1100  // means aborting
1101  break;
1102 
1103  // determine new uncpath
1104  m_pMyShell->clearError( nMyCommandIdentifier );
1106  if( !m_aUncPath.endsWith( "/" ) )
1107  m_aUncPath += "/";
1108 
1109  m_aUncPath += rtl::Uri::encode( aRequestImpl.newName(),
1110  rtl_UriCharClassPchar,
1111  rtl_UriEncodeIgnoreEscapes,
1112  RTL_TEXTENCODING_UTF8 );
1113  }
1114  }
1115 
1116  if ( ! success )
1117  return;
1118 
1120 
1123 
1124  osl::MutexGuard aGuard( m_aMutex );
1126 }
1127 
1128 
1129 void BaseContent::endTask( sal_Int32 CommandId )
1130 {
1131  // This is the only function allowed to throw an exception
1132  m_pMyShell->endTask( CommandId,m_aUncPath,this );
1133 }
1134 
1135 
1136 std::optional<ContentEventNotifier>
1138 {
1139  osl::MutexGuard aGuard( m_aMutex );
1140 
1141  m_nState |= Deleted;
1142 
1144  return {};
1145 
1147  this,
1149  m_pContentEventListeners->getElements() );
1150 }
1151 
1152 
1153 std::optional<ContentEventNotifier>
1154 BaseContent::cEXC( const OUString& aNewName )
1155 {
1156  osl::MutexGuard aGuard( m_aMutex );
1157 
1159  m_aUncPath = aNewName;
1160  m_xContentIdentifier = new FileContentIdentifier( aNewName );
1161 
1163  return {};
1165  this,
1167  xOldRef,
1168  m_pContentEventListeners->getElements() );
1169 }
1170 
1171 
1172 std::optional<ContentEventNotifier>
1174 {
1175  osl::MutexGuard aGuard( m_aMutex );
1177  return {};
1179  this,
1181  m_pContentEventListeners->getElements() );
1182 }
1183 
1184 std::optional<PropertySetInfoChangeNotifier>
1186 {
1187  osl::MutexGuard aGuard( m_aMutex );
1189  return {};
1191 }
1192 
1193 
1194 std::optional<PropertyChangeNotifier>
1196 {
1197  osl::MutexGuard aGuard( m_aMutex );
1198 
1199  if (!m_pPropertyListener)
1200  return {};
1201 
1202  const std::vector< OUString > seqNames = m_pPropertyListener->getContainedTypes();
1203  if( seqNames.empty() )
1204  return {};
1205 
1206  ListenerMap listener;
1207  for( const auto& rName : seqNames )
1208  {
1210  if (!pContainer)
1211  continue;
1212  listener[rName] = pContainer->getElements();
1213  }
1214 
1215  return PropertyChangeNotifier( this, std::move(listener) );
1216 }
1217 
1218 
1219 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define TASKHANDLING_WRONG_GETPROPERTYVALUES_ARGUMENT
Definition: filerror.hxx:29
#define TASKHANDLING_WRONG_TRANSFER_ARGUMENT
Definition: filerror.hxx:32
css::uno::Reference< css::ucb::XCommandInfo > getCommandInfo()
Definition: bc.cxx:657
constexpr OUStringLiteral IsDocument(u"IsDocument")
#define TASKHANDLING_WRONG_DELETE_ARGUMENT
Definition: filerror.hxx:31
css::uno::Reference< css::ucb::XContentIdentifier > m_xContentIdentifier
Definition: bc.hxx:196
#define TASKHANDLING_WRONG_SETPROPERTYVALUES_ARGUMENT
Definition: filerror.hxx:28
void disposeAndClear(const lang::EventObject &rEvt)
Definition: bc.cxx:67
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
Definition: bc.cxx:646
void endTask(sal_Int32 CommandId, const OUString &aUnqPath, BaseContent *pContent)
Deinstalls the task and evaluates a possibly set error code.
Definition: filtask.cxx:382
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::beans::XPropertySetInfoChangeListener > > m_pPropertySetInfoChangeListeners
Definition: bc.hxx:211
std::optional< ContentEventNotifier > cCEL() override
Definition: bc.cxx:1173
void deleteContent(sal_Int32 nMyCommandIdentifier)
Definition: bc.cxx:940
#define TASKHANDLING_UNSUPPORTED_OPEN_MODE
Definition: filerror.hxx:35
friend class ContentEventNotifier
Definition: bc.hxx:254
virtual void SAL_CALL abort(sal_Int32 CommandId) override
Definition: bc.cxx:262
std::vector< css::uno::Reference< ListenerT > > getElements() const
std::unordered_map< OUString, std::vector< css::uno::Reference< css::beans::XPropertiesChangeListener > > > ListenerMap
Definition: filnot.hxx:83
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: bc.cxx:239
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: bc.cxx:268
sal_Int64 n
aBuf
css::uno::Reference< css::ucb::XDynamicResultSet > open(sal_Int32 nMyCommandIdentifier, const css::ucb::OpenCommandArgument2 &aCommandArgument)
Definition: bc.cxx:864
void deassociate(const OUString &UnqPath, const OUString &PropertyName)
Definition: filtask.cxx:568
virtual void SAL_CALL addContentEventListener(const css::uno::Reference< css::ucb::XContentEventListener > &Listener) override
Definition: bc.cxx:476
OUString Name
bool remove(sal_Int32 CommandId, const OUString &aUnqPath, FileUrlType eTypeToMove=FileUrlType::Unknown, bool MustExist=true)
Deletes the content belonging to fileURL aUnqPath( recursively in case of directory ) ...
Definition: filtask.cxx:1511
void insertDefaultProperties(const OUString &aUnqPath)
Definition: filtask.cxx:1923
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) override
Definition: bc.cxx:378
Title
#define TASKHANDLING_INSERTED_STATE_IN_OPEN_COMMAND
Definition: filerror.hxx:38
#define TASKHANDLING_TRANSFER_INVALIDURL
Definition: filerror.hxx:81
virtual void SAL_CALL addProperty(const OUString &Name, sal_Int16 Attributes, const css::uno::Any &DefaultValue) override
Definition: bc.cxx:505
static constexpr OUStringLiteral FolderContentType
Definition: filtask.hxx:630
#define TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND
Definition: filerror.hxx:37
#define TASKHANDLER_UNSUPPORTED_COMMAND
Definition: filerror.hxx:27
virtual void SAL_CALL dispose() override
Definition: bc.cxx:200
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: bc.cxx:190
Value
void installError(sal_Int32 CommandId, sal_Int32 ErrorCode, sal_Int32 minorCode=TASKHANDLER_NO_ERROR)
The error code may be one of the error codes defined in filerror.hxx.
Definition: filtask.cxx:436
virtual sal_Int32 SAL_CALL createCommandIdentifier() override
Definition: bc.cxx:255
FileProvider * m_pProvider
Definition: filtask.hxx:483
std::unique_ptr< PropertyListeners > m_pPropertyListener
Definition: bc.hxx:212
comphelper::OInterfaceContainerHelper3< beans::XPropertiesChangeListener > * getContainer(const OUString &rKey)
Definition: bc.cxx:112
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: bc.cxx:177
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define TASKHANDLING_TRANSFER_DESTFILETYPE
Definition: filerror.hxx:82
PropertyListeners(::osl::Mutex &aMutex)
Definition: bc.cxx:63
virtual void SAL_CALL addPropertySetInfoChangeListener(const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override
Definition: bc.cxx:596
virtual OUString SAL_CALL getContentType() override
Definition: bc.cxx:433
std::vector< OUString > getContainedTypes() const
Definition: bc.cxx:100
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL createNewContent(const css::ucb::ContentInfo &Info) override
Definition: bc.cxx:541
void transfer(sal_Int32 nMyCommandIdentifier, const css::ucb::TransferInfo &aTransferInfo)
Definition: bc.cxx:954
static bool getUrlFromUnq(const OUString &Unq, OUString &Url)
Definition: filtask.cxx:1974
static constexpr OUStringLiteral FileContentType
Definition: filtask.hxx:632
bool mkfil(sal_Int32 CommandId, const OUString &aFileName, bool OverWrite, const css::uno::Reference< css::io::XInputStream > &aInputStream)
Creates new file with given URL.
Definition: filtask.cxx:1733
void removeInterface(const OUString &rKey, const uno::Reference< beans::XPropertiesChangeListener > &rListener)
Definition: bc.cxx:90
#define TASKHANDLING_NOCONTENTTYPE_INSERT_COMMAND
Definition: filerror.hxx:52
err
#define TASKHANDLING_TRANSFER_INVALIDSCHEME
Definition: filerror.hxx:80
comphelper::OInterfaceContainerHelper3< beans::XPropertiesChangeListener > ContainerHelper
Definition: bc.cxx:59
#define TOOLS_WARN_EXCEPTION(area, stream)
std::unordered_map< OUString, ContainerHelper > m_aMap
Definition: bc.cxx:61
int i
virtual OUString SAL_CALL getImplementationName() override
Definition: bc.cxx:233
#define TASKHANDLING_WRONG_CREATENEWCONTENT_ARGUMENT
Definition: filerror.hxx:34
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: bc.cxx:245
std::optional< PropertyChangeNotifier > cPCL() override
Definition: bc.cxx:1195
osl::Mutex m_aEventListenerMutex
Definition: bc.hxx:208
void copy(sal_Int32 CommandId, const OUString &srcUnqPath, const OUString &dstUnqPath, sal_Int32 NameClash)
Copies the content belonging to fileURL srcUnqPath to fileURL dstUnqPath ( files and directories ) ...
Definition: filtask.cxx:1339
css::uno::Reference< css::task::XInteractionRequest > const & getRequest() const
Definition: filinsreq.hxx:124
uno::Reference< sdbc::XRow > xRow
float u
unsigned char sal_Bool
sal_uInt16 m_nState
Definition: bc.hxx:204
OUString getTitle(const OUString &aPath)
Definition: filglob.cxx:186
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo()
Definition: filtask.cxx:2903
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::ucb::XContentEventListener > > m_pContentEventListeners
Definition: bc.hxx:210
OUString m_aUncPath
Definition: bc.hxx:197
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
Definition: prov.cxx:113
css::uno::Type const & get()
virtual void SAL_CALL removePropertySetInfoChangeListener(const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override
Definition: bc.cxx:608
void insert(sal_Int32 nMyCommandIdentifier, const css::ucb::InsertCommandArgument &aInsertArgument)
Definition: bc.cxx:1018
sal_Int32 getCommandId()
Definition: filtask.cxx:448
void deregisterNotifier(const OUString &aUnqPath, Notifier *pNotifier)
Definition: filtask.cxx:502
constexpr OUStringLiteral CasePreservingURL(u"CasePreservingURL")
osl::Mutex & rMutex
Definition: bc.cxx:60
css::uno::Reference< css::io::XStream > open_rw(sal_Int32 CommandId, const OUString &aUnqPath, bool bLock)
Given a file URL aUnqPath, this methods returns a XStream which can be used to read and write from/to...
Definition: filtask.cxx:742
virtual void SAL_CALL removeContentEventListener(const css::uno::Reference< css::ucb::XContentEventListener > &Listener) override
Definition: bc.cxx:491
virtual ~BaseContent() override
Definition: bc.cxx:163
css::uno::Reference< css::sdbc::XRow > getv(sal_Int32 CommandId, const OUString &aUnqPath, const css::uno::Sequence< css::beans::Property > &properties)
Reads the values of the properties belonging to fileURL aUnqPath; Returns an XRow object containing t...
const PropertyValue * pValues
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
Definition: bc.cxx:622
css::uno::Sequence< css::uno::Any > setPropertyValues(sal_Int32 nMyCommandIdentifier, const css::uno::Sequence< css::beans::PropertyValue > &Values)
Definition: bc.cxx:728
css::uno::Reference< css::ucb::XCommandInfo > info_c()
Info methods.
Definition: filtask.cxx:804
css::uno::Reference< css::io::XInputStream > open(sal_Int32 CommandId, const OUString &aUnqPath, bool bLock)
Given a file URL aUnqPath, this methods returns a XInputStream which reads from the open file...
Definition: filtask.cxx:710
virtual css::uno::Sequence< css::ucb::ContentInfo > SAL_CALL queryCreatableContentsInfo() override
Definition: bc.cxx:534
#define TASKHANDLING_WRONG_OPEN_ARGUMENT
Definition: filerror.hxx:30
static bool getUnqFromUrl(const OUString &Url, OUString &Unq)
Definition: filtask.cxx:1953
COMPHELPER_DLLPUBLIC bool isFileUrl(OUString const &url)
virtual void SAL_CALL removeProperty(const OUString &Name) override
Definition: bc.cxx:520
css::uno::Reference< css::ucb::XDynamicResultSet > ls(sal_Int32 CommandId, const OUString &aUnqPath, const sal_Int32 OpenMode, const css::uno::Sequence< css::beans::Property > &sProperty, const css::uno::Sequence< css::ucb::NumberedSortingInfo > &sSortingInfo)
This method returns the result set containing the children of the directory belonging to file URL aUn...
Definition: filtask.cxx:773
std::optional< ContentEventNotifier > cEXC(const OUString &aNewName) override
Definition: bc.cxx:1154
void move(sal_Int32 CommandId, const OUString &srcUnqPath, const OUString &dstUnqPath, const sal_Int32 NameClash)
Moves the content belonging to fileURL srcUnqPath to fileURL dstUnqPath( files and directories ) ...
Definition: filtask.cxx:1131
void page(sal_Int32 CommandId, const OUString &aUnqPath, const css::uno::Reference< css::io::XOutputStream > &xOutputStream)
Given an xOutputStream, this method writes the content of the file belonging to URL aUnqPath into the...
Definition: filtask.cxx:621
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL getIdentifier() override
Definition: bc.cxx:426
css::uno::Sequence< css::uno::Any > setv(const OUString &aUnqPath, const css::uno::Sequence< css::beans::PropertyValue > &values)
Sets the values of the properties belonging to fileURL aUnqPath.
Definition: filtask.cxx:835
Any result
osl::Mutex m_aMutex
Definition: bc.hxx:206
#define THROW_WHERE
Definition: bc.cxx:52
css::uno::Reference< css::beans::XPropertySetInfo > info_p(const OUString &aUnqPath)
Definition: filtask.cxx:818
bool write(sal_Int32 CommandId, const OUString &aUnqPath, bool OverWrite, const css::uno::Reference< css::io::XInputStream > &aInputStream)
writes to the file with given URL.
Definition: filtask.cxx:1764
BaseContent(TaskManager *pMyShell, const OUString &parentName, bool bFolder)
Definition: bc.cxx:133
std::unique_ptr< comphelper::OInterfaceContainerHelper3< css::lang::XEventListener > > m_pDisposeEventListeners
Definition: bc.hxx:209
void endTask(sal_Int32 CommandId)
Definition: bc.cxx:1129
std::optional< PropertySetInfoChangeNotifier > cPSL() override
Definition: bc.cxx:1185
std::optional< ContentEventNotifier > cDEL() override
Definition: bc.cxx:1137
#define TASKHANDLING_WRONG_INSERT_ARGUMENT
Definition: filerror.hxx:33
css::uno::Reference< css::beans::XPropertySetInfo > getPropertySetInfo()
Definition: bc.cxx:667
OUString getParentName(const OUString &aFileName)
Definition: filglob.cxx:193
bool mkdir(sal_Int32 CommandId, const OUString &aDirectoryName, bool OverWrite)
Creates new directory with given URL, recursively if necessary Return:: success of operation...
Definition: filtask.cxx:1673
#define TASKHANDLING_NONAMESET_INSERT_COMMAND
Definition: filerror.hxx:51
void registerNotifier(const OUString &aUnqPath, Notifier *pNotifier)
This two methods register and deregister a change listener for the content belonging to URL aUnqPath...
Definition: filtask.cxx:483
#define TASKHANDLING_NOFRESHINSERT_IN_INSERT_COMMAND
Definition: filerror.hxx:50
void startTask(sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.cxx:367
css::uno::Reference< css::sdbc::XRow > getPropertyValues(sal_Int32 nMyCommandIdentifier, const css::uno::Sequence< css::beans::Property > &PropertySet)
Definition: bc.cxx:676
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Sequence< OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) override
Definition: bc.cxx:404
void clearError(sal_Int32)
Clears any error which are set on the commandid.
Definition: filtask.cxx:413
void handleTask(sal_Int32 CommandId, const css::uno::Reference< css::task::XInteractionRequest > &request)
Handles an interactionrequest.
Definition: filtask.cxx:455
void associate(const OUString &UnqPath, const OUString &PropertyName, const css::uno::Any &DefaultValue, const sal_Int16 Attributes)
Used to associate and deassociate a new property with the content belonging to URL UnqPath...
Definition: filtask.cxx:529
void addInterface(const OUString &rKey, const uno::Reference< beans::XPropertiesChangeListener > &rListener)
Definition: bc.cxx:78
TaskManager * m_pMyShell
Definition: bc.hxx:195