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 #pragma once
20 
21 #include <osl/file.hxx>
22 #include <rtl/ustring.hxx>
23 
24 #include <osl/mutex.hxx>
25 #include <com/sun/star/uno/Sequence.hxx>
26 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
27 #include <com/sun/star/ucb/XCommandInfo.hpp>
28 #include <com/sun/star/beans/Property.hpp>
29 #include <com/sun/star/beans/PropertyValue.hpp>
30 #include <com/sun/star/io/XStream.hpp>
31 #include <com/sun/star/io/XOutputStream.hpp>
32 #include <com/sun/star/io/XInputStream.hpp>
33 #include <com/sun/star/beans/XPropertySetInfo.hpp>
34 #include <com/sun/star/ucb/NumberedSortingInfo.hpp>
35 #include <com/sun/star/sdbc/XRow.hpp>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/ucb/XDynamicResultSet.hpp>
38 #include <com/sun/star/beans/XPropertyContainer.hpp>
39 #include <com/sun/star/beans/XPropertyAccess.hpp>
40 #include <com/sun/star/ucb/ContentInfo.hpp>
41 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
42 #include <com/sun/star/ucb/XPersistentPropertySet.hpp>
43 #include <com/sun/star/ucb/XPropertySetRegistry.hpp>
44 #include <com/sun/star/task/XInteractionHandler.hpp>
45 #include <com/sun/star/task/XInteractionRequest.hpp>
46 #include "filerror.hxx"
47 #include "filnot.hxx"
48 #include <unordered_map>
49 #include <unordered_set>
50 #include <vector>
51 
52 namespace fileaccess
53 {
54  class BaseContent;
55  class FileProvider;
56  class XPropertySetInfo_impl;
57  class XCommandInfo_impl;
58  class XResultSet_impl;
59 
60  /*
61  * The relevant methods in this class all have as first argument the CommandId,
62  * so if necessary, every method has access to its relevant XInteractionHandler and
63  * XProgressHandler.
64  */
65 
66 
68  {
69  friend class XPropertySetInfo_impl;
70  friend class XResultSet_impl;
71  friend class XCommandInfo_impl;
72 
73  private:
74 
76  {
77  private:
78 
79  bool m_bHandled;
81  css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler;
82  css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment;
83 
84 
85  public:
86 
87  explicit TaskHandling(
88  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv )
89  : m_bHandled( false ),
90  m_nErrorCode( TASKHANDLER_NO_ERROR ),
91  m_nMinorCode( TASKHANDLER_NO_ERROR ),
92  m_xCommandEnvironment( xCommandEnv )
93  {
94  }
95 
96  void setHandled()
97  {
98  m_bHandled = true;
99  }
100 
101  bool isHandled() const
102  {
103  return m_bHandled;
104  }
105 
106  void clearError()
107  {
108  m_nErrorCode = TASKHANDLER_NO_ERROR;
109  m_nMinorCode = TASKHANDLER_NO_ERROR;
110  }
111 
112  void installError( sal_Int32 nErrorCode,
113  sal_Int32 nMinorCode )
114  {
115  m_nErrorCode = nErrorCode;
116  m_nMinorCode = nMinorCode;
117  }
118 
119  sal_Int32 getInstalledError() const
120  {
121  return m_nErrorCode;
122  }
123 
124  sal_Int32 getMinorErrorCode() const
125  {
126  return m_nMinorCode;
127  }
128 
129  css::uno::Reference< css::task::XInteractionHandler > const &
131  {
132  if( ! m_xInteractionHandler.is() && m_xCommandEnvironment.is() )
133  m_xInteractionHandler = m_xCommandEnvironment->getInteractionHandler();
134 
135  return m_xInteractionHandler;
136  }
137 
138  const css::uno::Reference< css::ucb::XCommandEnvironment >&
140  {
141  return m_xCommandEnvironment;
142  }
143 
144  }; // end class TaskHandling
145 
146 
147  typedef std::unordered_map< sal_Int32,TaskHandling > TaskMap;
148  private:
149 
150  osl::Mutex m_aMutex;
151  sal_Int32 m_nCommandId;
152  TaskMap m_aTaskMap;
153 
154 
155  public:
157  {
158  private:
159  OUString PropertyName;
160  sal_Int32 Handle;
161  bool isNative;
162  css::uno::Type Typ; // Duplicates information in Value
163  css::uno::Any Value;
164  css::beans::PropertyState State;
165  sal_Int16 Attributes;
166  public:
167  explicit MyProperty( const OUString& thePropertyName );
168  MyProperty( bool theIsNative,
169  const OUString& thePropertyName,
170  sal_Int32 theHandle,
171  const css::uno::Type& theTyp,
172  const css::uno::Any& theValue,
173  const css::beans::PropertyState& theState,
174  sal_Int16 theAttributes );
175 
176  inline const bool& IsNative() const;
177  const OUString& getPropertyName() const { return PropertyName; }
178  inline const sal_Int32& getHandle() const;
179  inline const css::uno::Type& getType() const;
180  inline const css::uno::Any& getValue() const;
181  inline const css::beans::PropertyState& getState() const;
182  inline const sal_Int16& getAttributes() const;
183 
184  // The set* functions are declared const, because the key of "this" stays intact
185  inline void setValue( const css::uno::Any& theValue ) const;
186  inline void setState( const css::beans::PropertyState& theState ) const;
187  };
188 
189  struct eMyProperty
190  {
191  bool operator()( const MyProperty& rKey1, const MyProperty& rKey2 ) const
192  {
193  return rKey1.getPropertyName() == rKey2.getPropertyName();
194  }
195  };
196 
197  struct hMyProperty
198  {
199  size_t operator()( const MyProperty& rName ) const
200  {
201  return rName.getPropertyName().hashCode();
202  }
203  };
204 
205  typedef std::unordered_set< MyProperty,hMyProperty,eMyProperty > PropertySet;
206 
208  {
209  public:
210  UnqPathData();
212  ~UnqPathData();
213 
214  PropertySet properties;
215  std::vector< Notifier* > notifier;
216 
217  // Three views on the PersistentPropertySet
218  css::uno::Reference< css::ucb::XPersistentPropertySet > xS;
219  css::uno::Reference< css::beans::XPropertyContainer > xC;
220  css::uno::Reference< css::beans::XPropertyAccess > xA;
221  };
222 
223  typedef std::unordered_map< OUString,UnqPathData > ContentMap;
224 
225  TaskManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
226  FileProvider* pProvider, bool bWithConfig );
227  ~TaskManager();
228 
230  void startTask(
231  sal_Int32 CommandId,
232  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv );
233 
234  sal_Int32 getCommandId();
235 
236 
243  void installError( sal_Int32 CommandId,
244  sal_Int32 ErrorCode,
245  sal_Int32 minorCode = TASKHANDLER_NO_ERROR );
246 
247  void retrieveError( sal_Int32 CommandId,
248  sal_Int32 &ErrorCode,
249  sal_Int32 &minorCode);
250 
256  void endTask( sal_Int32 CommandId,
257  // the physical URL of the object
258  const OUString& aUnqPath,
259  BaseContent* pContent);
260 
261 
266  void handleTask( sal_Int32 CommandId,
267  const css::uno::Reference< css::task::XInteractionRequest >& request );
268 
273  void clearError( sal_Int32 );
274 
280  void registerNotifier( const OUString& aUnqPath,Notifier* pNotifier );
281 
282  void deregisterNotifier( const OUString& aUnqPath,Notifier* pNotifier );
283 
284 
295  void associate( const OUString& UnqPath,
296  const OUString& PropertyName,
297  const css::uno::Any& DefaultValue,
298  const sal_Int16 Attributes );
299 
303  void deassociate( const OUString& UnqPath,
304  const OUString& PropertyName );
305 
306 
307  // Every method having a command id is not allowed to throw anything,
308  // but instead must install every error code in the task handler
309 
310 
316  void page( sal_Int32 CommandId,
317  const OUString& aUnqPath,
318  const css::uno::Reference< css::io::XOutputStream >& xOutputStream );
319 
320 
325  css::uno::Reference< css::io::XInputStream >
326  open( sal_Int32 CommandId,
327  const OUString& aUnqPath,
328  bool bLock );
329 
330 
336  css::uno::Reference< css::io::XStream >
337  open_rw( sal_Int32 CommandId,
338  const OUString& aUnqPath,
339  bool bLock );
340 
341 
347  css::uno::Reference< css::ucb::XDynamicResultSet >
348  ls( sal_Int32 CommandId,
349  const OUString& aUnqPath,
350  const sal_Int32 OpenMode,
351  const css::uno::Sequence< css::beans::Property >& sProperty,
352  const css::uno::Sequence< css::ucb::NumberedSortingInfo > & sSortingInfo );
353 
354 
359  // Info for commands
360  css::uno::Reference< css::ucb::XCommandInfo >
361  info_c();
362 
363  // Info for the properties
364  css::uno::Reference< css::beans::XPropertySetInfo >
365  info_p( const OUString& aUnqPath );
366 
367 
372  css::uno::Sequence< css::uno::Any >
373  setv( const OUString& aUnqPath,
374  const css::uno::Sequence< css::beans::PropertyValue >& values );
375 
376 
382  css::uno::Reference< css::sdbc::XRow >
383  getv( sal_Int32 CommandId,
384  const OUString& aUnqPath,
385  const css::uno::Sequence< css::beans::Property >& properties );
386 
387 
388  /********************************************************************************/
389  /* transfer-commands */
390  /********************************************************************************/
391 
396  void
397  move( sal_Int32 CommandId,
398  const OUString& srcUnqPath, // Full file(folder)-path
399  const OUString& dstUnqPath, // Path to the destination-directory
400  const sal_Int32 NameClash );
401 
406  void
407  copy( sal_Int32 CommandId, // See "move"
408  const OUString& srcUnqPath,
409  const OUString& dstUnqPath,
410  sal_Int32 NameClash );
411 
412  enum class FileUrlType { Folder = 1, File = -1, Unknown = 0 };
413 
418  bool
419  remove( sal_Int32 CommandId,
420  const OUString& aUnqPath,
421  FileUrlType eTypeToMove = FileUrlType::Unknown,
422  bool MustExist = true );
423 
424 
425  /********************************************************************************/
426  /* write and create - commandos */
427  /********************************************************************************/
428 
434  bool
435  mkdir( sal_Int32 CommandId,
436  const OUString& aDirectoryName,
437  bool OverWrite );
438 
439 
446  bool
447  mkfil( sal_Int32 CommandId,
448  const OUString& aFileName,
449  bool OverWrite,
450  const css::uno::Reference< css::io::XInputStream >& aInputStream );
451 
452 
458  bool
459  write( sal_Int32 CommandId,
460  const OUString& aUnqPath,
461  bool OverWrite,
462  const css::uno::Reference< css::io::XInputStream >& aInputStream );
463 
464 
465  void insertDefaultProperties( const OUString& aUnqPath );
466 
467  static css::uno::Sequence< css::ucb::ContentInfo >
469 
470 
471  /******************************************************************************/
472  /* */
473  /* mapping of file urls */
474  /* to uncpath and vice versa */
475  /* */
476  /******************************************************************************/
477 
478  static bool getUnqFromUrl( const OUString& Url, OUString& Unq );
479 
480  static bool getUrlFromUnq( const OUString& Unq, OUString& Url );
481 
482 
484  css::uno::Reference< css::uno::XComponentContext > m_xContext;
485  css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry;
486 
487  private:
488 
489  /********************************************************************************/
490  /* get eventListeners */
491  /********************************************************************************/
492 
493  std::vector< ContentEventNotifier >
494  getContentEventListeners( const OUString& aName );
495 
496  std::vector< ContentEventNotifier >
497  getContentDeletedEventListeners( const OUString& aName );
498 
499  std::vector< ContentEventNotifier >
500  getContentExchangedEventListeners( const OUString& aOldPrefix,
501  const OUString& aNewPrefix,
502  bool withChildren );
503 
504  std::vector< PropertyChangeNotifier >
505  getPropertyChangeNotifier( const OUString& aName );
506 
507  std::vector< PropertySetInfoChangeNotifier >
508  getPropertySetListeners( const OUString& aName );
509 
510 
511  /********************************************************************************/
512  /* notify eventListeners */
513  /********************************************************************************/
514 
515  static void notifyPropertyChanges(
516  const std::vector<PropertyChangeNotifier>& listeners,
517  const css::uno::Sequence<css::beans::PropertyChangeEvent>& seqChanged);
518 
519  static void notifyContentExchanged(
520  const std::vector<ContentEventNotifier>& listeners_vec);
521 
522  static void
523  notifyInsert(const std::vector<ContentEventNotifier>& listeners,
524  const OUString& aChildName);
525 
526  static void
527  notifyContentDeleted(const std::vector<ContentEventNotifier>& listeners);
528 
529  static void
530  notifyContentRemoved(const std::vector<ContentEventNotifier>& listeners,
531  const OUString& aChildName);
532 
533  static void notifyPropertyAdded(
534  const std::vector<PropertySetInfoChangeNotifier>& listeners,
535  const OUString& aPropertyName);
536 
537  static void notifyPropertyRemoved(
538  const std::vector<PropertySetInfoChangeNotifier>& listeners,
539  const OUString& aPropertyName);
540 
541  /********************************************************************************/
542  /* remove persistent propertyset */
543  /********************************************************************************/
544 
545  void erasePersistentSetWithoutChildren( const OUString& aUnqPath );
546  void erasePersistentSet( const OUString& aUnqPath,
547  bool withChildren = false );
548 
549  /********************************************************************************/
550  /* copy persistent propertyset */
551  /* from srcUnqPath to dstUnqPath */
552  /********************************************************************************/
553 
554  void copyPersistentSetWithoutChildren( const OUString& srcUnqPath,
555  const OUString& dstUnqPath );
556  void copyPersistentSet( const OUString& srcUnqPath,
557  const OUString& dstUnqPath,
558  bool withChildren );
559 
560 
561  // Special optimized method for getting the properties of a directoryitem, which
562  // is returned by osl::DirectoryItem::getNextItem()
563 
564  bool
565  getv( const css::uno::Sequence< css::beans::Property >& properties,
566  osl::DirectoryItem& DirItem,
567  OUString& aUnqPath,
568  bool& bIsRegular,
569  css::uno::Reference< css::sdbc::XRow > & row );
570 
571 
577  void load( const TaskManager::ContentMap::iterator& it,
578  bool create );
579 
586  void
587  commit(
588  const TaskManager::ContentMap::iterator& it,
589  const osl::FileStatus& aFileStatus );
590 
597  static void
599  sal_Int32& n_Mask,
600  const css::uno::Sequence< css::beans::Property >& seq );
601 
602 
603  // Helper function for public copy
604 
605  osl::FileBase::RC
607  const OUString& srcUnqPath,
608  const OUString& dstUnqPath,
609  FileUrlType TypeToCopy,
610  bool testExistence );
611 
612 
613  // Helper function for mkfil,mkdir and write
614  // Creates whole path
615  // returns success of the operation
616  // The call determines the errorCode, which should be used to install
617  // any error
618 
619  bool
620  ensuredir( sal_Int32 CommandId,
621  const OUString& aDirectoryName,
622  sal_Int32 errorCode );
623 
624  // General
625  ContentMap m_aContent;
626 
627 
628  public:
629 
630  static constexpr OUStringLiteral FolderContentType =
631  u"application/vnd.sun.staroffice.fsys-folder";
632  static constexpr OUStringLiteral FileContentType =
633  u"application/vnd.sun.staroffice.fsys-file";
634 
635 
636  private:
637 
638  PropertySet m_aDefaultProperties;
639  css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo;
640 
641  public:
642  // Miscellaneous:
643  // Methods for "writeComponentInfo" and "createComponentFactory"
644 
645  static void getScheme( OUString& Scheme );
646  };
647 
648 } // end namespace TaskHandling
649 
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void copyPersistentSet(const OUString &srcUnqPath, const OUString &dstUnqPath, bool withChildren)
Definition: filtask.cxx:2870
void installError(sal_Int32 nErrorCode, sal_Int32 nMinorCode)
Definition: filtask.hxx:112
static void notifyPropertyRemoved(const std::vector< PropertySetInfoChangeNotifier > &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2641
std::vector< ContentEventNotifier > getContentEventListeners(const OUString &aName)
Definition: filtask.cxx:2540
css::uno::Reference< css::ucb::XPersistentPropertySet > xS
Definition: filtask.hxx:218
bool operator()(const MyProperty &rKey1, const MyProperty &rKey2) const
Definition: filtask.hxx:191
void retrieveError(sal_Int32 CommandId, sal_Int32 &ErrorCode, sal_Int32 &minorCode)
Definition: filtask.cxx:423
const css::uno::Reference< css::ucb::XCommandEnvironment > & getCommandEnvironment() const
Definition: filtask.hxx:139
void setState(const css::beans::PropertyState &theState) const
Definition: filinl.hxx:49
void endTask(sal_Int32 CommandId, const OUString &aUnqPath, BaseContent *pContent)
Deinstalls the task and evaluates a possibly set error code.
Definition: filtask.cxx:383
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:2147
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry
Definition: filtask.hxx:485
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:2242
const css::uno::Type & getType() const
Definition: filinl.hxx:29
std::vector< ContentEventNotifier > getContentDeletedEventListeners(const OUString &aName)
Definition: filtask.cxx:2562
css::uno::Reference< css::beans::XPropertyContainer > xC
Definition: filtask.hxx:219
void deassociate(const OUString &UnqPath, const OUString &PropertyName)
Definition: filtask.cxx:569
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler
Definition: filtask.hxx:81
void insertDefaultProperties(const OUString &aUnqPath)
Definition: filtask.cxx:1922
TaskManager(const css::uno::Reference< css::uno::XComponentContext > &rxContext, FileProvider *pProvider, bool bWithConfig)
Definition: filtask.cxx:135
const OUString & getPropertyName() const
Definition: filtask.hxx:177
css::uno::Reference< css::beans::XPropertyAccess > xA
Definition: filtask.hxx:220
std::unordered_map< OUString, UnqPathData > ContentMap
Definition: filtask.hxx:223
sal_Int32 getInstalledError() const
Definition: filtask.hxx:119
css::uno::Reference< css::task::XInteractionHandler > const & getInteractionHandler()
Definition: filtask.hxx:130
static constexpr OUStringLiteral FolderContentType
Definition: filtask.hxx:630
std::vector< PropertySetInfoChangeNotifier > getPropertySetListeners(const OUString &aName)
Definition: filtask.cxx:2611
void erasePersistentSetWithoutChildren(const OUString &aUnqPath)
Definition: filtask.cxx:2782
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:437
const sal_Int32 & getHandle() const
Definition: filinl.hxx:25
FileProvider * m_pProvider
Definition: filtask.hxx:483
std::unordered_map< sal_Int32, TaskHandling > TaskMap
Definition: filtask.hxx:147
static void notifyContentRemoved(const std::vector< ContentEventNotifier > &listeners, const OUString &aChildName)
Definition: filtask.cxx:2600
static void getScheme(OUString &Scheme)
Definition: filtask.cxx:2924
std::vector< PropertyChangeNotifier > getPropertyChangeNotifier(const OUString &aName)
Definition: filtask.cxx:2746
static bool getUrlFromUnq(const OUString &Unq, OUString &Url)
Definition: filtask.cxx:1973
void erasePersistentSet(const OUString &aUnqPath, bool withChildren=false)
Definition: filtask.cxx:2802
static constexpr OUStringLiteral FileContentType
Definition: filtask.hxx:632
bool mkfil(sal_Int32 CommandId, const OUString &aFileName, bool OverWrite, const css::uno::Reference< css::io::XInputStream > &aInputStream)
Creates new file with given URL.
Definition: filtask.cxx:1732
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: filtask.hxx:484
static void notifyPropertyChanges(const std::vector< PropertyChangeNotifier > &listeners, const css::uno::Sequence< css::beans::PropertyChangeEvent > &seqChanged)
Definition: filtask.cxx:2766
MyProperty(const OUString &thePropertyName)
Definition: filtask.cxx:87
std::vector< ContentEventNotifier > getContentExchangedEventListeners(const OUString &aOldPrefix, const OUString &aNewPrefix, bool withChildren)
Definition: filtask.cxx:2653
TaskHandling(const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.hxx:87
bool ensuredir(sal_Int32 CommandId, const OUString &aDirectoryName, sal_Int32 errorCode)
Definition: filtask.cxx:2060
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:1338
const sal_Int16 & getAttributes() const
Definition: filinl.hxx:41
static void notifyPropertyAdded(const std::vector< PropertySetInfoChangeNotifier > &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2631
float u
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo()
Definition: filtask.cxx:2902
void copyPersistentSetWithoutChildren(const OUString &srcUnqPath, const OUString &dstUnqPath)
Definition: filtask.cxx:2840
css::beans::PropertyState State
Definition: filtask.hxx:164
void load(const TaskManager::ContentMap::iterator &it, bool create)
Load the properties from configuration, if create == true create them.
Definition: filtask.cxx:2190
ErrorCode
css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo
Definition: filtask.hxx:639
static void notifyContentDeleted(const std::vector< ContentEventNotifier > &listeners)
Definition: filtask.cxx:2591
sal_Int32 getCommandId()
Definition: filtask.cxx:449
osl::FileBase::RC copy_recursive(const OUString &srcUnqPath, const OUString &dstUnqPath, FileUrlType TypeToCopy, bool testExistence)
Definition: filtask.cxx:1986
void deregisterNotifier(const OUString &aUnqPath, Notifier *pNotifier)
Definition: filtask.cxx:503
sal_Int32 getMinorErrorCode() const
Definition: filtask.hxx:124
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:743
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:21
css::uno::Reference< css::ucb::XCommandInfo > info_c()
Info methods.
Definition: filtask.cxx:805
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:711
static void notifyContentExchanged(const std::vector< ContentEventNotifier > &listeners_vec)
Definition: filtask.cxx:2735
static bool getUnqFromUrl(const OUString &Url, OUString &Unq)
Definition: filtask.cxx:1952
const css::beans::PropertyState & getState() const
Definition: filinl.hxx:37
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:774
css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment
Definition: filtask.hxx:82
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:1130
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:622
void setValue(const css::uno::Any &theValue) const
Definition: filinl.hxx:45
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:836
css::uno::Reference< css::beans::XPropertySetInfo > info_p(const OUString &aUnqPath)
Definition: filtask.cxx:819
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:1763
#define TASKHANDLER_NO_ERROR
Definition: filerror.hxx:26
static void notifyInsert(const std::vector< ContentEventNotifier > &listeners, const OUString &aChildName)
Definition: filtask.cxx:2582
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:1672
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:484
std::unordered_set< MyProperty, hMyProperty, eMyProperty > PropertySet
Definition: filtask.hxx:205
void startTask(sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.cxx:368
void clearError(sal_Int32)
Clears any error which are set on the commandid.
Definition: filtask.cxx:414
void handleTask(sal_Int32 CommandId, const css::uno::Reference< css::task::XInteractionRequest > &request)
Handles an interactionrequest.
Definition: filtask.cxx:456
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:530
std::vector< Notifier * > notifier
Definition: filtask.hxx:215
size_t operator()(const MyProperty &rName) const
Definition: filtask.hxx:199
PropertySet m_aDefaultProperties
Definition: filtask.hxx:638
const css::uno::Any & getValue() const
Definition: filinl.hxx:33