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 ODAttributeMap;
27
28NS_CLASS_AVAILABLE_MAC(10_9)
29@interface ODRecordMap : NSObject {
30 @protected
31 NSString *native;
32 NSDictionary *odPredicate;
33 NSMutableDictionary *attributes;
34}
35
36/* native value for this attribute, if not present, translation function or preformed OD predicate must be present */
37@property(copy) NSString *native NS_AVAILABLE_MAC(10_9);
38
39/*
40 * preformed OD-style predicate that defines a query for a specific record type
41 *
42 * predicate dictionary:
43 * attribute : <native attribute>
44 * values : [ <value> ] # note multiple values will be treated as AND
45 * matchtype : <value from kODMatchEqualTo(0x2001) | kODMatchBeginsWith(0x2002) | kODMatchContains(0x2003) | kODMatchEndsWith(0x2004)>
46 *
47 * nested predicates
48 * operator : { OR | AND | NOT }
49 * predicates : [ <predicate>, ... ]
50 */
51@property(copy) NSDictionary *odPredicate NS_AVAILABLE_MAC(10_9);
52
53/* dictionary of OpenDirectory standard attributes as a key and a value of ODAttributeMap */
54@property(readonly, copy) NSDictionary *attributes NS_AVAILABLE_MAC(10_9);
55
56/* returns an array of NSStrings that list the attributes for this recordmap */
57@property(readonly, copy) NSArray *standardAttributeTypes NS_AVAILABLE_MAC(10_9);
58
59/*!
60 * @method recordMap
61 *
62 * @abstract
63 * Returns an initialized and autoreleased ODRecordMap object.
64 *
65 * @discussion
66 * Returns an initialized and autoreleased ODRecordMap object.
67 */
68+ (instancetype)recordMap;
69
70/*!
71 * @method attributeMapForStandardAttribute:
72 *
73 * @abstract
74 * Returns an ODAttributeMap object for the given OD standard attribute.
75 *
76 * @discussion
77 * Returns an ODAttributeMap object for the given OD standard attribute.
78 */
79- (ODAttributeMap *)attributeMapForStandardAttribute:(NSString *)standardAttribute NS_AVAILABLE_MAC(10_9);
80
81/*!
82 * @method setAttributeMap:forStandardAttribute:
83 *
84 * @abstract
85 * Sets an ODAttributeMap object for a given OD standard attribute.
86 *
87 * @discussion
88 * Sets an ODAttributeMap object for a given OD standard attribute.
89 */
90- (void)setAttributeMap:(ODAttributeMap *)attributeMap forStandardAttribute:(NSString *)standardAttribute NS_AVAILABLE_MAC(10_9);
91
92@end