Microsoft Information Protection (MIP) SDK for C: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C
Loading...
Searching...
No Matches
label_cc.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 Contains C API definitions for label
29*
30* @file label_cc.h
31*/
32
33#ifndef API_MIP_UPE_LABEL_CC_H_
34#define API_MIP_UPE_LABEL_CC_H_
35
38#include "mip_cc/error_cc.h"
40#include "mip_cc/result_cc.h"
41
43
44/**
45 * @brief Release resources associated with a label
46 *
47 * @param label Label to be released
48 */
49MIP_CC_API(void) MIP_CC_ReleaseLabel(mip_cc_label label);
50
51/**
52 * @brief Gets label ID
53 *
54 * @param label Label
55 * @param labelId [Output] Label ID
56 * @param errorInfo [Output] (Optional) Failure info if operation result is error
57 *
58 * @return Result code indicating success or failure
59 */
60MIP_CC_API(mip_cc_result) MIP_CC_Label_GetId(
61 const mip_cc_label label,
64
65/**
66 * @brief Gets size of buffer required to store name
67 *
68 * @param label Label
69 * @param nameSize [Output] Size of buffer to hold name (in number of chars)
70 * @param errorInfo [Output] (Optional) Failure info if operation result is error
71 *
72 * @return Result code indicating success or failure
73 */
74MIP_CC_API(mip_cc_result) MIP_CC_Label_GetNameSize(
75 const mip_cc_label label,
76 int64_t* nameSize,
78
79/**
80 * @brief Gets label name
81 *
82 * @param label Label
83 * @param nameBuffer [Output] Buffer the name will be copied into.
84 * @param nameBufferSize Size (in number of chars) of the nameBuffer.
85 * @param actualNameSize [Output] Number of chars written to the buffer
86 * @param errorInfo [Output] (Optional) Failure info if operation result is error
87 *
88 * @return Result code indicating success or failure
89 *
90 * @note If nameBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
91 * actualNameSize will be set to the minimum required buffer size.
92 */
93MIP_CC_API(mip_cc_result) MIP_CC_Label_GetName(
94 const mip_cc_label label,
96 const int64_t nameBufferSize,
99
100/**
101 * @brief Gets size of buffer required to store description
102 *
103 * @param label Label
104 * @param descriptionSize [Output] Size of buffer to hold description (in number of chars)
105 * @param errorInfo [Output] (Optional) Failure info if operation result is error
106 *
107 * @return Result code indicating success or failure
108 */
109MIP_CC_API(mip_cc_result) MIP_CC_Label_GetDescriptionSize(
110 const mip_cc_label label,
113
114/**
115 * @brief Gets label description
116 *
117 * @param label Label
118 * @param descriptionBuffer [Output] Buffer the description will be copied into.
119 * @param descriptionBufferSize Size (in number of chars) of the descriptionBuffer.
120 * @param actualDescriptionSize [Output] Number of chars written to the buffer
121 * @param errorInfo [Output] (Optional) Failure info if operation result is error
122 *
123 * @return Result code indicating success or failure
124 *
125 * @note If descriptionBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
126 * actualDescriptionSize will be set to the minimum required buffer size.
127 */
128MIP_CC_API(mip_cc_result) MIP_CC_Label_GetDescription(
129 const mip_cc_label label,
134
135/**
136 * @brief Gets size of buffer required to store color
137 *
138 * @param label Label
139 * @param colorSize [Output] Size of buffer to hold color (in number of chars)
140 * @param errorInfo [Output] (Optional) Failure info if operation result is error
141 *
142 * @return Result code indicating success or failure
143 */
144MIP_CC_API(mip_cc_result) MIP_CC_Label_GetColorSize(
145 const mip_cc_label label,
146 int64_t* colorSize,
148
149/**
150 * @brief Gets label color
151 *
152 * @param label Label
153 * @param colorBuffer [Output] Buffer the color will be copied into (in #RRGGBB format).
154 * @param colorBufferSize Size (in number of chars) of the colorBuffer.
155 * @param actualColorSize [Output] Number of chars written to the buffer
156 * @param errorInfo [Output] (Optional) Failure info if operation result is error
157 *
158 * @return Result code indicating success or failure
159 *
160 * @note If colorBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
161 * actualColorSize will be set to the minimum required buffer size.
162 */
163MIP_CC_API(mip_cc_result) MIP_CC_Label_GetColor(
164 const mip_cc_label label,
166 const int64_t colorBufferSize,
169
170/**
171 * @brief Gets sensitivity level of label. Higher value means more sensitive.
172 *
173 * @param label Label
174 * @param sensitivity [Output] Sensitivity level
175 * @param errorInfo [Output] (Optional) Failure info if operation result is error
176 *
177 * @return Result code indicating success or failure
178 */
179MIP_CC_API(mip_cc_result) MIP_CC_Label_GetSensitivity(
180 const mip_cc_label label,
181 int32_t* sensitivity,
183
184/**
185 * @brief Gets size of buffer required to store tooltip
186 *
187 * @param label Label
188 * @param tooltipSize [Output] Size of buffer to hold tooltip (in number of chars)
189 * @param errorInfo [Output] (Optional) Failure info if operation result is error
190 *
191 * @return Result code indicating success or failure
192 */
193MIP_CC_API(mip_cc_result) MIP_CC_Label_GetTooltipSize(
194 const mip_cc_label label,
195 int64_t* tooltipSize,
197
198/**
199 * @brief Gets label tooltip
200 *
201 * @param label Label
202 * @param tooltipBuffer [Output] Buffer the tooltip will be copied into.
203 * @param tooltipBufferSize Size (in number of chars) of the tooltipBuffer.
204 * @param actualTooltipSize [Output] Number of chars written to the buffer
205 * @param errorInfo [Output] (Optional) Failure info if operation result is error
206 *
207 * @return Result code indicating success or failure
208 *
209 * @note If tooltipBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
210 * actualTooltipSize will be set to the minimum required buffer size.
211 */
212MIP_CC_API(mip_cc_result) MIP_CC_Label_GetTooltip(
213 const mip_cc_label label,
215 const int64_t tooltipBufferSize,
218
219/**
220 * @brief Gets size of buffer required to store auto-classification tooltip
221 *
222 * @param label Label
223 * @param tooltipSize [Output] Size of buffer to hold tooltip (in number of chars)
224 * @param errorInfo [Output] (Optional) Failure info if operation result is error
225 *
226 * @return Result code indicating success or failure
227 */
228MIP_CC_API(mip_cc_result) MIP_CC_Label_GetAutoTooltipSize(
229 const mip_cc_label label,
230 int64_t* tooltipSize,
232
233/**
234 * @brief Gets label auto-classification tooltip
235 *
236 * @param label Label
237 * @param tooltipBuffer [Output] Buffer the tooltip will be copied into.
238 * @param tooltipBufferSize Size (in number of chars) of the tooltipBuffer.
239 * @param actualTooltipSize [Output] Number of chars written to the buffer
240 * @param errorInfo [Output] (Optional) Failure info if operation result is error
241 *
242 * @return Result code indicating success or failure
243 *
244 * @note If tooltipBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
245 * actualTooltipSize will be set to the minimum required buffer size.
246 */
247MIP_CC_API(mip_cc_result) MIP_CC_Label_GetAutoTooltip(
248 const mip_cc_label label,
249 char* tooltipBuffer,
250 const int64_t tooltipBufferSize,
251 int64_t* actualTooltipSize,
253
254/**
255 * @brief Gets whether or not a label is active
256 *
257 * @param label Label
258 * @param isActive [Output] Whether or not a label is considered active.
259 * @param errorInfo [Output] (Optional) Failure info if operation result is error
260 *
261 * @return Result code indicating success or failure
262 *
263 * @note Only active labels can be applied. Inactivte labels cannot be applied and are used for display purposes only.
264 */
265MIP_CC_API(mip_cc_result) MIP_CC_Label_IsActive(
266 const mip_cc_label label,
267 bool* isActive,
269
270/**
271 * @brief Gets the parent label, if any
272 *
273 * @param label Label
274 * @param parent [Output] Parent label, if any, else null
275 * @param errorInfo [Output] (Optional) Failure info if operation result is error
276 *
277 * @return Result code indicating success or failure
278 */
279MIP_CC_API(mip_cc_result) MIP_CC_Label_GetParent(
280 const mip_cc_label label,
283
284/**
285 * @brief Gets the number of children labels
286 *
287 * @param label Label
288 * @param childrenSize [Output] Number of children
289 * @param errorInfo [Output] (Optional) Failure info if operation result is error
290 *
291 * @return Result code indicating success or failure
292 */
293MIP_CC_API(mip_cc_result) MIP_CC_Label_GetChildrenSize(
294 const mip_cc_label label,
295 int64_t* childrenSize,
297
298/**
299 * @brief Gets the children labels
300 *
301 * @param label Label
302 * @param childrenBuffer [Output] Buffer the children labels will be copied into. Children labels
303 * are owned by the caller and must be released with MIP_CC_ReleaseLabel.
304 * @param childrenBufferSize Size (in number of labels) of the childrenBuffer.
305 * @param actualChildrenSize [Output] Number of children labels written to the buffer
306 * @param errorInfo [Output] (Optional) Failure info if operation result is error
307 *
308 * @return Result code indicating success or failure
309 *
310 * @note If childrenBuffer is null or insufficient, MIP_RESULT_ERROR_INSUFFICIENT_BUFFER will be returned and
311 * actualChildrenSize will be set to the minimum required buffer size
312 */
313MIP_CC_API(mip_cc_result) MIP_CC_Label_GetChildren(
314 const mip_cc_label label,
316 const int64_t childrenBufferSize,
319
320/**
321 * @brief Gets policy-defined custom settings of a label
322 *
323 * @param label Label
324 * @param settings [Output] Dictionary of settings, owned by the caller
325 * @param errorInfo [Output] (Optional) Failure info if operation result is error
326 *
327 * @return Result code indicating success or failure
328 *
329 * @note The 'settings' variable must be released by the caller by calling MIP_CC_ReleaseDictionary
330 */
331MIP_CC_API(mip_cc_result) MIP_CC_Label_GetCustomSettings(
332 const mip_cc_label label,
335
336#endif // API_MIP_UPE_LABEL_CC_H_
A file Containing the common types used by the upe, file and protection modules.
mip_cc_label * label
Contains C API definitions for common string dictionary.
Error definition and functions.
mip_cc_label const int64_t int64_t * actualChildrenSize
Definition label_cc.h:317
char const int64_t int64_t * actualColorSize
Definition label_cc.h:167
char * descriptionBuffer
Definition label_cc.h:130
int64_t * nameSize
Definition label_cc.h:76
char * tooltipBuffer
Definition label_cc.h:214
mip_cc_dictionary * settings
Definition label_cc.h:333
int64_t * colorSize
Definition label_cc.h:146
mip_cc_handle * mip_cc_label
Definition label_cc.h:42
int32_t * sensitivity
Definition label_cc.h:181
mip_cc_label * childrenBuffer
Definition label_cc.h:315
char const int64_t tooltipBufferSize
Definition label_cc.h:215
char const int64_t int64_t * actualNameSize
Definition label_cc.h:97
int64_t * descriptionSize
Definition label_cc.h:111
mip_cc_guid * labelId
Definition label_cc.h:62
mip_cc_label const int64_t childrenBufferSize
Definition label_cc.h:316
char * colorBuffer
Definition label_cc.h:165
int64_t * childrenSize
Definition label_cc.h:295
char const int64_t nameBufferSize
Definition label_cc.h:96
char const int64_t int64_t * actualDescriptionSize
Definition label_cc.h:132
int64_t * tooltipSize
Definition label_cc.h:195
mip_cc_label * parent
Definition label_cc.h:281
char const int64_t colorBufferSize
Definition label_cc.h:166
char const int64_t descriptionBufferSize
Definition label_cc.h:131
mip_cc_guid mip_cc_error * errorInfo
Definition label_cc.h:63
bool * isActive
Definition label_cc.h:267
char const int64_t int64_t * actualTooltipSize
Definition label_cc.h:216
char * nameBuffer
Definition label_cc.h:95
MIP_CC_API(void) MIP_CC_ReleaseLabel(mip_cc_label label)
Release resources associated with a label.
Export/import and other macros for C API.
Defines success/error result codes.
mip_cc_result
API success/failure result.
Definition result_cc.h:44
Error information.
Definition error_cc.h:79
Opaque handle to MIP object.