PageRenderTime 53ms CodeModel.GetById 14ms app.highlight 36ms RepoModel.GetById 2ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/ACL/GDataServiceACL.m

http://macfuse.googlecode.com/
Objective C | 96 lines | 55 code | 20 blank | 21 comment | 9 complexity | ce0aed5439470d3f7fd36811ea5eb757 MD5 | raw file
 1/* Copyright (c) 2009 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//  GDataServiceACL.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ACLS \
21  || GDATA_INCLUDE_CALENDAR_SERVICE || GDATA_INCLUDE_DOCS_SERVICE
22
23#import "GDataServiceACL.h"
24#import "GDataEntryACL.h"
25
26@implementation GDataServiceGoogle (GDataServiceACLAdditions)
27
28
29// ACL feed and entry support
30
31- (GDataServiceTicket *)fetchACLFeedWithURL:(NSURL *)feedURL
32                                   delegate:(id)delegate
33                          didFinishSelector:(SEL)finishedSelector {
34
35  return [self fetchFeedWithURL:feedURL
36                       delegate:delegate
37              didFinishSelector:finishedSelector];
38}
39
40- (GDataServiceTicket *)fetchACLEntryByInsertingEntry:(GDataEntryACL *)entryToInsert
41                                           forFeedURL:(NSURL *)feedURL
42                                             delegate:(id)delegate
43                                    didFinishSelector:(SEL)finishedSelector {
44  // add ACL namespaces, if needed
45  if ([entryToInsert namespaces] == nil) {
46    [entryToInsert setNamespaces:[[entryToInsert class] ACLNamespaces]];
47  }
48
49  return [self fetchEntryByInsertingEntry:entryToInsert
50                               forFeedURL:feedURL
51                                 delegate:delegate
52                        didFinishSelector:finishedSelector];
53}
54
55- (GDataServiceTicket *)fetchACLEntryByUpdatingEntry:(GDataEntryACL *)entryToUpdate
56                                            delegate:(id)delegate
57                                   didFinishSelector:(SEL)finishedSelector {
58
59  // add ACL namespaces, if needed
60  if ([entryToUpdate namespaces] == nil) {
61    [entryToUpdate setNamespaces:[[entryToUpdate class] ACLNamespaces]];
62  }
63
64  return [self fetchEntryByUpdatingEntry:entryToUpdate
65                                delegate:delegate
66                       didFinishSelector:finishedSelector];
67}
68
69- (GDataServiceTicket *)fetchACLEntryByUpdatingEntry:(GDataEntryACL *)entryToUpdate
70                                         forEntryURL:(NSURL *)entryURL
71                                            delegate:(id)delegate
72                                   didFinishSelector:(SEL)finishedSelector {
73
74  // add ACL namespaces, if needed
75  if ([entryToUpdate namespaces] == nil) {
76    [entryToUpdate setNamespaces:[[entryToUpdate class] ACLNamespaces]];
77  }
78
79  return [self fetchEntryByUpdatingEntry:entryToUpdate
80                             forEntryURL:entryURL
81                                delegate:delegate
82                       didFinishSelector:finishedSelector];
83}
84
85- (GDataServiceTicket *)deleteACLEntry:(GDataEntryACL *)entryToDelete
86                              delegate:(id)delegate
87                     didFinishSelector:(SEL)finishedSelector {
88
89  return [self deleteEntry:entryToDelete
90                  delegate:delegate
91         didFinishSelector:finishedSelector];
92}
93
94@end
95
96#endif // !GDATA_REQUIRE_SERVICE_INCLUDE || GDATA_INCLUDE_*