1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
30 #include <vcl/timer.hxx>
32 #include "appbaslib.hxx"
34 namespace svtools
{ class AsynchronLink
; }
38 class SfxBasicManagerHolder
;
40 class AutoReloadTimer_Impl
: public Timer
43 SfxObjectShell
* pObjSh
;
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
>
58 css::uno::Reference
< css::script::XLibraryContainer
>
60 ::sfx2::DocumentMacroMode
62 SfxProgress
* pProgress
;
66 sal_uInt16 nVisualDocumentNumber
;
67 SignatureState nDocumentSignatureState
;
68 SignatureState nScriptingSignatureState
;
69 bool bClosing
:1, // sal_True while Close(), to prevent recurrences Notification
72 bIsAbortingImport
:1, // Import operation should be canceled.
74 bPreparedForClose
: 1,
77 bIsPrintJobCancelable
:1, // Stampit disable/enable cancel button for print jobs ... default = true = enable!
80 bModelInitialized
:1, // whether the related model is initialized
82 m_bMacroSignBroken
:1, // whether the macro signature was explicitly broken
83 m_bNoBasicCapabilities
:1,
84 m_bDocRecoverySupport
: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.
97 SfxEventHintId nEventId
; // If Open/Create as to be sent
99 std::unique_ptr
<AutoReloadTimer_Impl
> pReloadTimer
;
100 SfxLoadedFlags nLoadedFlags
;
101 SfxLoadedFlags nFlagsInProgress
;
105 tools::SvRef
<SvRefBase
> xHeaderAttributes
;
106 ::rtl::Reference
< SfxBaseModel
>
108 sal_uInt16 nStyleFilter
;
110 bool m_bEnableSetModified
;
113 tools::Rectangle m_aVisArea
;
116 bool m_bCreateTempStor
;
117 css::uno::Reference
< css::embed::XStorage
> m_xDocStorage
;
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
;
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */