diff options
Diffstat (limited to 'include/sfx2')
-rw-r--r-- | include/sfx2/docfile.hxx | 5 | ||||
-rw-r--r-- | include/sfx2/docmacromode.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/objsh.hxx | 9 | ||||
-rw-r--r-- | include/sfx2/signaturestate.hxx | 25 |
4 files changed, 24 insertions, 18 deletions
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index 9e6160ea98b1..2964e1998f77 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <sal/config.h> #include <sfx2/dllapi.h> +#include <sfx2/signaturestate.hxx> #include <sal/types.h> #include <com/sun/star/util/RevisionTag.hpp> #include <com/sun/star/util/DateTime.hpp> @@ -260,8 +261,8 @@ public: // the following two methods must be used and make sense only during saving currently // TODO/LATER: in future the signature state should be controlled by the medium not by the document // in this case the methods will be used generally, and might need to be renamed - SAL_DLLPRIVATE sal_uInt16 GetCachedSignatureState_Impl(); - SAL_DLLPRIVATE void SetCachedSignatureState_Impl( sal_uInt16 nState ); + SAL_DLLPRIVATE SignatureState GetCachedSignatureState_Impl(); + SAL_DLLPRIVATE void SetCachedSignatureState_Impl( SignatureState nState ); static css::uno::Sequence < css::util::RevisionTag > GetVersionList( const css::uno::Reference< css::embed::XStorage >& xStorage ); diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx index 6945c788cdfc..f245962ab274 100644 --- a/include/sfx2/docmacromode.hxx +++ b/include/sfx2/docmacromode.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SFX2_DOCMACROMODE_HXX #include <sfx2/dllapi.h> +#include <sfx2/signaturestate.hxx> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/embed/XStorage.hpp> @@ -148,7 +149,7 @@ namespace sfx2 @seealso <sfx2/signaturestate.hxx> */ - virtual sal_Int16 + virtual SignatureState getScriptingSignatureState() = 0; /** allows to detect whether there is a trusted scripting signature diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 7e235d99ef82..152e864dcc8c 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -21,6 +21,7 @@ #include <sal/config.h> #include <sfx2/dllapi.h> +#include <sfx2/signaturestate.hxx> #include <sal/types.h> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/uno/Reference.h> @@ -363,9 +364,9 @@ public: bool ExportTo( SfxMedium &rMedium ); // xmlsec05, check with SFX team - sal_uInt16 GetDocumentSignatureState(); + SignatureState GetDocumentSignatureState(); void SignDocumentContent(); - sal_uInt16 GetScriptingSignatureState(); + SignatureState GetScriptingSignatureState(); void SignScriptingContent(); virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog( @@ -635,7 +636,7 @@ public: SAL_DLLPRIVATE void BreakMacroSign_Impl( bool bBreakMacroSing ); SAL_DLLPRIVATE void CheckSecurityOnLoading_Impl(); SAL_DLLPRIVATE void CheckForBrokenDocSignatures_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ); - SAL_DLLPRIVATE sal_uInt16 ImplCheckSignaturesInformation( + SAL_DLLPRIVATE SignatureState ImplCheckSignaturesInformation( const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation >& aInfos ); SAL_DLLPRIVATE void CheckEncryption_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ); SAL_DLLPRIVATE void SetModifyPasswordEntered( bool bEntered = true ); @@ -696,7 +697,7 @@ public: // configuration items SAL_DLLPRIVATE SfxToolBoxConfig* GetToolBoxConfig_Impl(); - SAL_DLLPRIVATE sal_uInt16 ImplGetSignatureState( bool bScriptingContent = false ); + SAL_DLLPRIVATE SignatureState ImplGetSignatureState( bool bScriptingContent = false ); SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > ImplAnalyzeSignature( diff --git a/include/sfx2/signaturestate.hxx b/include/sfx2/signaturestate.hxx index 0e795d5d5255..b2bccf3469c0 100644 --- a/include/sfx2/signaturestate.hxx +++ b/include/sfx2/signaturestate.hxx @@ -21,17 +21,20 @@ #define INCLUDED_SFX2_SIGNATURESTATE_HXX // xmlsec05, check with SFX team -#define SIGNATURESTATE_UNKNOWN (sal_Int16)(-1) -#define SIGNATURESTATE_NOSIGNATURES (sal_Int16)0 -#define SIGNATURESTATE_SIGNATURES_OK (sal_Int16)1 -#define SIGNATURESTATE_SIGNATURES_BROKEN (sal_Int16)2 -// State was SIGNATURES_OK, but doc is modified now -#define SIGNATURESTATE_SIGNATURES_INVALID (sal_Int16)3 -// signature is OK, but certificate could not be validated -#define SIGNATURESTATE_SIGNATURES_NOTVALIDATED (sal_Int16)4 -//signatur and certificate are ok,but not al files are signed, as was the case in -//OOo 2.x - OOo 3.1.1. This state is only used together with document signatures. -#define SIGNATURESTATE_SIGNATURES_PARTIAL_OK (sal_Int16)5 +enum class SignatureState +{ + UNKNOWN = 0xffff, // used to be -1 when this was a sal_uInt16 + NOSIGNATURES = 0, + OK = 1, + BROKEN = 2, + // State was SignatureState::OK, but doc is modified now + INVALID = 3, + // signature is OK, but certificate could not be validated + NOTVALIDATED = 4, + //signatur and certificate are ok,but not al files are signed, as was the case in + //OOo 2.x - OOo 3.1.1. This state is only used together with document signatures. + PARTIAL_OK = 5 +}; #endif // INCLUDED_SFX2_SIGNATURESTATE_HXX |