PageRenderTime 47ms CodeModel.GetById 34ms app.highlight 10ms RepoModel.GetById 2ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Contacts/GDataFeedContact.m

http://macfuse.googlecode.com/
Objective C | 87 lines | 46 code | 24 blank | 17 comment | 4 complexity | d58103be2106ae321085b90689f18d9e MD5 | raw file
 1/* Copyright (c) 2008 Google Inc.
 2 *
 3 * Licensed under the Apache License, Version 2.0 (the "License");
 4 * you may not use this file except in compliance with the License.
 5 * You may obtain a copy of the License at
 6 *
 7 *     http://www.apache.org/licenses/LICENSE-2.0
 8 *
 9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16//
17//  GDataFeedContact.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE
21
22#import "GDataFeedContact.h"
23
24#import "GDataEntryContact.h"
25#import "GDataWhere.h"
26#import "GDataCategory.h"
27#import "GDataContactConstants.h"
28
29@implementation GDataFeedContact
30
31+ (NSString *)coreProtocolVersionForServiceVersion:(NSString *)serviceVersion {
32  return [GDataContactConstants coreProtocolVersionForServiceVersion:serviceVersion];
33}
34
35+ (NSString *)standardFeedKind {
36  return kGDataCategoryContact;
37}
38
39+ (void)load {
40  [self registerFeedClass];
41}
42
43+ (GDataFeedContact *)contactFeed {
44  GDataFeedContact *obj = [self object];
45
46  [obj setNamespaces:[GDataContactConstants contactNamespaces]];
47
48  return obj;
49}
50
51- (void)addExtensionDeclarations {
52  
53  [super addExtensionDeclarations];
54  
55  Class feedClass = [self class];
56  [self addExtensionDeclarationForParentClass:feedClass
57                                   childClass:[GDataWhere class]];  
58}
59
60- (Class)classForEntries {
61  return [GDataEntryContact class];
62}
63
64+ (NSString *)defaultServiceVersion {
65  return kGDataContactDefaultServiceVersion;
66}
67
68#pragma mark -
69
70- (NSArray *)entriesWithGroupHref:(NSString *)href {
71
72  NSArray *entries = [self entries];
73  NSMutableArray *array = [NSMutableArray array];
74
75  for (GDataEntryContact *entry in entries) {
76
77    if ([entry groupMembershipInfoWithHref:href] != nil) {
78      [array addObject:entry];
79    }
80  }
81
82  return array;
83}
84
85@end
86
87#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE