xref: /aoo41x/main/sfx2/source/inc/objshimp.hxx (revision 353d8f4d)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SFX_OBJSHIMP_HXX
24cdf0e10cSrcweir #define _SFX_OBJSHIMP_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir //#include <hash_map>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
29cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
30cdf0e10cSrcweir #include <rtl/ustring.hxx>
31cdf0e10cSrcweir #include <rtl/ref.hxx>
32cdf0e10cSrcweir #include <com/sun/star/logging/XSimpleLogRing.hpp>
33cdf0e10cSrcweir #include <tools/datetime.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <unotools/securityoptions.hxx>
36cdf0e10cSrcweir #include <sfx2/objsh.hxx>
37cdf0e10cSrcweir #include "sfx2/docmacromode.hxx"
38cdf0e10cSrcweir #include "bitset.hxx"
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace svtools { class AsynchronLink; }
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //====================================================================
43cdf0e10cSrcweir 
44cdf0e10cSrcweir DBG_NAMEEX(SfxObjectShell)
45cdf0e10cSrcweir 
46cdf0e10cSrcweir class SfxViewFrame;
47cdf0e10cSrcweir struct MarkData_Impl
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	String aMark;
50cdf0e10cSrcweir 	String aUserData;
51cdf0e10cSrcweir 	SfxViewFrame* pFrame;
52cdf0e10cSrcweir };
53cdf0e10cSrcweir 
54cdf0e10cSrcweir class SfxFrame;
55cdf0e10cSrcweir class SfxToolBoxConfig;
56cdf0e10cSrcweir class SfxBasicManagerHolder;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
59cdf0e10cSrcweir {
60cdf0e10cSrcweir     ::comphelper::EmbeddedObjectContainer* mpObjectContainer;
61cdf0e10cSrcweir     SfxBasicManagerHolder*
62cdf0e10cSrcweir                         pBasicManager;
63cdf0e10cSrcweir     SfxObjectShell&     rDocShell;
64cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >
65cdf0e10cSrcweir                         xBasicLibraries;
66cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >
67cdf0e10cSrcweir                         xDialogLibraries;
68cdf0e10cSrcweir 	com::sun::star::uno::Sequence < rtl::OUString > xEventNames;
69cdf0e10cSrcweir     ::sfx2::DocumentMacroMode
70cdf0e10cSrcweir                         aMacroMode;
71cdf0e10cSrcweir 	SfxProgress*		pProgress;
72cdf0e10cSrcweir 	String				aTitle;
73cdf0e10cSrcweir     String              aTempName;
74cdf0e10cSrcweir 	DateTime			nTime;
75cdf0e10cSrcweir     sal_uInt16          nVisualDocumentNumber;
76cdf0e10cSrcweir     sal_Int16           nDocumentSignatureState;
77cdf0e10cSrcweir     sal_Int16           nScriptingSignatureState;
78cdf0e10cSrcweir     sal_Bool            bInList:1,  		// ob per First/Next erreichbar
79cdf0e10cSrcweir 						bClosing:1,         // sal_True w"aehrend Close(), um Benachrichtigungs-Rekursionen zu verhindern
80cdf0e10cSrcweir 						bIsSaving:1,
81cdf0e10cSrcweir 						bPasswd:1,
82cdf0e10cSrcweir 						bIsTmp:1,
83cdf0e10cSrcweir 						bIsNamedVisible:1,
84cdf0e10cSrcweir 						bIsTemplate:1,
85cdf0e10cSrcweir 						bIsAbortingImport:1,  // Importvorgang soll abgebrochen werden.
86cdf0e10cSrcweir                         bImportDone : 1, //Import schon fertig? Fuer AutoReload von Docs.
87cdf0e10cSrcweir 						bInPrepareClose : 1,
88cdf0e10cSrcweir 						bPreparedForClose : 1,
89cdf0e10cSrcweir 						bWaitingForPicklist : 1,// Muss noch in die Pickliste
90cdf0e10cSrcweir 						bForbidReload : 1,
91cdf0e10cSrcweir 						bBasicInitialized :1,
92cdf0e10cSrcweir                         bIsPrintJobCancelable :1, // Stampit disable/enable cancel button for print jobs ... default = true = enable!
93cdf0e10cSrcweir                         bOwnsStorage:1,
94cdf0e10cSrcweir                         bNoBaseURL:1,
95cdf0e10cSrcweir                         bInitialized:1,
96cdf0e10cSrcweir                         bSignatureErrorIsShown:1,
97cdf0e10cSrcweir                         bModelInitialized:1, // whether the related model is initialized
98cdf0e10cSrcweir                         bPreserveVersions:1,
99cdf0e10cSrcweir 						m_bMacroSignBroken:1, // whether the macro signature was explicitly broken
100cdf0e10cSrcweir                         m_bNoBasicCapabilities:1,
101cdf0e10cSrcweir                         m_bDocRecoverySupport:1,
102cdf0e10cSrcweir 						bQueryLoadTemplate:1,
103cdf0e10cSrcweir 						bLoadReadonly:1,
104cdf0e10cSrcweir 						bUseUserData:1,
105cdf0e10cSrcweir 						bSaveVersionOnClose:1,
106cdf0e10cSrcweir                         m_bSharedXMLFlag:1, // whether the flag should be stored in xml file
107cdf0e10cSrcweir                         m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	IndexBitSet         aBitSet;
110cdf0e10cSrcweir 	sal_uInt32               lErr;
111cdf0e10cSrcweir 	sal_uInt16				nEventId;			// falls vor Activate noch ein
112cdf0e10cSrcweir 											// Open/Create gesendet werden mu/s
113cdf0e10cSrcweir 	AutoReloadTimer_Impl *pReloadTimer;
114cdf0e10cSrcweir 	MarkData_Impl*      pMarkData;
115cdf0e10cSrcweir 	sal_uInt16              nLoadedFlags;
116cdf0e10cSrcweir 	sal_uInt16              nFlagsInProgress;
117cdf0e10cSrcweir 	sal_Bool				bModalMode;
118cdf0e10cSrcweir     sal_Bool                bRunningMacro;
119cdf0e10cSrcweir 	sal_Bool                bReloadAvailable;
120cdf0e10cSrcweir 	sal_uInt16				nAutoLoadLocks;
121cdf0e10cSrcweir 	SfxModule*              pModule;
122cdf0e10cSrcweir 	SfxObjectShellFlags     eFlags;
123cdf0e10cSrcweir 	sal_Bool				bReadOnlyUI;
124cdf0e10cSrcweir 	SvRefBaseRef            xHeaderAttributes;
125cdf0e10cSrcweir 	sal_Bool				bHiddenLockedByAPI;
126cdf0e10cSrcweir     ::rtl::Reference< SfxBaseModel >
127cdf0e10cSrcweir                             pBaseModel;
128cdf0e10cSrcweir 	sal_uInt16				nStyleFilter;
129cdf0e10cSrcweir 	sal_Bool				bDisposing;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	sal_Bool				m_bEnableSetModified;
132cdf0e10cSrcweir 	sal_Bool				m_bIsModified;
133cdf0e10cSrcweir 
134cdf0e10cSrcweir 	Rectangle				m_aVisArea;
135cdf0e10cSrcweir 	MapUnit					m_nMapUnit;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	sal_Bool				m_bCreateTempStor;
138cdf0e10cSrcweir 	::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xDocStorage;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 	sal_Bool				m_bIsInit;
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     ::rtl::OUString         m_aSharedFileURL;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::logging::XSimpleLogRing > m_xLogRing;
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     sal_Bool                m_bIncomplEncrWarnShown;
147cdf0e10cSrcweir 
148cdf0e10cSrcweir     // TODO/LATER: m_aModifyPasswordInfo should completely replace m_nModifyPasswordHash in future
149cdf0e10cSrcweir     sal_uInt32              m_nModifyPasswordHash;
150cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aModifyPasswordInfo;
151cdf0e10cSrcweir     sal_Bool                m_bModifyPasswordEntered;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir 	SfxObjectShell_Impl( SfxObjectShell& _rDocShell );
154cdf0e10cSrcweir 	virtual ~SfxObjectShell_Impl();
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     static sal_Bool NeedsOfficeUpdateDialog();
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     // IMacroDocumentAccess overridables
159cdf0e10cSrcweir     virtual sal_Int16 getCurrentMacroExecMode() const;
160cdf0e10cSrcweir     virtual sal_Bool setCurrentMacroExecMode( sal_uInt16 nMacroMode );
161cdf0e10cSrcweir     virtual ::rtl::OUString getDocumentLocation() const;
162cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > getZipStorageToSign();
163cdf0e10cSrcweir     virtual sal_Bool documentStorageHasMacros() const;
164cdf0e10cSrcweir     virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XEmbeddedScripts > getEmbeddedDocumentScripts() const;
165cdf0e10cSrcweir     virtual sal_Int16 getScriptingSignatureState();
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     virtual sal_Bool hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor );
168cdf0e10cSrcweir     virtual void showBrokenSignatureWarning( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction ) const;
169cdf0e10cSrcweir };
170cdf0e10cSrcweir 
171cdf0e10cSrcweir #endif
172cdf0e10cSrcweir 
173