Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
get_template_settings.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 Defines GetTemplatesSettings interface
29 *
30 * @file get_template_settings.h
31 */
32
33#ifndef API_MIP_PROTECTION_GET_TEMPLATE_SETTINGS_H_
34#define API_MIP_PROTECTION_GET_TEMPLATE_SETTINGS_H_
35
36#include <memory>
37#include <string>
38
39#include "mip/mip_export.h"
40#include "mip/mip_namespace.h"
42
43MIP_NAMESPACE_BEGIN
44
45/**
46 * @brief Settings to use when obtaining templates
47 */
49public:
50 /**
51 * @brief Sets the delegated user
52 *
53 * @param delegatedUserEmail the delegation email.
54 *
55 * @note A delegated user is specified when the authenticating user/application is acting on behalf of another user
56 */
57 virtual void SetDelegatedUserEmail(const std::string& delegatedUserEmail) = 0;
58
59 /**
60 * @brief Gets the delegated user
61 *
62 * @return Delegated user
63 *
64 * @note A delegated user is specified when the authenticating user/application is acting on behalf of another user
65 */
66 virtual const std::string& GetDelegatedUserEmail() const = 0;
67
68 /**
69 * @brief Can enable force refresh of templates, ignoring former cached response
70 *
71 * @param enabled True to force the refresh. False to use the cached templates if available.
72 */
73 virtual void ForceRefresh(bool enabled) = 0;
74
75 /**
76 * @brief Can enable force refresh of templates, ignoring former cached response
77 *
78 * @return True to ignore cached templates. False to use if available.
79 */
80 virtual bool ShouldRefreshTemplates() const = 0;
81
82 /**
83 * @brief Can disable caching of template response. Will cache by default.
84 *
85 * @param cachingAllowed False to disallow template caching.
86 */
87 virtual void EnableCaching(bool cachingAllowed) = 0;
88
89 /**
90 * @brief Can cache templates or not.
91 *
92 * @return True to cache templates. False to not.
93 */
94 virtual bool ShouldCacheResponse() const = 0;
95
96#ifdef MIP_OFFLINE_PUBLISHING_ENABLED
97 /**
98 * @brief Can return full serialized template info in descriptor.
99 *
100 * @param fetchSerializedTemplates if True, will populate GetSerializedTemplate() in TemplateDescriptor.
101 *
102 * @note Serialized templates will only be fetched if SDK was built with offline publishing functionality
103 */
104 virtual void SetFetchSerializedTemplates(bool fetchSerializedTemplates) = 0;
105
106 /**
107 * @brief Whether or not to set the serialized template in the TemplateDescriptor output
108 *
109 * @return True if serialized template will be set. False, otherwise. False by default.
110 */
111 virtual bool FetchSerializedTemplates() const = 0;
112#endif // MIP_OFFLINE_PUBLISHING_ENABLED
113 /**
114 * @brief Creates a GetTemplatesSettings object
115 *
116 * @return A GetTemplatesSettings object
117 */
118 MIP_API static std::shared_ptr<GetTemplatesSettings> __CDECL CreateGetTemplatesSettings();
119
120 /** @cond DOXYGEN_HIDE */
121 virtual ~GetTemplatesSettings() {}
122protected:
124 /** @endcond */
125};
126
127MIP_NAMESPACE_END
128
129#endif // API_MIP_PROTECTION_GET_TEMPLATE_SETTINGS_H_
Settings to use when obtaining templates.
static MIP_API std::shared_ptr< GetTemplatesSettings > __CDECL CreateGetTemplatesSettings()
Creates a GetTemplatesSettings object.
virtual void ForceRefresh(bool enabled)=0
Can enable force refresh of templates, ignoring former cached response.
virtual void SetDelegatedUserEmail(const std::string &delegatedUserEmail)=0
Sets the delegated user.
virtual const std::string & GetDelegatedUserEmail() const =0
Gets the delegated user.
virtual bool ShouldCacheResponse() const =0
Can cache templates or not.
virtual void EnableCaching(bool cachingAllowed)=0
Can disable caching of template response.
virtual bool ShouldRefreshTemplates() const =0
Can enable force refresh of templates, ignoring former cached response.
Settings to use for protection operations.
A file export/import macros.
MIP namespace macros.
Defines ProtectionCommonSettings interface.