LibreOffice Module sfx2 (master) 1
|
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< Impl > | m_pImpl |
Shared code to handle Business Authorization Identification and Labeling Scheme (BAILS) properties.
Definition at line 50 of file classificationhelper.hxx.
SfxClassificationHelper::SfxClassificationHelper | ( | const css::uno::Reference< css::document::XDocumentProperties > & | xDocumentProperties, |
bool | bUseLocalizedPolicy = true |
||
) |
Definition at line 557 of file classificationhelper.cxx.
References aProperties, eType, m_pImpl, policyTypeToString(), and stringToPolicyType().
|
default |
|
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.
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.
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.
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.
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().
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.
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.
OUString SfxClassificationHelper::GetDocumentWatermark | ( | ) |
Definition at line 794 of file classificationhelper.cxx.
References IntellectualProperty, m_pImpl, PROP_DOCWATERMARK(), and PROP_PREFIX_INTELLECTUALPROPERTY().
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.
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().
InfobarType SfxClassificationHelper::GetImpactLevelType | ( | ) |
Definition at line 692 of file classificationhelper.cxx.
References DANGER, IntellectualProperty, m_pImpl, PROP_PREFIX_INTELLECTUALPROPERTY(), SUCCESS, and WARNING.
Referenced by UpdateInfobar().
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().
std::vector< OUString > const & SfxClassificationHelper::GetIntellectualPropertyPartNumbers | ( | ) | const |
Definition at line 605 of file classificationhelper.cxx.
References m_pImpl.
std::vector< OUString > const & SfxClassificationHelper::GetIntellectualPropertyParts | ( | ) | const |
Definition at line 600 of file classificationhelper.cxx.
References m_pImpl.
std::vector< OUString > const & SfxClassificationHelper::GetMarkings | ( | ) | const |
Definition at line 595 of file classificationhelper.cxx.
References m_pImpl.
|
static |
Definition at line 942 of file classificationhelper.cxx.
References eType, IntellectualProperty, and utl::ConfigManager::IsFuzzing().
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().
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().
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().
|
static |
Does the document have any BAILS properties?
Definition at line 474 of file classificationhelper.cxx.
References aProperties.
Referenced by CheckPaste(), and SfxViewFrame::Notify().
|
static |
Returns the string representation of a SfxClassificationPolicyType element.
Definition at line 903 of file classificationhelper.cxx.
References eType, ExportControl, IntellectualProperty, NationalSecurity, and PROP_PREFIX_INTELLECTUALPROPERTY().
Referenced by SfxClassificationHelper::Impl::pushToDocumentProperties(), SetBACName(), SfxClassificationHelper::Impl::setStartValidity(), and SfxClassificationHelper().
|
static |
Brief text located at the bottom of each document's pages.
Definition at line 924 of file classificationhelper.cxx.
Referenced by HasDocumentFooter().
|
static |
Brief text located at the top of each document's pages.
Definition at line 918 of file classificationhelper.cxx.
Referenced by HasDocumentHeader().
|
static |
Brief text formatted as a watermark on each document's page.
Definition at line 930 of file classificationhelper.cxx.
Referenced by GetDocumentWatermark().
|
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().
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().
|
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.
|
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().
void SfxClassificationHelper::UpdateInfobar | ( | SfxViewFrame & | rViewFrame | ) |
Definition at line 879 of file classificationhelper.cxx.
References SfxViewFrame::AppendInfoBar(), GetBACName(), GetImpactLevelType(), HasImpactLevel(), IntellectualProperty, SfxViewFrame::RemoveInfoBar(), SfxResId(), and u.
Referenced by SetBACName().
|
private |
Definition at line 52 of file classificationhelper.hxx.
|
private |
Definition at line 53 of file classificationhelper.hxx.
Referenced by GetAbbreviatedBACName(), GetAbbreviatedBACNames(), GetBACIdentifiers(), GetBACName(), GetBACNameForIdentifier(), GetBACNames(), GetDocumentWatermark(), GetHigherClass(), GetImpactLevel(), GetImpactLevelType(), GetImpactScale(), GetIntellectualPropertyPartNumbers(), GetIntellectualPropertyParts(), GetMarkings(), HasDocumentFooter(), HasDocumentHeader(), HasImpactLevel(), SetBACName(), and SfxClassificationHelper().