this repo has no description
1/*
2 * Copyright (c) 2012 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#import <Foundation/Foundation.h>
25
26@class ODRecordMap;
27
28NS_CLASS_AVAILABLE(10_9, NA)
29@interface ODMappings : NSObject {
30 @protected
31 NSString *comment;
32 NSString *templateName;
33 NSString *identifier;
34 NSString *function;
35 NSArray *functionAttributes;
36 NSMutableDictionary *recordTypes;
37}
38
39/* Short comment about the mappings */
40@property(copy) NSString *comment NS_AVAILABLE_MAC(10_9);
41
42/*
43 * Name of the mappings template to be used for this configuration from /System/Library/OpenDirectory/Mappings or /Library/OpenDirectory/Mappings
44 * if a template is used, then no other values should be set, template is an exclusive setting
45 */
46@property(copy) NSString *templateName NS_AVAILABLE_MAC(10_9);
47
48/* RFC1034 identifier for this mapping, com.company.mapping */
49@property(copy) NSString *identifier NS_AVAILABLE_MAC(10_9);
50
51/* Returns a list of NSString values for all attributes currently configured */
52@property(readonly, copy) NSArray *recordTypes NS_AVAILABLE_MAC(10_9);
53
54/* function to translate record types */
55@property(copy) NSString *function NS_AVAILABLE_MAC(10_9);
56
57/* native attributes required for translation function to work */
58@property(copy) NSArray *functionAttributes NS_AVAILABLE_MAC(10_9);
59
60/*!
61 * @method mappings
62 *
63 * @abstract
64 * Returns an initialized and autoreleased ODMappings object.
65 *
66 * @discussion
67 * Returns an initialized and autoreleased ODMappings object.
68 */
69+ (instancetype)mappings;
70
71/*!
72 * @method recordType:
73 *
74 * @abstract
75 * Returns an ODRecordMap associated with the provided recordtype.
76 *
77 * @discussion
78 * Returns an ODRecordMap associated with the provided recordtype.
79 */
80- (ODRecordMap *) recordMapForStandardRecordType:(NSString *)stdType NS_AVAILABLE_MAC(10_9);
81
82/*!
83 * @method setRecordMap:forRecordType:
84 *
85 * @abstract
86 * Sets a particular ODRecordMap for a given standard record type.
87 *
88 * @discussion
89 * Sets a particular ODRecordMap for a given standard record type.
90 */
91- (void) setRecordMap:(ODRecordMap *)map forStandardRecordType:(NSString *)stdType NS_AVAILABLE_MAC(10_9);
92
93@end