Microsoft Information Protection (MIP) SDK for C++: Reference 1.16
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
ProtectionProfile::Settings Class Reference

Settings used by ProtectionProfile during its creation and throughout its lifetime. More...

#include <src/api/mip/protection/protection_profile.h>

Collaboration diagram for ProtectionProfile::Settings:

Public Member Functions

void AddRedirectionUri (const std::string &originalUri, const std::string &redirectUri)
 Adds a redirect uri.
 
bool CanCacheLicenses () const
 Gets whether or not end user licenses (EULs) are cached locally.
 
CacheStorageType GetCacheStorageType () const
 Get whether caches are stored in memory or on disk.
 
std::shared_ptr< ConsentDelegateGetConsentDelegate () const
 Gets the consent delegate used for connecting to services.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Get the custom settings, used for feature gating and testing.
 
DnsRedirection GetDnsRedirection () const
 Gets the dns redirect mode.
 
std::shared_ptr< HttpDelegateGetHttpDelegate () const
 Get the HTTP delegate (if any) provided by the application.
 
const std::shared_ptr< void > & GetLoggerContext () const
 Get logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.
 
std::shared_ptr< MipContextGetMipContext () const
 Get MIP context which represents shared state across all profiles.
 
std::shared_ptr< ProtectionProfile::ObserverGetObserver () const
 Gets the observer that receives notifications of events related to ProtectionProfile.
 
const std::map< std::string, std::string > & GetRedirectionUris () const
 Gets the redirection uris.
 
const std::string & GetSessionId () const
 Gets the session ID.
 
std::shared_ptr< StorageDelegateGetStorageDelegate () const
 Get the StorageDelegate (if any) provided by the application.
 
std::shared_ptr< TaskDispatcherDelegateGetTaskDispatcherDelegate () const
 Get the TaskDispatcher delegate (if any) provided by the application.
 
void SetCanCacheLicenses (bool canCacheLicenses)
 Configures whether or not end user licenses (EULs) will be cached locally.
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &customSettings)
 Set the custom settings, used for feature gating and testing.
 
void SetDnsRedirection (DnsRedirection dnsRedirection)
 Sets the dns redirection mode that controls how redirection is handled during online operations.
 
void SetHttpDelegate (const std::shared_ptr< HttpDelegate > &httpDelegate)
 Override default HTTP stack with client's own.
 
void SetLoggerContext (const std::shared_ptr< void > &loggerContext)
 Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.
 
void SetSessionId (const std::string &sessionId)
 Sets the session ID.
 
void SetStorageDelegate (const std::shared_ptr< StorageDelegate > &storageDelegate)
 Override default storage cache with client's own implementation.
 
void SetTaskDispatcherDelegate (const std::shared_ptr< TaskDispatcherDelegate > &taskDispatcherDelegate)
 Override default asynchonous task dispatching handling with client's own.
 
 Settings (const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< ConsentDelegate > &consentDelegate)
 ProtectionProfile::Settings constructor, used for synchronous operations.
 
 Settings (const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< ConsentDelegate > &consentDelegate, const std::shared_ptr< ProtectionProfile::Observer > &observer)
 ProtectionProfile::Settings constructor that specifies an observer to be used for async operations.
 

Private Attributes

CacheStorageType mCacheStorageType
 
bool mCanCacheLicenses = true
 
std::shared_ptr< ConsentDelegatemConsentDelegate
 
std::vector< std::pair< std::string, std::string > > mCustomSettings
 
DnsRedirection mDnsRedirection
 
std::shared_ptr< HttpDelegatemHttpDelegate
 
std::shared_ptr< void > mLoggerContext
 
std::shared_ptr< MipContextmMipContext
 
std::shared_ptr< ProtectionProfile::ObservermObserver
 
std::map< std::string, std::string > mRedirectionUris
 
std::string mSessionId
 
std::shared_ptr< StorageDelegatemStorageDelegate
 
std::shared_ptr< TaskDispatcherDelegatemTaskDispatcherDelegate
 

Detailed Description

Settings used by ProtectionProfile during its creation and throughout its lifetime.

Definition at line 167 of file protection_profile.h.

Constructor & Destructor Documentation

◆ Settings() [1/2]

ProtectionProfile::Settings::Settings ( const std::shared_ptr< MipContext > & mipContext,
CacheStorageType cacheStorageType,
const std::shared_ptr< ConsentDelegate > & consentDelegate,
const std::shared_ptr< ProtectionProfile::Observer > & observer )
inline

ProtectionProfile::Settings constructor that specifies an observer to be used for async operations.

Parameters
mipContextGlobal context settings
cacheStorageTypeStore any cached state in memory or on disk
consentDelegateDelegate used to obtain user permission to access external resources
observerObserver instance that will receive notifications of events related to ProtectionProfile
applicationInfoInfo about application that is consuming the protection SDK

Definition at line 178 of file protection_profile.h.

183 : mMipContext(mipContext),
184 mCacheStorageType(cacheStorageType),
185 mConsentDelegate(consentDelegate),
186 mObserver(observer),
187 mCanCacheLicenses(true),
188#if defined(MIP_OFFLINE_PUBLISHING_ENABLED) || defined(SWIG) || defined(SWIG_DIRECTORS)
189 mOfflinePublishing(false),
190#endif // MIP_OFFLINE_PUBLISHING_ENABLED
192 }
std::shared_ptr< MipContext > mMipContext
std::shared_ptr< ConsentDelegate > mConsentDelegate
std::shared_ptr< ProtectionProfile::Observer > mObserver

◆ Settings() [2/2]

ProtectionProfile::Settings::Settings ( const std::shared_ptr< MipContext > & mipContext,
CacheStorageType cacheStorageType,
const std::shared_ptr< ConsentDelegate > & consentDelegate )
inline

ProtectionProfile::Settings constructor, used for synchronous operations.

Parameters
mipContextGlobal context settings
cacheStorageTypeStore any cached state in memory or on disk
consentDelegateDelegate used to obtain user permission to access external resources
applicationInfoInfo about application which is consuming the protection SDK

Definition at line 202 of file protection_profile.h.

206 : Settings(mipContext, cacheStorageType, consentDelegate, nullptr /*observer*/) {
207 }
Settings(const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< ConsentDelegate > &consentDelegate, const std::shared_ptr< ProtectionProfile::Observer > &observer)
ProtectionProfile::Settings constructor that specifies an observer to be used for async operations.

Member Function Documentation

◆ AddRedirectionUri()

void ProtectionProfile::Settings::AddRedirectionUri ( const std::string & originalUri,
const std::string & redirectUri )
inline

Adds a redirect uri.

Parameters
originalUriThe uri that should be redirected from
redirectUriThe uri that will replace the originalUri
Note
Use this function to provide a domain that should be redirected to another Uri The originalUri will be normalized before comparison with the domain for the current request. If the domain of the current request matches that of the originalUri then the redirectUri will be used instead This redirection will occur before DNS lookup redirection

Definition at line 371 of file protection_profile.h.

371 {
372 mRedirectionUris[originalUri] = redirectUri;
373 }
std::map< std::string, std::string > mRedirectionUris

References mRedirectionUris.

◆ CanCacheLicenses()

bool ProtectionProfile::Settings::CanCacheLicenses ( ) const
inline

Gets whether or not end user licenses (EULs) are cached locally.

Returns
License caching configuration

Definition at line 319 of file protection_profile.h.

319 {
320 return mCanCacheLicenses;
321 }

References mCanCacheLicenses.

◆ GetCacheStorageType()

CacheStorageType ProtectionProfile::Settings::GetCacheStorageType ( ) const
inline

Get whether caches are stored in memory or on disk.

Returns
storage type used

Definition at line 218 of file protection_profile.h.

218{ return mCacheStorageType; }

References mCacheStorageType.

◆ GetConsentDelegate()

std::shared_ptr< ConsentDelegate > ProtectionProfile::Settings::GetConsentDelegate ( ) const
inline

Gets the consent delegate used for connecting to services.

Returns
Consent delegate used for connecting to services

Definition at line 225 of file protection_profile.h.

225{ return mConsentDelegate; }

References mConsentDelegate.

◆ GetCustomSettings()

const std::vector< std::pair< std::string, std::string > > & ProtectionProfile::Settings::GetCustomSettings ( ) const
inline

Get the custom settings, used for feature gating and testing.

Returns
List of name/value pairs.

Definition at line 337 of file protection_profile.h.

337 {
338 return mCustomSettings;
339 }
std::vector< std::pair< std::string, std::string > > mCustomSettings

References mCustomSettings.

◆ GetDnsRedirection()

DnsRedirection ProtectionProfile::Settings::GetDnsRedirection ( ) const
inline

Gets the dns redirect mode.

Returns
The redirect mode used

Definition at line 409 of file protection_profile.h.

409 {
410 return mDnsRedirection;
411 }

References mDnsRedirection.

◆ GetHttpDelegate()

std::shared_ptr< HttpDelegate > ProtectionProfile::Settings::GetHttpDelegate ( ) const
inline

Get the HTTP delegate (if any) provided by the application.

Returns
HTTP delegate to be used for HTTP operations

Definition at line 246 of file protection_profile.h.

246{ return mHttpDelegate; }
std::shared_ptr< HttpDelegate > mHttpDelegate

References mHttpDelegate.

◆ GetLoggerContext()

const std::shared_ptr< void > & ProtectionProfile::Settings::GetLoggerContext ( ) const
inline

Get logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.

Returns
The logger context

Definition at line 347 of file protection_profile.h.

347{ return mLoggerContext; }
std::shared_ptr< void > mLoggerContext

References mLoggerContext.

◆ GetMipContext()

std::shared_ptr< MipContext > ProtectionProfile::Settings::GetMipContext ( ) const
inline

Get MIP context which represents shared state across all profiles.

Returns
MIP context

Definition at line 239 of file protection_profile.h.

239{ return mMipContext; }

References mMipContext.

◆ GetObserver()

std::shared_ptr< ProtectionProfile::Observer > ProtectionProfile::Settings::GetObserver ( ) const
inline

Gets the observer that receives notifications of events related to ProtectionProfile.

Returns
Observer that receives notifications of events related to ProtectionProfile

Definition at line 232 of file protection_profile.h.

232{ return mObserver; }

References mObserver.

◆ GetRedirectionUris()

const std::map< std::string, std::string > & ProtectionProfile::Settings::GetRedirectionUris ( ) const
inline

Gets the redirection uris.

Returns
Map of redirection uris

Definition at line 380 of file protection_profile.h.

380 {
381 return mRedirectionUris;
382 }

References mRedirectionUris.

◆ GetSessionId()

const std::string & ProtectionProfile::Settings::GetSessionId ( ) const
inline

Gets the session ID.

Returns
Session ID that will be used to correlate logs/telemetry

Definition at line 300 of file protection_profile.h.

300{ return mSessionId; }

References mSessionId.

◆ GetStorageDelegate()

std::shared_ptr< StorageDelegate > ProtectionProfile::Settings::GetStorageDelegate ( ) const
inline

Get the StorageDelegate (if any) provided by the application.

Returns
StorageDelegate to be used for caching

Definition at line 260 of file protection_profile.h.

260{ return mStorageDelegate; }
std::shared_ptr< StorageDelegate > mStorageDelegate

References mStorageDelegate.

◆ GetTaskDispatcherDelegate()

std::shared_ptr< TaskDispatcherDelegate > ProtectionProfile::Settings::GetTaskDispatcherDelegate ( ) const
inline

Get the TaskDispatcher delegate (if any) provided by the application.

Returns
TaskDispatcher delegate to be used for executing asynchronous tasks

Definition at line 274 of file protection_profile.h.

274{ return mTaskDispatcherDelegate; }
std::shared_ptr< TaskDispatcherDelegate > mTaskDispatcherDelegate

References mTaskDispatcherDelegate.

◆ SetCanCacheLicenses()

void ProtectionProfile::Settings::SetCanCacheLicenses ( bool canCacheLicenses)
inline

Configures whether or not end user licenses (EULs) will be cached locally.

Parameters
canCacheLicensesWhether or not engine should cache a license when opening protected content
Note
If true, opening protected content will cache the associated license locally. If false, opening protected content will always perform HTTP operation to acquire the license from the RMS service.

Definition at line 310 of file protection_profile.h.

310 {
311 mCanCacheLicenses = canCacheLicenses;
312 }

References mCanCacheLicenses.

◆ SetCustomSettings()

void ProtectionProfile::Settings::SetCustomSettings ( const std::vector< std::pair< std::string, std::string > > & customSettings)
inline

Set the custom settings, used for feature gating and testing.

Parameters
customSettingsList of name/value pairs.

Definition at line 328 of file protection_profile.h.

328 {
329 mCustomSettings = customSettings;
330 }

References mCustomSettings.

◆ SetDnsRedirection()

void ProtectionProfile::Settings::SetDnsRedirection ( DnsRedirection dnsRedirection)
inline

Sets the dns redirection mode that controls how redirection is handled during online operations.

Parameters
dnsRedirectionThe redirection mode to use

Definition at line 418 of file protection_profile.h.

418 {
419 mDnsRedirection = dnsRedirection;
420 }

References mDnsRedirection.

◆ SetHttpDelegate()

void ProtectionProfile::Settings::SetHttpDelegate ( const std::shared_ptr< HttpDelegate > & httpDelegate)
inline

Override default HTTP stack with client's own.

Parameters
httpDelegateHTTP callback interface implemented by client application

Definition at line 253 of file protection_profile.h.

253{ mHttpDelegate = httpDelegate; }

References mHttpDelegate.

◆ SetLoggerContext()

void ProtectionProfile::Settings::SetLoggerContext ( const std::shared_ptr< void > & loggerContext)
inline

Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.

Parameters
loggerContextThe logger context

Definition at line 356 of file protection_profile.h.

356 {
357 mLoggerContext = loggerContext;
358 }

References mLoggerContext.

◆ SetSessionId()

void ProtectionProfile::Settings::SetSessionId ( const std::string & sessionId)
inline

Sets the session ID.

Parameters
sessionIdSession ID that will be used to correlate logs/telemetry

Definition at line 293 of file protection_profile.h.

293{ mSessionId = sessionId; }

References mSessionId.

◆ SetStorageDelegate()

void ProtectionProfile::Settings::SetStorageDelegate ( const std::shared_ptr< StorageDelegate > & storageDelegate)
inline

Override default storage cache with client's own implementation.

Parameters
storageDelegateStorageDelegate interface implemented by client application

Definition at line 267 of file protection_profile.h.

267{ mStorageDelegate = storageDelegate; }

References mStorageDelegate.

◆ SetTaskDispatcherDelegate()

void ProtectionProfile::Settings::SetTaskDispatcherDelegate ( const std::shared_ptr< TaskDispatcherDelegate > & taskDispatcherDelegate)
inline

Override default asynchonous task dispatching handling with client's own.

Parameters
taskDispatcherDelegateTask dispatching callback interface implemented by client application
Note
tasks can reference profile objects preventing its destruction as a result taskdispatcher queues should not be shared.

Definition at line 284 of file protection_profile.h.

284 {
285 mTaskDispatcherDelegate = taskDispatcherDelegate;
286 }

References mTaskDispatcherDelegate.

Member Data Documentation

◆ mCacheStorageType

CacheStorageType ProtectionProfile::Settings::mCacheStorageType
private

Definition at line 424 of file protection_profile.h.

Referenced by GetCacheStorageType().

◆ mCanCacheLicenses

bool ProtectionProfile::Settings::mCanCacheLicenses = true
private

Definition at line 430 of file protection_profile.h.

Referenced by CanCacheLicenses(), and SetCanCacheLicenses().

◆ mConsentDelegate

std::shared_ptr<ConsentDelegate> ProtectionProfile::Settings::mConsentDelegate
private

Definition at line 425 of file protection_profile.h.

Referenced by GetConsentDelegate().

◆ mCustomSettings

std::vector<std::pair<std::string, std::string> > ProtectionProfile::Settings::mCustomSettings
private

Definition at line 431 of file protection_profile.h.

Referenced by GetCustomSettings(), and SetCustomSettings().

◆ mDnsRedirection

DnsRedirection ProtectionProfile::Settings::mDnsRedirection
private

Definition at line 438 of file protection_profile.h.

Referenced by GetDnsRedirection(), and SetDnsRedirection().

◆ mHttpDelegate

std::shared_ptr<HttpDelegate> ProtectionProfile::Settings::mHttpDelegate
private

Definition at line 427 of file protection_profile.h.

Referenced by GetHttpDelegate(), and SetHttpDelegate().

◆ mLoggerContext

std::shared_ptr<void> ProtectionProfile::Settings::mLoggerContext
private

Definition at line 432 of file protection_profile.h.

Referenced by GetLoggerContext(), and SetLoggerContext().

◆ mMipContext

std::shared_ptr<MipContext> ProtectionProfile::Settings::mMipContext
private

Definition at line 423 of file protection_profile.h.

Referenced by GetMipContext().

◆ mObserver

std::shared_ptr<ProtectionProfile::Observer> ProtectionProfile::Settings::mObserver
private

Definition at line 426 of file protection_profile.h.

Referenced by GetObserver().

◆ mRedirectionUris

std::map<std::string, std::string> ProtectionProfile::Settings::mRedirectionUris
private

Definition at line 433 of file protection_profile.h.

Referenced by AddRedirectionUri(), and GetRedirectionUris().

◆ mSessionId

std::string ProtectionProfile::Settings::mSessionId
private

Definition at line 429 of file protection_profile.h.

Referenced by GetSessionId(), and SetSessionId().

◆ mStorageDelegate

std::shared_ptr<StorageDelegate> ProtectionProfile::Settings::mStorageDelegate
private

Definition at line 434 of file protection_profile.h.

Referenced by GetStorageDelegate(), and SetStorageDelegate().

◆ mTaskDispatcherDelegate

std::shared_ptr<TaskDispatcherDelegate> ProtectionProfile::Settings::mTaskDispatcherDelegate
private

Definition at line 428 of file protection_profile.h.

Referenced by GetTaskDispatcherDelegate(), and SetTaskDispatcherDelegate().


The documentation for this class was generated from the following file: