xref: /AOO41X/main/sc/source/core/inc/poolhelp.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
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_POOLHELP_HXX
25 #define SC_POOLHELP_HXX
26 
27 #include <rtl/ref.hxx>
28 #include <vos/refernce.hxx>
29 #include <tools/link.hxx>
30 #include "docoptio.hxx"
31 
32 class ScDocument;
33 class ScDocumentPool;
34 class ScStyleSheetPool;
35 class SvNumberFormatter;
36 class SfxItemPool;
37 
38 
39 class ScPoolHelper : public vos::OReference
40 {
41 private:
42     ScDocOptions        aOpt;
43     ScDocumentPool*     pDocPool;
44     rtl::Reference< ScStyleSheetPool > mxStylePool;
45     mutable SvNumberFormatter*  pFormTable;
46     mutable SfxItemPool*        pEditPool;                      // EditTextObjectPool
47     mutable SfxItemPool*        pEnginePool;                    // EditEnginePool
48     ScDocument*         m_pSourceDoc;
49 
50     void                UseDocOptions() const;
51 
52 public:
53                 ScPoolHelper( ScDocument* pSourceDoc );
54     virtual     ~ScPoolHelper();
55 
56                 // called in dtor of main document
57     void        SourceDocumentGone();
58 
59                 // access to pointers (are never 0):
GetDocPool() const60     ScDocumentPool*     GetDocPool() const      { return pDocPool; }
GetStylePool() const61     ScStyleSheetPool*   GetStylePool() const    { return mxStylePool.get(); }
62     SvNumberFormatter*  GetFormTable() const;
63     SfxItemPool*        GetEditPool() const;
64     SfxItemPool*        GetEnginePool() const;
65 
66     void                SetFormTableOpt(const ScDocOptions& rOpt);
67 };
68 
69 #endif
70 
71