Bump version to 21.06.18.1
[LibreOffice.git] / sfx2 / source / inc / objshimp.hxx
blob21799f7cad49dd1a0e5d72e5838d65d47462ca21
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 <bitset.hxx>
30 #include <vcl/timer.hxx>
32 #include "appbaslib.hxx"
34 namespace svtools { class AsynchronLink; }
36 class SfxViewFrame;
38 class SfxBasicManagerHolder;
40 class AutoReloadTimer_Impl : public Timer
42 OUString aUrl;
43 SfxObjectShell* pObjSh;
45 public:
46 AutoReloadTimer_Impl( const OUString& rURL, sal_uInt32 nTime,
47 SfxObjectShell* pSh );
48 virtual void Invoke() override;
51 struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
53 std::unique_ptr<::comphelper::EmbeddedObjectContainer> mxObjectContainer;
54 SfxBasicManagerHolder aBasicManager;
55 SfxObjectShell& rDocShell;
56 css::uno::Reference< css::script::XLibraryContainer >
57 xBasicLibraries;
58 css::uno::Reference< css::script::XLibraryContainer >
59 xDialogLibraries;
60 ::sfx2::DocumentMacroMode
61 aMacroMode;
62 SfxProgress* pProgress;
63 OUString aTitle;
64 OUString aTempName;
65 DateTime nTime;
66 sal_uInt16 nVisualDocumentNumber;
67 SignatureState nDocumentSignatureState;
68 SignatureState nScriptingSignatureState;
69 bool bClosing:1, // sal_True while Close(), to prevent recurrences Notification
70 bIsSaving:1,
71 bIsNamedVisible:1,
72 bIsAbortingImport:1, // Import operation should be canceled.
73 bInPrepareClose : 1,
74 bPreparedForClose : 1,
75 bForbidReload : 1,
76 bBasicInitialized :1,
77 bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable!
78 bOwnsStorage:1,
79 bInitialized:1,
80 bModelInitialized:1, // whether the related model is initialized
81 bPreserveVersions:1,
82 m_bMacroSignBroken:1, // whether the macro signature was explicitly broken
83 m_bNoBasicCapabilities:1,
84 m_bDocRecoverySupport:1,
85 bQueryLoadTemplate:1,
86 bLoadReadonly:1,
87 bUseUserData:1,
88 bUseThumbnailSave:1,
89 bSaveVersionOnClose:1,
90 m_bSharedXMLFlag:1, // whether the document should be edited in shared mode
91 m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file
92 m_bConfigOptionsChecked:1, // whether or not the user options are checked after the Options dialog is closed.
93 m_bMacroCallsSeenWhileLoading:1; // whether or not the user options are checked after the Options dialog is closed.
95 IndexBitSet aBitSet;
96 ErrCode lErr;
97 SfxEventHintId nEventId; // If Open/Create as to be sent
98 // before Activate
99 std::unique_ptr<AutoReloadTimer_Impl> pReloadTimer;
100 SfxLoadedFlags nLoadedFlags;
101 SfxLoadedFlags nFlagsInProgress;
102 bool bModalMode;
103 bool bRunningMacro;
104 bool bReadOnlyUI;
105 tools::SvRef<SvRefBase> xHeaderAttributes;
106 ::rtl::Reference< SfxBaseModel >
107 pBaseModel;
108 sal_uInt16 nStyleFilter;
110 bool m_bEnableSetModified;
111 bool m_bIsModified;
113 tools::Rectangle m_aVisArea;
114 MapUnit m_nMapUnit;
116 bool m_bCreateTempStor;
117 css::uno::Reference< css::embed::XStorage > m_xDocStorage;
119 bool m_bIsInit;
121 OUString m_aSharedFileURL;
123 bool m_bIncomplEncrWarnShown;
125 // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
126 sal_uInt32 m_nModifyPasswordHash;
127 css::uno::Sequence< css::beans::PropertyValue > m_aModifyPasswordInfo;
128 bool m_bModifyPasswordEntered;
129 /// If true, then this is not a real save, just the signatures change.
130 bool m_bSavingForSigning;
131 bool m_bAllowModifiedBackAfterSigning;
133 /// Holds Infobars until View is fully loaded
134 std::vector<InfobarData> m_aPendingInfobars;
136 SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
137 virtual ~SfxObjectShell_Impl();
139 // IMacroDocumentAccess overridables
140 virtual sal_Int16 getCurrentMacroExecMode() const override;
141 virtual void setCurrentMacroExecMode( sal_uInt16 nMacroMode ) override;
142 virtual OUString getDocumentLocation() const override;
143 virtual bool documentStorageHasMacros() const override;
144 virtual bool macroCallsSeenWhileLoading() const override;
145 virtual css::uno::Reference< css::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const override;
146 virtual SignatureState getScriptingSignatureState() override;
148 virtual bool hasTrustedScriptingSignature( bool bAllowUIToAddAuthor ) override;
151 #endif
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */