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