Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
msg_inspector.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#ifndef API_MIP_FILE_MSG_INSPECTOR_H_
29#define API_MIP_FILE_MSG_INSPECTOR_H_
30
31#include <memory>
32#include <vector>
33
35#include "mip/mip_namespace.h"
36
37MIP_NAMESPACE_BEGIN
38
39/**
40 * @brief Body type enumerator.
41 */
42enum class BodyType : unsigned int {
43 UNKNOWN = 0, /**< Unkown body type */
44 TXT = 1, /**< Text style body type, encoding is returned as utf8 */
45 HTML = 2, /**< HTML style body type, encoding is returned as utf8 */
46 RTF = 3 /**< RTF style body type, a binary format */
47};
48
50public:
51 /**
52 * @brief Get attachment as a binary byte vector.
53 */
54 virtual const std::vector<uint8_t>& GetBytes() = 0;
55 /**
56 * @brief Get attachment as a binary stream.
57 */
58 virtual std::shared_ptr<Stream> GetStream() const = 0;
59 /**
60 * @brief Get attachment name as a string.
61 */
62 virtual const std::string& GetName() const = 0;
63 /**
64 * @brief Get attachment long name as a string.
65 */
66 virtual const std::string& GetLongName() const = 0;
67 /**
68 * @brief Get attachment path name as a string. if path not empty then reference attachment.
69 */
70 virtual const std::string& GetPath() const = 0;
71 /**
72 * @brief Get attachment long path name as a string. if path not empty then reference attachment.
73 */
74 virtual const std::string& GetLongPath() const = 0;
75 /** @cond DOXYGEN_HIDE */
76 virtual ~MsgAttachmentData() {}
77 /** @endcond */
78};
79
81public:
82 /**
83 * @brief Get the body of the msg. if TXT/HTML formatted as utf8.
84 *
85 * @return a vector of bytes.
86 */
87 virtual const std::vector<uint8_t>& GetBody() const = 0;
88 /**
89 * @brief Get body encoding code page, relevant for txt, html body formats.
90 *
91 * @return an unsigned code page. @see https://docs.microsoft.com/en-us/windows/win32/intl/code-page-identifiers
92 */
93 virtual unsigned int GetCodePage() const = 0;
94 /**
95 * @brief Get body type.
96 *
97 * @return the message's body type.
98 */
99 virtual BodyType GetBodyType() const = 0;
100 /**
101 * @brief Get a list of attachment as msg attachment data objects.
102 *
103 * @return a vector of std::unique_ptr<MsgAttachmentData>
104 */
105 virtual const std::vector<std::shared_ptr<MsgAttachmentData>>& GetAttachments() const = 0;
106 /** @cond DOXYGEN_HIDE */
107 virtual ~MsgInspector() {}
108 /** @endcond */
109};
110
111MIP_NAMESPACE_END
112
113#endif // API_MIP_FILE_MSG_INSPECTOR_H_
virtual const std::string & GetPath() const =0
Get attachment path name as a string.
virtual const std::string & GetLongPath() const =0
Get attachment long path name as a string.
virtual const std::vector< uint8_t > & GetBytes()=0
Get attachment as a binary byte vector.
virtual std::shared_ptr< Stream > GetStream() const =0
Get attachment as a binary stream.
virtual const std::string & GetLongName() const =0
Get attachment long name as a string.
virtual const std::string & GetName() const =0
Get attachment name as a string.
virtual unsigned int GetCodePage() const =0
Get body encoding code page, relevant for txt, html body formats.
virtual const std::vector< uint8_t > & GetBody() const =0
Get the body of the msg.
virtual BodyType GetBodyType() const =0
Get body type.
virtual const std::vector< std::shared_ptr< MsgAttachmentData > > & GetAttachments() const =0
Get a list of attachment as msg attachment data objects.
MIP namespace macros.
BodyType
Body type enumerator.
@ HTML
HTML style body type, encoding is returned as utf8.
@ TXT
Text style body type, encoding is returned as utf8.
@ UNKNOWN
Unkown body type.
@ RTF
RTF style body type, a binary format.