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 PropertyName;
161  sal_Int32 Handle;
162  bool isNative;
163  css::uno::Type Typ; // Duplicates information in Value
164  css::uno::Any Value;
165  css::beans::PropertyState State;
166  sal_Int16 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  inline const bool& IsNative() const;
178  const OUString& getPropertyName() const { return PropertyName; }
179  inline const sal_Int32& getHandle() const;
180  inline const css::uno::Type& getType() const;
181  inline const css::uno::Any& getValue() const;
182  inline const css::beans::PropertyState& getState() const;
183  inline const sal_Int16& getAttributes() const;
184 
185  // The set* functions are declared const, because the key of "this" stays intact
186  inline void setValue( const css::uno::Any& theValue ) const;
187  inline void setState( const css::beans::PropertyState& theState ) const;
188  };
189 
190  struct eMyProperty
191  {
192  bool operator()( const MyProperty& rKey1, const MyProperty& rKey2 ) const
193  {
194  return rKey1.getPropertyName() == rKey2.getPropertyName();
195  }
196  };
197 
198  struct hMyProperty
199  {
200  size_t operator()( const MyProperty& rName ) const
201  {
202  return rName.getPropertyName().hashCode();
203  }
204  };
205 
206  typedef std::unordered_set< MyProperty,hMyProperty,eMyProperty > PropertySet;
207 
209  {
210  public:
211  UnqPathData();
213  ~UnqPathData();
214 
215  PropertySet properties;
216  std::vector< Notifier* > notifier;
217 
218  // Three views on the PersistentPropertySet
219  css::uno::Reference< css::ucb::XPersistentPropertySet > xS;
220  css::uno::Reference< css::beans::XPropertyContainer > xC;
221  css::uno::Reference< css::beans::XPropertyAccess > xA;
222  };
223 
224  typedef std::unordered_map< OUString,UnqPathData > ContentMap;
225 
226  TaskManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
227  FileProvider* pProvider, bool bWithConfig );
228  ~TaskManager();
229 
231  void startTask(
232  sal_Int32 CommandId,
233  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv );
234 
235  sal_Int32 getCommandId();
236 
237 
244  void installError( sal_Int32 CommandId,
245  sal_Int32 ErrorCode,
246  sal_Int32 minorCode = TASKHANDLER_NO_ERROR );
247 
248  void retrieveError( sal_Int32 CommandId,
249  sal_Int32 &ErrorCode,
250  sal_Int32 &minorCode);
251 
257  void endTask( sal_Int32 CommandId,
258  // the physical URL of the object
259  const OUString& aUnqPath,
261 
262 
267  void handleTask( sal_Int32 CommandId,
268  const css::uno::Reference< css::task::XInteractionRequest >& request );
269 
274  void clearError( sal_Int32 );
275 
281  void registerNotifier( const OUString& aUnqPath,Notifier* pNotifier );
282 
283  void deregisterNotifier( const OUString& aUnqPath,Notifier* pNotifier );
284 
285 
296  void associate( const OUString& UnqPath,
297  const OUString& PropertyName,
298  const css::uno::Any& DefaultValue,
299  const sal_Int16 Attributes );
300 
304  void deassociate( const OUString& UnqPath,
305  const OUString& PropertyName );
306 
307 
308  // Every method having a command id is not allowed to throw anything,
309  // but instead must install every error code in the task handler
310 
311 
317  void page( sal_Int32 CommandId,
318  const OUString& aUnqPath,
319  const css::uno::Reference< css::io::XOutputStream >& xOutputStream );
320 
321 
326  css::uno::Reference< css::io::XInputStream >
327  open( sal_Int32 CommandId,
328  const OUString& aUnqPath,
329  bool bLock );
330 
331 
337  css::uno::Reference< css::io::XStream >
338  open_rw( sal_Int32 CommandId,
339  const OUString& aUnqPath,
340  bool bLock );
341 
342 
348  css::uno::Reference< css::ucb::XDynamicResultSet >
349  ls( sal_Int32 CommandId,
350  const OUString& aUnqPath,
351  const sal_Int32 OpenMode,
352  const css::uno::Sequence< css::beans::Property >& sProperty,
353  const css::uno::Sequence< css::ucb::NumberedSortingInfo > & sSortingInfo );
354 
355 
360  // Info for commands
361  css::uno::Reference< css::ucb::XCommandInfo >
362  info_c();
363 
364  // Info for the properties
365  css::uno::Reference< css::beans::XPropertySetInfo >
366  info_p( const OUString& aUnqPath );
367 
368 
373  css::uno::Sequence< css::uno::Any >
374  setv( const OUString& aUnqPath,
375  const css::uno::Sequence< css::beans::PropertyValue >& values );
376 
377 
383  css::uno::Reference< css::sdbc::XRow >
384  getv( sal_Int32 CommandId,
385  const OUString& aUnqPath,
386  const css::uno::Sequence< css::beans::Property >& properties );
387 
388 
389  /********************************************************************************/
390  /* transfer-commands */
391  /********************************************************************************/
392 
397  void
398  move( sal_Int32 CommandId,
399  const OUString& srcUnqPath, // Full file(folder)-path
400  const OUString& dstUnqPath, // Path to the destination-directory
401  const sal_Int32 NameClash );
402 
407  void
408  copy( sal_Int32 CommandId, // See "move"
409  const OUString& srcUnqPath,
410  const OUString& dstUnqPath,
411  sal_Int32 NameClash );
412 
413  enum class FileUrlType { Folder = 1, File = -1, Unknown = 0 };
414 
419  bool
420  remove( sal_Int32 CommandId,
421  const OUString& aUnqPath,
422  FileUrlType eTypeToMove = FileUrlType::Unknown,
423  bool MustExist = true );
424 
425 
426  /********************************************************************************/
427  /* write and create - commandos */
428  /********************************************************************************/
429 
435  bool
436  mkdir( sal_Int32 CommandId,
437  const OUString& aDirectoryName,
438  bool OverWrite );
439 
440 
447  bool
448  mkfil( sal_Int32 CommandId,
449  const OUString& aFileName,
450  bool OverWrite,
451  const css::uno::Reference< css::io::XInputStream >& aInputStream );
452 
453 
459  bool
460  write( sal_Int32 CommandId,
461  const OUString& aUnqPath,
462  bool OverWrite,
463  const css::uno::Reference< css::io::XInputStream >& aInputStream );
464 
465 
466  void insertDefaultProperties( const OUString& aUnqPath );
467 
468  static css::uno::Sequence< css::ucb::ContentInfo >
470 
471 
472  /******************************************************************************/
473  /* */
474  /* mapping of file urls */
475  /* to uncpath and vice versa */
476  /* */
477  /******************************************************************************/
478 
479  static bool getUnqFromUrl( const OUString& Url, OUString& Unq );
480 
481  static bool getUrlFromUnq( const OUString& Unq, OUString& Url );
482 
483 
485  css::uno::Reference< css::uno::XComponentContext > m_xContext;
486  css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry;
487 
488  private:
489 
490  /********************************************************************************/
491  /* get eventListeners */
492  /********************************************************************************/
493 
494  std::vector< std::unique_ptr< ContentEventNotifier > >
495  getContentEventListeners( const OUString& aName );
496 
497  std::vector< std::unique_ptr< ContentEventNotifier > >
498  getContentDeletedEventListeners( const OUString& aName );
499 
500  std::vector< std::unique_ptr < ContentEventNotifier > >
501  getContentExchangedEventListeners( const OUString& aOldPrefix,
502  const OUString& aNewPrefix,
503  bool withChildren );
504 
505  std::vector< std::unique_ptr< PropertyChangeNotifier > >
506  getPropertyChangeNotifier( const OUString& aName );
507 
508  std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > >
509  getPropertySetListeners( const OUString& aName );
510 
511 
512  /********************************************************************************/
513  /* notify eventListeners */
514  /********************************************************************************/
515 
516  static void notifyPropertyChanges(
517  const std::vector<std::unique_ptr<PropertyChangeNotifier>>& listeners,
518  const css::uno::Sequence<css::beans::PropertyChangeEvent>& seqChanged);
519 
520  static void notifyContentExchanged(
521  const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners_vec);
522 
523  static void
524  notifyInsert(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
525  const OUString& aChildName);
526 
527  static void
528  notifyContentDeleted(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners);
529 
530  static void
531  notifyContentRemoved(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
532  const OUString& aChildName);
533 
534  static void notifyPropertyAdded(
535  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
536  const OUString& aPropertyName);
537 
538  static void notifyPropertyRemoved(
539  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
540  const OUString& aPropertyName);
541 
542  /********************************************************************************/
543  /* remove persistent propertyset */
544  /********************************************************************************/
545 
546  void erasePersistentSetWithoutChildren( const OUString& aUnqPath );
547  void erasePersistentSet( const OUString& aUnqPath,
548  bool withChildren = false );
549 
550  /********************************************************************************/
551  /* copy persistent propertyset */
552  /* from srcUnqPath to dstUnqPath */
553  /********************************************************************************/
554 
555  void copyPersistentSetWithoutChildren( const OUString& srcUnqPath,
556  const OUString& dstUnqPath );
557  void copyPersistentSet( const OUString& srcUnqPath,
558  const OUString& dstUnqPath,
559  bool withChildren );
560 
561 
562  // Special optimized method for getting the properties of a directoryitem, which
563  // is returned by osl::DirectoryItem::getNextItem()
564 
565  bool
566  getv( const css::uno::Sequence< css::beans::Property >& properties,
567  osl::DirectoryItem& DirItem,
568  OUString& aUnqPath,
569  bool& bIsRegular,
570  css::uno::Reference< css::sdbc::XRow > & row );
571 
572 
578  void load( const TaskManager::ContentMap::iterator& it,
579  bool create );
580 
587  void
588  commit(
589  const TaskManager::ContentMap::iterator& it,
590  const osl::FileStatus& aFileStatus );
591 
598  static void
600  sal_Int32& n_Mask,
601  const css::uno::Sequence< css::beans::Property >& seq );
602 
603 
604  // Helper function for public copy
605 
606  osl::FileBase::RC
608  const OUString& srcUnqPath,
609  const OUString& dstUnqPath,
610  FileUrlType TypeToCopy,
611  bool testExistence );
612 
613 
614  // Helper function for mkfil,mkdir and write
615  // Creates whole path
616  // returns success of the operation
617  // The call determines the errorCode, which should be used to install
618  // any error
619 
620  bool
621  ensuredir( sal_Int32 CommandId,
622  const OUString& aDirectoryName,
623  sal_Int32 errorCode );
624 
625  // General
626  ContentMap m_aContent;
627 
628 
629  public:
630 
631  static const OUStringLiteral FolderContentType;
632  static const OUStringLiteral FileContentType;
633 
634 
635  private:
636 
637  PropertySet m_aDefaultProperties;
638  css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo;
639 
640  public:
641  // Miscellaneous:
642  // Methods for "writeComponentInfo" and "createComponentFactory"
643 
644  static void getScheme( OUString& Scheme );
645 
646  static OUString getImplementationName_static();
647 
648  static css::uno::Sequence< OUString > getSupportedServiceNames_static();
649  };
650 
651 } // end namespace TaskHandling
652 
653 #endif
654 
655 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void copyPersistentSet(const OUString &srcUnqPath, const OUString &dstUnqPath, bool withChildren)
Definition: filtask.cxx:2877
void installError(sal_Int32 nErrorCode, sal_Int32 nMinorCode)
Definition: filtask.hxx:113
css::uno::Reference< css::ucb::XPersistentPropertySet > xS
Definition: filtask.hxx:219
bool operator()(const MyProperty &rKey1, const MyProperty &rKey2) const
Definition: filtask.hxx:192
static void notifyInsert(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners, const OUString &aChildName)
Definition: filtask.cxx:2589
void retrieveError(sal_Int32 CommandId, sal_Int32 &ErrorCode, sal_Int32 &minorCode)
Definition: filtask.cxx:425
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:2607
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:385
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:2152
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry
Definition: filtask.hxx:486
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:2249
const css::uno::Type & getType() const
Definition: filinl.hxx:30
css::uno::Reference< css::beans::XPropertyContainer > xC
Definition: filtask.hxx:220
std::vector< std::unique_ptr< ContentEventNotifier > > getContentExchangedEventListeners(const OUString &aOldPrefix, const OUString &aNewPrefix, bool withChildren)
Definition: filtask.cxx:2660
void deassociate(const OUString &UnqPath, const OUString &PropertyName)
Definition: filtask.cxx:571
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler
Definition: filtask.hxx:82
void insertDefaultProperties(const OUString &aUnqPath)
Definition: filtask.cxx:1927
TaskManager(const css::uno::Reference< css::uno::XComponentContext > &rxContext, FileProvider *pProvider, bool bWithConfig)
Definition: filtask.cxx:137
const OUString & getPropertyName() const
Definition: filtask.hxx:178
css::uno::Reference< css::beans::XPropertyAccess > xA
Definition: filtask.hxx:221
std::unordered_map< OUString, UnqPathData > ContentMap
Definition: filtask.hxx:224
sal_Int32 getInstalledError() const
Definition: filtask.hxx:120
static OUString getImplementationName_static()
Definition: filtask.cxx:2947
css::uno::Reference< css::task::XInteractionHandler > const & getInteractionHandler()
Definition: filtask.hxx:131
void erasePersistentSetWithoutChildren(const OUString &aUnqPath)
Definition: filtask.cxx:2789
static void notifyPropertyAdded(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2638
static const OUStringLiteral FolderContentType
Definition: filtask.hxx:631
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:439
const sal_Int32 & getHandle() const
Definition: filinl.hxx:26
static const OUStringLiteral FileContentType
Definition: filtask.hxx:632
FileProvider * m_pProvider
Definition: filtask.hxx:484
std::unordered_map< sal_Int32, TaskHandling > TaskMap
Definition: filtask.hxx:148
static void getScheme(OUString &Scheme)
Definition: filtask.cxx:2941
std::vector< std::unique_ptr< ContentEventNotifier > > getContentDeletedEventListeners(const OUString &aName)
Definition: filtask.cxx:2569
static void notifyContentDeleted(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners)
Definition: filtask.cxx:2598
static bool getUrlFromUnq(const OUString &Unq, OUString &Url)
Definition: filtask.cxx:1978
void erasePersistentSet(const OUString &aUnqPath, bool withChildren=false)
Definition: filtask.cxx:2809
std::vector< std::unique_ptr< PropertyChangeNotifier > > getPropertyChangeNotifier(const OUString &aName)
Definition: filtask.cxx:2753
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:1737
std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > > getPropertySetListeners(const OUString &aName)
Definition: filtask.cxx:2618
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: filtask.hxx:485
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:2065
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:1343
const sal_Int16 & getAttributes() const
Definition: filinl.hxx:42
::rtl::Reference< Content > pContent
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo()
Definition: filtask.cxx:2909
static css::uno::Sequence< OUString > getSupportedServiceNames_static()
Definition: filtask.cxx:2954
void copyPersistentSetWithoutChildren(const OUString &srcUnqPath, const OUString &dstUnqPath)
Definition: filtask.cxx:2847
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:2195
static void notifyContentExchanged(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners_vec)
Definition: filtask.cxx:2742
ErrorCode
css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo
Definition: filtask.hxx:638
sal_Int32 getCommandId()
Definition: filtask.cxx:451
osl::FileBase::RC copy_recursive(const OUString &srcUnqPath, const OUString &dstUnqPath, FileUrlType TypeToCopy, bool testExistence)
Definition: filtask.cxx:1991
void deregisterNotifier(const OUString &aUnqPath, Notifier *pNotifier)
Definition: filtask.cxx:505
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:2773
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:745
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:807
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:713
static bool getUnqFromUrl(const OUString &Url, OUString &Unq)
Definition: filtask.cxx:1957
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:776
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:1135
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:624
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:840
static void notifyPropertyRemoved(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2648
css::uno::Reference< css::beans::XPropertySetInfo > info_p(const OUString &aUnqPath)
Definition: filtask.cxx:822
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:1768
#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:1677
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:486
std::vector< std::unique_ptr< ContentEventNotifier > > getContentEventListeners(const OUString &aName)
Definition: filtask.cxx:2547
std::unordered_set< MyProperty, hMyProperty, eMyProperty > PropertySet
Definition: filtask.hxx:206
void startTask(sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.cxx:370
void clearError(sal_Int32)
Clears any error which are set on the commandid.
Definition: filtask.cxx:416
void handleTask(sal_Int32 CommandId, const css::uno::Reference< css::task::XInteractionRequest > &request)
Handles an interactionrequest.
Definition: filtask.cxx:458
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:532
std::vector< Notifier * > notifier
Definition: filtask.hxx:216
size_t operator()(const MyProperty &rName) const
Definition: filtask.hxx:200
PropertySet m_aDefaultProperties
Definition: filtask.hxx:637
const css::uno::Any & getValue() const
Definition: filinl.hxx:34