LibreOffice Module ucb (master)  1
filnot.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_FILNOT_HXX
20 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILNOT_HXX
21 
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <com/sun/star/uno/XInterface.hpp>
24 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
25 #include <com/sun/star/ucb/XContentIdentifier.hpp>
26 #include <com/sun/star/ucb/XContent.hpp>
27 #include <memory>
28 #include <unordered_map>
29 #include <vector>
30 
31 namespace fileaccess {
32 
33  class TaskManager;
34 
36  {
37  private:
39  css::uno::Reference< css::ucb::XContent > m_xCreatorContent;
40  css::uno::Reference< css::ucb::XContentIdentifier > m_xCreatorId;
41  css::uno::Reference< css::ucb::XContentIdentifier > m_xOldId;
42  std::vector< css::uno::Reference< css::uno::XInterface > > m_sListeners;
43  public:
44 
46  TaskManager* pMyShell,
47  const css::uno::Reference< css::ucb::XContent >& xCreatorContent,
48  const css::uno::Reference< css::ucb::XContentIdentifier >& xCreatorId,
49  const std::vector< css::uno::Reference< css::uno::XInterface > >& sListeners );
50 
52  TaskManager* pMyShell,
53  const css::uno::Reference< css::ucb::XContent >& xCreatorContent,
54  const css::uno::Reference< css::ucb::XContentIdentifier >& xCreatorId,
55  const css::uno::Reference< css::ucb::XContentIdentifier >& xOldId,
56  const std::vector< css::uno::Reference< css::uno::XInterface > >& sListeners );
57 
58  void notifyChildInserted( const OUString& aChildName );
59  void notifyDeleted();
60  void notifyRemoved( const OUString& aChildName );
61  void notifyExchanged( );
62  };
63 
64 
66  {
67  private:
68  css::uno::Reference< css::ucb::XContent > m_xCreatorContent;
69  std::vector< css::uno::Reference< css::uno::XInterface > > m_sListeners;
70  public:
72  const css::uno::Reference< css::ucb::XContent >& xCreatorContent,
73  const std::vector< css::uno::Reference< css::uno::XInterface > >& sListeners );
74 
75  void notifyPropertyAdded( const OUString & aPropertyName );
76  void notifyPropertyRemoved( const OUString & aPropertyName );
77  };
78 
79 
80  typedef std::unordered_map< OUString,
81  css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > > ListenerMap;
82 
84  {
85  private:
86  css::uno::Reference< css::ucb::XContent > m_xCreatorContent;
87  std::unique_ptr<ListenerMap> m_pListeners;
88  public:
90  const css::uno::Reference< css::ucb::XContent >& xCreatorContent,
91  std::unique_ptr<ListenerMap> pListeners );
92 
94 
96  const css::uno::Sequence< css::beans::PropertyChangeEvent >& seqChanged );
97  };
98 
99 
100  class Notifier
101  {
102  public:
103  // Side effect of this function is the change of the name
104  virtual std::unique_ptr<ContentEventNotifier> cEXC( const OUString& aNewName ) = 0;
105  // Side effect is the change of the state of the object to "deleted".
106  virtual std::unique_ptr<ContentEventNotifier> cDEL() = 0;
107  virtual std::unique_ptr<ContentEventNotifier> cCEL() = 0;
108  virtual std::unique_ptr<PropertySetInfoChangeNotifier> cPSL() = 0;
109  virtual std::unique_ptr<PropertyChangeNotifier> cPCL() = 0;
110 
111  protected:
113  };
114 
115 
116 } // end namespace fileaccess
117 
118 #endif
119 
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void notifyPropertyChanged(const css::uno::Sequence< css::beans::PropertyChangeEvent > &seqChanged)
Definition: filnot.cxx:211
void notifyPropertyRemoved(const OUString &aPropertyName)
Definition: filnot.cxx:174
ContentEventNotifier(TaskManager *pMyShell, const css::uno::Reference< css::ucb::XContent > &xCreatorContent, const css::uno::Reference< css::ucb::XContentIdentifier > &xCreatorId, const std::vector< css::uno::Reference< css::uno::XInterface > > &sListeners)
virtual std::unique_ptr< PropertySetInfoChangeNotifier > cPSL()=0
void notifyPropertyAdded(const OUString &aPropertyName)
Definition: filnot.cxx:157
std::unordered_map< OUString, css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > > ListenerMap
Definition: filnot.hxx:81
virtual std::unique_ptr< PropertyChangeNotifier > cPCL()=0
PropertyChangeNotifier(const css::uno::Reference< css::ucb::XContent > &xCreatorContent, std::unique_ptr< ListenerMap > pListeners)
css::uno::Reference< css::ucb::XContent > m_xCreatorContent
Definition: filnot.hxx:86
css::uno::Reference< css::ucb::XContentIdentifier > m_xCreatorId
Definition: filnot.hxx:40
virtual std::unique_ptr< ContentEventNotifier > cCEL()=0
css::uno::Reference< css::ucb::XContentIdentifier > m_xOldId
Definition: filnot.hxx:41
virtual std::unique_ptr< ContentEventNotifier > cDEL()=0
void notifyChildInserted(const OUString &aChildName)
Definition: filnot.cxx:59
virtual std::unique_ptr< ContentEventNotifier > cEXC(const OUString &aNewName)=0
std::unique_ptr< ListenerMap > m_pListeners
Definition: filnot.hxx:87
PropertySetInfoChangeNotifier(const css::uno::Reference< css::ucb::XContent > &xCreatorContent, const std::vector< css::uno::Reference< css::uno::XInterface > > &sListeners)
Definition: filnot.cxx:146
css::uno::Reference< css::ucb::XContent > m_xCreatorContent
Definition: filnot.hxx:68
std::vector< css::uno::Reference< css::uno::XInterface > > m_sListeners
Definition: filnot.hxx:42
std::vector< css::uno::Reference< css::uno::XInterface > > m_sListeners
Definition: filnot.hxx:69
void notifyRemoved(const OUString &aChildName)
Definition: filnot.cxx:97
css::uno::Reference< css::ucb::XContent > m_xCreatorContent
Definition: filnot.hxx:39