fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / framework / source / inc / accelerators / storageholder.hxx
blobfcef47674374fac8500a9c589c8beb7a3eaebf9f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX
21 #define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX
23 #include <accelerators/istoragelistener.hxx>
24 #include <general.h>
25 #include <stdtypes.h>
27 #include <com/sun/star/embed/XStorage.hpp>
29 namespace framework
32 /**
33 TODO document me
35 class StorageHolder
38 // types
39 public:
41 /** @short TODO */
42 typedef ::std::vector< css::uno::Reference< css::embed::XStorage > > TStorageList;
44 typedef ::std::vector< IStorageListener* > TStorageListenerList;
46 struct TStorageInfo
48 public:
49 css::uno::Reference< css::embed::XStorage > Storage;
50 sal_Int32 UseCount;
51 TStorageListenerList Listener;
53 TStorageInfo()
54 : UseCount(0)
58 /** @short TODO */
59 typedef std::unordered_map< OUString ,
60 TStorageInfo ,
61 OUStringHash ,
62 std::equal_to< OUString > > TPath2StorageInfo;
64 // member
65 private:
66 mutable osl::Mutex m_mutex;
68 /** @short TODO */
69 css::uno::Reference< css::embed::XStorage > m_xRoot;
71 /** @short TODO */
72 TPath2StorageInfo m_lStorages;
74 // interface
75 public:
77 /** @short TODO
79 StorageHolder();
81 /** @short TODO
83 virtual ~StorageHolder();
85 /** @short TODO
87 void forgetCachedStorages();
89 /** @short TODO
91 void setRootStorage(const css::uno::Reference< css::embed::XStorage >& xRoot);
93 /** @short TODO
95 css::uno::Reference< css::embed::XStorage > getRootStorage() const;
97 /** @short TODO
98 open or get!
100 css::uno::Reference< css::embed::XStorage > openPath(const OUString& sPath ,
101 sal_Int32 nOpenMode);
103 /** @short TODO
105 StorageHolder::TStorageList getAllPathStorages(const OUString& sPath);
107 /** @short TODO
109 void commitPath(const OUString& sPath);
111 /** @short TODO
113 void closePath(const OUString& sPath);
115 /** @short TODO
117 void notifyPath(const OUString& sPath);
119 /** @short TODO
121 void addStorageListener( IStorageListener* pListener,
122 const OUString& sPath );
124 /** @short TODO
126 void removeStorageListener( IStorageListener* pListener,
127 const OUString& sPath );
129 /** @short TODO
131 OUString getPathOfStorage(const css::uno::Reference< css::embed::XStorage >& xStorage);
133 /** @short TODO
135 css::uno::Reference< css::embed::XStorage > getParentStorage(const css::uno::Reference< css::embed::XStorage >& xChild);
137 /** @short TODO
139 css::uno::Reference< css::embed::XStorage > getParentStorage(const OUString& sChildPath);
141 /** @short TODO
143 void operator=(const StorageHolder& rCopy);
145 /** @short opens a sub element of the specified base storage.
147 @descr First this method try to open the requested sub element
148 using the given open mode. If it failed there is second step,
149 which tries to do the same again ... but removing a might existing
150 WRITE flag from the open mode. The user can suppress this fallback
151 handling by setting the parameter bAllowFallback to sal_False.
153 @param xBaseStorage
154 the storage, where the sub element should be searched.
156 @param sSubElement
157 the full name of the sub element.
158 e.g. "default.xml"
160 @param eOpenMode
161 a flag field, which set the open mode for this operation.
163 @param bAllowFallback
164 if eOpenMode contains an ELEMENT_WRITE flag this parameter
165 allow to remove it and try it with the rest of eOpenMode flags
166 again.
168 static css::uno::Reference< css::embed::XStorage > openSubStorageWithFallback(const css::uno::Reference< css::embed::XStorage >& xBaseStorage ,
169 const OUString& sSubStorage ,
170 sal_Int32 eOpenMode ,
171 bool bAllowFallback);
173 static css::uno::Reference< css::io::XStream > openSubStreamWithFallback(const css::uno::Reference< css::embed::XStorage >& xBaseStorage ,
174 const OUString& sSubStream ,
175 sal_Int32 eOpenMode ,
176 bool bAllowFallback);
178 // helper
179 private:
181 /** @short TODO
183 static OUString impl_st_normPath(const OUString& sPath);
185 /** @short TODO
187 static OUStringList impl_st_parsePath(const OUString& sPath);
190 } // namespace framework
192 #endif // INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */