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