LibreOffice Module sfx2 (master) 1
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SfxClassificationHelper Class Reference

Shared code to handle Business Authorization Identification and Labeling Scheme (BAILS) properties. More...

#include <classificationhelper.hxx>

Classes

class  Impl
 Implementation details of SfxClassificationHelper. More...
 

Public Member Functions

 SfxClassificationHelper (const css::uno::Reference< css::document::XDocumentProperties > &xDocumentProperties, bool bUseLocalizedPolicy=true)
 
 ~SfxClassificationHelper ()
 
const OUString & GetBACName (SfxClassificationPolicyType eType) const
 Get the currently selected category for eType. More...
 
std::vector< OUString > GetBACNames ()
 Return all possible valid category names, based on the policy. More...
 
std::vector< OUString > GetBACIdentifiers ()
 Return all possible valid category identifiers, based on the policy. More...
 
const OUString & GetAbbreviatedBACName (const OUString &sFullName)
 Get the currently selected category abbreviation for eType. Returns full name if no abbreviation defined. More...
 
OUString GetBACNameForIdentifier (std::u16string_view sIdentifier)
 Get the currently selected category for the identifier. More...
 
std::vector< OUString > GetAbbreviatedBACNames ()
 Return all possible valid abbreviated category names, based on the policy. More...
 
void SetBACName (const OUString &rName, SfxClassificationPolicyType eType)
 Setting this sets all the other properties, based on the policy. More...
 
OUString GetHigherClass (const OUString &first, const OUString &second)
 Returns the class with the higher priority (based on sensitivity). More...
 
bool HasImpactLevel ()
 If GetImpactScale() and GetImpactLevel*() will return something meaningful. More...
 
InfobarType GetImpactLevelType ()
 
sal_Int32 GetImpactLevel ()
 Larger value means more confidential. More...
 
OUString GetImpactScale ()
 Comparing the GetImpactLevel() result is only meaningful when the impact scale is the same. More...
 
OUString GetDocumentWatermark ()
 
bool HasDocumentHeader ()
 The selected category has some content for the document header. More...
 
bool HasDocumentFooter ()
 The selected category has some content for the document footer. More...
 
void UpdateInfobar (SfxViewFrame &rViewFrame)
 
std::vector< OUString > const & GetMarkings () const
 
std::vector< OUString > const & GetIntellectualPropertyParts () const
 
std::vector< OUString > const & GetIntellectualPropertyPartNumbers () const
 

Static Public Member Functions

static bool IsClassified (const css::uno::Reference< css::document::XDocumentProperties > &xDocumentProperties)
 Does the document have any BAILS properties? More...
 
static SfxClassificationCheckPasteResult CheckPaste (const css::uno::Reference< css::document::XDocumentProperties > &xSource, const css::uno::Reference< css::document::XDocumentProperties > &xDestination)
 Checks if pasting from xSource to xDestination would leak information. More...
 
static bool ShowPasteInfo (SfxClassificationCheckPasteResult eResult)
 Wrapper around CheckPaste(): informs the user if necessary and finds out if the paste can be continued or not. More...
 
static SfxClassificationPolicyType stringToPolicyType (std::u16string_view rType)
 Does a best-effort conversion of rType to SfxClassificationPolicyType. More...
 
static const OUString & policyTypeToString (SfxClassificationPolicyType eType)
 Returns the string representation of a SfxClassificationPolicyType element. More...
 
static const OUString & PROP_DOCHEADER ()
 Brief text located at the top of each document's pages. More...
 
static const OUString & PROP_DOCFOOTER ()
 Brief text located at the bottom of each document's pages. More...
 
static const OUString & PROP_DOCWATERMARK ()
 Brief text formatted as a watermark on each document's page. More...
 
static const OUString & PROP_PREFIX_INTELLECTUALPROPERTY ()
 Get the property prefix for the IntellectualProperty policy type. More...
 
static SfxClassificationPolicyType getPolicyType ()
 

Private Attributes

class SAL_DLLPRIVATE Impl
 
std::unique_ptr< Implm_pImpl
 

Detailed Description

Shared code to handle Business Authorization Identification and Labeling Scheme (BAILS) properties.

Definition at line 50 of file classificationhelper.hxx.

Constructor & Destructor Documentation

◆ SfxClassificationHelper()

SfxClassificationHelper::SfxClassificationHelper ( const css::uno::Reference< css::document::XDocumentProperties > &  xDocumentProperties,
bool  bUseLocalizedPolicy = true 
)

◆ ~SfxClassificationHelper()

SfxClassificationHelper::~SfxClassificationHelper ( )
default

Member Function Documentation

◆ CheckPaste()

SfxClassificationCheckPasteResult SfxClassificationHelper::CheckPaste ( const css::uno::Reference< css::document::XDocumentProperties > &  xSource,
const css::uno::Reference< css::document::XDocumentProperties > &  xDestination 
)
static

Checks if pasting from xSource to xDestination would leak information.

Definition at line 491 of file classificationhelper.cxx.

References DocClassificationTooLow, GetImpactLevel(), GetImpactScale(), IsClassified(), None, and TargetDocNotClassified.

◆ GetAbbreviatedBACName()

const OUString & SfxClassificationHelper::GetAbbreviatedBACName ( const OUString &  sFullName)

Get the currently selected category abbreviation for eType. Returns full name if no abbreviation defined.

Definition at line 615 of file classificationhelper.cxx.

References m_pImpl.

◆ GetAbbreviatedBACNames()

std::vector< OUString > SfxClassificationHelper::GetAbbreviatedBACNames ( )

Return all possible valid abbreviated category names, based on the policy.

Definition at line 834 of file classificationhelper.cxx.

References m_pImpl.

◆ GetBACIdentifiers()

std::vector< OUString > SfxClassificationHelper::GetBACIdentifiers ( )

Return all possible valid category identifiers, based on the policy.

Definition at line 821 of file classificationhelper.cxx.

References m_pImpl.

◆ GetBACName()

const OUString & SfxClassificationHelper::GetBACName ( SfxClassificationPolicyType  eType) const

Get the currently selected category for eType.

Definition at line 610 of file classificationhelper.cxx.

References eType, and m_pImpl.

Referenced by UpdateInfobar().

◆ GetBACNameForIdentifier()

OUString SfxClassificationHelper::GetBACNameForIdentifier ( std::u16string_view  sIdentifier)

Get the currently selected category for the identifier.

Definition at line 626 of file classificationhelper.cxx.

References m_pImpl.

◆ GetBACNames()

std::vector< OUString > SfxClassificationHelper::GetBACNames ( )

Return all possible valid category names, based on the policy.

Definition at line 808 of file classificationhelper.cxx.

References m_pImpl.

◆ GetDocumentWatermark()

OUString SfxClassificationHelper::GetDocumentWatermark ( )

◆ GetHigherClass()

OUString SfxClassificationHelper::GetHigherClass ( const OUString &  first,
const OUString &  second 
)

Returns the class with the higher priority (based on sensitivity).

Definition at line 640 of file classificationhelper.cxx.

References first, and m_pImpl.

◆ GetImpactLevel()

sal_Int32 SfxClassificationHelper::GetImpactLevel ( )

Larger value means more confidential.

Definition at line 737 of file classificationhelper.cxx.

References IntellectualProperty, m_pImpl, nValue, and PROP_PREFIX_INTELLECTUALPROPERTY().

Referenced by CheckPaste().

◆ GetImpactLevelType()

InfobarType SfxClassificationHelper::GetImpactLevelType ( )

◆ GetImpactScale()

OUString SfxClassificationHelper::GetImpactScale ( )

Comparing the GetImpactLevel() result is only meaningful when the impact scale is the same.

Definition at line 780 of file classificationhelper.cxx.

References IntellectualProperty, m_pImpl, and PROP_PREFIX_INTELLECTUALPROPERTY().

Referenced by CheckPaste().

◆ GetIntellectualPropertyPartNumbers()

std::vector< OUString > const & SfxClassificationHelper::GetIntellectualPropertyPartNumbers ( ) const

Definition at line 605 of file classificationhelper.cxx.

References m_pImpl.

◆ GetIntellectualPropertyParts()

std::vector< OUString > const & SfxClassificationHelper::GetIntellectualPropertyParts ( ) const

Definition at line 600 of file classificationhelper.cxx.

References m_pImpl.

◆ GetMarkings()

std::vector< OUString > const & SfxClassificationHelper::GetMarkings ( ) const

Definition at line 595 of file classificationhelper.cxx.

References m_pImpl.

◆ getPolicyType()

SfxClassificationPolicyType SfxClassificationHelper::getPolicyType ( )
static

◆ HasDocumentFooter()

bool SfxClassificationHelper::HasDocumentFooter ( )

The selected category has some content for the document footer.

Definition at line 681 of file classificationhelper.cxx.

References IntellectualProperty, m_pImpl, PROP_DOCFOOTER(), and PROP_PREFIX_INTELLECTUALPROPERTY().

◆ HasDocumentHeader()

bool SfxClassificationHelper::HasDocumentHeader ( )

The selected category has some content for the document header.

Definition at line 670 of file classificationhelper.cxx.

References IntellectualProperty, m_pImpl, PROP_DOCHEADER(), and PROP_PREFIX_INTELLECTUALPROPERTY().

◆ HasImpactLevel()

bool SfxClassificationHelper::HasImpactLevel ( )

If GetImpactScale() and GetImpactLevel*() will return something meaningful.

Definition at line 655 of file classificationhelper.cxx.

References IntellectualProperty, m_pImpl, and PROP_PREFIX_INTELLECTUALPROPERTY().

Referenced by UpdateInfobar().

◆ IsClassified()

bool SfxClassificationHelper::IsClassified ( const css::uno::Reference< css::document::XDocumentProperties > &  xDocumentProperties)
static

Does the document have any BAILS properties?

Definition at line 474 of file classificationhelper.cxx.

References aProperties.

Referenced by CheckPaste(), and SfxViewFrame::Notify().

◆ policyTypeToString()

const OUString & SfxClassificationHelper::policyTypeToString ( SfxClassificationPolicyType  eType)
static

◆ PROP_DOCFOOTER()

const OUString & SfxClassificationHelper::PROP_DOCFOOTER ( )
static

Brief text located at the bottom of each document's pages.

Definition at line 924 of file classificationhelper.cxx.

Referenced by HasDocumentFooter().

◆ PROP_DOCHEADER()

const OUString & SfxClassificationHelper::PROP_DOCHEADER ( )
static

Brief text located at the top of each document's pages.

Definition at line 918 of file classificationhelper.cxx.

Referenced by HasDocumentHeader().

◆ PROP_DOCWATERMARK()

const OUString & SfxClassificationHelper::PROP_DOCWATERMARK ( )
static

Brief text formatted as a watermark on each document's page.

Definition at line 930 of file classificationhelper.cxx.

Referenced by GetDocumentWatermark().

◆ PROP_PREFIX_INTELLECTUALPROPERTY()

const OUString & SfxClassificationHelper::PROP_PREFIX_INTELLECTUALPROPERTY ( )
static

Get the property prefix for the IntellectualProperty policy type.

Definition at line 936 of file classificationhelper.cxx.

Referenced by GetDocumentWatermark(), GetImpactLevel(), GetImpactLevelType(), GetImpactScale(), HasDocumentFooter(), HasDocumentHeader(), HasImpactLevel(), and policyTypeToString().

◆ SetBACName()

void SfxClassificationHelper::SetBACName ( const OUString &  rName,
SfxClassificationPolicyType  eType 
)

Setting this sets all the other properties, based on the policy.

Definition at line 847 of file classificationhelper.cxx.

References SfxViewFrame::Current(), eType, m_pImpl, policyTypeToString(), SAL_WARN, and UpdateInfobar().

◆ ShowPasteInfo()

bool SfxClassificationHelper::ShowPasteInfo ( SfxClassificationCheckPasteResult  eResult)
static

Wrapper around CheckPaste(): informs the user if necessary and finds out if the paste can be continued or not.

Definition at line 519 of file classificationhelper.cxx.

References Application::CreateMessageDialog(), DocClassificationTooLow, Application::IsHeadlessModeEnabled(), None, SfxResId(), and TargetDocNotClassified.

◆ stringToPolicyType()

SfxClassificationPolicyType SfxClassificationHelper::stringToPolicyType ( std::u16string_view  rType)
static

Does a best-effort conversion of rType to SfxClassificationPolicyType.

Definition at line 893 of file classificationhelper.cxx.

References ExportControl, IntellectualProperty, NationalSecurity, and o3tl::starts_with().

Referenced by SfxClassificationHelper().

◆ UpdateInfobar()

void SfxClassificationHelper::UpdateInfobar ( SfxViewFrame rViewFrame)

Member Data Documentation

◆ Impl

class SAL_DLLPRIVATE SfxClassificationHelper::Impl
private

Definition at line 52 of file classificationhelper.hxx.

◆ m_pImpl

std::unique_ptr<Impl> SfxClassificationHelper::m_pImpl
private

The documentation for this class was generated from the following files: