Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sfx2 / source / inc / objshimp.hxx
blob1bece81ce1c0d2ea08a7d9eb9032b88fd93fda40
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 .
19 #ifndef INCLUDED_SFX2_SOURCE_INC_OBJSHIMP_HXX
20 #define INCLUDED_SFX2_SOURCE_INC_OBJSHIMP_HXX
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <rtl/ustring.hxx>
24 #include <rtl/ref.hxx>
25 #include <tools/datetime.hxx>
27 #include <sfx2/objsh.hxx>
28 #include <sfx2/docmacromode.hxx>
29 #include <sfx2/namedcolor.hxx>
30 #include <bitset.hxx>
31 #include <vcl/timer.hxx>
33 #include "appbaslib.hxx"
35 namespace svtools { class AsynchronLink; }
37 class SfxViewFrame;
39 class SfxBasicManagerHolder;
41 class AutoReloadTimer_Impl final : public Timer
43 OUString aUrl;
44 SfxObjectShell* pObjSh;
46 public:
47 AutoReloadTimer_Impl( OUString aURL, sal_uInt32 nTime,
48 SfxObjectShell* pSh );
49 virtual void Invoke() override;
52 struct SfxObjectShell_Impl final : public ::sfx2::IMacroDocumentAccess
54 std::unique_ptr<::comphelper::EmbeddedObjectContainer> mxObjectContainer;
55 SfxBasicManagerHolder aBasicManager;
56 SfxObjectShell& rDocShell;
57 css::uno::Reference< css::script::XLibraryContainer >
58 xBasicLibraries;
59 css::uno::Reference< css::script::XLibraryContainer >
60 xDialogLibraries;
61 ::sfx2::DocumentMacroMode
62 aMacroMode;
63 SfxProgress* pProgress;
64 OUString aTitle;
65 OUString aTempName;
66 DateTime nTime;
67 sal_uInt16 nVisualDocumentNumber;
68 SignatureState nDocumentSignatureState;
69 SignatureState nScriptingSignatureState;
70 bool bClosing:1, // sal_True while Close(), to prevent recurrences Notification
71 bIsSaving:1,
72 bIsNamedVisible:1,
73 bIsAbortingImport:1, // Import operation should be canceled.
74 bInPrepareClose : 1,
75 bPreparedForClose : 1,
76 bForbidReload : 1,
77 bBasicInitialized :1,
78 bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable!
79 bOwnsStorage:1,
80 bInitialized:1,
81 bModelInitialized:1, // whether the related model is initialized
82 bPreserveVersions:1,
83 m_bMacroSignBroken:1, // whether the macro signature was explicitly broken
84 m_bNoBasicCapabilities:1,
85 m_bDocRecoverySupport:1,
86 bQueryLoadTemplate:1,
87 bLoadReadonly:1,
88 bUseUserData:1,
89 bUseThumbnailSave:1,
90 bSaveVersionOnClose:1,
91 m_bSharedXMLFlag:1, // whether the document should be edited in shared mode
92 m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file
93 m_bConfigOptionsChecked:1, // whether or not the user options are checked after the Options dialog is closed.
94 m_bMacroCallsSeenWhileLoading:1; // whether or not the user options are checked after the Options dialog is closed.
96 IndexBitSet aBitSet;
97 ErrCode lErr;
98 SfxEventHintId nEventId; // If Open/Create as to be sent
99 // before Activate
100 std::unique_ptr<AutoReloadTimer_Impl> pReloadTimer;
101 SfxLoadedFlags nLoadedFlags;
102 SfxLoadedFlags nFlagsInProgress;
103 bool bModalMode;
104 bool bRunningMacro;
105 bool bReadOnlyUI;
106 tools::SvRef<SvRefBase> xHeaderAttributes;
107 ::rtl::Reference< SfxBaseModel >
108 pBaseModel;
109 sal_uInt16 nStyleFilter;
111 bool m_bEnableSetModified;
112 bool m_bIsModified;
114 tools::Rectangle m_aVisArea;
115 MapUnit m_nMapUnit;
117 bool m_bCreateTempStor;
118 css::uno::Reference< css::embed::XStorage > m_xDocStorage;
120 bool m_bIsInit;
122 OUString m_aSharedFileURL;
124 bool m_bIncomplEncrWarnShown;
126 // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
127 sal_uInt32 m_nModifyPasswordHash;
128 css::uno::Sequence< css::beans::PropertyValue > m_aModifyPasswordInfo;
129 bool m_bModifyPasswordEntered;
130 /// If true, then this is not a real save, just the signatures change.
131 bool m_bSavingForSigning;
132 bool m_bAllowModifiedBackAfterSigning;
134 /// Holds Infobars until View is fully loaded
135 std::vector<InfobarData> m_aPendingInfobars;
137 // Recent colors used by toolbar buttons
138 std::unordered_map<sal_uInt16, NamedColor> m_aRecentColors;
140 SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
141 virtual ~SfxObjectShell_Impl();
143 // IMacroDocumentAccess overridables
144 virtual sal_Int16 getCurrentMacroExecMode() const override;
145 virtual void setCurrentMacroExecMode( sal_uInt16 nMacroMode ) override;
146 virtual OUString getDocumentLocation() const override;
147 virtual bool documentStorageHasMacros() const override;
148 virtual bool macroCallsSeenWhileLoading() const override;
149 virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override;
150 virtual SignatureState getScriptingSignatureState() override;
152 virtual bool hasTrustedScriptingSignature( bool bAllowUIToAddAuthor ) override;
155 #endif
157 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */