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  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  typedef std::vector< Notifier* > NotifierList;
208 
209 
211  {
212  public:
213  UnqPathData();
215  ~UnqPathData();
216 
217  PropertySet properties;
218  NotifierList notifier;
219 
220  // Three views on the PersistentPropertySet
221  css::uno::Reference< css::ucb::XPersistentPropertySet > xS;
222  css::uno::Reference< css::beans::XPropertyContainer > xC;
223  css::uno::Reference< css::beans::XPropertyAccess > xA;
224  };
225 
226  typedef std::unordered_map< OUString,UnqPathData > ContentMap;
227 
228  TaskManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
229  FileProvider* pProvider, bool bWithConfig );
230  ~TaskManager();
231 
233  void startTask(
234  sal_Int32 CommandId,
235  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv );
236 
237  sal_Int32 getCommandId();
238 
239 
246  void installError( sal_Int32 CommandId,
247  sal_Int32 ErrorCode,
248  sal_Int32 minorCode = TASKHANDLER_NO_ERROR );
249 
250  void retrieveError( sal_Int32 CommandId,
251  sal_Int32 &ErrorCode,
252  sal_Int32 &minorCode);
253 
259  void endTask( sal_Int32 CommandId,
260  // the physical URL of the object
261  const OUString& aUnqPath,
263 
264 
269  void handleTask( sal_Int32 CommandId,
270  const css::uno::Reference< css::task::XInteractionRequest >& request );
271 
276  void clearError( sal_Int32 );
277 
283  void registerNotifier( const OUString& aUnqPath,Notifier* pNotifier );
284 
285  void deregisterNotifier( const OUString& aUnqPath,Notifier* pNotifier );
286 
287 
298  void associate( const OUString& UnqPath,
299  const OUString& PropertyName,
300  const css::uno::Any& DefaultValue,
301  const sal_Int16 Attributes );
302 
306  void deassociate( const OUString& UnqPath,
307  const OUString& PropertyName );
308 
309 
310  // Every method having a command id is not allowed to throw anything,
311  // but instead must install every error code in the task handler
312 
313 
319  void page( sal_Int32 CommandId,
320  const OUString& aUnqPath,
321  const css::uno::Reference< css::io::XOutputStream >& xOutputStream );
322 
323 
328  css::uno::Reference< css::io::XInputStream >
329  open( sal_Int32 CommandId,
330  const OUString& aUnqPath,
331  bool bLock );
332 
333 
339  css::uno::Reference< css::io::XStream >
340  open_rw( sal_Int32 CommandId,
341  const OUString& aUnqPath,
342  bool bLock );
343 
344 
350  css::uno::Reference< css::ucb::XDynamicResultSet >
351  ls( sal_Int32 CommandId,
352  const OUString& aUnqPath,
353  const sal_Int32 OpenMode,
354  const css::uno::Sequence< css::beans::Property >& sProperty,
355  const css::uno::Sequence< css::ucb::NumberedSortingInfo > & sSortingInfo );
356 
357 
362  // Info for commands
363  css::uno::Reference< css::ucb::XCommandInfo >
364  info_c();
365 
366  // Info for the properties
367  css::uno::Reference< css::beans::XPropertySetInfo >
368  info_p( const OUString& aUnqPath );
369 
370 
375  css::uno::Sequence< css::uno::Any >
376  setv( const OUString& aUnqPath,
377  const css::uno::Sequence< css::beans::PropertyValue >& values );
378 
379 
385  css::uno::Reference< css::sdbc::XRow >
386  getv( sal_Int32 CommandId,
387  const OUString& aUnqPath,
388  const css::uno::Sequence< css::beans::Property >& properties );
389 
390 
391  /********************************************************************************/
392  /* transfer-commands */
393  /********************************************************************************/
394 
399  void
400  move( sal_Int32 CommandId,
401  const OUString& srcUnqPath, // Full file(folder)-path
402  const OUString& dstUnqPath, // Path to the destination-directory
403  const sal_Int32 NameClash );
404 
409  void
410  copy( sal_Int32 CommandId, // See "move"
411  const OUString& srcUnqPath,
412  const OUString& dstUnqPath,
413  sal_Int32 NameClash );
414 
415  enum class FileUrlType { Folder = 1, File = -1, Unknown = 0 };
416 
421  bool
422  remove( sal_Int32 CommandId,
423  const OUString& aUnqPath,
424  FileUrlType eTypeToMove = FileUrlType::Unknown,
425  bool MustExist = true );
426 
427 
428  /********************************************************************************/
429  /* write and create - commandos */
430  /********************************************************************************/
431 
437  bool
438  mkdir( sal_Int32 CommandId,
439  const OUString& aDirectoryName,
440  bool OverWrite );
441 
442 
449  bool
450  mkfil( sal_Int32 CommandId,
451  const OUString& aFileName,
452  bool OverWrite,
453  const css::uno::Reference< css::io::XInputStream >& aInputStream );
454 
455 
461  bool
462  write( sal_Int32 CommandId,
463  const OUString& aUnqPath,
464  bool OverWrite,
465  const css::uno::Reference< css::io::XInputStream >& aInputStream );
466 
467 
468  void insertDefaultProperties( const OUString& aUnqPath );
469 
470  static css::uno::Sequence< css::ucb::ContentInfo >
472 
473 
474  /******************************************************************************/
475  /* */
476  /* mapping of file urls */
477  /* to uncpath and vice versa */
478  /* */
479  /******************************************************************************/
480 
481  static bool getUnqFromUrl( const OUString& Url, OUString& Unq );
482 
483  static bool getUrlFromUnq( const OUString& Unq, OUString& Url );
484 
485 
487  css::uno::Reference< css::uno::XComponentContext > m_xContext;
488  css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry;
489 
490  private:
491 
492  /********************************************************************************/
493  /* get eventListeners */
494  /********************************************************************************/
495 
496  std::vector< std::unique_ptr< ContentEventNotifier > >
497  getContentEventListeners( const OUString& aName );
498 
499  std::vector< std::unique_ptr< ContentEventNotifier > >
500  getContentDeletedEventListeners( const OUString& aName );
501 
502  std::vector< std::unique_ptr < ContentEventNotifier > >
503  getContentExchangedEventListeners( const OUString& aOldPrefix,
504  const OUString& aNewPrefix,
505  bool withChildren );
506 
507  std::vector< std::unique_ptr< PropertyChangeNotifier > >
508  getPropertyChangeNotifier( const OUString& aName );
509 
510  std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > >
511  getPropertySetListeners( const OUString& aName );
512 
513 
514  /********************************************************************************/
515  /* notify eventListeners */
516  /********************************************************************************/
517 
518  static void notifyPropertyChanges(
519  const std::vector<std::unique_ptr<PropertyChangeNotifier>>& listeners,
520  const css::uno::Sequence<css::beans::PropertyChangeEvent>& seqChanged);
521 
522  static void notifyContentExchanged(
523  const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners_vec);
524 
525  static void
526  notifyInsert(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
527  const OUString& aChildName);
528 
529  static void
530  notifyContentDeleted(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners);
531 
532  static void
533  notifyContentRemoved(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
534  const OUString& aChildName);
535 
536  static void notifyPropertyAdded(
537  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
538  const OUString& aPropertyName);
539 
540  static void notifyPropertyRemoved(
541  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
542  const OUString& aPropertyName);
543 
544  /********************************************************************************/
545  /* remove persistent propertyset */
546  /********************************************************************************/
547 
548  void erasePersistentSetWithoutChildren( const OUString& aUnqPath );
549  void erasePersistentSet( const OUString& aUnqPath,
550  bool withChildren = false );
551 
552  /********************************************************************************/
553  /* copy persistent propertyset */
554  /* from srcUnqPath to dstUnqPath */
555  /********************************************************************************/
556 
557  void copyPersistentSetWithoutChildren( const OUString& srcUnqPath,
558  const OUString& dstUnqPath );
559  void copyPersistentSet( const OUString& srcUnqPath,
560  const OUString& dstUnqPath,
561  bool withChildren );
562 
563 
564  // Special optimized method for getting the properties of a directoryitem, which
565  // is returned by osl::DirectoryItem::getNextItem()
566 
567  bool
568  getv( const css::uno::Sequence< css::beans::Property >& properties,
569  osl::DirectoryItem& DirItem,
570  OUString& aUnqPath,
571  bool& bIsRegular,
572  css::uno::Reference< css::sdbc::XRow > & row );
573 
574 
580  void load( const TaskManager::ContentMap::iterator& it,
581  bool create );
582 
589  void
590  commit(
591  const TaskManager::ContentMap::iterator& it,
592  const osl::FileStatus& aFileStatus );
593 
600  static void
602  sal_Int32& n_Mask,
603  const css::uno::Sequence< css::beans::Property >& seq );
604 
605 
606  // Helper function for public copy
607 
608  osl::FileBase::RC
610  const OUString& srcUnqPath,
611  const OUString& dstUnqPath,
612  FileUrlType TypeToCopy,
613  bool testExistence );
614 
615 
616  // Helper function for mkfil,mkdir and write
617  // Creates whole path
618  // returns success of the operation
619  // The call determines the errorCode, which should be used to install
620  // any error
621 
622  bool
623  ensuredir( sal_Int32 CommandId,
624  const OUString& aDirectoryName,
625  sal_Int32 errorCode );
626 
627  // General
628  ContentMap m_aContent;
629 
630 
631  public:
632 
633  static const OUStringLiteral FolderContentType;
634  static const OUStringLiteral FileContentType;
635 
636 
637  private:
638 
639  PropertySet m_aDefaultProperties;
640  css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo;
641 
642  public:
643  // Miscellaneous:
644  // Methods for "writeComponentInfo" and "createComponentFactory"
645 
646  static void getScheme( OUString& Scheme );
647 
648  static OUString getImplementationName_static();
649 
650  static css::uno::Sequence< OUString > getSupportedServiceNames_static();
651  };
652 
653 } // end namespace TaskHandling
654 
655 #endif
656 
657 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void copyPersistentSet(const OUString &srcUnqPath, const OUString &dstUnqPath, bool withChildren)
Definition: filtask.cxx:2874
void installError(sal_Int32 nErrorCode, sal_Int32 nMinorCode)
Definition: filtask.hxx:113
css::uno::Reference< css::ucb::XPersistentPropertySet > xS
Definition: filtask.hxx:221
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:2586
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:2604
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:2149
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry
Definition: filtask.hxx:488
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:2246
const css::uno::Type & getType() const
Definition: filinl.hxx:30
css::uno::Reference< css::beans::XPropertyContainer > xC
Definition: filtask.hxx:222
std::vector< std::unique_ptr< ContentEventNotifier > > getContentExchangedEventListeners(const OUString &aOldPrefix, const OUString &aNewPrefix, bool withChildren)
Definition: filtask.cxx:2657
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:223
std::unordered_map< OUString, UnqPathData > ContentMap
Definition: filtask.hxx:226
sal_Int32 getInstalledError() const
Definition: filtask.hxx:120
static OUString getImplementationName_static()
Definition: filtask.cxx:2944
css::uno::Reference< css::task::XInteractionHandler > const & getInteractionHandler()
Definition: filtask.hxx:131
void erasePersistentSetWithoutChildren(const OUString &aUnqPath)
Definition: filtask.cxx:2786
static void notifyPropertyAdded(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2635
static const OUStringLiteral FolderContentType
Definition: filtask.hxx:633
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:634
FileProvider * m_pProvider
Definition: filtask.hxx:486
std::unordered_map< sal_Int32, TaskHandling > TaskMap
Definition: filtask.hxx:148
static void getScheme(OUString &Scheme)
Definition: filtask.cxx:2938
std::vector< std::unique_ptr< ContentEventNotifier > > getContentDeletedEventListeners(const OUString &aName)
Definition: filtask.cxx:2566
static void notifyContentDeleted(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners)
Definition: filtask.cxx:2595
static bool getUrlFromUnq(const OUString &Unq, OUString &Url)
Definition: filtask.cxx:1978
void erasePersistentSet(const OUString &aUnqPath, bool withChildren=false)
Definition: filtask.cxx:2806
std::vector< std::unique_ptr< PropertyChangeNotifier > > getPropertyChangeNotifier(const OUString &aName)
Definition: filtask.cxx:2750
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:2615
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: filtask.hxx:487
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:2062
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:2906
static css::uno::Sequence< OUString > getSupportedServiceNames_static()
Definition: filtask.cxx:2951
void copyPersistentSetWithoutChildren(const OUString &srcUnqPath, const OUString &dstUnqPath)
Definition: filtask.cxx:2844
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:2192
static void notifyContentExchanged(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners_vec)
Definition: filtask.cxx:2739
ErrorCode
css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo
Definition: filtask.hxx:640
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:2770
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:2645
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:2544
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
std::vector< Notifier * > NotifierList
Definition: filtask.hxx:207
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
size_t operator()(const MyProperty &rName) const
Definition: filtask.hxx:200
PropertySet m_aDefaultProperties
Definition: filtask.hxx:639
const css::uno::Any & getValue() const
Definition: filinl.hxx:34