Microsoft Information Protection (MIP) SDK for C++: Reference 1.16
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
label.h
Go to the documentation of this file.
1/*
2 *
3 * Copyright (c) Microsoft Corporation.
4 * All rights reserved.
5 *
6 * This code is licensed under the MIT License.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files(the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions :
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 *
26 */
27/**
28 * @brief This file contains the Label class.
29 *
30 * @file label.h
31 */
32
33#ifndef API_MIP_UPE_LABEL_H_
34#define API_MIP_UPE_LABEL_H_
35
36#include <memory>
37#include <string>
38#include <vector>
39
40#include "mip/common_types.h"
41#include "mip/mip_export.h"
42#include "mip/mip_namespace.h"
43
44MIP_NAMESPACE_BEGIN
45
46/**
47 * @brief Abstraction for a single Microsoft Information Protection label.
48 */
49class Label {
50public:
51 /**
52 * @brief Get the label ID.
53 *
54 * @return the label ID.
55 */
56 virtual const std::string& GetId() const = 0;
57 /**
58 * @brief Get the label name.
59 *
60 * @return the label name.
61 */
62 virtual const std::string& GetName() const = 0;
63 /**
64 * @brief Get the label description.
65 *
66 * @return the label description.
67 */
68 virtual const std::string& GetDescription() const = 0;
69 /**
70 * @brief Get the color the label should be displayed.
71 *
72 * @return color value the string format. "#RRGGBB" where each of RR, GG, BB is a hexadecimal 0-f.
73 */
74 virtual const std::string& GetColor() const = 0;
75 /**
76 * @brief Get the Sensitivity of the label.
77 *
78 * @return a numerical value. Higher value defines higher Sensitivity. Sub labels share the priority of their parent label so justification is never required when changing labels among them.
79 */
80 virtual int GetSensitivity() const = 0;
81 /**
82 * @brief Get the tooltip description of the label.
83 *
84 * @return a tooltip string.
85 */
86 virtual const std::string& GetTooltip() const = 0;
87 /**
88 * @brief Get the tooltip description of the classification that cause this label to be applied.
89 *
90 * @return a tooltip string.
91 */
92 virtual const std::string& GetAutoTooltip() const = 0;
93 /**
94 * @brief Gets a boolean signaling if the label is active.
95 *
96 * @note Only active labels can be applied. Inactive labels cannot be applied, and are used for display purposes only.
97 * @return true if label is active, else false.
98 */
99 virtual bool IsActive() const = 0;
100 /**
101 * @brief Get the parent label.
102 *
103 * @return a weak pointer to the parent label if exists else an empty pointer.
104 */
105 virtual std::weak_ptr<Label> GetParent() const = 0;
106 /**
107 * @brief Get the children labels of the current label.
108 *
109 * @return a vector of shared pointers to labels.
110 */
111 virtual const std::vector<std::shared_ptr<Label>>& GetChildren() const = 0;
112 /**
113 * @brief Get the custom settings of a label.
114 *
115 * @return a vector of key value pairs representing custom settings.
116 */
117 virtual const std::vector<std::pair<std::string, std::string>>& GetCustomSettings() const = 0;
118 /**
119 * @brief Gets the action source of the label.
120 *
121 * @return Action source
122 */
123 virtual ActionSource GetActionSource() const = 0;
124 /**
125 * @brief Gets content types.
126 *
127 * @return The content types that the label can be applied to.
128 */
129 virtual const std::vector<std::string>& GetContentFormats() const = 0;
130 /**
131 * @brief Gets the double key URL, if the label requires double key user defined protection.
132 *
133 * @note Will return empty string if the label does not use double key or if the label uses template protection.
134 *
135 * @return The double key URL.
136 */
137 virtual std::string GetDoubleKeyUrl() const = 0;
138 /** @cond DOXYGEN_HIDE */
139 virtual ~Label() {}
140
141protected:
142 Label() {}
143 /** @endcond */
144};
145
146MIP_NAMESPACE_END
147
148#endif // API_MIP_UPE_LABEL_H_
Abstraction for a single Microsoft Information Protection label.
Definition label.h:49
virtual const std::vector< std::string > & GetContentFormats() const =0
Gets content types.
virtual const std::string & GetDescription() const =0
Get the label description.
virtual const std::vector< std::shared_ptr< Label > > & GetChildren() const =0
Get the children labels of the current label.
virtual const std::string & GetTooltip() const =0
Get the tooltip description of the label.
virtual std::string GetDoubleKeyUrl() const =0
Gets the double key URL, if the label requires double key user defined protection.
virtual ActionSource GetActionSource() const =0
Gets the action source of the label.
virtual const std::vector< std::pair< std::string, std::string > > & GetCustomSettings() const =0
Get the custom settings of a label.
virtual const std::string & GetAutoTooltip() const =0
Get the tooltip description of the classification that cause this label to be applied.
virtual const std::string & GetColor() const =0
Get the color the label should be displayed.
virtual const std::string & GetId() const =0
Get the label ID.
virtual std::weak_ptr< Label > GetParent() const =0
Get the parent label.
virtual int GetSensitivity() const =0
Get the Sensitivity of the label.
virtual bool IsActive() const =0
Gets a boolean signaling if the label is active.
virtual const std::string & GetName() const =0
Get the label name.
A file Containing the common types used by the upe, file and protection modules.
ActionSource
defines what triggered the SetLabel event
A file export/import macros.
MIP namespace macros.