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