Today's Menu  Portugal
journal and plan nutrition
Instance Methods | Properties | List of all members
Z5GoogleCalendarDataController Class Reference

#import <Z5GoogleCalendarDataController.h>

Inheritance diagram for Z5GoogleCalendarDataController:
Inheritance graph
[legend]
Collaboration diagram for Z5GoogleCalendarDataController:
Collaboration graph
[legend]

Instance Methods

(void) - addCalendarListener:
 
(void) - removeCalendarListener:
 
(id) - init [implementation]
 
(void) - connectToLogin [implementation]
 
(void) - signedIn: [implementation]
 
(void) - signedOut: [implementation]
 

Properties

GTLRCalendarService * service
 

Detailed Description

Definition at line 15 of file Z5GoogleCalendarDataController.h.

Method Documentation

◆ addCalendarListener:()

- (void) addCalendarListener: (id<Z5GoogleCalendarListener>)  ear

Definition at line 28 of file Z5GoogleCalendarDataController.m.

28  : (id<Z5GoogleCalendarListener>)ear
29 {
30  [self connectToLogin];
31  [localCalendarListeners addObject:ear];
32 }

◆ connectToLogin()

- (void) connectToLogin
implementation

Definition at line 37 of file Z5GoogleCalendarDataController.m.

38 {
39  Z5GoogleLoginController *loginControl = [[[Z5DataController sharedInstance] remoteDataController] loginController];
40  [loginControl addLoginListener:self];
41 }
void addLoginListener:(id< Z5GoogleLoginListener > ear)
instancetype sharedInstance()
Singleton interface to both core and remote data sources.

◆ init()

- (id) init
implementation

Definition at line 17 of file Z5GoogleCalendarDataController.m.

18 {
19  // Initialize the service object.
20  self.service = [[GTLRCalendarService alloc] init];
21 
22  localCalendarListeners = [[NSMutableArray alloc] initWithCapacity:10];
23 
24  return self;
25 }

◆ removeCalendarListener:()

- (void) removeCalendarListener: (id<Z5GoogleCalendarListener>)  ear

Definition at line 33 of file Z5GoogleCalendarDataController.m.

33  : (id<Z5GoogleCalendarListener>)ear
34 {
35  [localCalendarListeners removeObject:ear];
36 }

◆ signedIn:()

- (void) signedIn: (GIDGoogleUser *)  user
implementation

Definition at line 44 of file Z5GoogleCalendarDataController.m.

44  : (GIDGoogleUser *)user
45 {
46  NSLog(@"GoogleCalendarController.signedIn: %@", user.profile.name);
47  self.service.authorizer = user.authentication.fetcherAuthorizer;
48 }
GIDProfileData * profile
Definition: GIDGoogleUser.h:24
id< GTMFetcherAuthorizationProtocol > fetcherAuthorizer()
NSString * name
GIDAuthentication * authentication
Definition: GIDGoogleUser.h:27

◆ signedOut:()

- (void) signedOut: (GIDGoogleUser *)  user
implementation

Definition at line 49 of file Z5GoogleCalendarDataController.m.

49  :(GIDGoogleUser *)user
50 {
51  self.service.authorizer = nil;
52 }

Property Documentation

◆ service

- (GTLRCalendarService*) service
readwritenonatomicstrong

Definition at line 17 of file Z5GoogleCalendarDataController.h.


The documentation for this class was generated from the following files: