pEpObjCAdapter/PEPIdentity.h
author Dirk Zimmermann <dirk@pep-project.org>
Thu, 17 May 2018 09:33:33 +0200
changeset 616 9e50cc7cd612
parent 567 b9439926c09f
permissions -rw-r--r--
IOSAD-93 consistently using precomposedStringWithCanonicalMapping, stringWithUTF8String
     1 //
     2 //  PEPIdentity.h
     3 //  pEpObjCAdapter
     4 //
     5 //  Created by Dirk Zimmermann on 30.10.17.
     6 //  Copyright © 2017 p≡p. All rights reserved.
     7 //
     8 
     9 #import <Foundation/Foundation.h>
    10 
    11 #import "PEPSessionProtocol.h"
    12 
    13 @class PEPSession;
    14 
    15 @interface PEPIdentity : NSObject <NSMutableCopying>
    16 
    17 /**
    18  The network address of this identity
    19  */
    20 @property (nonatomic, nonnull) NSString *address;
    21 
    22 /**
    23  The (optional) user ID.
    24  */
    25 @property (nonatomic, nullable) NSString *userID;
    26 
    27 /**
    28  The (optional) user name.
    29  */
    30 @property (nonatomic, nullable) NSString *userName;
    31 
    32 /**
    33  The (optional) fingerprint.
    34  */
    35 @property (nonatomic, nullable) NSString *fingerPrint;
    36 
    37 /**
    38  The (optional) language that this identity uses.
    39  */
    40 @property (nonatomic, nullable) NSString *language;
    41 
    42 /**
    43  The comm type of this identity.
    44  */
    45 @property PEP_comm_type commType;
    46 
    47 /**
    48  Is this one of our own identities?
    49  */
    50 @property BOOL isOwn;
    51 
    52 /**
    53  Comm type contains the PEP_ct_confirmed flag?
    54  */
    55 @property (readonly) BOOL isConfirmed;
    56 
    57 - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    58                                  userID:(NSString * _Nullable)userID
    59                                userName:(NSString * _Nullable)userName
    60                                   isOwn:(BOOL)isOwn
    61                             fingerPrint:(NSString * _Nullable)fingerPrint
    62                                commType:(PEP_comm_type)commType
    63                                language:(NSString * _Nullable)language;
    64 
    65 - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    66                                  userID:(NSString * _Nullable)userID
    67                                userName:(NSString * _Nullable)userName
    68                                   isOwn:(BOOL)isOwn
    69                             fingerPrint:(NSString * _Nullable)fingerPrint;
    70 
    71 - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address
    72                                  userID:(NSString * _Nullable)userID
    73                                userName:(NSString * _Nullable)userName
    74                                   isOwn:(BOOL)isOwn;
    75 
    76 - (nonnull instancetype)initWithAddress:(NSString * _Nonnull)address;
    77 
    78 - (nonnull instancetype)initWithDictionary:(NSDictionary * _Nonnull)dictionary;
    79 
    80 /**
    81  Copy constructor.
    82  */
    83 - (nonnull instancetype)initWithIdentity:(PEPIdentity * _Nonnull)identity;
    84 
    85 /**
    86  This method should be removed once the adapter fully supports objects for identity
    87  and message types insead of dictionaries.
    88  */
    89 - (PEPDict * _Nonnull)dictionary;
    90 
    91 /**
    92  This method should be removed once the adapter fully supports objects for identity
    93  and message types insead of dictionaries.
    94  */
    95 - (PEPMutableDict * _Nonnull)mutableDictionary;
    96 
    97 /**
    98  Is the given identity a pEp user, from the engine's point of view?
    99  */
   100 - (NSNumber * _Nullable)isPEPUser:(PEPSession * _Nullable)session
   101                             error:(NSError * _Nullable * _Nullable)error;
   102 
   103 /**
   104  Puts all properties into a default/nil state.
   105  */
   106 - (void)reset;
   107 
   108 @end