update dev300-m58
[ooovba.git] / svtools / inc / stylepool.hxx
blobf0035571b9b4fa5693b7cdf2f041af36d4e5e2e9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: stylepool.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef INCLUDED_SVTOOLS_STYLEPOOL_HXX
31 #define INCLUDED_SVTOOLS_STYLEPOOL_HXX
33 #include <boost/shared_ptr.hpp>
34 #include <rtl/ustring.hxx>
35 #include <svtools/itemset.hxx>
37 class StylePoolImpl;
38 class StylePoolIterImpl;
39 class IStylePoolIteratorAccess;
41 class SVL_DLLPUBLIC StylePool
43 private:
44 StylePoolImpl *pImpl;
45 public:
46 typedef boost::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
48 // --> OD 2008-03-07 #i86923#
49 explicit StylePool( SfxItemSet* pIgnorableItems = 0 );
50 // <--
52 /** Insert a SfxItemSet into the style pool.
54 The pool makes a copy of the provided SfxItemSet.
56 @param SfxItemSet
57 the SfxItemSet to insert
59 @return a shared pointer to the SfxItemSet
61 virtual SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet );
63 /** Create an iterator
65 The iterator walks through the StylePool
66 OD 2008-03-07 #i86923#
67 introduce optional parameter to control, if unused SfxItemsSet are skipped or not
68 introduce optional parameter to control, if ignorable items are skipped or not
70 @attention every change, e.g. destruction, of the StylePool could cause undefined effects.
72 @param bSkipUnusedItemSets
73 input parameter - boolean, indicating if unused SfxItemSets are skipped or not
75 @param bSkipIgnorableItems
76 input parameter - boolean, indicating if ignorable items are skipped or not
78 @postcond the iterator "points before the first" SfxItemSet of the pool.
79 The first StylePoolIterator::getNext() call will deliver the first SfxItemSet.
81 virtual IStylePoolIteratorAccess* createIterator( const bool bSkipUnusedItemSets = false,
82 const bool bSkipIgnorableItems = false );
84 /** Returns the number of styles
86 virtual sal_Int32 getCount() const;
88 virtual ~StylePool();
90 static ::rtl::OUString nameOf( SfxItemSet_Pointer_t pSet );
93 class SVL_DLLPUBLIC IStylePoolIteratorAccess
95 public:
96 /** Delivers a shared pointer to the next SfxItemSet of the pool
97 If there is no more SfxItemSet, the delivered share_pointer is empty.
99 virtual StylePool::SfxItemSet_Pointer_t getNext() = 0;
100 virtual ::rtl::OUString getName() = 0;
101 virtual ~IStylePoolIteratorAccess() {};
103 #endif