xref: /AOO41X/main/svx/inc/svx/fmmodel.hxx (revision 3ce09a58b0d6873449cda31e55c66dba2dbc8f7f)
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 _SVX_FMMODEL_HXX
25 #define _SVX_FMMODEL_HXX
26 
27 #include <svx/svdmodel.hxx>
28 #include "svx/svxdllapi.h"
29 
30 class SfxObjectShell;
31 class SfxItemPool;
32 class VCItemPool;
33 class FmXUndoEnvironment;
34 class SfxObjectShell;
35 class SbxObject;
36 class SbxArray;
37 class SbxValue;
38 
39 struct FmFormModelImplData;
40 class SVX_DLLPUBLIC FmFormModel :
41     public SdrModel
42 {
43 private:
44     FmFormModelImplData*    m_pImpl;
45     SfxObjectShell*         m_pObjShell;
46 
47     sal_Bool            m_bOpenInDesignMode : 1;
48     sal_Bool            m_bAutoControlFocus : 1;
49 
50     SVX_DLLPRIVATE FmFormModel( const FmFormModel& );   // never implemented
51     SVX_DLLPRIVATE void operator=(const FmFormModel& rSrcModel);   // never implemented
52 
53 public:
54     TYPEINFO();
55 
56     FmFormModel(SfxItemPool* pPool=NULL, SfxObjectShell* pPers=NULL );
57     FmFormModel(const XubString& rPath, SfxItemPool* pPool=NULL, SfxObjectShell* pPers=NULL );
58     virtual ~FmFormModel();
59 
60     virtual SdrPage* AllocPage(FASTBOOL bMasterPage);
61     virtual void     InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
62     virtual SdrPage* RemovePage(sal_uInt16 nPgNum);
63     virtual void     MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos);
64     virtual void     InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF);
65     virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum);
66 
67     virtual SdrLayerID      GetControlExportLayerId( const SdrObject& rObj ) const;
GetObjectShell() const68     SfxObjectShell*         GetObjectShell() const { return m_pObjShell; }
69     void                    SetObjectShell( SfxObjectShell* pShell );
70 
GetOpenInDesignMode() const71     sal_Bool GetOpenInDesignMode() const { return m_bOpenInDesignMode; }
72     void SetOpenInDesignMode( sal_Bool _bOpenDesignMode );
73 
GetAutoControlFocus() const74     sal_Bool    GetAutoControlFocus() const { return m_bAutoControlFocus; }
75     void        SetAutoControlFocus( sal_Bool _bAutoControlFocus );
76 
77     /** check whether the OpenInDesignMode has been set explicitly or been loaded (<FALSE/>)
78         or if it still has the default value from construction (<TRUE/>)
79     */
80     sal_Bool    OpenInDesignModeIsDefaulted();
81 
82     /** determines whether form controls should use the SdrModel's reference device for text rendering
83     */
84     sal_Bool    ControlsUseRefDevice() const;
85 
86     FmXUndoEnvironment& GetUndoEnv();
87 
88 private:
89     void        implSetOpenInDesignMode( sal_Bool _bOpenDesignMode, sal_Bool _bForce );
90 };
91 
92 #endif          // _FM_FMMODEL_HXX
93 
94