Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / fmmodel.hxx
blob4cbe427411ef91c6fe66d3766baf28a7009446c1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_SVX_FMMODEL_HXX
21 #define INCLUDED_SVX_FMMODEL_HXX
23 #include <svx/svdmodel.hxx>
24 #include <svx/svxdllapi.h>
25 #include <memory>
27 class SfxObjectShell;
28 class SfxItemPool;
29 class FmXUndoEnvironment;
30 class SfxObjectShell;
31 class SbxObject;
32 class SbxArray;
33 class SbxValue;
35 struct FmFormModelImplData;
36 class SVX_DLLPUBLIC FmFormModel :
37 public SdrModel
39 private:
40 std::unique_ptr<FmFormModelImplData> m_pImpl;
41 SfxObjectShell* m_pObjShell;
43 bool m_bOpenInDesignMode : 1;
44 bool m_bAutoControlFocus : 1;
46 FmFormModel( const FmFormModel& ) = delete;
47 void operator=(const FmFormModel& rSrcModel) = delete;
49 public:
51 FmFormModel(SfxItemPool* pPool=nullptr, SfxObjectShell* pPers=nullptr );
52 FmFormModel(const OUString& rPath, SfxItemPool* pPool=nullptr,
53 SfxObjectShell* pPers=nullptr );
54 FmFormModel(const OUString& rPath, SfxItemPool* pPool, SfxObjectShell* pPers,
55 bool bUseExtColorTable);
57 virtual ~FmFormModel() override;
59 virtual SdrPage* AllocPage(bool bMasterPage) override;
60 virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override;
61 virtual SdrPage* RemovePage(sal_uInt16 nPgNum) override;
62 virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos) override;
63 virtual void InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos=0xFFFF) override;
64 virtual SdrPage* RemoveMasterPage(sal_uInt16 nPgNum) override;
66 SfxObjectShell* GetObjectShell() const { return m_pObjShell; }
67 void SetObjectShell( SfxObjectShell* pShell );
69 bool GetOpenInDesignMode() const { return m_bOpenInDesignMode; }
70 void SetOpenInDesignMode( bool _bOpenDesignMode );
72 bool GetAutoControlFocus() const { return m_bAutoControlFocus; }
73 void SetAutoControlFocus( bool _bAutoControlFocus );
75 /** check whether the OpenInDesignMode has been set explicitly or been loaded (<FALSE/>)
76 or if it still has the default value from construction (<TRUE/>)
78 bool OpenInDesignModeIsDefaulted();
80 /** determines whether form controls should use the SdrModel's reference device for text rendering
82 bool ControlsUseRefDevice() const;
84 FmXUndoEnvironment& GetUndoEnv();
86 private:
87 void implSetOpenInDesignMode( bool _bOpenDesignMode );
90 #endif // _FM_FMMODEL_HXX
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */