LibreOffice Module ucb (master)  1
filtask.hxx
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 #ifndef INCLUDED_UCB_SOURCE_UCP_FILE_FILTASK_HXX
20 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILTASK_HXX
21 
22 #include <osl/file.hxx>
23 #include <rtl/ustring.hxx>
24 
25 #include <osl/mutex.hxx>
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
28 #include <com/sun/star/ucb/XCommandInfo.hpp>
29 #include <com/sun/star/beans/Property.hpp>
30 #include <com/sun/star/beans/PropertyValue.hpp>
31 #include <com/sun/star/io/XStream.hpp>
32 #include <com/sun/star/io/XOutputStream.hpp>
33 #include <com/sun/star/io/XInputStream.hpp>
34 #include <com/sun/star/beans/XPropertySetInfo.hpp>
35 #include <com/sun/star/ucb/NumberedSortingInfo.hpp>
36 #include <com/sun/star/sdbc/XRow.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <com/sun/star/ucb/XDynamicResultSet.hpp>
39 #include <com/sun/star/beans/XPropertyContainer.hpp>
40 #include <com/sun/star/beans/XPropertyAccess.hpp>
41 #include <com/sun/star/ucb/ContentInfo.hpp>
42 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
43 #include <com/sun/star/ucb/XPersistentPropertySet.hpp>
44 #include <com/sun/star/ucb/XPropertySetRegistry.hpp>
45 #include <com/sun/star/task/XInteractionHandler.hpp>
46 #include <com/sun/star/task/XInteractionRequest.hpp>
47 #include "filerror.hxx"
48 #include "filnot.hxx"
49 #include <unordered_map>
50 #include <unordered_set>
51 #include <vector>
52 
53 namespace fileaccess
54 {
55  class BaseContent;
56  class FileProvider;
57  class XPropertySetInfo_impl;
58  class XCommandInfo_impl;
59  class XResultSet_impl;
60 
61  /*
62  * The relevant methods in this class all have as first argument the CommandId,
63  * so if necessary, every method has access to its relevant XInteractionHandler and
64  * XProgressHandler.
65  */
66 
67 
69  {
70  friend class XPropertySetInfo_impl;
71  friend class XResultSet_impl;
72  friend class XCommandInfo_impl;
73 
74  private:
75 
77  {
78  private:
79 
80  bool m_bHandled;
82  css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler;
83  css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment;
84 
85 
86  public:
87 
88  explicit TaskHandling(
89  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv )
90  : m_bHandled( false ),
91  m_nErrorCode( TASKHANDLER_NO_ERROR ),
92  m_nMinorCode( TASKHANDLER_NO_ERROR ),
93  m_xCommandEnvironment( xCommandEnv )
94  {
95  }
96 
97  void setHandled()
98  {
99  m_bHandled = true;
100  }
101 
102  bool isHandled() const
103  {
104  return m_bHandled;
105  }
106 
107  void clearError()
108  {
109  m_nErrorCode = TASKHANDLER_NO_ERROR;
110  m_nMinorCode = TASKHANDLER_NO_ERROR;
111  }
112 
113  void installError( sal_Int32 nErrorCode,
114  sal_Int32 nMinorCode )
115  {
116  m_nErrorCode = nErrorCode;
117  m_nMinorCode = nMinorCode;
118  }
119 
120  sal_Int32 getInstalledError() const
121  {
122  return m_nErrorCode;
123  }
124 
125  sal_Int32 getMinorErrorCode() const
126  {
127  return m_nMinorCode;
128  }
129 
130  css::uno::Reference< css::task::XInteractionHandler > const &
132  {
133  if( ! m_xInteractionHandler.is() && m_xCommandEnvironment.is() )
134  m_xInteractionHandler = m_xCommandEnvironment->getInteractionHandler();
135 
136  return m_xInteractionHandler;
137  }
138 
139  const css::uno::Reference< css::ucb::XCommandEnvironment >&
141  {
142  return m_xCommandEnvironment;
143  }
144 
145  }; // end class TaskHandling
146 
147 
148  typedef std::unordered_map< sal_Int32,TaskHandling > TaskMap;
149  private:
150 
151  osl::Mutex m_aMutex;
152  sal_Int32 m_nCommandId;
153  TaskMap m_aTaskMap;
154 
155 
156  public:
158  {
159  private:
160  OUString const PropertyName;
161  sal_Int32 const Handle;
162  bool const isNative;
163  css::uno::Type const Typ; // Duplicates information in Value
164  css::uno::Any Value;
165  css::beans::PropertyState State;
166  sal_Int16 const Attributes;
167  public:
168  explicit MyProperty( const OUString& thePropertyName );
169  MyProperty( bool theIsNative,
170  const OUString& thePropertyName,
171  sal_Int32 theHandle,
172  const css::uno::Type& theTyp,
173  const css::uno::Any& theValue,
174  const css::beans::PropertyState& theState,
175  sal_Int16 theAttributes );
176 
177  ~MyProperty();
178  inline const bool& IsNative() const;
179  const OUString& getPropertyName() const { return PropertyName; }
180  inline const sal_Int32& getHandle() const;
181  inline const css::uno::Type& getType() const;
182  inline const css::uno::Any& getValue() const;
183  inline const css::beans::PropertyState& getState() const;
184  inline const sal_Int16& getAttributes() const;
185 
186  // The set* functions are declared const, because the key of "this" stays intact
187  inline void setValue( const css::uno::Any& theValue ) const;
188  inline void setState( const css::beans::PropertyState& theState ) const;
189  };
190 
191  struct eMyProperty
192  {
193  bool operator()( const MyProperty& rKey1, const MyProperty& rKey2 ) const
194  {
195  return rKey1.getPropertyName() == rKey2.getPropertyName();
196  }
197  };
198 
199  struct hMyProperty
200  {
201  size_t operator()( const MyProperty& rName ) const
202  {
203  return rName.getPropertyName().hashCode();
204  }
205  };
206 
207  typedef std::unordered_set< MyProperty,hMyProperty,eMyProperty > PropertySet;
208  typedef std::vector< Notifier* > NotifierList;
209 
210 
212  {
213  public:
214  UnqPathData();
216  ~UnqPathData();
217 
218  PropertySet properties;
219  NotifierList notifier;
220 
221  // Three views on the PersistentPropertySet
222  css::uno::Reference< css::ucb::XPersistentPropertySet > xS;
223  css::uno::Reference< css::beans::XPropertyContainer > xC;
224  css::uno::Reference< css::beans::XPropertyAccess > xA;
225  };
226 
227  typedef std::unordered_map< OUString,UnqPathData > ContentMap;
228 
229  TaskManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
230  FileProvider* pProvider, bool bWithConfig );
231  ~TaskManager();
232 
234  void startTask(
235  sal_Int32 CommandId,
236  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv );
237 
238  sal_Int32 getCommandId();
239 
240 
247  void installError( sal_Int32 CommandId,
248  sal_Int32 ErrorCode,
249  sal_Int32 minorCode = TASKHANDLER_NO_ERROR );
250 
251  void retrieveError( sal_Int32 CommandId,
252  sal_Int32 &ErrorCode,
253  sal_Int32 &minorCode);
254 
260  void endTask( sal_Int32 CommandId,
261  // the physical URL of the object
262  const OUString& aUnqPath,
263  BaseContent* pContent);
264 
265 
270  void handleTask( sal_Int32 CommandId,
271  const css::uno::Reference< css::task::XInteractionRequest >& request );
272 
277  void clearError( sal_Int32 );
278 
284  void registerNotifier( const OUString& aUnqPath,Notifier* pNotifier );
285 
286  void deregisterNotifier( const OUString& aUnqPath,Notifier* pNotifier );
287 
288 
299  void associate( const OUString& UnqPath,
300  const OUString& PropertyName,
301  const css::uno::Any& DefaultValue,
302  const sal_Int16 Attributes );
303 
307  void deassociate( const OUString& UnqPath,
308  const OUString& PropertyName );
309 
310 
311  // Every method having a command id is not allowed to throw anything,
312  // but instead must install every error code in the task handler
313 
314 
320  void page( sal_Int32 CommandId,
321  const OUString& aUnqPath,
322  const css::uno::Reference< css::io::XOutputStream >& xOutputStream );
323 
324 
329  css::uno::Reference< css::io::XInputStream >
330  open( sal_Int32 CommandId,
331  const OUString& aUnqPath,
332  bool bLock );
333 
334 
340  css::uno::Reference< css::io::XStream >
341  open_rw( sal_Int32 CommandId,
342  const OUString& aUnqPath,
343  bool bLock );
344 
345 
351  css::uno::Reference< css::ucb::XDynamicResultSet >
352  ls( sal_Int32 CommandId,
353  const OUString& aUnqPath,
354  const sal_Int32 OpenMode,
355  const css::uno::Sequence< css::beans::Property >& sProperty,
356  const css::uno::Sequence< css::ucb::NumberedSortingInfo > & sSortingInfo );
357 
358 
363  // Info for commands
364  css::uno::Reference< css::ucb::XCommandInfo >
365  info_c();
366 
367  // Info for the properties
368  css::uno::Reference< css::beans::XPropertySetInfo >
369  info_p( const OUString& aUnqPath );
370 
371 
376  css::uno::Sequence< css::uno::Any >
377  setv( const OUString& aUnqPath,
378  const css::uno::Sequence< css::beans::PropertyValue >& values );
379 
380 
386  css::uno::Reference< css::sdbc::XRow >
387  getv( sal_Int32 CommandId,
388  const OUString& aUnqPath,
389  const css::uno::Sequence< css::beans::Property >& properties );
390 
391 
392  /********************************************************************************/
393  /* transfer-commands */
394  /********************************************************************************/
395 
400  void
401  move( sal_Int32 CommandId,
402  const OUString& srcUnqPath, // Full file(folder)-path
403  const OUString& dstUnqPath, // Path to the destination-directory
404  const sal_Int32 NameClash );
405 
410  void
411  copy( sal_Int32 CommandId, // See "move"
412  const OUString& srcUnqPath,
413  const OUString& dstUnqPath,
414  sal_Int32 NameClash );
415 
416  enum class FileUrlType { Folder = 1, File = -1, Unknown = 0 };
417 
422  bool
423  remove( sal_Int32 CommandId,
424  const OUString& aUnqPath,
425  FileUrlType eTypeToMove = FileUrlType::Unknown,
426  bool MustExist = true );
427 
428 
429  /********************************************************************************/
430  /* write and create - commandos */
431  /********************************************************************************/
432 
438  bool
439  mkdir( sal_Int32 CommandId,
440  const OUString& aDirectoryName,
441  bool OverWrite );
442 
443 
450  bool
451  mkfil( sal_Int32 CommandId,
452  const OUString& aFileName,
453  bool OverWrite,
454  const css::uno::Reference< css::io::XInputStream >& aInputStream );
455 
456 
462  bool
463  write( sal_Int32 CommandId,
464  const OUString& aUnqPath,
465  bool OverWrite,
466  const css::uno::Reference< css::io::XInputStream >& aInputStream );
467 
468 
469  void insertDefaultProperties( const OUString& aUnqPath );
470 
471  static css::uno::Sequence< css::ucb::ContentInfo >
473 
474 
475  /******************************************************************************/
476  /* */
477  /* mapping of file urls */
478  /* to uncpath and vice versa */
479  /* */
480  /******************************************************************************/
481 
482  static bool getUnqFromUrl( const OUString& Url, OUString& Unq );
483 
484  static bool getUrlFromUnq( const OUString& Unq, OUString& Url );
485 
486 
488  css::uno::Reference< css::uno::XComponentContext > m_xContext;
489  css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry;
490 
491  private:
492 
493  /********************************************************************************/
494  /* get eventListeners */
495  /********************************************************************************/
496 
497  std::vector< std::unique_ptr< ContentEventNotifier > >
498  getContentEventListeners( const OUString& aName );
499 
500  std::vector< std::unique_ptr< ContentEventNotifier > >
501  getContentDeletedEventListeners( const OUString& aName );
502 
503  std::vector< std::unique_ptr < ContentEventNotifier > >
504  getContentExchangedEventListeners( const OUString& aOldPrefix,
505  const OUString& aNewPrefix,
506  bool withChildren );
507 
508  std::vector< std::unique_ptr< PropertyChangeNotifier > >
509  getPropertyChangeNotifier( const OUString& aName );
510 
511  std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > >
512  getPropertySetListeners( const OUString& aName );
513 
514 
515  /********************************************************************************/
516  /* notify eventListeners */
517  /********************************************************************************/
518 
519  static void notifyPropertyChanges(
520  const std::vector<std::unique_ptr<PropertyChangeNotifier>>& listeners,
521  const css::uno::Sequence<css::beans::PropertyChangeEvent>& seqChanged);
522 
523  static void notifyContentExchanged(
524  const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners_vec);
525 
526  static void
527  notifyInsert(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
528  const OUString& aChildName);
529 
530  static void
531  notifyContentDeleted(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners);
532 
533  static void
534  notifyContentRemoved(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
535  const OUString& aChildName);
536 
537  static void notifyPropertyAdded(
538  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
539  const OUString& aPropertyName);
540 
541  static void notifyPropertyRemoved(
542  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
543  const OUString& aPropertyName);
544 
545  /********************************************************************************/
546  /* remove persistent propertyset */
547  /********************************************************************************/
548 
549  void erasePersistentSetWithoutChildren( const OUString& aUnqPath );
550  void erasePersistentSet( const OUString& aUnqPath,
551  bool withChildren = false );
552 
553  /********************************************************************************/
554  /* copy persistent propertyset */
555  /* from srcUnqPath to dstUnqPath */
556  /********************************************************************************/
557 
558  void copyPersistentSetWithoutChildren( const OUString& srcUnqPath,
559  const OUString& dstUnqPath );
560  void copyPersistentSet( const OUString& srcUnqPath,
561  const OUString& dstUnqPath,
562  bool withChildren );
563 
564 
565  // Special optimized method for getting the properties of a directoryitem, which
566  // is returned by osl::DirectoryItem::getNextItem()
567 
568  bool
569  getv( const css::uno::Sequence< css::beans::Property >& properties,
570  osl::DirectoryItem& DirItem,
571  OUString& aUnqPath,
572  bool& bIsRegular,
573  css::uno::Reference< css::sdbc::XRow > & row );
574 
575 
581  void load( const TaskManager::ContentMap::iterator& it,
582  bool create );
583 
590  void
591  commit(
592  const TaskManager::ContentMap::iterator& it,
593  const osl::FileStatus& aFileStatus );
594 
601  static void
603  sal_Int32& n_Mask,
604  const css::uno::Sequence< css::beans::Property >& seq );
605 
606 
607  // Helper function for public copy
608 
609  osl::FileBase::RC
611  const OUString& srcUnqPath,
612  const OUString& dstUnqPath,
613  FileUrlType TypeToCopy,
614  bool testExistence );
615 
616 
617  // Helper function for mkfil,mkdir and write
618  // Creates whole path
619  // returns success of the operation
620  // The call determines the errorCode, which should be used to install
621  // any error
622 
623  bool
624  ensuredir( sal_Int32 CommandId,
625  const OUString& aDirectoryName,
626  sal_Int32 errorCode );
627 
628  // General
629  ContentMap m_aContent;
630 
631 
632  public:
633 
634  static const OUStringLiteral FolderContentType;
635  static const OUStringLiteral FileContentType;
636 
637 
638  private:
639 
640  PropertySet m_aDefaultProperties;
641  css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo;
642 
643  public:
644  // Miscellaneous:
645  // Methods for "writeComponentInfo" and "createComponentFactory"
646 
647  static void getScheme( OUString& Scheme );
648 
649  static OUString getImplementationName_static();
650 
651  static css::uno::Sequence< OUString > getSupportedServiceNames_static();
652  };
653 
654 } // end namespace TaskHandling
655 
656 #endif
657 
658 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void copyPersistentSet(const OUString &srcUnqPath, const OUString &dstUnqPath, bool withChildren)
Definition: filtask.cxx:2879
void installError(sal_Int32 nErrorCode, sal_Int32 nMinorCode)
Definition: filtask.hxx:113
css::uno::Reference< css::ucb::XPersistentPropertySet > xS
Definition: filtask.hxx:222
bool operator()(const MyProperty &rKey1, const MyProperty &rKey2) const
Definition: filtask.hxx:193
static void notifyInsert(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners, const OUString &aChildName)
Definition: filtask.cxx:2591
void retrieveError(sal_Int32 CommandId, sal_Int32 &ErrorCode, sal_Int32 &minorCode)
Definition: filtask.cxx:430
const css::uno::Reference< css::ucb::XCommandEnvironment > & getCommandEnvironment() const
Definition: filtask.hxx:140
static void notifyContentRemoved(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners, const OUString &aChildName)
Definition: filtask.cxx:2609
void setState(const css::beans::PropertyState &theState) const
Definition: filinl.hxx:50
void endTask(sal_Int32 CommandId, const OUString &aUnqPath, BaseContent *pContent)
Deinstalls the task and evaluates a possibly set error code.
Definition: filtask.cxx:390
static void getMaskFromProperties(sal_Int32 &n_Mask, const css::uno::Sequence< css::beans::Property > &seq)
Given a Sequence of properties seq, this method determines the mask used to instantiate an osl::FileS...
Definition: filtask.cxx:2154
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry
Definition: filtask.hxx:489
void commit(const TaskManager::ContentMap::iterator &it, const osl::FileStatus &aFileStatus)
Commit inserts the determined properties in the filestatus object into the internal map...
Definition: filtask.cxx:2251
const css::uno::Type & getType() const
Definition: filinl.hxx:30
css::uno::Reference< css::beans::XPropertyContainer > xC
Definition: filtask.hxx:223
std::vector< std::unique_ptr< ContentEventNotifier > > getContentExchangedEventListeners(const OUString &aOldPrefix, const OUString &aNewPrefix, bool withChildren)
Definition: filtask.cxx:2662
void deassociate(const OUString &UnqPath, const OUString &PropertyName)
Definition: filtask.cxx:576
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler
Definition: filtask.hxx:82
void insertDefaultProperties(const OUString &aUnqPath)
Definition: filtask.cxx:1932
TaskManager(const css::uno::Reference< css::uno::XComponentContext > &rxContext, FileProvider *pProvider, bool bWithConfig)
Definition: filtask.cxx:142
const OUString & getPropertyName() const
Definition: filtask.hxx:179
css::uno::Reference< css::beans::XPropertyAccess > xA
Definition: filtask.hxx:224
std::unordered_map< OUString, UnqPathData > ContentMap
Definition: filtask.hxx:227
sal_Int32 getInstalledError() const
Definition: filtask.hxx:120
static OUString getImplementationName_static()
Definition: filtask.cxx:2949
css::uno::Reference< css::task::XInteractionHandler > const & getInteractionHandler()
Definition: filtask.hxx:131
void erasePersistentSetWithoutChildren(const OUString &aUnqPath)
Definition: filtask.cxx:2791
static void notifyPropertyAdded(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2640
static const OUStringLiteral FolderContentType
Definition: filtask.hxx:634
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:444
const sal_Int32 & getHandle() const
Definition: filinl.hxx:26
static const OUStringLiteral FileContentType
Definition: filtask.hxx:635
FileProvider * m_pProvider
Definition: filtask.hxx:487
std::unordered_map< sal_Int32, TaskHandling > TaskMap
Definition: filtask.hxx:148
static void getScheme(OUString &Scheme)
Definition: filtask.cxx:2943
std::vector< std::unique_ptr< ContentEventNotifier > > getContentDeletedEventListeners(const OUString &aName)
Definition: filtask.cxx:2571
static void notifyContentDeleted(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners)
Definition: filtask.cxx:2600
static bool getUrlFromUnq(const OUString &Unq, OUString &Url)
Definition: filtask.cxx:1983
void erasePersistentSet(const OUString &aUnqPath, bool withChildren=false)
Definition: filtask.cxx:2811
std::vector< std::unique_ptr< PropertyChangeNotifier > > getPropertyChangeNotifier(const OUString &aName)
Definition: filtask.cxx:2755
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:1742
std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > > getPropertySetListeners(const OUString &aName)
Definition: filtask.cxx:2620
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: filtask.hxx:488
MyProperty(const OUString &thePropertyName)
Definition: filtask.cxx:87
TaskHandling(const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.hxx:88
bool ensuredir(sal_Int32 CommandId, const OUString &aDirectoryName, sal_Int32 errorCode)
Definition: filtask.cxx:2067
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:1348
const sal_Int16 & getAttributes() const
Definition: filinl.hxx:42
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo()
Definition: filtask.cxx:2911
static css::uno::Sequence< OUString > getSupportedServiceNames_static()
Definition: filtask.cxx:2956
void copyPersistentSetWithoutChildren(const OUString &srcUnqPath, const OUString &dstUnqPath)
Definition: filtask.cxx:2849
css::beans::PropertyState State
Definition: filtask.hxx:165
void load(const TaskManager::ContentMap::iterator &it, bool create)
Load the properties from configuration, if create == true create them.
Definition: filtask.cxx:2197
static void notifyContentExchanged(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners_vec)
Definition: filtask.cxx:2744
ErrorCode
css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo
Definition: filtask.hxx:641
sal_Int32 getCommandId()
Definition: filtask.cxx:456
osl::FileBase::RC copy_recursive(const OUString &srcUnqPath, const OUString &dstUnqPath, FileUrlType TypeToCopy, bool testExistence)
Definition: filtask.cxx:1996
void deregisterNotifier(const OUString &aUnqPath, Notifier *pNotifier)
Definition: filtask.cxx:510
sal_Int32 getMinorErrorCode() const
Definition: filtask.hxx:125
static void notifyPropertyChanges(const std::vector< std::unique_ptr< PropertyChangeNotifier >> &listeners, const css::uno::Sequence< css::beans::PropertyChangeEvent > &seqChanged)
Definition: filtask.cxx:2775
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:750
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 bool & IsNative() const
Definition: filinl.hxx:22
css::uno::Reference< css::ucb::XCommandInfo > info_c()
Info methods.
Definition: filtask.cxx:812
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:718
static bool getUnqFromUrl(const OUString &Url, OUString &Unq)
Definition: filtask.cxx:1962
const css::beans::PropertyState & getState() const
Definition: filinl.hxx:38
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:781
css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment
Definition: filtask.hxx:83
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:1140
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
void setValue(const css::uno::Any &theValue) const
Definition: filinl.hxx:46
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:845
static void notifyPropertyRemoved(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2650
css::uno::Reference< css::beans::XPropertySetInfo > info_p(const OUString &aUnqPath)
Definition: filtask.cxx:827
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:1773
#define TASKHANDLER_NO_ERROR
Definition: filerror.hxx:27
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:1682
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:491
std::vector< std::unique_ptr< ContentEventNotifier > > getContentEventListeners(const OUString &aName)
Definition: filtask.cxx:2549
std::unordered_set< MyProperty, hMyProperty, eMyProperty > PropertySet
Definition: filtask.hxx:207
void startTask(sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.cxx:375
std::vector< Notifier * > NotifierList
Definition: filtask.hxx:208
void clearError(sal_Int32)
Clears any error which are set on the commandid.
Definition: filtask.cxx:421
void handleTask(sal_Int32 CommandId, const css::uno::Reference< css::task::XInteractionRequest > &request)
Handles an interactionrequest.
Definition: filtask.cxx:463
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
size_t operator()(const MyProperty &rName) const
Definition: filtask.hxx:201
PropertySet m_aDefaultProperties
Definition: filtask.hxx:640
const css::uno::Any & getValue() const
Definition: filinl.hxx:34