xref: /aoo42x/main/sc/inc/stlpool.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_STLPOOL_HXX
25 #define SC_STLPOOL_HXX
26 
27 #include <svl/style.hxx>
28 
29 
30 class ScStyleSheet;
31 class ScDocument;
32 
33 class ScStyleSheetPool : public SfxStyleSheetPool
34 {
35 public:
36 						ScStyleSheetPool( SfxItemPool&	rPool,
37 										  ScDocument*	pDocument );
38 
39 	void				SetDocument( ScDocument* pDocument );
GetDocument() const40 	ScDocument*			GetDocument() const { return pDoc; }
41 
42 	virtual void		Remove( SfxStyleSheetBase* pStyle );
43 
SetActualStyleSheet(SfxStyleSheetBase * pActStyleSheet)44 	void				SetActualStyleSheet ( SfxStyleSheetBase* pActStyleSheet )
45 								{ pActualStyleSheet = pActStyleSheet; }
46 
GetActualStyleSheet()47 	SfxStyleSheetBase*	GetActualStyleSheet ()
48 								{ return pActualStyleSheet; }
49 
50 	void				CreateStandardStyles();
51 	void				CopyStdStylesFrom( ScStyleSheetPool* pSrcPool );
52 //UNUSED2008-05  void				UpdateStdNames();
53 
54 	void				CopyStyleFrom( ScStyleSheetPool* pSrcPool,
55 										const String& rName, SfxStyleFamily eFamily );
56 
57 	ScStyleSheet*		FindCaseIns( const String& rName, SfxStyleFamily eFam );
58 
59 //UNUSED2009-05 void				SetForceStdName( const String* pSet );
GetForceStdName() const60 	const String*		GetForceStdName() const	{ return pForceStdName; }
61 
62 	virtual SfxStyleSheetBase& Make( const String&, SfxStyleFamily eFam,
63 									 sal_uInt16 nMask = 0xffff, sal_uInt16 nPos = 0xffff );
64 
65 protected:
66 	virtual 			~ScStyleSheetPool();
67 
68     using SfxStyleSheetPool::Create;    // calcwarnings: Create(const SfxStyleSheet&) - ever used?
69 
70 	virtual SfxStyleSheetBase* Create( const String&	rName,
71 									   SfxStyleFamily	eFamily,
72 									   sal_uInt16			nMask);
73 	virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& rStyle );
74 
75 private:
76 	SfxStyleSheetBase*	pActualStyleSheet;
77 	ScDocument*			pDoc;
78 	const String*		pForceStdName;
79 };
80 
81 #endif	   // SC_STLPOOL_HXX
82 
83