pEpObjCAdapter/PEPMessageUtil.h
author Dirk Zimmermann <dirk@pep-project.org>
Mon, 10 Sep 2018 12:06:49 +0200
changeset 649 090fa902a419
parent 597 aa68b6d6a966
child 656 c89b619e9e70
permissions -rw-r--r--
IOSAD-99 message *PEP_messageToStruct(PEPMessage *message)
dirk@187
     1
//
dirk@367
     2
//  PEPMessageUtil.h
dirk@187
     3
//  pEpiOSAdapter
dirk@187
     4
//
dirk@187
     5
//  Created by Volker Birk on 09.07.15.
dirk@187
     6
//  Copyright (c) 2015 p≡p. All rights reserved.
dirk@187
     7
//
dirk@187
     8
dirk@187
     9
#import <Foundation/Foundation.h>
dirk@187
    10
dirk@187
    11
#include "message_api.h"
dirk@187
    12
dirk@307
    13
@class PEPIdentity;
dirk@481
    14
@class PEPMessage;
dirk@307
    15
dirk@187
    16
NSArray * _Nonnull PEP_arrayFromStringlist(stringlist_t * _Nonnull sl);
dirk@187
    17
stringlist_t * _Nullable PEP_arrayToStringlist(NSArray * _Nullable array);
dirk@187
    18
dirk@307
    19
pEp_identity * _Nonnull PEP_identityToStruct(PEPIdentity * _Nonnull identity);
dirk@352
    20
dirk@352
    21
/**
dirk@352
    22
 If the ident does not contain an address, no PEPIdentity can be constructed.
dirk@352
    23
 */
dirk@352
    24
PEPIdentity * _Nullable PEP_identityFromStruct(pEp_identity * _Nonnull ident);
dirk@307
    25
dirk@187
    26
pEp_identity * _Nullable PEP_identityDictToStruct(NSDictionary * _Nullable dict);
dirk@187
    27
NSDictionary * _Nonnull PEP_identityDictFromStruct(pEp_identity * _Nullable ident);
dirk@187
    28
dirk@481
    29
PEPMessage * _Nullable pEpMessageFromStruct(message * _Nullable msg);
dirk@481
    30
dirk@649
    31
message *PEP_messageToStruct(PEPMessage *message);
dirk@187
    32
message * _Nullable PEP_messageDictToStruct(NSDictionary * _Nullable dict);
dirk@187
    33
NSDictionary * _Nonnull PEP_messageDictFromStruct(message * _Nullable msg);
dirk@187
    34
dirk@597
    35
NSArray *PEP_identityArrayFromList(identity_list *il);
dirk@597
    36
NSArray *PEP_arrayFromStringPairlist(stringpair_list_t *sl);
dirk@597
    37
NSArray *PEP_arrayFromBloblist(bloblist_t *bl);
dirk@597
    38
dirk@187
    39
#pragma mark -- Constants
dirk@187
    40
dirk@187
    41
/** The name of the user */
dirk@187
    42
extern NSString *const _Nonnull kPepUsername;
dirk@187
    43
dirk@187
    44
/** Email address of the contact */
dirk@187
    45
extern NSString *const _Nonnull kPepAddress;
dirk@187
    46
dirk@187
    47
/**
dirk@187
    48
 A user ID, used by pEp to map multiple identities to a single user.
andreas@406
    49
 This should be a stable ID.
dirk@187
    50
 pEp identities set up with mySelf() get a special user ID.
dirk@187
    51
 */
dirk@187
    52
extern NSString *const _Nonnull kPepUserID;
dirk@187
    53
andreas@406
    54
/**
andreas@406
    55
 Dict key for value isOwn/me.
andreas@406
    56
 isOwn indicates the identity is representing me. 
andreas@406
    57
 */
andreas@406
    58
extern NSString *const _Nonnull kPepIsOwn;
andreas@406
    59
dirk@187
    60
/** The fingerprint for the key for this contact. */
dirk@187
    61
extern NSString *const _Nonnull kPepFingerprint;
dirk@187
    62
dirk@187
    63
/** In an email, the identity this email is from */
dirk@187
    64
extern NSString *const _Nonnull kPepFrom;
dirk@187
    65
dirk@187
    66
/** In an email, the `NSArray` of to recipients */
dirk@187
    67
extern NSString *const _Nonnull kPepTo;
dirk@187
    68
dirk@187
    69
/** In an email, the `NSArray` of CC recipients */
dirk@187
    70
extern NSString *const _Nonnull kPepCC;
dirk@187
    71
dirk@187
    72
/** In an email, the `NSArray` of BCC recipients */
dirk@187
    73
extern NSString *const _Nonnull kPepBCC;
dirk@187
    74
dirk@187
    75
/** The subject of an email */
dirk@187
    76
extern NSString *const _Nonnull kPepShortMessage;
dirk@187
    77
dirk@187
    78
/** The text message of an email */
dirk@187
    79
extern NSString *const _Nonnull kPepLongMessage;
dirk@187
    80
dirk@187
    81
/** HTML message part, if any */
dirk@187
    82
extern NSString *const _Nonnull kPepLongMessageFormatted;
dirk@187
    83
dirk@187
    84
/** NSNumber denoting a boolean. True if that message is supposed to be sent. */
dirk@187
    85
extern NSString *const _Nonnull kPepOutgoing;
dirk@187
    86
dirk@187
    87
/** Sent date of the message (NSDate) */
dirk@187
    88
extern NSString *const _Nonnull kPepSent;
dirk@187
    89
dirk@187
    90
/** Received date of the message (NSDate) */
dirk@187
    91
extern NSString *const _Nonnull kPepReceived;
dirk@187
    92
dirk@187
    93
/** The message ID */
dirk@187
    94
extern NSString *const _Nonnull kPepID;
dirk@187
    95
dirk@187
    96
extern NSString *const _Nonnull kPepReceivedBy;
dirk@187
    97
extern NSString *const _Nonnull kPepReplyTo;
dirk@187
    98
extern NSString *const _Nonnull kPepInReplyTo;
dirk@187
    99
extern NSString *const _Nonnull kPepReferences;
dirk@187
   100
extern NSString *const _Nonnull kPepKeywords;
dirk@187
   101
extern NSString *const _Nonnull kPepOptFields;
dirk@187
   102
dirk@187
   103
/** NSArray of attachment dicts */
dirk@187
   104
extern NSString *const _Nonnull kPepAttachments;
dirk@187
   105
dirk@187
   106
/** The pEp internal communication type */
dirk@187
   107
extern NSString *const _Nonnull kPepCommType;
dirk@187
   108
dirk@187
   109
/** The raw message created by pEp (NSData) */
dirk@187
   110
extern NSString *const _Nonnull kPepRawMessage;
dirk@187
   111
dirk@187
   112
/** NSError parameters will use this domain */
dirk@187
   113
extern NSString *const _Nonnull PEPSessionErrorDomain;
dirk@187
   114
dirk@187
   115
/** Optional field "X-pEp-Version" */
dirk@187
   116
extern NSString *const _Nonnull kXpEpVersion;
dirk@187
   117
dirk@187
   118
/** Optional field "X-EncStatus" */
dirk@187
   119
extern NSString *const _Nonnull kXEncStatus;
dirk@187
   120
dirk@187
   121
/** Optional field "X-KeyList" */
dirk@187
   122
extern NSString *const _Nonnull kXKeylist;
dirk@302
   123
dirk@302
   124
/** Key for the boolean flag that denotes own identities */
dirk@302
   125
extern NSString *const _Nonnull kPepIsOwnIdentity;