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_SVTOOLS_STYLEPOOL_HXX
20 #define INCLUDED_SVTOOLS_STYLEPOOL_HXX
22 #include <boost/shared_ptr.hpp>
23 #include <rtl/ustring.hxx>
24 #include <svl/itemset.hxx>
27 class IStylePoolIteratorAccess
;
29 class SVL_DLLPUBLIC StylePool
34 typedef boost::shared_ptr
<SfxItemSet
> SfxItemSet_Pointer_t
;
36 explicit StylePool( SfxItemSet
* pIgnorableItems
= 0 );
38 /** Insert a SfxItemSet into the style pool.
40 The pool makes a copy of the provided SfxItemSet.
43 the SfxItemSet to insert
45 @return a shared pointer to the SfxItemSet
47 virtual SfxItemSet_Pointer_t
insertItemSet( const SfxItemSet
& rSet
);
49 /** Create an iterator
51 The iterator walks through the StylePool
52 OD 2008-03-07 #i86923#
53 introduce optional parameter to control, if unused SfxItemsSet are skipped or not
54 introduce optional parameter to control, if ignorable items are skipped or not
56 @attention every change, e.g. destruction, of the StylePool could cause undefined effects.
58 @param bSkipUnusedItemSets
59 input parameter - boolean, indicating if unused SfxItemSets are skipped or not
61 @param bSkipIgnorableItems
62 input parameter - boolean, indicating if ignorable items are skipped or not
64 @postcond the iterator "points before the first" SfxItemSet of the pool.
65 The first StylePoolIterator::getNext() call will deliver the first SfxItemSet.
67 virtual IStylePoolIteratorAccess
* createIterator( const bool bSkipUnusedItemSets
= false,
68 const bool bSkipIgnorableItems
= false );
70 /** Returns the number of styles
72 virtual sal_Int32
getCount() const;
76 static OUString
nameOf( SfxItemSet_Pointer_t pSet
);
79 class SVL_DLLPUBLIC IStylePoolIteratorAccess
82 /** Delivers a shared pointer to the next SfxItemSet of the pool
83 If there is no more SfxItemSet, the delivered share_pointer is empty.
85 virtual StylePool::SfxItemSet_Pointer_t
getNext() = 0;
86 virtual OUString
getName() = 0;
87 virtual ~IStylePoolIteratorAccess() {};
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */