1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_SVL_STYLEPOOL_HXX
20 #define INCLUDED_SVL_STYLEPOOL_HXX
23 #include <rtl/ustring.hxx>
24 #include <svl/itemset.hxx>
27 class IStylePoolIteratorAccess
;
29 class SVL_DLLPUBLIC StylePool final
32 std::unique_ptr
<StylePoolImpl
> pImpl
;
34 explicit StylePool( SfxItemSet
* pIgnorableItems
= nullptr );
36 /** Insert a SfxItemSet into the style pool.
38 The pool makes a copy of the provided SfxItemSet.
41 the SfxItemSet to insert
43 @return a shared pointer to the SfxItemSet
45 std::shared_ptr
<SfxItemSet
> insertItemSet( const SfxItemSet
& rSet
);
47 /** Create an iterator
49 The iterator walks through the StylePool
50 OD 2008-03-07 #i86923#
51 introduce optional parameter to control, if unused SfxItemsSet are skipped or not
52 introduce optional parameter to control, if ignorable items are skipped or not
54 @attention every change, e.g. destruction, of the StylePool could cause undefined effects.
56 @param bSkipUnusedItemSets
57 input parameter - boolean, indicating if unused SfxItemSets are skipped or not
59 @param bSkipIgnorableItems
60 input parameter - boolean, indicating if ignorable items are skipped or not
62 @postcond the iterator "points before the first" SfxItemSet of the pool.
63 The first StylePoolIterator::getNext() call will deliver the first SfxItemSet.
65 IStylePoolIteratorAccess
* createIterator( const bool bSkipUnusedItemSets
= false,
66 const bool bSkipIgnorableItems
= false );
70 static OUString
nameOf( const std::shared_ptr
<SfxItemSet
>& pSet
);
73 class SVL_DLLPUBLIC IStylePoolIteratorAccess
76 /** Delivers a shared pointer to the next SfxItemSet of the pool
77 If there is no more SfxItemSet, the delivered share_pointer is empty.
79 virtual std::shared_ptr
<SfxItemSet
> getNext() = 0;
80 virtual ~IStylePoolIteratorAccess() {};
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */