20#ifndef INCLUDED_SFX2_DOCFILE_HXX
21#define INCLUDED_SFX2_DOCFILE_HXX
29#include <rtl/ustring.hxx>
66 std::unique_ptr< SfxMedium_Impl >
pImpl;
68 SAL_DLLPRIVATE
void SetIsRemote_Impl();
69 SAL_DLLPRIVATE
void CloseInStream_Impl(
bool bInDestruction =
false);
70 SAL_DLLPRIVATE
void CloseOutStream_Impl();
71 SAL_DLLPRIVATE
void CloseStreams_Impl(
bool bInDestruction =
false);
73 SAL_DLLPRIVATE
void SetEncryptionDataToStorage_Impl();
80 std::shared_ptr<const SfxFilter> pFilter =
nullptr,
81 const std::shared_ptr<SfxItemSet>& pSet =
nullptr );
83 const OUString &rReferer,
85 std::shared_ptr<const SfxFilter> pFilter =
nullptr,
86 const std::shared_ptr<SfxItemSet>& pSet =
nullptr );
87 SfxMedium(
const css::uno::Reference< css::embed::XStorage >& xStorage,
88 const OUString& rBaseURL,
89 const std::shared_ptr<SfxItemSet>& pSet =
nullptr );
90 SfxMedium(
const css::uno::Reference< css::embed::XStorage >& xStorage,
91 const OUString& rBaseURL,
92 const OUString& rTypeName,
93 const std::shared_ptr<SfxItemSet>& pSet =
nullptr );
94 SfxMedium(
const css::uno::Sequence< css::beans::PropertyValue >& aArgs );
99 bool CheckCanGetLockfile()
const;
100 void SetOriginallyReadOnly(
bool val);
101 void AddToCheckEditableWorkerList();
104 const std::shared_ptr<std::recursive_mutex>& GetCheckEditableMutex()
const;
105 void CancelCheckEditableEntry(
bool bRemoveEvent =
true);
107 void UseInteractionHandler(
bool );
108 css::uno::Reference< css::task::XInteractionHandler >
109 GetInteractionHandler(
bool bGetAlways =
false );
111 void setStreamToLoadFrom(
112 const css::uno::Reference<css::io::XInputStream>& xInputStream,
115 void SetLoadTargetFrame(
SfxFrame* pFrame );
116 SfxFrame* GetLoadTargetFrame()
const;
121 void SetFilter(
const std::shared_ptr<const SfxFilter>& pFilter);
122 const std::shared_ptr<const SfxFilter>& GetFilter()
const;
123 const OUString& GetOrigURL()
const;
126 void SetArgs(
const css::uno::Sequence<css::beans::PropertyValue>& rArgs);
127 const css::uno::Sequence<css::beans::PropertyValue> & GetArgs()
const;
128 void Close(
bool bInDestruction =
false);
129 void CloseAndRelease();
131 void CompleteReOpen();
132 const OUString&
GetName()
const;
135 void CheckFileDate(
const css::util::DateTime& aInitDate );
136 [[nodiscard]]
bool DocNeedsFileDateCheck()
const;
137 css::util::DateTime
const & GetInitFileDate(
bool bIgnoreOldValue );
139 css::uno::Reference< css::ucb::XContent > GetContent()
const;
140 const OUString& GetPhysicalName()
const;
141 [[nodiscard]]
bool IsRemote()
const;
142 [[nodiscard]]
bool IsOpen()
const;
149 ErrCode GetWarningError()
const;
150 ErrCode const & GetLastStorageCreationState()
const;
153 void SetWarningError(
ErrCode nWarningError);
155 void CloseInStream();
156 void CloseOutStream();
161 void SetOpenMode(
StreamMode nStorOpen,
bool bDontClose =
false );
175 LockFileResult LockOrigFileOnDemand(
bool bLoading,
bool bNoUI,
bool bTryIgnoreLockFile =
false,
177 void DisableUnlockWebDAV(
bool bDisableUnlockWebDAV =
true );
178 void UnlockFile(
bool bReleaseLockStream );
180 void DisableFileSync(
bool bDisableFileSync);
182 css::uno::Reference< css::embed::XStorage > GetStorage(
bool bCreateTempFile =
true );
183 css::uno::Reference< css::embed::XStorage > GetOutputStorage();
185 [[nodiscard]]
bool IsExpired()
const;
186 void SetName(
const OUString& rName,
bool bSetOrigURL =
false );
188 const css::uno::Sequence < css::util::RevisionTag >&
189 GetVersionList(
bool _bNoReload =
false );
197 [[nodiscard]]
bool IsOriginallyReadOnly()
const;
201 [[nodiscard]]
bool IsOriginallyLoadedReadOnly()
const;
203 css::uno::Reference< css::io::XInputStream >
const & GetInputStream();
205 void CreateTempFile(
bool bReplace =
true );
206 void CreateTempFileNoCopy();
207 OUString SwitchDocumentToTempFile();
208 bool SwitchDocumentToFile(
const OUString& aURL );
210 OUString GetBaseURL(
bool bForSaving=
false );
211 void SetInCheckIn(
bool bInCheckIn );
212 bool IsInCheckIn( )
const;
213 bool IsSkipImages( )
const;
215 SAL_DLLPRIVATE
bool HasStorage_Impl()
const;
217 SAL_DLLPRIVATE
void StorageBackup_Impl();
218 SAL_DLLPRIVATE OUString
const & GetBackup_Impl();
220 SAL_DLLPRIVATE css::uno::Reference< css::embed::XStorage >
const & GetZipStorageToSign_Impl(
bool bReadOnly =
true );
221 SAL_DLLPRIVATE
void CloseZipStorage_Impl();
224 SAL_DLLPRIVATE
void SetStorage_Impl(
const css::uno::Reference< css::embed::XStorage >& xNewStorage );
226 SAL_DLLPRIVATE
void CloseAndReleaseStreams_Impl();
227 SAL_DLLPRIVATE
void AddVersion_Impl( css::util::RevisionTag& rVersion );
228 SAL_DLLPRIVATE
bool TransferVersionList_Impl(
SfxMedium const & rMedium );
229 SAL_DLLPRIVATE
void SaveVersionList_Impl();
230 SAL_DLLPRIVATE
void RemoveVersion_Impl(
const OUString& rVersion );
232 SAL_DLLPRIVATE
void SetExpired_Impl(
const DateTime& rDateTime );
235 SAL_DLLPRIVATE
void Init_Impl();
237 SAL_DLLPRIVATE
void GetLockingStream_Impl();
238 SAL_DLLPRIVATE
void GetMedium_Impl();
239 SAL_DLLPRIVATE
bool TryDirectTransfer(
const OUString& aURL,
SfxItemSet const & aTargetSet );
240 SAL_DLLPRIVATE
void Transfer_Impl();
241 SAL_DLLPRIVATE
void CreateFileStream();
242 SAL_DLLPRIVATE
void SetUpdatePickList(
bool);
243 SAL_DLLPRIVATE
bool IsUpdatePickList()
const;
245 SAL_DLLPRIVATE
void SetLongName(
const OUString &rName);
246 SAL_DLLPRIVATE
const OUString & GetLongName()
const;
247 SAL_DLLPRIVATE
bool IsPreview_Impl()
const;
248 SAL_DLLPRIVATE
void ClearBackup_Impl();
249 SAL_DLLPRIVATE
void SetPhysicalName_Impl(
const OUString& rName);
250 SAL_DLLPRIVATE
void CanDisposeStorage_Impl(
bool bDisposeStorage );
251 SAL_DLLPRIVATE
bool WillDisposeStorageOnClose_Impl();
253 SAL_DLLPRIVATE
void DoBackup_Impl(
bool bForceUsingBackupPath);
254 SAL_DLLPRIVATE
void DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent );
255 SAL_DLLPRIVATE
void DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent,
256 std::u16string_view aPrefix,
257 std::u16string_view aExtension,
258 const OUString& aDestDir );
261 const css::uno::Reference< css::ucb::XCommandEnvironment >& xComEnv );
263 SAL_DLLPRIVATE
bool StorageCommit_Impl();
265 SAL_DLLPRIVATE
void TransactedTransferForFS_Impl(
const INetURLObject& aSource,
267 const css::uno::Reference< css::ucb::XCommandEnvironment >& xComEnv );
271 bool bSignScriptingContent,
bool bHasValidDocumentSignature,
272 const OUString& aSignatureLineId = OUString(),
273 const css::uno::Reference<css::security::XCertificate>& xCert
274 = css::uno::Reference<css::security::XCertificate>(),
275 const css::uno::Reference<css::graphic::XGraphic>& xValidGraphic
276 = css::uno::Reference<css::graphic::XGraphic>(),
277 const css::uno::Reference<css::graphic::XGraphic>& xInvalidGraphic
278 = css::uno::Reference<css::graphic::XGraphic>(),
279 const OUString& aComment = OUString());
281 SAL_DLLPRIVATE
bool SignDocumentContentUsingCertificate(
282 const css::uno::Reference<css::frame::XModel>& xModel,
bool bHasValidDocumentSignature,
283 const css::uno::Reference<css::security::XCertificate>& xCertificate);
288 SAL_DLLPRIVATE
SignatureState GetCachedSignatureState_Impl()
const;
289 SAL_DLLPRIVATE
void SetCachedSignatureState_Impl(
SignatureState nState );
291 void SetHasEmbeddedObjects(
bool bHasEmbeddedObjects);
294 const css::uno::Reference< css::embed::XStorage >& xStorage );
295 static OUString CreateTempCopyWithExt( std::u16string_view aURL );
296 static bool CallApproveHandler(
const css::uno::Reference< css::task::XInteractionHandler >& xHandler,
const css::uno::Any& rRequest,
bool bAllowAbort);
298 static bool SetWritableForUserOnly(
const OUString& aURL );
299 static sal_uInt32 CreatePasswordToModifyHash( std::u16string_view aPasswd,
bool bWriter );
304 bool bIsLoading,
bool bOwnLock,
bool bHandleSysLocked);
ErrCode IgnoreWarning() const
SfxMedium(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rBaseURL, const std::shared_ptr< SfxItemSet > &pSet=nullptr)
bool ShowLockFileProblemDialog(MessageDlg nWhichDlg)
std::unique_ptr< SfxMedium_Impl > pImpl
static css::uno::Sequence< css::util::RevisionTag > GetVersionList(const css::uno::Reference< css::embed::XStorage > &xStorage)
SfxMedium(const css::uno::Sequence< css::beans::PropertyValue > &aArgs)
SfxMedium(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rBaseURL, const OUString &rTypeName, const std::shared_ptr< SfxItemSet > &pSet=nullptr)
ShowLockResult ShowLockedDocumentDialog(const LockFileEntry &aData, bool bIsLoading, bool bOwnLock, bool bHandleSysLocked)
DECL_DLLPRIVATE_STATIC_LINK(SfxMedium, ShowReloadEditableDialog, void *, void)
virtual OUString GetName() const override
constexpr OUStringLiteral IsRemote(u"IsRemote")
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
Implementation of the interface com.sun.star.rdf.XDocumentMetadataAccess.