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 <cppuhelper/weak.hxx>
25 #include <osl/file.hxx>
26 #include <rtl/ustring.hxx>
27 
28 #include <osl/mutex.hxx>
29 #include <com/sun/star/uno/Sequence.hxx>
30 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
31 #include <com/sun/star/ucb/XCommandInfo.hpp>
32 #include <com/sun/star/beans/Property.hpp>
33 #include <com/sun/star/beans/PropertyValue.hpp>
34 #include <com/sun/star/io/XStream.hpp>
35 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
36 #include <com/sun/star/ucb/XCommandProcessor.hpp>
37 #include <com/sun/star/io/XOutputStream.hpp>
38 #include <com/sun/star/io/XInputStream.hpp>
39 #include <com/sun/star/beans/XPropertySetInfo.hpp>
40 #include <com/sun/star/beans/XPropertiesChangeNotifier.hpp>
41 #include <com/sun/star/ucb/NumberedSortingInfo.hpp>
42 #include <com/sun/star/sdbc/XRow.hpp>
43 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
44 #include <com/sun/star/uno/XComponentContext.hpp>
45 #include <com/sun/star/ucb/XContentProvider.hpp>
46 #include <com/sun/star/ucb/XDynamicResultSet.hpp>
47 #include <com/sun/star/beans/XPropertyContainer.hpp>
48 #include <com/sun/star/beans/XPropertyAccess.hpp>
49 #include <com/sun/star/ucb/XPropertySetRegistryFactory.hpp>
50 #include <com/sun/star/ucb/TransferInfo.hpp>
51 #include <com/sun/star/ucb/ContentInfo.hpp>
52 #include <com/sun/star/ucb/DuplicateCommandIdentifierException.hpp>
53 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
54 #include <com/sun/star/ucb/XProgressHandler.hpp>
55 #include <com/sun/star/task/XInteractionHandler.hpp>
56 #include <com/sun/star/task/XInteractionRequest.hpp>
57 #include "filerror.hxx"
58 #include "filnot.hxx"
59 #include <unordered_map>
60 #include <functional>
61 #include <unordered_set>
62 #include <vector>
63 
64 namespace fileaccess
65 {
66  class BaseContent;
67  class FileProvider;
68  class XPropertySetInfo_impl;
69  class XCommandInfo_impl;
70  class XResultSet_impl;
71 
72  /*
73  * The relevant methods in this class all have as first argument the CommandId,
74  * so if necessary, every method has access to its relevant XInteractionHandler and
75  * XProgressHandler.
76  */
77 
78 
80  {
81  friend class XPropertySetInfo_impl;
82  friend class XResultSet_impl;
83  friend class XCommandInfo_impl;
84 
85  private:
86 
88  {
89  private:
90 
91  bool m_bHandled;
93  css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler;
94  css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment;
95 
96 
97  public:
98 
99  explicit TaskHandling(
100  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv )
101  : m_bHandled( false ),
102  m_nErrorCode( TASKHANDLER_NO_ERROR ),
103  m_nMinorCode( TASKHANDLER_NO_ERROR ),
104  m_xCommandEnvironment( xCommandEnv )
105  {
106  }
107 
108  void setHandled()
109  {
110  m_bHandled = true;
111  }
112 
113  bool isHandled() const
114  {
115  return m_bHandled;
116  }
117 
118  void clearError()
119  {
120  m_nErrorCode = TASKHANDLER_NO_ERROR;
121  m_nMinorCode = TASKHANDLER_NO_ERROR;
122  }
123 
124  void installError( sal_Int32 nErrorCode,
125  sal_Int32 nMinorCode )
126  {
127  m_nErrorCode = nErrorCode;
128  m_nMinorCode = nMinorCode;
129  }
130 
131  sal_Int32 getInstalledError()
132  {
133  return m_nErrorCode;
134  }
135 
136  sal_Int32 getMinorErrorCode()
137  {
138  return m_nMinorCode;
139  }
140 
141  css::uno::Reference< css::task::XInteractionHandler > const &
143  {
144  if( ! m_xInteractionHandler.is() && m_xCommandEnvironment.is() )
145  m_xInteractionHandler = m_xCommandEnvironment->getInteractionHandler();
146 
147  return m_xInteractionHandler;
148  }
149 
150  const css::uno::Reference< css::ucb::XCommandEnvironment >&
152  {
153  return m_xCommandEnvironment;
154  }
155 
156  }; // end class TaskHandling
157 
158 
159  typedef std::unordered_map< sal_Int32,TaskHandling > TaskMap;
160  private:
161 
162  osl::Mutex m_aMutex;
163  sal_Int32 m_nCommandId;
164  TaskMap m_aTaskMap;
165 
166 
167  public:
169  {
170  private:
171  OUString const PropertyName;
172  sal_Int32 const Handle;
173  bool const isNative;
174  css::uno::Type const Typ; // Duplicates information in Value
175  css::uno::Any Value;
176  css::beans::PropertyState State;
177  sal_Int16 const Attributes;
178  public:
179  explicit MyProperty( const OUString& thePropertyName );
180  MyProperty( bool theIsNative,
181  const OUString& thePropertyName,
182  sal_Int32 theHandle,
183  const css::uno::Type& theTyp,
184  const css::uno::Any& theValue,
185  const css::beans::PropertyState& theState,
186  sal_Int16 theAttributes );
187 
188  ~MyProperty();
189  inline const bool& IsNative() const;
190  const OUString& getPropertyName() const { return PropertyName; }
191  inline const sal_Int32& getHandle() const;
192  inline const css::uno::Type& getType() const;
193  inline const css::uno::Any& getValue() const;
194  inline const css::beans::PropertyState& getState() const;
195  inline const sal_Int16& getAttributes() const;
196 
197  // The set* functions are declared const, because the key of "this" stays intact
198  inline void setValue( const css::uno::Any& theValue ) const;
199  inline void setState( const css::beans::PropertyState& theState ) const;
200  };
201 
202  struct eMyProperty
203  {
204  bool operator()( const MyProperty& rKey1, const MyProperty& rKey2 ) const
205  {
206  return rKey1.getPropertyName() == rKey2.getPropertyName();
207  }
208  };
209 
210  struct hMyProperty
211  {
212  size_t operator()( const MyProperty& rName ) const
213  {
214  return rName.getPropertyName().hashCode();
215  }
216  };
217 
218  typedef std::unordered_set< MyProperty,hMyProperty,eMyProperty > PropertySet;
219  typedef std::vector< Notifier* > NotifierList;
220 
221 
223  {
224  public:
225  UnqPathData();
227  ~UnqPathData();
228 
229  PropertySet properties;
230  NotifierList notifier;
231 
232  // Three views on the PersistentPropertySet
233  css::uno::Reference< css::ucb::XPersistentPropertySet > xS;
234  css::uno::Reference< css::beans::XPropertyContainer > xC;
235  css::uno::Reference< css::beans::XPropertyAccess > xA;
236  };
237 
238  typedef std::unordered_map< OUString,UnqPathData > ContentMap;
239 
240  TaskManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
241  FileProvider* pProvider, bool bWithConfig );
242  ~TaskManager();
243 
245  void startTask(
246  sal_Int32 CommandId,
247  const css::uno::Reference< css::ucb::XCommandEnvironment >& xCommandEnv );
248 
249  sal_Int32 getCommandId();
250 
251 
258  void installError( sal_Int32 CommandId,
259  sal_Int32 ErrorCode,
260  sal_Int32 minorCode = TASKHANDLER_NO_ERROR );
261 
262  void retrieveError( sal_Int32 CommandId,
263  sal_Int32 &ErrorCode,
264  sal_Int32 &minorCode);
265 
271  void endTask( sal_Int32 CommandId,
272  // the physical URL of the object
273  const OUString& aUnqPath,
274  BaseContent* pContent);
275 
276 
281  void handleTask( sal_Int32 CommandId,
282  const css::uno::Reference< css::task::XInteractionRequest >& request );
283 
288  void clearError( sal_Int32 );
289 
295  void registerNotifier( const OUString& aUnqPath,Notifier* pNotifier );
296 
297  void deregisterNotifier( const OUString& aUnqPath,Notifier* pNotifier );
298 
299 
310  void associate( const OUString& UnqPath,
311  const OUString& PropertyName,
312  const css::uno::Any& DefaultValue,
313  const sal_Int16 Attributes );
314 
318  void deassociate( const OUString& UnqPath,
319  const OUString& PropertyName );
320 
321 
322  // Every method having a command id is not allowed to throw anything,
323  // but instead must install every error code in the task handler
324 
325 
331  void page( sal_Int32 CommandId,
332  const OUString& aUnqPath,
333  const css::uno::Reference< css::io::XOutputStream >& xOutputStream );
334 
335 
340  css::uno::Reference< css::io::XInputStream >
341  open( sal_Int32 CommandId,
342  const OUString& aUnqPath,
343  bool bLock );
344 
345 
351  css::uno::Reference< css::io::XStream >
352  open_rw( sal_Int32 CommandId,
353  const OUString& aUnqPath,
354  bool bLock );
355 
356 
362  css::uno::Reference< css::ucb::XDynamicResultSet >
363  ls( sal_Int32 CommandId,
364  const OUString& aUnqPath,
365  const sal_Int32 OpenMode,
366  const css::uno::Sequence< css::beans::Property >& sProperty,
367  const css::uno::Sequence< css::ucb::NumberedSortingInfo > & sSortingInfo );
368 
369 
374  // Info for commands
375  css::uno::Reference< css::ucb::XCommandInfo >
376  info_c();
377 
378  // Info for the properties
379  css::uno::Reference< css::beans::XPropertySetInfo >
380  info_p( const OUString& aUnqPath );
381 
382 
387  css::uno::Sequence< css::uno::Any >
388  setv( const OUString& aUnqPath,
389  const css::uno::Sequence< css::beans::PropertyValue >& values );
390 
391 
397  css::uno::Reference< css::sdbc::XRow >
398  getv( sal_Int32 CommandId,
399  const OUString& aUnqPath,
400  const css::uno::Sequence< css::beans::Property >& properties );
401 
402 
403  /********************************************************************************/
404  /* transfer-commands */
405  /********************************************************************************/
406 
411  void
412  move( sal_Int32 CommandId,
413  const OUString& srcUnqPath, // Full file(folder)-path
414  const OUString& dstUnqPath, // Path to the destination-directory
415  const sal_Int32 NameClash );
416 
421  void
422  copy( sal_Int32 CommandId, // See "move"
423  const OUString& srcUnqPath,
424  const OUString& dstUnqPath,
425  sal_Int32 NameClash );
426 
427  enum class FileUrlType { Folder = 1, File = -1, Unknown = 0 };
428 
433  bool
434  remove( sal_Int32 CommandId,
435  const OUString& aUnqPath,
436  FileUrlType eTypeToMove = FileUrlType::Unknown,
437  bool MustExist = true );
438 
439 
440  /********************************************************************************/
441  /* write and create - commandos */
442  /********************************************************************************/
443 
449  bool
450  mkdir( sal_Int32 CommandId,
451  const OUString& aDirectoryName,
452  bool OverWrite );
453 
454 
461  bool
462  mkfil( sal_Int32 CommandId,
463  const OUString& aFileName,
464  bool OverWrite,
465  const css::uno::Reference< css::io::XInputStream >& aInputStream );
466 
467 
473  bool
474  write( sal_Int32 CommandId,
475  const OUString& aUnqPath,
476  bool OverWrite,
477  const css::uno::Reference< css::io::XInputStream >& aInputStream );
478 
479 
480  void insertDefaultProperties( const OUString& aUnqPath );
481 
482  static css::uno::Sequence< css::ucb::ContentInfo >
484 
485 
486  /******************************************************************************/
487  /* */
488  /* mapping of file urls */
489  /* to uncpath and vice versa */
490  /* */
491  /******************************************************************************/
492 
493  static bool getUnqFromUrl( const OUString& Url, OUString& Unq );
494 
495  static bool getUrlFromUnq( const OUString& Unq, OUString& Url );
496 
497 
499  css::uno::Reference< css::uno::XComponentContext > m_xContext;
500  css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry;
501 
502  private:
503 
504  /********************************************************************************/
505  /* get eventListeners */
506  /********************************************************************************/
507 
508  std::vector< std::unique_ptr< ContentEventNotifier > >
509  getContentEventListeners( const OUString& aName );
510 
511  std::vector< std::unique_ptr< ContentEventNotifier > >
512  getContentDeletedEventListeners( const OUString& aName );
513 
514  std::vector< std::unique_ptr < ContentEventNotifier > >
515  getContentExchangedEventListeners( const OUString& aOldPrefix,
516  const OUString& aNewPrefix,
517  bool withChildren );
518 
519  std::vector< std::unique_ptr< PropertyChangeNotifier > >
520  getPropertyChangeNotifier( const OUString& aName );
521 
522  std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > >
523  getPropertySetListeners( const OUString& aName );
524 
525 
526  /********************************************************************************/
527  /* notify eventListeners */
528  /********************************************************************************/
529 
530  static void notifyPropertyChanges(
531  const std::vector<std::unique_ptr<PropertyChangeNotifier>>& listeners,
532  const css::uno::Sequence<css::beans::PropertyChangeEvent>& seqChanged);
533 
534  static void notifyContentExchanged(
535  const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners_vec);
536 
537  static void
538  notifyInsert(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
539  const OUString& aChildName);
540 
541  static void
542  notifyContentDeleted(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners);
543 
544  static void
545  notifyContentRemoved(const std::vector<std::unique_ptr<ContentEventNotifier>>& listeners,
546  const OUString& aChildName);
547 
548  static void notifyPropertyAdded(
549  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
550  const OUString& aPropertyName);
551 
552  static void notifyPropertyRemoved(
553  const std::vector<std::unique_ptr<PropertySetInfoChangeNotifier>>& listeners,
554  const OUString& aPropertyName);
555 
556  /********************************************************************************/
557  /* remove persistent propertyset */
558  /********************************************************************************/
559 
560  void erasePersistentSetWithoutChildren( const OUString& aUnqPath );
561  void erasePersistentSet( const OUString& aUnqPath,
562  bool withChildren = false );
563 
564  /********************************************************************************/
565  /* copy persistent propertyset */
566  /* from srcUnqPath to dstUnqPath */
567  /********************************************************************************/
568 
569  void copyPersistentSetWithoutChildren( const OUString& srcUnqPath,
570  const OUString& dstUnqPath );
571  void copyPersistentSet( const OUString& srcUnqPath,
572  const OUString& dstUnqPath,
573  bool withChildren );
574 
575 
576  // Special optimized method for getting the properties of a directoryitem, which
577  // is returned by osl::DirectoryItem::getNextItem()
578 
579  bool
580  getv( const css::uno::Sequence< css::beans::Property >& properties,
581  osl::DirectoryItem& DirItem,
582  OUString& aUnqPath,
583  bool& bIsRegular,
584  css::uno::Reference< css::sdbc::XRow > & row );
585 
586 
592  void load( const TaskManager::ContentMap::iterator& it,
593  bool create );
594 
601  void
602  commit(
603  const TaskManager::ContentMap::iterator& it,
604  const osl::FileStatus& aFileStatus );
605 
612  static void
614  sal_Int32& n_Mask,
615  const css::uno::Sequence< css::beans::Property >& seq );
616 
617 
618  // Helper function for public copy
619 
620  osl::FileBase::RC
622  const OUString& srcUnqPath,
623  const OUString& dstUnqPath,
624  FileUrlType TypeToCopy,
625  bool testExistence );
626 
627 
628  // Helper function for mkfil,mkdir and write
629  // Creates whole path
630  // returns success of the operation
631  // The call determines the errorCode, which should be used to install
632  // any error
633 
634  bool
635  ensuredir( sal_Int32 CommandId,
636  const OUString& aDirectoryName,
637  sal_Int32 errorCode );
638 
639  // General
640  ContentMap m_aContent;
641 
642 
643  public:
644 
645  static const OUStringLiteral FolderContentType;
646  static const OUStringLiteral FileContentType;
647 
648 
649  private:
650 
651  PropertySet m_aDefaultProperties;
652  css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo;
653 
654  public:
655  // Miscellaneous:
656  // Methods for "writeComponentInfo" and "createComponentFactory"
657 
658  static void getScheme( OUString& Scheme );
659 
660  static OUString getImplementationName_static();
661 
662  static css::uno::Sequence< OUString > getSupportedServiceNames_static();
663  };
664 
665 } // end namespace TaskHandling
666 
667 #endif
668 
669 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void copyPersistentSet(const OUString &srcUnqPath, const OUString &dstUnqPath, bool withChildren)
Definition: filtask.cxx:2876
void installError(sal_Int32 nErrorCode, sal_Int32 nMinorCode)
Definition: filtask.hxx:124
css::uno::Reference< css::ucb::XPersistentPropertySet > xS
Definition: filtask.hxx:233
bool operator()(const MyProperty &rKey1, const MyProperty &rKey2) const
Definition: filtask.hxx:204
static void notifyInsert(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners, const OUString &aChildName)
Definition: filtask.cxx:2588
void retrieveError(sal_Int32 CommandId, sal_Int32 &ErrorCode, sal_Int32 &minorCode)
Definition: filtask.cxx:427
static void notifyContentRemoved(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners, const OUString &aChildName)
Definition: filtask.cxx:2606
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:387
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:2151
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xFileRegistry
Definition: filtask.hxx:500
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:2248
const css::uno::Type & getType() const
Definition: filinl.hxx:30
css::uno::Reference< css::beans::XPropertyContainer > xC
Definition: filtask.hxx:234
std::vector< std::unique_ptr< ContentEventNotifier > > getContentExchangedEventListeners(const OUString &aOldPrefix, const OUString &aNewPrefix, bool withChildren)
Definition: filtask.cxx:2659
void deassociate(const OUString &UnqPath, const OUString &PropertyName)
Definition: filtask.cxx:573
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler
Definition: filtask.hxx:93
void insertDefaultProperties(const OUString &aUnqPath)
Definition: filtask.cxx:1929
TaskManager(const css::uno::Reference< css::uno::XComponentContext > &rxContext, FileProvider *pProvider, bool bWithConfig)
Definition: filtask.cxx:139
const OUString & getPropertyName() const
Definition: filtask.hxx:190
css::uno::Reference< css::beans::XPropertyAccess > xA
Definition: filtask.hxx:235
std::unordered_map< OUString, UnqPathData > ContentMap
Definition: filtask.hxx:238
static OUString getImplementationName_static()
Definition: filtask.cxx:2946
css::uno::Reference< css::task::XInteractionHandler > const & getInteractionHandler()
Definition: filtask.hxx:142
void erasePersistentSetWithoutChildren(const OUString &aUnqPath)
Definition: filtask.cxx:2788
static void notifyPropertyAdded(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2637
static const OUStringLiteral FolderContentType
Definition: filtask.hxx:645
void installError(sal_Int32 CommandId, sal_Int32 ErrorCode, sal_Int32 minorCode=TASKHANDLER_NO_ERROR)
The error code may be one of the error codes defined in filerror.hxx.
Definition: filtask.cxx:441
const sal_Int32 & getHandle() const
Definition: filinl.hxx:26
static const OUStringLiteral FileContentType
Definition: filtask.hxx:646
FileProvider * m_pProvider
Definition: filtask.hxx:498
std::unordered_map< sal_Int32, TaskHandling > TaskMap
Definition: filtask.hxx:159
static void getScheme(OUString &Scheme)
Definition: filtask.cxx:2940
std::vector< std::unique_ptr< ContentEventNotifier > > getContentDeletedEventListeners(const OUString &aName)
Definition: filtask.cxx:2568
static void notifyContentDeleted(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners)
Definition: filtask.cxx:2597
static bool getUrlFromUnq(const OUString &Unq, OUString &Url)
Definition: filtask.cxx:1980
void erasePersistentSet(const OUString &aUnqPath, bool withChildren=false)
Definition: filtask.cxx:2808
std::vector< std::unique_ptr< PropertyChangeNotifier > > getPropertyChangeNotifier(const OUString &aName)
Definition: filtask.cxx:2752
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:1739
std::vector< std::unique_ptr< PropertySetInfoChangeNotifier > > getPropertySetListeners(const OUString &aName)
Definition: filtask.cxx:2617
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: filtask.hxx:499
MyProperty(const OUString &thePropertyName)
Definition: filtask.cxx:84
TaskHandling(const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.hxx:99
bool ensuredir(sal_Int32 CommandId, const OUString &aDirectoryName, sal_Int32 errorCode)
Definition: filtask.cxx:2064
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:1345
const sal_Int16 & getAttributes() const
Definition: filinl.hxx:42
static css::uno::Sequence< css::ucb::ContentInfo > queryCreatableContentsInfo()
Definition: filtask.cxx:2908
static css::uno::Sequence< OUString > getSupportedServiceNames_static()
Definition: filtask.cxx:2953
void copyPersistentSetWithoutChildren(const OUString &srcUnqPath, const OUString &dstUnqPath)
Definition: filtask.cxx:2846
css::beans::PropertyState State
Definition: filtask.hxx:176
void load(const TaskManager::ContentMap::iterator &it, bool create)
Load the properties from configuration, if create == true create them.
Definition: filtask.cxx:2194
static void notifyContentExchanged(const std::vector< std::unique_ptr< ContentEventNotifier >> &listeners_vec)
Definition: filtask.cxx:2741
ErrorCode
css::uno::Sequence< css::ucb::CommandInfo > m_sCommandInfo
Definition: filtask.hxx:652
sal_Int32 getCommandId()
Definition: filtask.cxx:453
osl::FileBase::RC copy_recursive(const OUString &srcUnqPath, const OUString &dstUnqPath, FileUrlType TypeToCopy, bool testExistence)
Definition: filtask.cxx:1993
void deregisterNotifier(const OUString &aUnqPath, Notifier *pNotifier)
Definition: filtask.cxx:507
static void notifyPropertyChanges(const std::vector< std::unique_ptr< PropertyChangeNotifier >> &listeners, const css::uno::Sequence< css::beans::PropertyChangeEvent > &seqChanged)
Definition: filtask.cxx:2772
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:747
const css::uno::Reference< css::ucb::XCommandEnvironment > & getCommandEnvironment()
Definition: filtask.hxx:151
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:809
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:715
static bool getUnqFromUrl(const OUString &Url, OUString &Unq)
Definition: filtask.cxx:1959
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:778
css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment
Definition: filtask.hxx:94
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:1137
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:626
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:842
static void notifyPropertyRemoved(const std::vector< std::unique_ptr< PropertySetInfoChangeNotifier >> &listeners, const OUString &aPropertyName)
Definition: filtask.cxx:2647
css::uno::Reference< css::beans::XPropertySetInfo > info_p(const OUString &aUnqPath)
Definition: filtask.cxx:824
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:1770
#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:1679
void registerNotifier(const OUString &aUnqPath, Notifier *pNotifier)
This two methods register and deregister a change listener for the content belonging to URL aUnqPath...
Definition: filtask.cxx:488
std::vector< std::unique_ptr< ContentEventNotifier > > getContentEventListeners(const OUString &aName)
Definition: filtask.cxx:2546
std::unordered_set< MyProperty, hMyProperty, eMyProperty > PropertySet
Definition: filtask.hxx:218
void startTask(sal_Int32 CommandId, const css::uno::Reference< css::ucb::XCommandEnvironment > &xCommandEnv)
Definition: filtask.cxx:372
std::vector< Notifier * > NotifierList
Definition: filtask.hxx:219
void clearError(sal_Int32)
Clears any error which are set on the commandid.
Definition: filtask.cxx:418
void handleTask(sal_Int32 CommandId, const css::uno::Reference< css::task::XInteractionRequest > &request)
Handles an interactionrequest.
Definition: filtask.cxx:460
void associate(const OUString &UnqPath, const OUString &PropertyName, const css::uno::Any &DefaultValue, const sal_Int16 Attributes)
Used to associate and deassociate a new property with the content belonging to URL UnqPath...
Definition: filtask.cxx:534
size_t operator()(const MyProperty &rName) const
Definition: filtask.hxx:212
PropertySet m_aDefaultProperties
Definition: filtask.hxx:651
const css::uno::Any & getValue() const
Definition: filinl.hxx:34