summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-17 09:13:42 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-17 10:04:54 +0100
commit89b928d43a5db1ad3bf761cdb24013c6bcf32e8b (patch)
treeb594a8c2ab86691f6388ef7c6e2e679705904ca1 /include
parentd977a49ef0fb5377379dbb7516cad3ee8ecead41 (diff)
sfx2: introduce initial SfxClassificationHelper
A document's metadata has predefinied keys like title, and has user-defined ones as well. The BAILS specification at <http://www.tscp.org/wp-content/uploads/2013/08/TSCP_BAILSv1.pdf> describes a mechanism to use the generic user-defined key-value pairs to embed classification-related (read: is it public? is it internal only? etc) information in a standard way. One approach in handling these in LO would be to let code here and there parse these user-defined key-value pairs again and again. An other one would be to handle these as first-class properties, even if the majority of the users would never need them. A middle between the above two approaches is this class: all these properties are still just user-defined properties, but if the document has them, then all related code is supposed to be implemented in this central class. Change-Id: Ib0297a5e91779b330c310a153f1a1628759dd028
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/classificationhelper.hxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx
new file mode 100644
index 000000000000..86627429816f
--- /dev/null
+++ b/include/sfx2/classificationhelper.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SFX2_CLASSIFICATIONHELPER_HXX
+#define INCLUDED_SFX2_CLASSIFICATIONHELPER_HXX
+
+#include <memory>
+
+#include <rtl/ustring.hxx>
+#include <sfx2/dllapi.h>
+
+class SfxObjectShell;
+
+/// Shared code to handle Business Authorization Identification and Labeling Scheme (BAILS) properties.
+class SFX2_DLLPUBLIC SfxClassificationHelper
+{
+ struct Impl;
+ std::unique_ptr<Impl> m_pImpl;
+
+public:
+ /// Does the document have any BAILS properties?
+ static bool IsClassified(SfxObjectShell& rObjectShell);
+
+ SfxClassificationHelper(SfxObjectShell& rObjectShell);
+ ~SfxClassificationHelper();
+ OUString GetBACName();
+ /// Impact level is a string, as the scale can be integer-based, but can be also low/high.
+ OUString GetImpactLevel();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */