From 5c4ae69f549eeccf94da6d3e432cf1ddc16f1eff Mon Sep 17 00:00:00 2001 From: Sergio Campama Date: Tue, 28 Mar 2017 14:18:52 -0400 Subject: [PATCH] Remove trailing whitespaces --- .../ContactsSampleAppController.m | 4 +- .../ContactsSampleWindowController.h | 18 +- .../ContactsSampleWindowController.m | 550 +++++++++--------- .../EditEntryWindowController.h | 4 +- .../EditEntryWindowController.m | 86 +-- .../GooglePhotosSampleAppController.m | 4 +- .../GooglePhotosSampleWindowController.h | 10 +- .../GooglePhotosSampleWindowController.m | 148 ++--- .../SpreadsheetSampleAppController.m | 4 +- .../SpreadsheetSampleWindowController.h | 10 +- .../SpreadsheetSampleWindowController.m | 144 ++--- Source/ACL/GDataACLRole.h | 4 +- Source/ACL/GDataACLScope.h | 4 +- Source/ACL/GDataACLScope.m | 2 +- Source/ACL/GDataFeedACL.h | 2 +- Source/ACL/GDataFeedACL.m | 4 +- Source/BaseClasses/GDataQuery.m | 2 +- Source/Clients/Blogger/GDataBlogger.h | 2 +- Source/Clients/Calendar/GDataCalendar.h | 2 +- Source/Clients/Calendar/GDataEntryCalendar.h | 2 +- Source/Clients/Calendar/GDataEntryCalendar.m | 22 +- .../Calendar/GDataEntryCalendarEvent.h | 6 +- .../Calendar/GDataEntryCalendarEvent.m | 28 +- Source/Clients/Calendar/GDataEntryEvent.h | 4 +- Source/Clients/Calendar/GDataEntryEvent.m | 22 +- Source/Clients/Calendar/GDataEntryMessage.h | 2 +- Source/Clients/Calendar/GDataEntryMessage.m | 20 +- Source/Clients/Calendar/GDataFeedEvent.m | 6 +- Source/Clients/Calendar/GDataOriginalEvent.m | 16 +- Source/Clients/Calendar/GDataQueryCalendar.m | 6 +- Source/Clients/Calendar/GDataRecurrence.m | 4 +- .../Calendar/GDataRecurrenceException.h | 4 +- .../Calendar/GDataRecurrenceException.m | 28 +- Source/Clients/Calendar/GDataReminder.h | 4 +- Source/Clients/Calendar/GDataReminder.m | 8 +- .../Calendar/GDataServiceGoogleCalendar.h | 6 +- .../Calendar/GDataServiceGoogleCalendar.m | 4 +- Source/Clients/Calendar/GDataWebContent.h | 6 +- Source/Clients/Calendar/GDataWebContent.m | 38 +- .../Clients/Contacts/GDataContactElements.h | 6 +- Source/Clients/Contacts/GDataContactEvent.h | 2 +- Source/Clients/Contacts/GDataContactJot.m | 10 +- .../Clients/Contacts/GDataContactLanguage.m | 4 +- Source/Clients/Contacts/GDataContactLink.h | 2 +- Source/Clients/Contacts/GDataContactLink.m | 14 +- .../Clients/Contacts/GDataContactPriority.m | 4 +- .../Clients/Contacts/GDataContactRelation.m | 12 +- .../Contacts/GDataContactSensitivity.m | 4 +- Source/Clients/Contacts/GDataContacts.h | 2 +- Source/Clients/Contacts/GDataEntryContact.m | 10 +- .../Clients/Contacts/GDataEntryContactGroup.m | 20 +- Source/Clients/Contacts/GDataFeedContact.m | 6 +- .../Clients/Contacts/GDataFeedContactGroup.m | 2 +- .../Contacts/GDataGroupMembershipInfo.h | 2 +- .../Contacts/GDataGroupMembershipInfo.m | 14 +- Source/Clients/Contacts/GDataQueryContact.h | 2 +- Source/Clients/Contacts/GDataQueryContact.m | 8 +- Source/Clients/Docs/GDataDocs.h | 2 +- Source/Clients/Docs/GDataQueryDocs.h | 4 +- Source/Clients/Docs/GDataServiceGoogleDocs.h | 4 +- Source/Clients/Photos/GDataEXIFTags.h | 8 +- Source/Clients/Photos/GDataEXIFTags.m | 44 +- Source/Clients/Photos/GDataEntryPhoto.h | 6 +- Source/Clients/Photos/GDataEntryPhoto.m | 30 +- Source/Clients/Photos/GDataEntryPhotoAlbum.m | 26 +- Source/Clients/Photos/GDataEntryPhotoBase.m | 16 +- .../Clients/Photos/GDataEntryPhotoComment.m | 22 +- Source/Clients/Photos/GDataEntryPhotoTag.m | 20 +- Source/Clients/Photos/GDataEntryPhotoUser.m | 28 +- Source/Clients/Photos/GDataFeedPhoto.h | 2 +- Source/Clients/Photos/GDataFeedPhoto.m | 28 +- Source/Clients/Photos/GDataFeedPhotoAlbum.m | 34 +- Source/Clients/Photos/GDataFeedPhotoBase.m | 18 +- Source/Clients/Photos/GDataFeedPhotoUser.m | 26 +- Source/Clients/Photos/GDataPhotoElements.h | 10 +- Source/Clients/Photos/GDataPhotoElements.m | 18 +- Source/Clients/Photos/GDataPhotos.h | 2 +- .../Clients/Photos/GDataQueryGooglePhotos.h | 6 +- .../Clients/Photos/GDataQueryGooglePhotos.m | 14 +- .../Clients/Photos/GDataServiceGooglePhotos.h | 4 +- .../Spreadsheets/GDataEntrySpreadsheet.m | 2 +- .../Spreadsheets/GDataEntrySpreadsheetCell.m | 26 +- .../Spreadsheets/GDataEntrySpreadsheetList.m | 42 +- .../Spreadsheets/GDataEntryWorksheet.m | 24 +- .../Spreadsheets/GDataFeedSpreadsheet.m | 2 +- .../Spreadsheets/GDataFeedSpreadsheetCell.m | 26 +- .../Spreadsheets/GDataQuerySpreadsheet.h | 2 +- .../Spreadsheets/GDataQuerySpreadsheet.m | 4 +- .../Spreadsheets/GDataRowColumnCount.m | 18 +- .../GDataServiceGoogleSpreadsheet.h | 4 +- .../Clients/Spreadsheets/GDataSpreadsheet.h | 2 +- .../Spreadsheets/GDataSpreadsheetCell.m | 32 +- .../GDataSpreadsheetCustomElement.m | 30 +- .../YouTube/GDataEntryYouTubeChannel.m | 6 +- .../YouTube/GDataEntryYouTubeComplaint.m | 4 +- .../YouTube/GDataEntryYouTubeFeedLinkBase.m | 4 +- .../Clients/YouTube/GDataEntryYouTubeFriend.m | 12 +- .../YouTube/GDataEntryYouTubePlaylist.m | 16 +- .../YouTube/GDataEntryYouTubePlaylistLink.m | 10 +- .../Clients/YouTube/GDataEntryYouTubeRating.m | 8 +- .../YouTube/GDataEntryYouTubeSubscription.m | 18 +- .../YouTube/GDataEntryYouTubeUserProfile.m | 42 +- .../Clients/YouTube/GDataEntryYouTubeVideo.m | 32 +- .../YouTube/GDataEntryYouTubeVideoMessage.m | 6 +- .../Clients/YouTube/GDataFeedYouTubeComment.h | 2 +- .../Clients/YouTube/GDataFeedYouTubeComment.m | 6 +- .../YouTube/GDataFeedYouTubeComplaint.h | 2 +- .../YouTube/GDataFeedYouTubeComplaint.m | 6 +- .../Clients/YouTube/GDataFeedYouTubeFriend.h | 2 +- .../Clients/YouTube/GDataFeedYouTubeFriend.m | 6 +- .../YouTube/GDataFeedYouTubePlaylist.h | 2 +- .../YouTube/GDataFeedYouTubePlaylist.m | 10 +- .../YouTube/GDataFeedYouTubePlaylistLink.h | 2 +- .../YouTube/GDataFeedYouTubePlaylistLink.m | 6 +- .../Clients/YouTube/GDataFeedYouTubeRating.h | 2 +- .../Clients/YouTube/GDataFeedYouTubeRating.m | 6 +- .../YouTube/GDataFeedYouTubeSubscription.h | 2 +- .../YouTube/GDataFeedYouTubeSubscription.m | 6 +- .../YouTube/GDataFeedYouTubeUserProfile.h | 2 +- .../YouTube/GDataFeedYouTubeUserProfile.m | 6 +- .../Clients/YouTube/GDataFeedYouTubeVideo.h | 2 +- .../Clients/YouTube/GDataFeedYouTubeVideo.m | 6 +- .../YouTube/GDataFeedYouTubeVideoMessage.h | 2 +- .../YouTube/GDataFeedYouTubeVideoMessage.m | 6 +- Source/Clients/YouTube/GDataQueryYouTube.h | 6 +- Source/Clients/YouTube/GDataQueryYouTube.m | 2 +- .../YouTube/GDataServiceGoogleYouTube.h | 12 +- Source/Clients/YouTube/GDataYouTube.h | 2 +- Source/Clients/YouTube/GDataYouTubeElements.m | 2 +- .../YouTube/GDataYouTubeMediaElements.h | 6 +- .../YouTube/GDataYouTubeMediaElements.m | 18 +- .../YouTube/GDataYouTubePublicationState.h | 4 +- .../YouTube/GDataYouTubePublicationState.m | 14 +- .../Clients/YouTube/GDataYouTubeStatistics.h | 6 +- .../Clients/YouTube/GDataYouTubeStatistics.m | 24 +- Source/Elements/GDataMoney.m | 6 +- Source/Elements/GDataName.m | 2 +- Source/GData.h | 2 +- Source/Introspection/GDataAtomCategoryGroup.m | 2 +- Source/Introspection/GDataAtomCollection.m | 2 +- .../Introspection/GDataAtomServiceDocument.m | 4 +- Source/Introspection/GDataAtomWorkspace.m | 2 +- Source/Media/GDataMediaCategory.m | 8 +- Source/Media/GDataMediaContent.h | 16 +- Source/Media/GDataMediaContent.m | 32 +- Source/Media/GDataMediaCredit.m | 8 +- Source/Media/GDataMediaGroup.h | 12 +- Source/Media/GDataMediaGroup.m | 48 +- Source/Media/GDataMediaKeywords.m | 4 +- Source/Media/GDataMediaPlayer.h | 2 +- Source/Media/GDataMediaPlayer.m | 6 +- Source/Media/GDataMediaRating.m | 6 +- Source/Media/GDataMediaRestriction.m | 8 +- Source/Media/GDataMediaThumbnail.h | 2 +- Source/Media/GDataMediaThumbnail.m | 18 +- Source/Media/GDataNormalPlayTime.m | 34 +- .../Networking/GDataAuthenticationFetcher.m | 2 +- Source/Tests/GDataDateTimeTest.m | 24 +- Source/Tests/GDataElementsTest.m | 386 ++++++------ Source/Tests/GDataFrameworkTest.m | 14 +- Source/Tests/GDataNormalPlayTimeTest.m | 16 +- Source/Tests/GDataServiceTest.m | 2 +- Source/Tests/GDataUtilitiesTest.m | 24 +- Source/Tests/main.m | 6 +- 164 files changed, 1493 insertions(+), 1493 deletions(-) diff --git a/Examples/ContactsSample/ContactsSampleAppController.m b/Examples/ContactsSample/ContactsSampleAppController.m index 9964cdd0..07844db6 100644 --- a/Examples/ContactsSample/ContactsSampleAppController.m +++ b/Examples/ContactsSample/ContactsSampleAppController.m @@ -23,10 +23,10 @@ @implementation ContactsSampleAppController - (void)applicationWillFinishLaunching:(NSNotification *)notifcation { - + ContactsSampleWindowController* windowController = [ContactsSampleWindowController sharedContactsSampleWindowController]; [windowController showWindow:self]; - + } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { diff --git a/Examples/ContactsSample/ContactsSampleWindowController.h b/Examples/ContactsSample/ContactsSampleWindowController.h index 3dc81e38..73faa56e 100644 --- a/Examples/ContactsSample/ContactsSampleWindowController.h +++ b/Examples/ContactsSample/ContactsSampleWindowController.h @@ -26,42 +26,42 @@ @interface ContactsSampleWindowController : NSWindowController { IBOutlet NSTextField *mUsernameField; IBOutlet NSSecureTextField *mPasswordField; - + IBOutlet NSButton *mShowDeletedCheckbox; IBOutlet NSButton *mMyContactsCheckbox; IBOutlet NSComboBox *mPropertyNameField; IBOutlet NSButton *mGetContactsButton; - + IBOutlet NSSegmentedControl *mFeedSegmentedControl; IBOutlet NSTableView *mFeedTable; IBOutlet NSProgressIndicator *mFeedProgressIndicator; IBOutlet NSTextView *mFeedResultTextField; IBOutlet NSButton *mFeedCancelButton; IBOutlet NSButton *mSortFeedCheckbox; - + IBOutlet NSImageView *mContactImageView; IBOutlet NSButton *mSetContactImageButton; IBOutlet NSButton *mDeleteContactImageButton; IBOutlet NSProgressIndicator *mSetContactImageProgressIndicator; - + IBOutlet NSButton *mAddContactButton; IBOutlet NSTextField *mAddTitleField; IBOutlet NSTextField *mAddEmailField; IBOutlet NSButton *mDeleteContactButton; IBOutlet NSButton *mDeleteAllButton; - + IBOutlet NSSegmentedControl *mEntrySegmentedControl; IBOutlet NSTableView *mEntryTable; IBOutlet NSTextView *mEntryResultTextField; - + IBOutlet NSButton *mAddEntryButton; IBOutlet NSButton *mDeleteEntryButton; IBOutlet NSButton *mEditEntryButton; IBOutlet NSButton *mMakePrimaryEntryButton; - - IBOutlet NSTextField *mServiceURLField; - + + IBOutlet NSTextField *mServiceURLField; + GDataFeedContact *mContactFeed; GDataServiceTicket *mContactFetchTicket; NSError *mContactFetchError; diff --git a/Examples/ContactsSample/ContactsSampleWindowController.m b/Examples/ContactsSample/ContactsSampleWindowController.m index 6bb4a023..2eafbdbd 100644 --- a/Examples/ContactsSample/ContactsSampleWindowController.m +++ b/Examples/ContactsSample/ContactsSampleWindowController.m @@ -69,7 +69,7 @@ - (NSString *)displayNameForItem:(id)item; - (GDataFeedContact *)contactFeed; - (void)setContactFeed:(GDataFeedContact *)feed; - (NSError *)contactFetchError; -- (void)setContactFetchError:(NSError *)error; +- (void)setContactFetchError:(NSError *)error; - (GDataServiceTicket *)contactFetchTicket; - (void)setContactFetchTicket:(GDataServiceTicket *)ticket; - (NSString *)contactImageETag; @@ -78,7 +78,7 @@ - (void)setContactImageETag:(NSString *)str; - (GDataFeedContactGroup *)groupFeed; - (void)setGroupFeed:(GDataFeedContactGroup *)feed; - (NSError *)groupFetchError; -- (void)setGroupFetchError:(NSError *)error; +- (void)setGroupFetchError:(NSError *)error; - (GDataServiceTicket *)groupFetchTicket; - (void)setGroupFetchTicket:(GDataServiceTicket *)ticket; @end @@ -104,10 +104,10 @@ @implementation ContactsSampleWindowController + (ContactsSampleWindowController *)sharedContactsSampleWindowController { - + if (!gContactsSampleWindowController) { gContactsSampleWindowController = [[[self class] alloc] init]; - } + } return gContactsSampleWindowController; } @@ -124,11 +124,11 @@ - (void)awakeFromNib { // to aid in understanding of each contact query operation. [mFeedResultTextField setTextColor:[NSColor darkGrayColor]]; [mEntryResultTextField setTextColor:[NSColor darkGrayColor]]; - + NSFont *resultTextFont = [NSFont fontWithName:@"Monaco" size:9]; [mFeedResultTextField setFont:resultTextFont]; [mEntryResultTextField setFont:resultTextFont]; - + [self updateUI]; } @@ -137,71 +137,71 @@ - (void)dealloc { [mContactFetchError release]; [mContactFetchTicket release]; [mContactImageETag release]; - + [mGroupFeed release]; [mGroupFetchError release]; [mGroupFetchTicket release]; - + [super dealloc]; } #pragma mark - - (BOOL)isDisplayingContacts { - BOOL flag = ([mFeedSegmentedControl selectedSegment] == kContactsSegment); + BOOL flag = ([mFeedSegmentedControl selectedSegment] == kContactsSegment); return flag; } - (void)updateSegmentedControlLabels { BOOL isDisplayingContacts = [self isDisplayingContacts]; - + // put the number of each type of segment in the label for the item - + // feed segments - + int numContacts = [[mContactFeed entries] count]; NSString *contactsLabel = [NSString stringWithFormat:@"Contacts - %d", numContacts]; [mFeedSegmentedControl setLabel:contactsLabel forSegment:kContactsSegment]; - + int numGroups = [[mGroupFeed entries] count]; NSString *groupsLabel = [NSString stringWithFormat:@"Groups - %d", numGroups]; [mFeedSegmentedControl setLabel:groupsLabel forSegment:kGroupsSegment]; - + // entry segments // // when contacts are displayed, all segments are enabled; when groups // are displayed, only extended properties is enabled - + int numOrg = [[[self selectedContact] organizations] count]; NSString *orgLabel = [NSString stringWithFormat:@"Org - %d", numOrg]; [mEntrySegmentedControl setLabel:orgLabel forSegment:kOrganizationSegment]; [mEntrySegmentedControl setEnabled:isDisplayingContacts forSegment:kOrganizationSegment]; - + int numEmail = [[[self selectedContact] emailAddresses] count]; NSString *mailLabel = [NSString stringWithFormat:@"E-mail - %d", numEmail]; [mEntrySegmentedControl setLabel:mailLabel forSegment:kEmailSegment]; [mEntrySegmentedControl setEnabled:isDisplayingContacts forSegment:kEmailSegment]; - + int numIM = [[[self selectedContact] IMAddresses] count]; NSString *IMlabel = [NSString stringWithFormat:@"IM - %d", numIM]; [mEntrySegmentedControl setLabel:IMlabel forSegment:kIMSegment]; [mEntrySegmentedControl setEnabled:isDisplayingContacts forSegment:kIMSegment]; - + int numPhone = [[[self selectedContact] phoneNumbers] count]; NSString *phoneLabel = [NSString stringWithFormat:@"Phone - %d", numPhone]; [mEntrySegmentedControl setLabel:phoneLabel forSegment:kPhoneSegment]; [mEntrySegmentedControl setEnabled:isDisplayingContacts forSegment:kPhoneSegment]; - + int numPostal = [[[self selectedContact] structuredPostalAddresses] count]; NSString *postalLabel = [NSString stringWithFormat:@"Postal - %d", numPostal]; [mEntrySegmentedControl setLabel:postalLabel forSegment:kPostalSegment]; [mEntrySegmentedControl setEnabled:isDisplayingContacts forSegment:kPostalSegment]; - + int numGroupInfos = [[[self selectedContact] groupMembershipInfos] count]; NSString *groupLabel = [NSString stringWithFormat:@"Group - %d", numGroupInfos]; [mEntrySegmentedControl setLabel:groupLabel forSegment:kGroupSegment]; [mEntrySegmentedControl setEnabled:isDisplayingContacts forSegment:kGroupSegment]; - + int numExtProps; if ([self isDisplayingContacts]) { numExtProps = [[[self selectedContact] extendedProperties] count]; @@ -214,23 +214,23 @@ - (void)updateSegmentedControlLabels { - (void)updateUI { BOOL isDisplayingContacts = [self isDisplayingContacts]; - + // contact list display - [mFeedTable reloadData]; - + [mFeedTable reloadData]; + if ((isDisplayingContacts && mContactFetchTicket != nil) || (!isDisplayingContacts && mGroupFetchTicket != nil)) { - [mFeedProgressIndicator startAnimation:self]; + [mFeedProgressIndicator startAnimation:self]; } else { - [mFeedProgressIndicator stopAnimation:self]; + [mFeedProgressIndicator stopAnimation:self]; } - + GDataEntryContact *selectedContact = [self selectedContact]; GDataEntryContactGroup *selectedGroup = [self selectedGroup]; - + if (isDisplayingContacts) { - - // show contact fetch or group fetch result error or the selected contact + + // show contact fetch or group fetch result error or the selected contact NSString *resultStr = @""; if (mContactFetchError) { resultStr = [mContactFetchError description]; @@ -242,10 +242,10 @@ - (void)updateUI { } } [mFeedResultTextField setString:resultStr]; - + } else { - - // show group fetch result error or the selected group + + // show group fetch result error or the selected group NSString *resultStr = @""; if (mGroupFetchError) { resultStr = [mGroupFetchError description]; @@ -256,15 +256,15 @@ - (void)updateUI { } [mFeedResultTextField setString:resultStr]; } - + [self updateImageForContact:selectedContact]; - + // the bottom table displays items (orgs, e-mail, postal, IM, or phone - // numbers, groups, extended props) for the selected contact, according to the + // numbers, groups, extended props) for the selected contact, according to the // selected segment for the type of the item - - [mEntryTable reloadData]; - + + [mEntryTable reloadData]; + // display selected item's description NSString *entryDesc = @""; GDataObject *selectedItem = [self selectedItem]; @@ -272,62 +272,62 @@ - (void)updateUI { entryDesc = [selectedItem description]; } [mEntryResultTextField setString:entryDesc]; - + // show the number of items for each segment [self updateSegmentedControlLabels]; - + // enable/disable cancel button depending on if a ticket is outstanding BOOL isTicketPending = (mContactFetchTicket != nil || mGroupFetchTicket != nil); [mFeedCancelButton setEnabled:isTicketPending]; - + // enable/disable other buttons BOOL isContactOrGroupSelected = (selectedContact != nil || selectedGroup != nil); BOOL isItemSelected = ([self selectedItem] != nil); BOOL canItemBePrimary = [[self selectedItem] respondsToSelector:@selector(isPrimary)]; BOOL isEntrySegmentEnabled = [mEntrySegmentedControl isEnabledForSegment: [mEntrySegmentedControl selectedSegment]]; - + [mAddEntryButton setEnabled:(isEntrySegmentEnabled && isContactOrGroupSelected)]; [mDeleteEntryButton setEnabled:isItemSelected]; [mEditEntryButton setEnabled:isItemSelected]; - + [mMakePrimaryEntryButton setEnabled:(isItemSelected && canItemBePrimary)]; - + [mEntrySegmentedControl setEnabled:isContactOrGroupSelected]; [mDeleteContactButton setEnabled:isContactOrGroupSelected]; - + BOOL isFeedAvailable = (mContactFeed != nil || mGroupFeed != nil); BOOL isAddInfoEntered = ([[mAddTitleField stringValue] length] > 0); - + [mAddContactButton setEnabled:(isAddInfoEntered && isFeedAvailable)]; - + BOOL canEditSelectedContactImage = ([selectedContact photoLink] != nil); [mSetContactImageButton setEnabled:canEditSelectedContactImage]; - + BOOL doesContactHaveImage = ([[selectedContact photoLink] ETag] != nil); - [mDeleteContactImageButton setEnabled:(doesContactHaveImage && + [mDeleteContactImageButton setEnabled:(doesContactHaveImage && canEditSelectedContactImage)]; - + [mAddTitleField setEnabled:isFeedAvailable]; [mAddEmailField setEnabled:(isFeedAvailable && isDisplayingContacts)]; [mAddContactButton setEnabled:isFeedAvailable]; - - BOOL canDeleteAllEntries = - (isDisplayingContacts - && [[mContactFeed entries] count] > 0 + + BOOL canDeleteAllEntries = + (isDisplayingContacts + && [[mContactFeed entries] count] > 0 && [mContactFeed batchLink] != nil) - || (!isDisplayingContacts + || (!isDisplayingContacts && [[mGroupFeed entries] count] > 0 && [mGroupFeed batchLink] != nil); - + [mDeleteAllButton setEnabled:canDeleteAllEntries]; - + if (isDisplayingContacts) { - [[mAddTitleField cell] setPlaceholderString:@"Add Name"]; - [[mAddEmailField cell] setPlaceholderString:@"Add E-mail"]; + [[mAddTitleField cell] setPlaceholderString:@"Add Name"]; + [[mAddEmailField cell] setPlaceholderString:@"Add E-mail"]; } else { - [[mAddTitleField cell] setPlaceholderString:@"Add Group"]; - [[mAddEmailField cell] setPlaceholderString:@""]; + [[mAddTitleField cell] setPlaceholderString:@"Add Group"]; + [[mAddEmailField cell] setPlaceholderString:@""]; } } @@ -345,7 +345,7 @@ - (void)updateImageForContact:(GDataEntryContact *)contact { // // if the new photo link ETag is different from the previous one, // clear the image and fetch the new image - + GDataLink *photoLink = [contact photoLink]; NSString *imageETag = [photoLink ETag]; @@ -396,49 +396,49 @@ - (void)imageFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data e #pragma mark IBActions - (IBAction)getFeedClicked:(id)sender { - + NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; - + NSString *username = [mUsernameField stringValue]; username = [username stringByTrimmingCharactersInSet:whitespace]; - + if ([username rangeOfString:@"@"].location == NSNotFound) { // if no domain was supplied, add @gmail.com username = [username stringByAppendingString:@"@gmail.com"]; } - + [mUsernameField setStringValue:username]; - + [self fetchAllGroupsAndContacts]; } - (IBAction)feedSegmentClicked:(id)sender { - [self updateUI]; + [self updateUI]; } - (IBAction)cancelFeedFetchClicked:(id)sender { [mContactFetchTicket cancelTicket]; [self setContactFetchTicket:nil]; - + [mGroupFetchTicket cancelTicket]; [self setGroupFetchTicket:nil]; - + [self updateUI]; } - (IBAction)setContactImageClicked:(id)sender { - [self setContactImage]; + [self setContactImage]; } - (IBAction)deleteContactImageClicked:(id)sender { - [self deleteContactImage]; + [self deleteContactImage]; } - (IBAction)addContactClicked:(id)sender { if ([self isDisplayingContacts]) { [self addAContact]; } else { - [self addAGroup]; + [self addAGroup]; } } @@ -468,15 +468,15 @@ - (IBAction)makeEntryPrimaryClicked:(id)sender { } - (IBAction)entrySegmentClicked:(id)sender { - [self updateUI]; + [self updateUI]; } - (IBAction)sortContactsClicked:(id)sender { - [self updateUI]; + [self updateUI]; } - (IBAction)loggingCheckboxClicked:(id)sender { - [GTMHTTPFetcher setLoggingEnabled:[sender state]]; + [GTMHTTPFetcher setLoggingEnabled:[sender state]]; } #pragma mark - @@ -489,9 +489,9 @@ - (IBAction)loggingCheckboxClicked:(id)sender { // fetched data.) - (GDataServiceGoogleContact *)contactService { - + static GDataServiceGoogleContact* service = nil; - + if (!service) { service = [[GDataServiceGoogleContact alloc] init]; @@ -502,24 +502,24 @@ - (GDataServiceGoogleContact *)contactService { // update the username/password each time the service is requested NSString *username = [mUsernameField stringValue]; NSString *password = [mPasswordField stringValue]; - + [service setUserCredentialsWithUsername:username password:password]; - + return service; } - (NSArray *)sortedEntries:(NSArray *)entries { - + if ([mSortFeedCheckbox state] == NSOnState) { - + NSSortDescriptor *sortDesc; SEL sel = @selector(caseInsensitiveCompare:); - - sortDesc = [[[NSSortDescriptor alloc] initWithKey:@"entryDisplayName" + + sortDesc = [[[NSSortDescriptor alloc] initWithKey:@"entryDisplayName" ascending:YES selector:sel] autorelease]; - + NSArray *sortDescriptors = [NSArray arrayWithObject:sortDesc]; entries = [entries sortedArrayUsingDescriptors:sortDescriptors]; } @@ -542,13 +542,13 @@ - (NSArray *)sortedGroupEntries { // get the contact selected in the top list, or nil if none or if groups // are being viewed - (GDataEntryContact *)selectedContact { - + if ([self isDisplayingContacts]) { - + NSArray *contacts = [self sortedContactEntries]; int rowIndex = [mFeedTable selectedRow]; if ([contacts count] > rowIndex) { - + GDataEntryContact *contact = [contacts objectAtIndex:rowIndex]; return contact; } @@ -556,15 +556,15 @@ - (GDataEntryContact *)selectedContact { return nil; } -// get the contact or group selected in the top list, or nil if none +// get the contact or group selected in the top list, or nil if none - (GDataEntryContactGroup *)selectedGroup { - + if (![self isDisplayingContacts]) { - + NSArray *groups = [self sortedGroupEntries]; int rowIndex = [mFeedTable selectedRow]; if ([groups count] > rowIndex) { - + GDataEntryContactGroup *group = [groups objectAtIndex:rowIndex]; return group; } @@ -575,7 +575,7 @@ - (GDataEntryContactGroup *)selectedGroup { - (id)selectedContactOrGroup { GDataEntryContact *selectedContact = [self selectedContact]; if (selectedContact) return selectedContact; - + GDataEntryContactGroup *selectedGroup = [self selectedGroup]; return selectedGroup; } @@ -584,21 +584,21 @@ - (id)selectedContactOrGroup { // // the item could be org, phone, e-mail, IM, postal, group, or extended props - (GDataObject *)selectedItem { - + NSArray *entries = [self itemsForSelectedSegment]; - + int rowIndex = [mEntryTable selectedRow]; if ([entries count] > rowIndex) { - + GDataObject *entry = [entries objectAtIndex:rowIndex]; return entry; } - return nil; + return nil; } // get the key needed to retrieve the list of items from a contact - (NSString *)keyForSelectedSegment { - + switch ([mEntrySegmentedControl selectedSegment]) { case kOrganizationSegment: return @"organizations"; case kEmailSegment: return @"emailAddresses"; @@ -607,44 +607,44 @@ - (NSString *)keyForSelectedSegment { case kIMSegment: return @"IMAddresses"; case kGroupSegment: return @"groupMembershipInfos"; case kExtendedPropsSegment: return @"extendedProperties"; - } + } return nil; } // get the selector needed to make an item primary - (SEL)makePrimarySelectorForSelectedSegment { - + switch ([mEntrySegmentedControl selectedSegment]) { case kOrganizationSegment: return @selector(setPrimaryOrganization:); case kEmailSegment: return @selector(setPrimaryEmailAddress:); case kIMSegment: return @selector(setPrimaryIMAddress:); case kPhoneSegment: return @selector(setPrimaryPhoneNumber:); case kPostalSegment: return @selector(setPrimaryStructuredPostalAddress:); - } + } return nil; } // get the list of items from the selected contact, according to the segmented // control's selection - (NSArray *)itemsForSelectedSegment { - + NSString *path = [self keyForSelectedSegment]; SEL sel = NSSelectorFromString(path); - + id selectedEntry = [self selectedContactOrGroup]; - + // some segment selectors don't apply to group entries NSArray *array = nil; - + if ([selectedEntry respondsToSelector:sel]) { array = [selectedEntry performSelector:sel]; } - + return array; } - (Class)itemClassForSelectedSegment { - + switch ([mEntrySegmentedControl selectedSegment]) { case kOrganizationSegment: return [GDataOrganization class]; case kEmailSegment: return [GDataEmail class]; @@ -660,25 +660,25 @@ - (Class)itemClassForSelectedSegment { #pragma mark Fetch all groups - (NSURL *)groupFeedURL { - + NSString *propName = [mPropertyNameField stringValue]; - + NSURL *feedURL; if ([propName caseInsensitiveCompare:@"full"] == NSOrderedSame || [propName length] == 0) { - + // full feed includes all clients' extended properties feedURL = [GDataServiceGoogleContact groupFeedURLForUserID:kGDataServiceDefaultUser]; - + } else if ([propName caseInsensitiveCompare:@"thin"] == NSOrderedSame) { - + // thin feed excludes extended properties feedURL = [GDataServiceGoogleContact contactURLForFeedName:kGDataGoogleContactGroupsFeedName userID:kGDataServiceDefaultUser projection:kGDataGoogleContactThinProjection]; - + } else { - + feedURL = [GDataServiceGoogleContact contactGroupFeedURLForPropertyName:propName]; } return feedURL; @@ -686,35 +686,35 @@ - (NSURL *)groupFeedURL { // begin retrieving the list of the user's contacts - (void)fetchAllGroupsAndContacts { - + [self setGroupFeed:nil]; [self setGroupFetchError:nil]; [self setGroupFetchTicket:nil]; - + // we will fetch contacts next [self setContactFeed:nil]; GDataServiceGoogleContact *service = [self contactService]; GDataServiceTicket *ticket; - + BOOL showDeleted = ([mShowDeletedCheckbox state] == NSOnState); - + // request a whole buncha groups; our service object is set to // follow next links as well in case there are more than 2000 const int kBuncha = 2000; - + NSURL *feedURL = [self groupFeedURL]; - + GDataQueryContact *query = [GDataQueryContact contactQueryWithFeedURL:feedURL]; [query setShouldShowDeleted:showDeleted]; [query setMaxResults:kBuncha]; - + ticket = [service fetchFeedWithQuery:query delegate:self didFinishSelector:@selector(groupsFetchTicket:finishedWithFeed:error:)]; - + [self setGroupFetchTicket:ticket]; - + [self updateUI]; } @@ -739,23 +739,23 @@ - (void)groupsFetchTicket:(GDataServiceTicket *)ticket #pragma mark Fetch all contacts - (NSURL *)contactFeedURL { - + NSString *propName = [mPropertyNameField stringValue]; - + NSURL *feedURL; if ([propName caseInsensitiveCompare:@"full"] == NSOrderedSame || [propName length] == 0) { - + // full feed includes all clients' extended properties feedURL = [GDataServiceGoogleContact contactFeedURLForUserID:kGDataServiceDefaultUser]; - + } else if ([propName caseInsensitiveCompare:@"thin"] == NSOrderedSame) { - + // thin feed excludes all extended properties feedURL = [GDataServiceGoogleContact contactFeedURLForUserID:kGDataServiceDefaultUser projection:kGDataGoogleContactThinProjection]; } else { - + feedURL = [GDataServiceGoogleContact contactFeedURLForPropertyName:propName]; } return feedURL; @@ -839,16 +839,16 @@ - (void)setContactImage { } - (void)setSelectedContactPhotoAtPath:(NSString *)path { - + NSString *errorMsg = nil; - + // make a new entry for the file NSString *mimeType = [GDataUtilities MIMETypeForFileAtPath:path defaultMIMEType:@"image/jpeg"]; if (!mimeType) { errorMsg = [NSString stringWithFormat:@"need MIME type for file %@", path]; } else { - + NSString *fullName = [[NSFileManager defaultManager] displayNameAtPath:path]; GDataEntryContact *newEntry = [GDataEntryContact contactEntryWithFullNameString:fullName]; @@ -868,13 +868,13 @@ - (void)setSelectedContactPhotoAtPath:(NSString *)path { [newEntry setETag:[photoLink ETag]]; NSURL *putURL = [photoLink URL]; - + // make service tickets call back into our upload progress selector GDataServiceGoogleContact *service = [self contactService]; - + SEL progressSel = @selector(ticket:hasDeliveredByteCount:ofTotalByteCount:); [service setServiceUploadProgressSelector:progressSel]; - + // insert the entry into the contacts feed [service fetchEntryByUpdatingEntry:newEntry forEntryURL:putURL @@ -885,21 +885,21 @@ - (void)setSelectedContactPhotoAtPath:(NSString *)path { [service setServiceUploadProgressSelector:nil]; } } - + if (errorMsg) { NSBeginAlertSheet(@"Upload Error", nil, nil, nil, [self window], nil, nil, nil, nil, @"%@", errorMsg); } - + [self updateUI]; } // progress callback - (void)ticket:(GDataServiceTicket *)ticket -hasDeliveredByteCount:(unsigned long long)numberOfBytesRead +hasDeliveredByteCount:(unsigned long long)numberOfBytesRead ofTotalByteCount:(unsigned long long)dataLength { - + [mSetContactImageProgressIndicator setMinValue:0.0]; [mSetContactImageProgressIndicator setMaxValue:(double)dataLength]; [mSetContactImageProgressIndicator setDoubleValue:(double)numberOfBytesRead]; @@ -932,14 +932,14 @@ - (void)uploadPhotoTicket:(GDataServiceTicket *)ticket #pragma mark Delete contact image - (void)deleteContactImage { - + // display the confirmation dialog GDataEntryContact *contact = [self selectedContact]; if (contact) { - + // make the user confirm that the selected contact should be deleted NSBeginAlertSheet(@"Delete Image", @"Delete", @"Cancel", nil, - [self window], self, + [self window], self, @selector(contactPhotoDeleteSheetDidEnd:returnCode:contextInfo:), nil, nil, @"Delete photo for contact \"%@\"?", [contact entryDisplayName]); @@ -948,18 +948,18 @@ - (void)deleteContactImage { - (void)contactPhotoDeleteSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - + if (returnCode == NSAlertDefaultReturn) { - + // delete the contact's photo - + GDataServiceGoogleContact *service = [self contactService]; - + GDataLink *photoLink = [[self selectedContact] photoLink]; NSURL *editURL = [photoLink URL]; NSString *etag = [photoLink ETag]; - + [service deleteResourceURL:editURL ETag:etag delegate:self @@ -991,15 +991,15 @@ - (void)deletePhotoTicket:(GDataServiceTicket *)ticket #pragma mark Add a Contact - (void)addAContact { - + NSString *title = [mAddTitleField stringValue]; NSString *email = [mAddEmailField stringValue]; - + if ([title length] > 0) { - + GDataEntryContact *newContact; newContact = [GDataEntryContact contactEntryWithFullNameString:title]; - + if ([email length] > 0) { // all items must have a rel or a label, but not both GDataEmail *emailObj = [GDataEmail emailWithLabel:nil @@ -1025,9 +1025,9 @@ - (void)addAContact { } GDataServiceGoogleContact *service = [self contactService]; - + NSURL *postURL = [[mContactFeed postLink] URL]; - + [service fetchEntryByInsertingEntry:newContact forFeedURL:postURL delegate:self @@ -1062,18 +1062,18 @@ - (void)addContactTicket:(GDataServiceTicket *)ticket #pragma mark Add a Group - (void)addAGroup { - + NSString *title = [mAddTitleField stringValue]; - + if ([title length] > 0) { - + GDataEntryContactGroup *newGroup; newGroup = [GDataEntryContactGroup contactGroupEntryWithTitle:title]; - + GDataServiceGoogleContact *service = [self contactService]; - + NSURL *postURL = [[mGroupFeed postLink] URL]; - + [service fetchEntryByInsertingEntry:newGroup forFeedURL:postURL delegate:self @@ -1108,14 +1108,14 @@ - (void)addGroupTicket:(GDataServiceTicket *)ticket #pragma mark Delete a Contact or Group - (void)deleteSelectedContactOrGroup { - + // display the confirmation dialog id entry = [self selectedContactOrGroup]; if (entry) { - + // make the user confirm that the selected entry should be deleted NSBeginAlertSheet(@"Delete", @"Delete", @"Cancel", nil, - [self window], self, + [self window], self, @selector(entryDeleteSheetDidEnd:returnCode:contextInfo:), nil, nil, @"Delete \"%@\"?", [entry entryDisplayName]); @@ -1124,15 +1124,15 @@ - (void)deleteSelectedContactOrGroup { // delete dialog callback - (void)entryDeleteSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - + if (returnCode == NSAlertDefaultReturn) { - + // delete the entry - + GDataServiceGoogleContact *service = [self contactService]; - + id entry = [self selectedContactOrGroup]; - + [service deleteEntry:entry delegate:self didFinishSelector:@selector(deleteEntryTicket:finishedWithNil:error:)]; @@ -1160,18 +1160,18 @@ - (void)deleteEntryTicket:(GDataServiceTicket *)ticket #pragma mark Batch Delete All Contacts or Groups - (void)deleteAllContactsOrGroups { - + // make the user confirm that all entries should be deleted GDataFeedBase *feed; - + if ([self isDisplayingContacts]) { feed = mContactFeed; } else { feed = mGroupFeed; } - + NSBeginAlertSheet(@"Delete All", @"Delete", @"Cancel", nil, - [self window], self, + [self window], self, @selector(deleteAllSheetDidEnd:returnCode:contextInfo:), nil, nil, @"Delete %u %@?", (unsigned int) [[feed entries] count], @@ -1183,9 +1183,9 @@ - (void)deleteAllContactsOrGroups { // delete dialog callback - (void)deleteAllSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - + if (returnCode == NSAlertDefaultReturn) { - + // delete the feed entries GDataFeedBase *feed; if ([self isDisplayingContacts]) { @@ -1193,31 +1193,31 @@ - (void)deleteAllSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contex } else { feed = mGroupFeed; } - + NSArray *entries = [feed entries]; - + NSURL *batchURL = [[feed batchLink] URL]; if (batchURL == nil) { // the button shouldn't be enabled when we can't batch delete, so we // shouldn't get here NSBeep(); - + } else { - + // the contacts feed supports batch size up to 100 entries const int kMaxBatchSize = 100; - + // allocate arrays that will be used by the callback when each // ticket finishes NSMutableArray *batchTickets = [NSMutableArray array]; NSMutableArray *batchResults = [NSMutableArray array]; - + unsigned int totalEntries = [entries count]; - + for (unsigned int idx = 0; idx < totalEntries; idx++) { - + GDataEntryBase *entry = [entries objectAtIndex:idx]; - + // add a batch ID to this entry static int staticID = 0; NSString *batchID = [NSString stringWithFormat:@"batchID_%u", ++staticID]; @@ -1225,45 +1225,45 @@ - (void)deleteAllSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contex // we don't need to add the batch operation to the entries since // we're putting it in the feed to apply to all entries - - // we could force an error on an item by nuking the entry's identifier, + + // we could force an error on an item by nuking the entry's identifier, // like // if (idx == 1) { [entry setIdentifier:nil]; } - + // send a batch when we've seen every entry, or when the batch size // has reached 100 if (((idx + 1) % kMaxBatchSize) == 0 || (idx + 1) == totalEntries) { - + // make a batch feed object: add entries to the feed, and since - // we are doing the same operation for all entries in the feed, + // we are doing the same operation for all entries in the feed, // add the operation to the feed - + GDataFeedContact *batchFeed = [GDataFeedContact contactFeed]; unsigned int rangeStart = idx - (idx % kMaxBatchSize); - NSRange batchEntryRange = NSMakeRange(rangeStart, + NSRange batchEntryRange = NSMakeRange(rangeStart, idx - rangeStart + 1); NSArray *entrySubset = [entries subarrayWithRange:batchEntryRange]; [batchFeed setEntriesWithEntries:entrySubset]; - + GDataBatchOperation *op; op = [GDataBatchOperation batchOperationWithType:kGDataBatchOperationDelete]; - [batchFeed setBatchOperation:op]; - + [batchFeed setBatchOperation:op]; + // now do the usual steps for authenticating for this service, and issue // the fetch - + GDataServiceGoogleContact *service = [self contactService]; GDataServiceTicket *ticket; - + ticket = [service fetchFeedWithBatchFeed:batchFeed forBatchFeedURL:batchURL delegate:self didFinishSelector:@selector(batchDeleteTicket:finishedWithFeed:error:)]; - + [batchTickets addObject:ticket]; - + // set the arrays used by the callback into the ticket properties [ticket setProperty:batchTickets forKey:kBatchTicketsProperty]; [ticket setProperty:batchResults forKey:kBatchResultsProperty]; @@ -1339,17 +1339,17 @@ - (void)batchDeleteTicket:(GDataServiceTicket *)ticket #pragma mark Add an Item - (void)addAnItem { - + // make a new object for the selected segment type // (org, phone, postal, IM, group, e-mail, extended props) Class objClass = [self itemClassForSelectedSegment]; id obj = [[[objClass alloc] init] autorelease]; - + if ([obj respondsToSelector:@selector(setRel:)]) { // each item needs a rel or a label; we'll use other as a default rel [obj setRel:kGDataContactOther]; } - + // display the item edit dialog EditEntryWindowController *controller = [[EditEntryWindowController alloc] init]; [controller runModalForTarget:self @@ -1360,28 +1360,28 @@ - (void)addAnItem { // callback from the edit item dialog - (void)addEditControllerFinished:(EditEntryWindowController *)addEntryController { - + if ([addEntryController wasSaveClicked]) { - - // add the object into a copy of the selected entry, + + // add the object into a copy of the selected entry, // and update the contact GDataObject *obj = [addEntryController object]; if (obj) { - + // make a new array of items with the addition added to it NSArray *oldItems = [self itemsForSelectedSegment]; NSMutableArray *newItems = [NSMutableArray arrayWithArray:oldItems]; [newItems addObject:obj]; - + // replace the entry's item array with our new one NSString *keyForSelectedSegment = [self keyForSelectedSegment]; - + id selectedEntryCopy = [[[self selectedContactOrGroup] copy] autorelease]; [selectedEntryCopy setValue:newItems forKey:keyForSelectedSegment]; - + // now update the entry on the server GDataServiceGoogleContact *service = [self contactService]; - + [service fetchEntryByUpdatingEntry:selectedEntryCopy delegate:self didFinishSelector:@selector(addItemTicket:addedEntry:error:)]; @@ -1414,7 +1414,7 @@ - (void)addItemTicket:(GDataServiceTicket *)ticket #pragma mark Edit an item - (void)editSelectedItem { - + // display the item edit dialog GDataObject *item = [self selectedItem]; if (item) { @@ -1428,28 +1428,28 @@ - (void)editSelectedItem { // callback from the edit item dialog - (void)editControllerFinished:(EditEntryWindowController *)editContactController { - + if ([editContactController wasSaveClicked]) { - + // add the object into the selected contact, and update the contact GDataObject *obj = [editContactController object]; if (obj) { - + // make a new array of items with the edited item replacing its predecessor NSArray *oldItems = [self itemsForSelectedSegment]; NSMutableArray *newItems = [NSMutableArray arrayWithArray:oldItems]; [newItems replaceObjectAtIndex:[newItems indexOfObject:[self selectedItem]] withObject:obj]; - + // replace the entry's item array with our new one NSString *keyForSelectedSegment = [self keyForSelectedSegment]; - + id selectedEntryCopy = [[[self selectedContactOrGroup] copy] autorelease]; [selectedEntryCopy setValue:newItems forKey:keyForSelectedSegment]; - + // now update the entry on the server GDataServiceGoogleContact *service = [self contactService]; - + [service fetchEntryByUpdatingEntry:selectedEntryCopy delegate:self didFinishSelector:@selector(editItemTicket:editedEntry:error:)]; @@ -1481,14 +1481,14 @@ - (void)editItemTicket:(GDataServiceTicket *)ticket #pragma mark Delete an item - (void)deleteSelectedItem { - + // display the item edit dialog GDataObject *item = [self selectedItem]; if (item) { - + // make the user confirm that the selected item should be deleted NSBeginAlertSheet(@"Delete Item", @"Delete", @"Cancel", nil, - [self window], self, + [self window], self, @selector(itemDeleteSheetDidEnd:returnCode:contextInfo:), nil, nil, @"Delete the item \"%@\"?", [self displayNameForItem:item]); @@ -1497,27 +1497,27 @@ - (void)deleteSelectedItem { // delete dialog callback - (void)itemDeleteSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - + if (returnCode == NSAlertDefaultReturn) { - + // delete the item from the contact's item array - + NSArray *oldItems = [self itemsForSelectedSegment]; NSMutableArray *newItems = [NSMutableArray arrayWithArray:oldItems]; - + // using removeObject would remove all matching items; we just want to // remove the selected one [newItems removeObjectAtIndex:[mEntryTable selectedRow]]; - + // replace the contact's item array with our new one NSString *keyForSelectedSegment = [self keyForSelectedSegment]; - + GDataEntryContact *selectedContact = [self selectedContactOrGroup]; [selectedContact setValue:newItems forKey:keyForSelectedSegment]; - + // now update the contact on the server GDataServiceGoogleContact *service = [self contactService]; - + [service fetchEntryByUpdatingEntry:selectedContact delegate:self didFinishSelector:@selector(deleteItemTicket:updatedEntry:error:)]; @@ -1546,15 +1546,15 @@ - (void)deleteItemTicket:(GDataServiceTicket *)ticket #pragma mark Make selected item primary - (void)makeSelectedItemPrimary { - + GDataObject *item = [self selectedItem]; GDataEntryContact *selectedContactCopy = [[[self selectedContact] copy] autorelease]; - + SEL sel = [self makePrimarySelectorForSelectedSegment]; [selectedContactCopy performSelector:sel withObject:item]; - + // now update the contact on the server - GDataServiceGoogleContact *service = [self contactService]; + GDataServiceGoogleContact *service = [self contactService]; GDataServiceTicket *ticket = [service fetchEntryByUpdatingEntry:selectedContactCopy @@ -1589,21 +1589,21 @@ - (void)makePrimaryTicket:(GDataServiceTicket *)ticket // - (void)tableViewSelectionDidChange:(NSNotification *)notification { - + [self updateUI]; } // table view data source methods - (int)numberOfRowsInTableView:(NSTableView *)tableView { if (tableView == mFeedTable) { - + // contact and group table if ([self isDisplayingContacts]) { return [[mContactFeed entries] count]; } else { return [[mGroupFeed entries] count]; } - + } else { // entry table unsigned int count = [[self itemsForSelectedSegment] count]; @@ -1613,7 +1613,7 @@ - (int)numberOfRowsInTableView:(NSTableView *)tableView { - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row { if (tableView == mFeedTable) { - + // contact and group table if ([self isDisplayingContacts]) { GDataEntryContact *contact = [[self sortedContactEntries] objectAtIndex:row]; @@ -1626,18 +1626,18 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum return [group entryDisplayName]; } } - + } else { // item table, displaying according to the segment selected - + NSString *output = nil; - + NSArray *items = [self itemsForSelectedSegment]; if ([items count] > row) { id obj = [items objectAtIndex:row]; - + output = [self displayNameForItem:obj]; - + if (output != nil && [obj respondsToSelector:@selector(isPrimary)] && [obj isPrimary]) { output = [output stringByAppendingString:@" (primary)"]; @@ -1649,20 +1649,20 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum } - (NSString *)displayNameForItem:(id)item { - + NSString *result = nil; - + // e-mail and IM have address methods if ([item respondsToSelector:@selector(address)]) { result = (NSString *) [item address]; } - + // org has title and name else if ([item respondsToSelector:@selector(orgTitle)]) { - + NSString *title = [item orgTitle]; NSString *name = [item orgName]; - + if (title && name) { result = [NSString stringWithFormat:@"%@, %@", title, name]; } else if (title) { @@ -1671,12 +1671,12 @@ - (NSString *)displayNameForItem:(id)item { result = name; } } - + // extended property has value or XMLValue, which we unified via a category - else if ([item respondsToSelector:@selector(unifiedStringValue)]) { + else if ([item respondsToSelector:@selector(unifiedStringValue)]) { result = [item unifiedStringValue]; } - + // groupMembershipInfo responds to href else if ([item respondsToSelector:@selector(href)]) { NSString *groupID = [item href]; @@ -1694,21 +1694,21 @@ - (NSString *)displayNameForItem:(id)item { } } } - + // structuredPostAddress responds to formattedAddress else if ([item respondsToSelector:@selector(formattedAddress)]) { NSMutableString *mutable = [NSMutableString stringWithString:[item formattedAddress]]; - - // make the return character visible + + // make the return character visible NSString *returnChar = [NSString stringWithUTF8String:"\n"]; NSString *returnSymbol = [NSString stringWithFormat:@"%C", (unichar)0x23CE]; - [mutable replaceOccurrencesOfString:returnChar + [mutable replaceOccurrencesOfString:returnChar withString:returnSymbol options:0 range:NSMakeRange(0, [mutable length])]; result = mutable; } - + // phone has a stringValue method else { result = [item stringValue]; @@ -1722,13 +1722,13 @@ - (NSString *)displayNameForItem:(id)item { - (void)controlTextDidChange:(NSNotification *)aNotification { // enable or disable Add Contact button - [self updateUI]; + [self updateUI]; } #pragma mark Setters and Getters - (GDataFeedContact *)contactFeed { - return mContactFeed; + return mContactFeed; } - (void)setContactFeed:(GDataFeedContact *)feed { @@ -1737,7 +1737,7 @@ - (void)setContactFeed:(GDataFeedContact *)feed { } - (NSError *)contactFetchError { - return mContactFetchError; + return mContactFetchError; } - (void)setContactFetchError:(NSError *)error { @@ -1746,7 +1746,7 @@ - (void)setContactFetchError:(NSError *)error { } - (GDataServiceTicket *)contactFetchTicket { - return mContactFetchTicket; + return mContactFetchTicket; } - (void)setContactFetchTicket:(GDataServiceTicket *)ticket { @@ -1765,7 +1765,7 @@ - (void)setContactImageETag:(NSString *)str { - (GDataFeedContactGroup *)groupFeed { - return mGroupFeed; + return mGroupFeed; } - (void)setGroupFeed:(GDataFeedContactGroup *)feed { @@ -1774,7 +1774,7 @@ - (void)setGroupFeed:(GDataFeedContactGroup *)feed { } - (NSError *)groupFetchError { - return mGroupFetchError; + return mGroupFetchError; } - (void)setGroupFetchError:(NSError *)error { @@ -1783,7 +1783,7 @@ - (void)setGroupFetchError:(NSError *)error { } - (GDataServiceTicket *)groupFetchTicket { - return mGroupFetchTicket; + return mGroupFetchTicket; } - (void)setGroupFetchTicket:(GDataServiceTicket *)ticket { @@ -1804,31 +1804,31 @@ - (void)setGroupFetchTicket:(GDataServiceTicket *)ticket { @implementation GDataEntryContact (ContactsSampleAdditions) - (NSString *)entryDisplayName { - + NSString *title; - + if ([self isDeleted]) { title = [NSString stringWithFormat:@"%C %@", kBallotX, [self identifier]]; - } else { - + } else { + title = [[self title] stringValue]; - + // if no title, fall back on e-mail address or use the string "Contact N" if ([title length] == 0 && [[self emailAddresses] count] > 0) { - + GDataEmail *email = [self primaryEmailAddress]; if (email == nil) { email = [[self emailAddresses] objectAtIndex:0]; } - title = [email address]; + title = [email address]; } - + if ([title length] == 0) { // fallback case - title = [self description]; + title = [self description]; } } - + return title; } @@ -1837,16 +1837,16 @@ - (NSString *)entryDisplayName { @implementation GDataEntryContactGroup (ContactsSampleAdditions) - (NSString *)entryDisplayName { - + NSString *title; - + if ([self isDeleted]) { title = [NSString stringWithFormat:@"%C %@", kBallotX, [self identifier]]; - } else { - + } else { + title = [[self title] stringValue]; } - + return title; } diff --git a/Examples/ContactsSample/EditEntryWindowController.h b/Examples/ContactsSample/EditEntryWindowController.h index 75506d94..cf4dbe7d 100644 --- a/Examples/ContactsSample/EditEntryWindowController.h +++ b/Examples/ContactsSample/EditEntryWindowController.h @@ -32,12 +32,12 @@ IBOutlet NSButton *mDeletedCheckbox; IBOutlet NSComboBox *mGroupField; // group title, though user may enter group ID - id mTarget; // WEAK + id mTarget; // WEAK SEL mDoneSEL; GDataObject *mObject; GDataFeedContactGroup *mGroupFeed; BOOL mWasSaveClicked; - + NSDictionary *relsDict_; } diff --git a/Examples/ContactsSample/EditEntryWindowController.m b/Examples/ContactsSample/EditEntryWindowController.m index c8cf0d96..04104bb1 100644 --- a/Examples/ContactsSample/EditEntryWindowController.m +++ b/Examples/ContactsSample/EditEntryWindowController.m @@ -54,13 +54,13 @@ // given the object we're editing, get the list with the selectors // and the display name for that class of object static ItemSelectors *ItemSelectorsForObject(GDataObject *obj) { - + NSString *className = NSStringFromClass([obj class]); - + for (int idx = 0; sAllItemSelectors[idx].className; idx++) { if ([className isEqual:sAllItemSelectors[idx].className]) { - return &sAllItemSelectors[idx]; + return &sAllItemSelectors[idx]; } } return NULL; @@ -77,12 +77,12 @@ - (id)init { } - (void)awakeFromNib { - + if (mObject) { // copy data from the object to our dialog's controls [self setUIFromObject:mObject]; } - + // make the lists of rel values for the rel combo box, and put in a dictionary // according to item class. This dictionary is used for the combo box // data source delegate methods @@ -90,27 +90,27 @@ - (void)awakeFromNib { // When the combo box menu's data source asks for the menu items, // we'll just look up the rel strings from the class of the item // being edited. - + NSArray *standardRels = [NSArray arrayWithObjects:kGDataContactHome, kGDataContactWork, kGDataContactOther, nil]; - - NSArray *orgRels = [NSArray arrayWithObjects:kGDataContactWork, + + NSArray *orgRels = [NSArray arrayWithObjects:kGDataContactWork, kGDataContactOther, nil]; - - NSArray *phoneRels = [NSArray arrayWithObjects:kGDataPhoneNumberHome, + + NSArray *phoneRels = [NSArray arrayWithObjects:kGDataPhoneNumberHome, kGDataPhoneNumberMobile, kGDataPhoneNumberPager, kGDataPhoneNumberWork, kGDataPhoneNumberHomeFax, kGDataPhoneNumberWorkFax, kGDataPhoneNumberOther, nil]; NSArray *noRels = [NSArray array]; - + relsDict_ = [[NSDictionary alloc] initWithObjectsAndKeys: orgRels, @"GDataOrganization", standardRels, @"GDataEmail", standardRels, @"GDataIM", phoneRels, @"GDataPhoneNumber", - standardRels, @"GDataStructuredPostalAddress", - noRels, @"GDataGroupMembershipInfo", + standardRels, @"GDataStructuredPostalAddress", + noRels, @"GDataGroupMembershipInfo", noRels, @"GDataExtendedProperty", nil]; } @@ -118,7 +118,7 @@ - (void)dealloc { [relsDict_ release]; [mObject release]; [mGroupFeed release]; - [super dealloc]; + [super dealloc]; } @@ -137,9 +137,9 @@ - (NSString *)stringValueForKey:(NSString *)key object:(GDataObject *)obj { } - (void)setUIFromObject:(GDataObject *)obj { - + ItemSelectors *sels = ItemSelectorsForObject(obj); - + NSString *value = [self stringValueForKey:(sels->valueKey) object:obj]; NSString *label = [self stringValueForKey:(sels->labelKey) object:obj]; NSString *rel = [self stringValueForKey:(sels->relKey) object:obj]; @@ -147,7 +147,7 @@ - (void)setUIFromObject:(GDataObject *)obj { NSString *protocol = [self stringValueForKey:(sels->protocolKey) object:obj]; [mClassNameField setStringValue:(sels->classDisplayName)]; - + [mValueField setStringValue:value]; [mLabelField setStringValue:label]; [mRelField setStringValue:rel]; @@ -159,11 +159,11 @@ - (void)setUIFromObject:(GDataObject *)obj { [mRelField setEnabled:(sels->relKey != nil)]; [mOrgTitleField setEnabled:(sels->titleKey != nil)]; [mProtocolField setEnabled:(sels->protocolKey != nil)]; - + // group combo box if ([obj isKindOfClass:[GDataGroupMembershipInfo class]]) { [mGroupField setEnabled:YES]; - + // set the field text to the group namefor this object's href NSString *objectID = [(GDataGroupMembershipInfo *)obj href]; if (objectID) { @@ -174,7 +174,7 @@ - (void)setUIFromObject:(GDataObject *)obj { } else { [mGroupField setEnabled:NO]; } - + // "primary" checkbox if ([obj respondsToSelector:@selector(isPrimary)]) { BOOL isPrimary = [(id)obj isPrimary]; @@ -192,7 +192,7 @@ - (void)setUIFromObject:(GDataObject *)obj { } else { [mDeletedCheckbox setEnabled:NO]; } - + } - (NSString *)stringValueOrNilForField:(NSTextField *)field { @@ -201,23 +201,23 @@ - (NSString *)stringValueOrNilForField:(NSTextField *)field { } - (GDataObject *)objectFromUI { - + ItemSelectors *sels = ItemSelectorsForObject(mObject); - + NSString *value = [self stringValueOrNilForField:mValueField]; NSString *label = [self stringValueOrNilForField:mLabelField]; NSString *rel = [self stringValueOrNilForField:mRelField]; NSString *title = [self stringValueOrNilForField:mOrgTitleField]; NSString *protocol = [self stringValueOrNilForField:mProtocolField]; - + GDataObject *newObj = [[mObject copy] autorelease]; - + if (sels->valueKey) [newObj setValue:value forKey:sels->valueKey]; if (sels->labelKey) [newObj setValue:label forKey:sels->labelKey]; if (sels->relKey) [newObj setValue:rel forKey:sels->relKey]; if (sels->titleKey) [newObj setValue:title forKey:sels->titleKey]; if (sels->protocolKey) [newObj setValue:protocol forKey:sels->protocolKey]; - + if ([mPrimaryCheckbox isEnabled]) { BOOL isPrimary = ([mPrimaryCheckbox state] == NSOnState); [(id)newObj setIsPrimary:isPrimary]; @@ -227,7 +227,7 @@ - (GDataObject *)objectFromUI { BOOL isDeleted = ([mDeletedCheckbox state] == NSOnState); [(id)newObj setIsDeleted:isDeleted]; } - + if ([mGroupField isEnabled]) { // find the index of the group entry that has the title in the combo box NSString *str = [mGroupField stringValue]; @@ -240,11 +240,11 @@ - (GDataObject *)objectFromUI { href = [[[mGroupFeed entries] objectAtIndex:index] identifier]; } else { // it wasn't a title, so assume the user entered a group's ID - href = str; + href = str; } [(id)newObj setHref:href]; } - + return newObj; } @@ -257,12 +257,12 @@ - (void)runModalForTarget:(id)target groupFeed:(GDataFeedContactGroup *)groupFeed object:(GDataObject *)object { - + mTarget = target; mDoneSEL = doneSelector; mObject = [object retain]; mGroupFeed = [groupFeed retain]; - + [NSApp beginSheet:[self window] modalForWindow:[mTarget window] modalDelegate:self @@ -271,14 +271,14 @@ - (void)runModalForTarget:(id)target } - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { - + } - (void)closeDialog { // call the target to say we're done - [mTarget performSelector:mDoneSEL + [mTarget performSelector:mDoneSEL withObject:[[self retain] autorelease]]; - + [[self window] orderOut:self]; [NSApp endSheet:[self window]]; } @@ -294,11 +294,11 @@ - (IBAction)cancelButtonClicked:(id)sender { - (GDataObject *)object { // copy from our dialog's controls into the object - return [self objectFromUI]; + return [self objectFromUI]; } - (BOOL)wasSaveClicked { - return mWasSaveClicked; + return mWasSaveClicked; } #pragma mark Rel and Protocol combo box data source @@ -309,9 +309,9 @@ - (NSArray *)relsForCurrentObject { } - (NSArray *)protocolsForCurrentObject { - + if ([mObject class] == [GDataIM class]) { - + return [NSArray arrayWithObjects: kGDataIMProtocolAIM, kGDataIMProtocolGoogleTalk, kGDataIMProtocolICQ, kGDataIMProtocolJabber, kGDataIMProtocolMSN, kGDataIMProtocolYahoo, nil]; @@ -348,21 +348,21 @@ @implementation GDataExtendedProperty (ContactsSampleAdditions) // setter that looks for a leading "<" to decide if it's an XML element - (NSString *)unifiedStringValue { - + NSString *result = [self value]; if (result == nil) { NSArray *xmlStrings = [[self XMLValues] valueForKey:@"XMLString"]; result = [xmlStrings componentsJoinedByString:@""]; } - return result; + return result; } - (void)setUnifiedStringValue:(NSString *)str { NSCharacterSet *wsSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; NSString *trimmed = [str stringByTrimmingCharactersInSet:wsSet]; - + if ([trimmed hasPrefix:@"<"]) { - + // set as an XML element NSError *error = nil; NSXMLElement *element; @@ -377,7 +377,7 @@ - (void)setUnifiedStringValue:(NSString *)str { [self setValue:nil]; } else { - + // set as an attribute string [self setValue:str]; [self setXMLValues:nil]; diff --git a/Examples/GooglePhotosSample/GooglePhotosSampleAppController.m b/Examples/GooglePhotosSample/GooglePhotosSampleAppController.m index ab741566..17be06eb 100644 --- a/Examples/GooglePhotosSample/GooglePhotosSampleAppController.m +++ b/Examples/GooglePhotosSample/GooglePhotosSampleAppController.m @@ -23,10 +23,10 @@ @implementation GooglePhotosSampleAppController - (void)applicationWillFinishLaunching:(NSNotification *)notifcation { - + GooglePhotosSampleWindowController* windowController = [GooglePhotosSampleWindowController sharedGooglePhotosSampleWindowController]; [windowController showWindow:self]; - + } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { diff --git a/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.h b/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.h index 45122875..73f125cb 100644 --- a/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.h +++ b/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.h @@ -26,7 +26,7 @@ @interface GooglePhotosSampleWindowController : NSWindowController { IBOutlet NSTextField *mUsernameField; IBOutlet NSSecureTextField *mPasswordField; - + IBOutlet NSTableView *mAlbumTable; IBOutlet NSProgressIndicator *mAlbumProgressIndicator; IBOutlet NSTextView *mAlbumResultTextField; @@ -42,24 +42,24 @@ IBOutlet NSTextView *mPhotoResultTextField; IBOutlet NSButton *mPhotoCancelButton; IBOutlet NSImageView *mPhotoImageView; - + IBOutlet NSButton *mAddTagButton; IBOutlet NSTextField *mTagField; IBOutlet NSButton *mAddCommentButton; IBOutlet NSTextField *mCommentField; - + IBOutlet NSButton *mAddToAlbumButton; IBOutlet NSButton *mAddToDropBoxButton; IBOutlet NSButton *mDeletePhotoButton; IBOutlet NSButton *mDownloadPhotoButton; IBOutlet NSPopUpButton *mChangeAlbumPopupButton; IBOutlet NSProgressIndicator *mUploadProgressIndicator; - + GDataFeedPhotoUser *mUserAlbumFeed; // user feed of album entries GDataServiceTicket *mAlbumFetchTicket; NSError *mAlbumFetchError; NSString *mAlbumImageURLString; - + GDataFeedPhotoAlbum *mAlbumPhotosFeed; // album feed of photo entries GDataServiceTicket *mPhotosFetchTicket; NSError *mPhotosFetchError; diff --git a/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.m b/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.m index 9fde77f9..5c578493 100644 --- a/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.m +++ b/Examples/GooglePhotosSample/GooglePhotosSampleWindowController.m @@ -48,7 +48,7 @@ - (GDataEntryPhoto *)selectedPhoto; - (GDataFeedPhotoUser *)albumFeed; - (void)setAlbumFeed:(GDataFeedPhotoUser *)feed; - (NSError *)albumFetchError; -- (void)setAlbumFetchError:(NSError *)error; +- (void)setAlbumFetchError:(NSError *)error; - (GDataServiceTicket *)albumFetchTicket; - (void)setAlbumFetchTicket:(GDataServiceTicket *)ticket; - (NSString *)albumImageURLString; @@ -72,10 +72,10 @@ @implementation GooglePhotosSampleWindowController + (GooglePhotosSampleWindowController *)sharedGooglePhotosSampleWindowController { - + if (!gGooglePhotosSampleWindowController) { gGooglePhotosSampleWindowController = [[GooglePhotosSampleWindowController alloc] init]; - } + } return gGooglePhotosSampleWindowController; } @@ -96,7 +96,7 @@ - (void)awakeFromNib { NSFont *resultTextFont = [NSFont fontWithName:@"Monaco" size:9]; [mAlbumResultTextField setFont:resultTextFont]; [mPhotoResultTextField setFont:resultTextFont]; - + [self updateUI]; } @@ -105,12 +105,12 @@ - (void)dealloc { [mAlbumFetchError release]; [mAlbumFetchTicket release]; [mAlbumImageURLString release]; - + [mAlbumPhotosFeed release]; [mPhotosFetchError release]; [mPhotosFetchTicket release]; [mPhotoImageURLString release]; - + [super dealloc]; } @@ -120,24 +120,24 @@ - (void)dealloc { // fetch or clear the thumbnail for this specified album - (void)updateImageForAlbum:(GDataEntryPhotoAlbum *)album { - + // if there's a thumbnail and it's different from the one being shown, // fetch it now if (!album) { // clear the image [mAlbumImageView setImage:nil]; [self setAlbumImageURLString:nil]; - - } else { + + } else { // if the new thumbnail URL string is different from the previous one, // save the new one, clear the image and fetch the new image - + NSArray *thumbnails = [[album mediaGroup] mediaThumbnails]; if ([thumbnails count] > 0) { - + NSString *imageURLString = [[thumbnails objectAtIndex:0] URLString]; if (!imageURLString || ![mAlbumImageURLString isEqual:imageURLString]) { - + [self setAlbumImageURLString:imageURLString]; [mAlbumImageView setImage:nil]; @@ -146,40 +146,40 @@ - (void)updateImageForAlbum:(GDataEntryPhotoAlbum *)album { forImageView:mAlbumImageView title:[[album title] stringValue]]; } - } + } } } } // get or clear the thumbnail for this specified photo - (void)updateImageForPhoto:(GDataEntryPhoto *)photo { - + // if there's a thumbnail and it's different from the one being shown, // fetch it now if (!photo) { // clear the image [mPhotoImageView setImage:nil]; [self setPhotoImageURLString:nil]; - - } else { + + } else { // if the new thumbnail URL string is different from the previous one, // save the new one, clear the image and fetch the new image - + NSArray *thumbnails = [[photo mediaGroup] mediaThumbnails]; if ([thumbnails count] > 0) { - + NSString *imageURLString = [[thumbnails objectAtIndex:0] URLString]; if (!imageURLString || ![mPhotoImageURLString isEqual:imageURLString]) { - + [self setPhotoImageURLString:imageURLString]; [mPhotoImageView setImage:nil]; - + if (imageURLString) { [self fetchURLString:imageURLString forImageView:mPhotoImageView title:[[photo title] stringValue]]; } - } + } } } } @@ -216,16 +216,16 @@ - (void)imageFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data e #pragma mark - - (void)updateUI { - + // album list display - [mAlbumTable reloadData]; - + [mAlbumTable reloadData]; + if (mAlbumFetchTicket != nil) { - [mAlbumProgressIndicator startAnimation:self]; + [mAlbumProgressIndicator startAnimation:self]; } else { - [mAlbumProgressIndicator stopAnimation:self]; + [mAlbumProgressIndicator stopAnimation:self]; } - + // album fetch result or selected item NSString *albumResultStr = @""; if (mAlbumFetchError) { @@ -240,17 +240,17 @@ - (void)updateUI { [self updateImageForAlbum:album]; } [mAlbumResultTextField setString:albumResultStr]; - + // photo list display - [mPhotoTable reloadData]; - + [mPhotoTable reloadData]; + // the bottom table displays photo entries if (mPhotosFetchTicket != nil) { - [mPhotoProgressIndicator startAnimation:self]; + [mPhotoProgressIndicator startAnimation:self]; } else { - [mPhotoProgressIndicator stopAnimation:self]; + [mPhotoProgressIndicator stopAnimation:self]; } - + // display photo entry fetch result or selected item GDataEntryPhoto *selectedPhoto = [self selectedPhoto]; @@ -266,11 +266,11 @@ - (void)updateUI { [self updateImageForPhoto:selectedPhoto]; } [mPhotoResultTextField setString:photoResultStr]; - + // enable/disable cancel buttons [mAlbumCancelButton setEnabled:(mAlbumFetchTicket != nil)]; [mPhotoCancelButton setEnabled:(mPhotosFetchTicket != nil)]; - + // enable/disable other buttons BOOL isAlbumSelected = ([self selectedAlbum] != nil); BOOL isPasswordProvided = ([[mPasswordField stringValue] length] > 0); @@ -284,12 +284,12 @@ - (void)updateUI { BOOL isSelectedEntryEditable = ([selectedPhoto editLink] != nil); [mDeletePhotoButton setEnabled:isSelectedEntryEditable]; [mChangeAlbumPopupButton setEnabled:isSelectedEntryEditable]; - + BOOL hasPhotoFeed = ([selectedPhoto feedLink] != nil); - + BOOL isTagProvided = ([[mTagField stringValue] length] > 0); BOOL isCommentProvided = ([[mCommentField stringValue] length] > 0); - + [mAddTagButton setEnabled:(hasPhotoFeed && isTagProvided)]; [mAddCommentButton setEnabled:(hasPhotoFeed && isCommentProvided)]; @@ -300,17 +300,17 @@ - (void)updateUI { } - (void)updateChangeAlbumList { - + // replace all menu items in the button with the titles and pointers // of the feed's entries, but preserve the title - + NSString *title = [mChangeAlbumPopupButton title]; - + NSMenu *menu = [[[NSMenu alloc] initWithTitle:title] autorelease]; [menu addItemWithTitle:title action:nil keyEquivalent:@""]; - + [mChangeAlbumPopupButton setMenu:menu]; - + GDataFeedPhotoUser *feed = [self albumFeed]; for (GDataEntryPhotoAlbum *albumEntry in feed) { @@ -331,13 +331,13 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { GDataEntryPhotoAlbum *menuItemAlbum = [menuItem representedObject]; if ([menuItemAlbum isKindOfClass:[GDataEntryPhotoAlbum class]]) { - + GDataEntryPhoto *selectedPhoto = [self selectedPhoto]; - + BOOL isSelectedPhotoEntryEditable = ([selectedPhoto editLink] != nil); - + if (isSelectedPhotoEntryEditable) { - + if (menuItemAlbum != nil && ![[selectedPhoto albumID] isEqual:[menuItemAlbum GPhotoID]]) { return YES; @@ -345,7 +345,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { } return NO; } - + // unknown item being validated return YES; } @@ -353,7 +353,7 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { #pragma mark IBActions - (IBAction)getAlbumClicked:(id)sender { - + NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; NSString *username = [mUsernameField stringValue]; @@ -363,7 +363,7 @@ - (IBAction)getAlbumClicked:(id)sender { // if no domain was supplied, add @gmail.com username = [username stringByAppendingString:@"@gmail.com"]; } - + [mUsernameField setStringValue:username]; [self fetchAllAlbums]; @@ -406,15 +406,15 @@ - (IBAction)downloadClicked:(id)sender { } - (IBAction)addCommentClicked:(id)sender { - [self addCommentToSelectedPhoto]; + [self addCommentToSelectedPhoto]; } - (IBAction)addTagClicked:(id)sender { - [self addTagToSelectedPhoto]; + [self addTagToSelectedPhoto]; } - (IBAction)loggingCheckboxClicked:(id)sender { - [GTMHTTPFetcher setLoggingEnabled:[sender state]]; + [GTMHTTPFetcher setLoggingEnabled:[sender state]]; } #pragma mark - @@ -426,9 +426,9 @@ - (IBAction)loggingCheckboxClicked:(id)sender { // fetched data.) - (GDataServiceGooglePhotos *)googlePhotosService { - + static GDataServiceGooglePhotos* service = nil; - + if (!service) { service = [[GDataServiceGooglePhotos alloc] init]; @@ -446,17 +446,17 @@ - (GDataServiceGooglePhotos *)googlePhotosService { [service setUserCredentialsWithUsername:nil password:nil]; } - + return service; } // get the album selected in the top list, or nil if none - (GDataEntryPhotoAlbum *)selectedAlbum { - + NSArray *albums = [mUserAlbumFeed entries]; int rowIndex = [mAlbumTable selectedRow]; if ([albums count] > 0 && rowIndex > -1) { - + GDataEntryPhotoAlbum *album = [albums objectAtIndex:rowIndex]; return album; } @@ -465,11 +465,11 @@ - (GDataEntryPhotoAlbum *)selectedAlbum { // get the photo selected in the bottom list, or nil if none - (GDataEntryPhoto *)selectedPhoto { - + NSArray *photos = [mAlbumPhotosFeed entries]; int rowIndex = [mPhotoTable selectedRow]; if ([photos count] > 0 && rowIndex > -1) { - + GDataEntryPhoto *photo = [photos objectAtIndex:rowIndex]; return photo; } @@ -480,17 +480,17 @@ - (GDataEntryPhoto *)selectedPhoto { // begin retrieving the list of the user's albums - (void)fetchAllAlbums { - + [self setAlbumFeed:nil]; [self setAlbumFetchError:nil]; [self setAlbumFetchTicket:nil]; - + [self setPhotoFeed:nil]; [self setPhotoFetchError:nil]; [self setPhotoFetchTicket:nil]; NSString *username = [mUsernameField stringValue]; - + GDataServiceGooglePhotos *service = [self googlePhotosService]; GDataServiceTicket *ticket; @@ -525,7 +525,7 @@ - (void)albumListFetchTicket:(GDataServiceTicket *)ticket [self updateUI]; } -#pragma mark Fetch an album's photos +#pragma mark Fetch an album's photos // for the album selected in the top list, begin retrieving the list of // photos @@ -1069,14 +1069,14 @@ - (void)controlTextDidChange:(NSNotification *)note { // - (void)tableViewSelectionDidChange:(NSNotification *)notification { - + if ([notification object] == mAlbumTable) { [self fetchSelectedAlbum]; } else { - // the user clicked on an entry; + // the user clicked on an entry; // just display it below the entry table - - [self updateUI]; + + [self updateUI]; } } @@ -1106,7 +1106,7 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum #pragma mark Setters and Getters - (GDataFeedPhotoUser *)albumFeed { - return mUserAlbumFeed; + return mUserAlbumFeed; } - (void)setAlbumFeed:(GDataFeedPhotoUser *)feed { @@ -1115,7 +1115,7 @@ - (void)setAlbumFeed:(GDataFeedPhotoUser *)feed { } - (NSError *)albumFetchError { - return mAlbumFetchError; + return mAlbumFetchError; } - (void)setAlbumFetchError:(NSError *)error { @@ -1124,7 +1124,7 @@ - (void)setAlbumFetchError:(NSError *)error { } - (GDataServiceTicket *)albumFetchTicket { - return mAlbumFetchTicket; + return mAlbumFetchTicket; } - (void)setAlbumFetchTicket:(GDataServiceTicket *)ticket { @@ -1142,7 +1142,7 @@ - (void)setAlbumImageURLString:(NSString *)str { } - (GDataFeedPhotoAlbum *)photoFeed { - return mAlbumPhotosFeed; + return mAlbumPhotosFeed; } - (void)setPhotoFeed:(GDataFeedPhotoAlbum *)feed { @@ -1151,7 +1151,7 @@ - (void)setPhotoFeed:(GDataFeedPhotoAlbum *)feed { } - (NSError *)photoFetchError { - return mPhotosFetchError; + return mPhotosFetchError; } - (void)setPhotoFetchError:(NSError *)error { @@ -1160,7 +1160,7 @@ - (void)setPhotoFetchError:(NSError *)error { } - (GDataServiceTicket *)photoFetchTicket { - return mPhotosFetchTicket; + return mPhotosFetchTicket; } - (void)setPhotoFetchTicket:(GDataServiceTicket *)ticket { diff --git a/Examples/SpreadsheetSample/SpreadsheetSampleAppController.m b/Examples/SpreadsheetSample/SpreadsheetSampleAppController.m index a162d638..35ac9b2d 100644 --- a/Examples/SpreadsheetSample/SpreadsheetSampleAppController.m +++ b/Examples/SpreadsheetSample/SpreadsheetSampleAppController.m @@ -23,10 +23,10 @@ @implementation SpreadsheetSampleAppController - (void)applicationWillFinishLaunching:(NSNotification *)notifcation { - + SpreadsheetSampleWindowController* windowController = [SpreadsheetSampleWindowController sharedSpreadsheetSampleWindowController]; [windowController showWindow:self]; - + } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { diff --git a/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.h b/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.h index e442cbff..4751d9fe 100644 --- a/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.h +++ b/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.h @@ -24,7 +24,7 @@ @interface SpreadsheetSampleWindowController : NSWindowController { IBOutlet NSTextField *mUsernameField; IBOutlet NSSecureTextField *mPasswordField; - + IBOutlet NSTableView *mSpreadsheetTable; IBOutlet NSProgressIndicator *mSpreadsheetProgressIndicator; IBOutlet NSTextView *mSpreadsheetResultTextField; @@ -32,20 +32,20 @@ IBOutlet NSTableView *mWorksheetTable; IBOutlet NSProgressIndicator *mWorksheetProgressIndicator; IBOutlet NSTextView *mWorksheetResultTextField; - + IBOutlet NSSegmentedControl *mFeedSelectorSegments; IBOutlet NSTableView *mEntryTable; IBOutlet NSProgressIndicator *mEntryProgressIndicator; IBOutlet NSTextView *mEntryResultTextField; - + GDataFeedSpreadsheet *mSpreadsheetFeed; BOOL mIsSpreadsheetFetchPending; NSError *mSpreadsheetFetchError; - + GDataFeedWorksheet *mWorksheetFeed; BOOL mIsWorksheetFetchPending; NSError *mWorksheetFetchError; - + GDataFeedBase *mEntryFeed; BOOL mIsEntryFetchPending; NSError *mEntryFetchError; diff --git a/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.m b/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.m index b65746a4..8e7d8820 100644 --- a/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.m +++ b/Examples/SpreadsheetSample/SpreadsheetSampleWindowController.m @@ -34,13 +34,13 @@ - (GDataEntryBase *)selectedEntry; - (GDataFeedSpreadsheet *)spreadsheetFeed; - (void)setSpreadsheetFeed:(GDataFeedSpreadsheet *)feed; - (NSError *)spreadsheetFetchError; -- (void)setSpreadsheetFetchError:(NSError *)error; +- (void)setSpreadsheetFetchError:(NSError *)error; - (GDataFeedWorksheet *)worksheetFeed; - (void)setWorksheetFeed:(GDataFeedWorksheet *)feed; - (NSError *)worksheetFetchError; - (void)setWorksheetFetchError:(NSError *)error; - + - (GDataFeedBase *)entryFeed; - (void)setEntryFeed:(GDataFeedBase *)feed; - (NSError *)entryFetchError; @@ -54,10 +54,10 @@ @implementation SpreadsheetSampleWindowController + (SpreadsheetSampleWindowController *)sharedSpreadsheetSampleWindowController { - + if (!gSpreadsheetSampleWindowController) { gSpreadsheetSampleWindowController = [[SpreadsheetSampleWindowController alloc] init]; - } + } return gSpreadsheetSampleWindowController; } @@ -87,29 +87,29 @@ - (void)awakeFromNib { - (void)dealloc { [mSpreadsheetFeed release]; [mSpreadsheetFetchError release]; - + [mWorksheetFeed release]; [mWorksheetFetchError release]; - + [mEntryFeed release]; [mEntryFetchError release]; - + [super dealloc]; } #pragma mark - - (void)updateUI { - + // spreadsheet list display - [mSpreadsheetTable reloadData]; - + [mSpreadsheetTable reloadData]; + if (mIsSpreadsheetFetchPending) { - [mSpreadsheetProgressIndicator startAnimation:self]; + [mSpreadsheetProgressIndicator startAnimation:self]; } else { - [mSpreadsheetProgressIndicator stopAnimation:self]; + [mSpreadsheetProgressIndicator stopAnimation:self]; } - + // spreadsheet fetch result or selected item NSString *spreadsheetResultStr = @""; if (mSpreadsheetFetchError) { @@ -119,21 +119,21 @@ - (void)updateUI { if (spreadsheet) { spreadsheetResultStr = [spreadsheet description]; } else { - + } } [mSpreadsheetResultTextField setString:spreadsheetResultStr]; - - + + // Worksheet list display - [mWorksheetTable reloadData]; - + [mWorksheetTable reloadData]; + if (mIsWorksheetFetchPending) { - [mWorksheetProgressIndicator startAnimation:self]; + [mWorksheetProgressIndicator startAnimation:self]; } else { - [mWorksheetProgressIndicator stopAnimation:self]; + [mWorksheetProgressIndicator stopAnimation:self]; } - + // Worksheet fetch result or selected item NSString *worksheetResultStr = @""; if (mWorksheetFetchError) { @@ -145,17 +145,17 @@ - (void)updateUI { } } [mWorksheetResultTextField setString:worksheetResultStr]; - - + + // cell/list entry display [mEntryTable reloadData]; - + if (mIsEntryFetchPending) { - [mEntryProgressIndicator startAnimation:self]; + [mEntryProgressIndicator startAnimation:self]; } else { - [mEntryProgressIndicator stopAnimation:self]; + [mEntryProgressIndicator stopAnimation:self]; } - + // entry fetch result or selected item NSString *entryResultStr = @""; if (mEntryFetchError) { @@ -167,23 +167,23 @@ - (void)updateUI { } } [mEntryResultTextField setString:entryResultStr]; - + } #pragma mark IBActions - (IBAction)getSpreadsheetClicked:(id)sender { - + NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; - + NSString *username = [mUsernameField stringValue]; username = [username stringByTrimmingCharactersInSet:whitespace]; - + if ([username rangeOfString:@"@"].location == NSNotFound) { // if no domain was supplied, add @gmail.com username = [username stringByAppendingString:@"@gmail.com"]; } - + [mUsernameField setStringValue:username]; [self fetchFeedOfSpreadsheets]; @@ -195,7 +195,7 @@ - (IBAction)feedSegmentClicked:(id)sender { } - (IBAction)loggingCheckboxClicked:(id)sender { - [GTMHTTPFetcher setLoggingEnabled:[sender state]]; + [GTMHTTPFetcher setLoggingEnabled:[sender state]]; } #pragma mark - @@ -208,7 +208,7 @@ - (IBAction)loggingCheckboxClicked:(id)sender { // fetched data.) - (GDataServiceGoogleSpreadsheet *)spreadsheetService { - + static GDataServiceGoogleSpreadsheet* service = nil; if (!service) { @@ -221,20 +221,20 @@ - (GDataServiceGoogleSpreadsheet *)spreadsheetService { // username/password may change NSString *username = [mUsernameField stringValue]; NSString *password = [mPasswordField stringValue]; - + [service setUserCredentialsWithUsername:username password:password]; - + return service; } // get the spreadsheet selected in the top list, or nil if none - (GDataEntrySpreadsheet *)selectedSpreadsheet { - + NSArray *spreadsheets = [mSpreadsheetFeed entries]; int rowIndex = [mSpreadsheetTable selectedRow]; if ([spreadsheets count] > 0 && rowIndex > -1) { - + GDataEntrySpreadsheet *spreadsheet = [spreadsheets objectAtIndex:rowIndex]; return spreadsheet; } @@ -243,11 +243,11 @@ - (GDataEntrySpreadsheet *)selectedSpreadsheet { // get the Worksheet selected in the second list, or nil if none - (GDataEntryWorksheet *)selectedWorksheet { - + NSArray *Worksheets = [mWorksheetFeed entries]; int rowIndex = [mWorksheetTable selectedRow]; if ([Worksheets count] > 0 && rowIndex > -1) { - + GDataEntryWorksheet *Worksheet = [Worksheets objectAtIndex:rowIndex]; return Worksheet; } @@ -256,12 +256,12 @@ - (GDataEntryWorksheet *)selectedWorksheet { // get the cell or list entry selected in the bottom list - (GDataEntryBase *)selectedEntry { - + NSArray *entries = [mEntryFeed entries]; - + int rowIndex = [mEntryTable selectedRow]; if ([entries count] > 0 && rowIndex > -1) { - + GDataEntryBase *entry = [entries objectAtIndex:rowIndex]; return entry; } @@ -310,19 +310,19 @@ - (void)feedTicket:(GDataServiceTicket *)ticket // for the spreadsheet selected in the top list, begin retrieving the list of // Worksheets - (void)fetchSelectedSpreadsheet { - + GDataEntrySpreadsheet *spreadsheet = [self selectedSpreadsheet]; if (spreadsheet) { - + NSURL *feedURL = [spreadsheet worksheetsFeedURL]; if (feedURL) { - + [self setWorksheetFeed:nil]; [self setWorksheetFetchError:nil]; mIsWorksheetFetchPending = YES; - + [self setEntryFeed:nil]; - [self setEntryFetchError:nil]; + [self setEntryFetchError:nil]; GDataServiceGoogleSpreadsheet *service = [self spreadsheetService]; [service fetchFeedWithURL:feedURL @@ -352,10 +352,10 @@ - (void)worksheetsTicket:(GDataServiceTicket *)ticket // of its contents, depending on the segmented control's setting - (void)fetchSelectedWorksheet { - + GDataEntryWorksheet *worksheet = [self selectedWorksheet]; if (worksheet) { - + // the segmented control lets the user retrieve cell entries (position 0) // or list entries (position 1) int segmentIndex = [mFeedSelectorSegments selectedSegment]; @@ -421,35 +421,35 @@ - (int)numberOfRowsInTableView:(NSTableView *)tableView { } else if (tableView == mWorksheetTable) { return [[mWorksheetFeed entries] count]; } else { - return [[mEntryFeed entries] count]; + return [[mEntryFeed entries] count]; } } - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row { - + if (tableView == mSpreadsheetTable) { - + // get the spreadsheet entry's title GDataEntrySpreadsheet *spreadsheet = [[mSpreadsheetFeed entries] objectAtIndex:row]; return [[spreadsheet title] stringValue]; - + } else if (tableView == mWorksheetTable) { - + // get the worksheet entry's title GDataEntryWorksheet *worksheetEntry = [[mWorksheetFeed entries] objectAtIndex:row]; return [[worksheetEntry title] stringValue]; - + } else { - + // entry table; get a string for the cell or the list item GDataEntryBase *entry = [[mEntryFeed entries] objectAtIndex:row]; NSString *displayStr; - + if ([entry isKindOfClass:[GDataEntrySpreadsheetCell class]]) { - + // format cell entry data GDataSpreadsheetCell *cell = [(GDataEntrySpreadsheetCell *)entry cell]; - + NSString *resultStr = [cell resultString]; // like "3.1415926" NSString *inputStr = [cell inputString]; // like "=pi()" NSString *title = [[entry title] stringValue]; // like "A3" @@ -457,14 +457,14 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum // show the input string (like =pi()) only if it differs // from the result string if (!inputStr || (resultStr && [inputStr isEqual:resultStr])) { - inputStr = @""; + inputStr = @""; } - + displayStr = [NSString stringWithFormat:@"%@: %@ %@", title, inputStr, (resultStr ? resultStr : @"")]; - + } else { - + // format list entry data // // a list entry we will show as a sequence of (name,value) items from @@ -475,9 +475,9 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum NSMutableArray *array = [NSMutableArray array]; NSEnumerator *enumerator = [customElements objectEnumerator]; GDataSpreadsheetCustomElement *element; - + while ((element = [enumerator nextObject]) != nil) { - + NSString *elemStr = [NSString stringWithFormat:@"(%@, %@)", [element name], [element stringValue]]; [array addObject:elemStr]; @@ -491,7 +491,7 @@ - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColum #pragma mark Setters and Getters - (GDataFeedSpreadsheet *)spreadsheetFeed { - return mSpreadsheetFeed; + return mSpreadsheetFeed; } - (void)setSpreadsheetFeed:(GDataFeedSpreadsheet *)feed { @@ -500,7 +500,7 @@ - (void)setSpreadsheetFeed:(GDataFeedSpreadsheet *)feed { } - (NSError *)spreadsheetFetchError { - return mSpreadsheetFetchError; + return mSpreadsheetFetchError; } - (void)setSpreadsheetFetchError:(NSError *)error { @@ -510,7 +510,7 @@ - (void)setSpreadsheetFetchError:(NSError *)error { - (GDataFeedWorksheet *)worksheetFeed { - return mWorksheetFeed; + return mWorksheetFeed; } - (void)setWorksheetFeed:(GDataFeedWorksheet *)feed { @@ -519,7 +519,7 @@ - (void)setWorksheetFeed:(GDataFeedWorksheet *)feed { } - (NSError *)worksheetFetchError { - return mWorksheetFetchError; + return mWorksheetFetchError; } - (void)setWorksheetFetchError:(NSError *)error { @@ -528,7 +528,7 @@ - (void)setWorksheetFetchError:(NSError *)error { } - (GDataFeedBase *)entryFeed { - return mEntryFeed; + return mEntryFeed; } - (void)setEntryFeed:(GDataFeedBase *)feed { @@ -537,7 +537,7 @@ - (void)setEntryFeed:(GDataFeedBase *)feed { } - (NSError *)entryFetchError { - return mEntryFetchError; + return mEntryFetchError; } - (void)setEntryFetchError:(NSError *)error { diff --git a/Source/ACL/GDataACLRole.h b/Source/ACL/GDataACLRole.h index f23c1489..f5961d74 100644 --- a/Source/ACL/GDataACLRole.h +++ b/Source/ACL/GDataACLRole.h @@ -26,7 +26,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAACLROLE_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -50,7 +50,7 @@ _EXTERN NSString* const kGDataRoleCommenter _INITIALIZE_AS(@"commenter"); + (id)roleWithValue:(NSString *)value; - (NSString *)value; -- (void)setValue:(NSString *)str; +- (void)setValue:(NSString *)str; @end @interface GDataACLRole : GDataACLRoleBase diff --git a/Source/ACL/GDataACLScope.h b/Source/ACL/GDataACLScope.h index 3cffaef5..6b8f94df 100644 --- a/Source/ACL/GDataACLScope.h +++ b/Source/ACL/GDataACLScope.h @@ -25,7 +25,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAACLSCOPE_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -43,7 +43,7 @@ _EXTERN NSString* const kGDataScopeTypeGroup _INITIALIZE_AS(@"group"); // // http://code.google.com/apis/calendar/reference.html#gacl_reference -@interface GDataACLScope : GDataObject +@interface GDataACLScope : GDataObject + (GDataACLScope *)scopeWithType:(NSString *)type value:(NSString *)value; diff --git a/Source/ACL/GDataACLScope.m b/Source/ACL/GDataACLScope.m index f51b1f79..31d75284 100644 --- a/Source/ACL/GDataACLScope.m +++ b/Source/ACL/GDataACLScope.m @@ -47,7 +47,7 @@ + (GDataACLScope *)scopeWithType:(NSString *)type value:(NSString *)value { } - (void)addParseDeclarations { - + NSArray *attrs = [NSArray arrayWithObjects: kTypeAttr, kValueAttr, kNameAttr, nil]; [self addLocalAttributeDeclarations:attrs]; diff --git a/Source/ACL/GDataFeedACL.h b/Source/ACL/GDataFeedACL.h index 85cef452..868d7928 100644 --- a/Source/ACL/GDataFeedACL.h +++ b/Source/ACL/GDataFeedACL.h @@ -23,7 +23,7 @@ #import "GDataFeedBase.h" #import "GDataEntryACL.h" -@interface GDataFeedACL : GDataFeedBase +@interface GDataFeedACL : GDataFeedBase + (id)ACLFeed; diff --git a/Source/ACL/GDataFeedACL.m b/Source/ACL/GDataFeedACL.m index fd731b09..54524a03 100644 --- a/Source/ACL/GDataFeedACL.m +++ b/Source/ACL/GDataFeedACL.m @@ -28,9 +28,9 @@ @implementation GDataFeedACL + (id)ACLFeed { GDataFeedACL *feed = [self object]; - + [feed setNamespaces:[GDataEntryACL ACLNamespaces]]; - + return feed; } diff --git a/Source/BaseClasses/GDataQuery.m b/Source/BaseClasses/GDataQuery.m index 74fa0211..0220e065 100644 --- a/Source/BaseClasses/GDataQuery.m +++ b/Source/BaseClasses/GDataQuery.m @@ -534,7 +534,7 @@ - (NSInteger)intValueForParameterWithName:(NSString *)name NSString *str = [customParameters_ objectForKey:name]; if (str != nil) return (NSInteger) [str intValue]; - + return missingVal; } diff --git a/Source/Clients/Blogger/GDataBlogger.h b/Source/Clients/Blogger/GDataBlogger.h index 7d3cda67..8f6b4c06 100644 --- a/Source/Clients/Blogger/GDataBlogger.h +++ b/Source/Clients/Blogger/GDataBlogger.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataBlogger.h // diff --git a/Source/Clients/Calendar/GDataCalendar.h b/Source/Clients/Calendar/GDataCalendar.h index ab99dbf7..79164f86 100644 --- a/Source/Clients/Calendar/GDataCalendar.h +++ b/Source/Clients/Calendar/GDataCalendar.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataCalendar.h // diff --git a/Source/Clients/Calendar/GDataEntryCalendar.h b/Source/Clients/Calendar/GDataEntryCalendar.h index c15cd477..78a66b7c 100644 --- a/Source/Clients/Calendar/GDataEntryCalendar.h +++ b/Source/Clients/Calendar/GDataEntryCalendar.h @@ -26,7 +26,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAENTRYCALENDAR_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN diff --git a/Source/Clients/Calendar/GDataEntryCalendar.m b/Source/Clients/Calendar/GDataEntryCalendar.m index 24b4cf89..0cbe303c 100644 --- a/Source/Clients/Calendar/GDataEntryCalendar.m +++ b/Source/Clients/Calendar/GDataEntryCalendar.m @@ -30,25 +30,25 @@ #import "GDataEntryCalendarEvent.h" // CalendarEntry extensions -@implementation GDataHiddenProperty +@implementation GDataHiddenProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"hidden"; } @end -@implementation GDataAccessLevelProperty +@implementation GDataAccessLevelProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"accesslevel"; } @end -@implementation GDataSelectedProperty +@implementation GDataSelectedProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"selected"; } @end -@implementation GDataOverrideNameProperty +@implementation GDataOverrideNameProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"overridename"; } @@ -79,7 +79,7 @@ + (NSDictionary *)calendarNamespaces { [GDataEntryBase baseGDataNamespaces]]; [namespaces setObject:kGDataNamespaceGCal forKey:kGDataNamespaceGCalPrefix]; - + return namespaces; } @@ -101,12 +101,12 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - - + + // Calendar extensions [self addExtensionDeclarationForParentClass:entryClass childClasses: @@ -238,7 +238,7 @@ - (void)setWhens:(NSArray *)array { } - (void)addWhen:(GDataWhen *)obj { - [self addObject:obj forExtensionClass:[obj class]]; + [self addObject:obj forExtensionClass:[obj class]]; } - (NSArray *)locations { @@ -250,7 +250,7 @@ - (void)setLocations:(NSArray *)array { } - (void)addLocation:(GDataWhere *)obj { - [self addObject:obj forExtensionClass:[obj class]]; + [self addObject:obj forExtensionClass:[obj class]]; } @end diff --git a/Source/Clients/Calendar/GDataEntryCalendarEvent.h b/Source/Clients/Calendar/GDataEntryCalendarEvent.h index ef95ea39..9b2b4db9 100644 --- a/Source/Clients/Calendar/GDataEntryCalendarEvent.h +++ b/Source/Clients/Calendar/GDataEntryCalendarEvent.h @@ -27,7 +27,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATACALENDAREVENT_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -60,7 +60,7 @@ _EXTERN NSString* const kGDataCategoryCalendarSettings _INITIALIZE_AS(@"http://s @class GDataWebContent; @interface GDataLink (GDataCalendarEntryEventExtensions) - (NSArray *)webContents; -- (void)setWebContents:(NSArray *)arr; +- (void)setWebContents:(NSArray *)arr; - (void)addWebContent:(GDataWebContent *)obj; @end @@ -85,7 +85,7 @@ _EXTERN NSString* const kGDataCategoryCalendarSettings _INITIALIZE_AS(@"http://s // for sync events, the iCal UID and sequence number need to be honored - (BOOL)isSyncEvent; -- (void)setIsSyncEvent:(BOOL)flag; +- (void)setIsSyncEvent:(BOOL)flag; - (NSString *)iCalUID; - (void)setICalUID:(NSString *)str; diff --git a/Source/Clients/Calendar/GDataEntryCalendarEvent.m b/Source/Clients/Calendar/GDataEntryCalendarEvent.m index f64dc888..82eca7df 100644 --- a/Source/Clients/Calendar/GDataEntryCalendarEvent.m +++ b/Source/Clients/Calendar/GDataEntryCalendarEvent.m @@ -42,7 +42,7 @@ + (NSString *)extensionElementLocalName { return @"additionalGuests"; } @interface GDataSendEventNotifications : GDataBoolValueConstruct @end -@implementation GDataSendEventNotifications +@implementation GDataSendEventNotifications + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"sendEventNotifications"; } @@ -51,7 +51,7 @@ + (NSString *)extensionElementLocalName { return @"sendEventNotifications"; } @interface GDataPrivateCopyProperty : GDataBoolValueConstruct @end -@implementation GDataPrivateCopyProperty +@implementation GDataPrivateCopyProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"privateCopy"; } @@ -77,7 +77,7 @@ @interface GDataSyncEventProperty : GDataBoolValueConstruct // insert and update @end -@implementation GDataSyncEventProperty +@implementation GDataSyncEventProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"syncEvent"; } @@ -90,7 +90,7 @@ @interface GDataSequenceProperty : GDataValueConstruct // Currently this is only a read-only entry. @end -@implementation GDataSequenceProperty +@implementation GDataSequenceProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"sequence"; } @@ -103,7 +103,7 @@ @interface GDataICalUIDProperty : GDataValueConstruct // Currently a read-only entry. @end -@implementation GDataICalUIDProperty +@implementation GDataICalUIDProperty + (NSString *)extensionElementURI { return kGDataNamespaceGCal; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"uid"; } @@ -201,17 +201,17 @@ - (void)addWebContent:(GDataWebContent *)obj { @implementation GDataEntryCalendarEvent + (NSDictionary *)calendarEventNamespaces { - + NSMutableDictionary *namespaces = [NSMutableDictionary dictionaryWithDictionary: [GDataEntryBase baseGDataNamespaces]]; - + [namespaces setObject:kGDataNamespaceGCal forKey:kGDataNamespaceGCalPrefix]; return namespaces; } + (GDataEntryCalendarEvent *)calendarEvent { GDataEntryCalendarEvent *entry = [self object]; - + [entry setNamespaces:[GDataEntryCalendar calendarNamespaces]]; return entry; } @@ -248,7 +248,7 @@ - (void)addExtensionDeclarations { [GDataAnyoneCanAddSelfProperty class], [GDataSuppressReplyNotificationsProperty class], nil]; - + [self addExtensionDeclarationForParentClass:[GDataWho class] childClasses: [GDataResourceProperty class], @@ -260,7 +260,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"sendEventNotifications", @"shouldSendEventNotifications", kGDataDescBooleanPresent }, { @"privateCopy", @"isPrivateCopy", kGDataDescBooleanPresent }, @@ -276,7 +276,7 @@ - (NSMutableArray *)itemsForDescription { { @"suppressReplyTypes", @"suppressReplyNotificationTypes", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -297,7 +297,7 @@ - (BOOL)shouldSendEventNotifications { // it is ambiguous whether this defaults to TRUE or FALSE, so just always // create the extension, to be sure. - (void)setShouldSendEventNotifications:(BOOL)flag { - GDataBoolValueConstruct *obj = [GDataSendEventNotifications boolValueWithBool:flag]; + GDataBoolValueConstruct *obj = [GDataSendEventNotifications boolValueWithBool:flag]; [self setObject:obj forExtensionClass:[GDataSendEventNotifications class]]; } @@ -372,7 +372,7 @@ - (void)setICalUID:(NSString *)str { if ([str length] > 0) { obj = [GDataICalUIDProperty valueWithString:str]; } else { - obj = nil; + obj = nil; } [self setObject:obj forExtensionClass:[GDataICalUIDProperty class]]; } @@ -459,7 +459,7 @@ - (void)setSequenceNumber:(NSNumber *)num { if (num != nil) { obj = [GDataSequenceProperty valueWithNumber:num]; } else { - obj = nil; + obj = nil; } [self setObject:obj forExtensionClass:[GDataSequenceProperty class]]; } diff --git a/Source/Clients/Calendar/GDataEntryEvent.h b/Source/Clients/Calendar/GDataEntryEvent.h index b8738a97..2b160085 100644 --- a/Source/Clients/Calendar/GDataEntryEvent.h +++ b/Source/Clients/Calendar/GDataEntryEvent.h @@ -25,7 +25,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAENTRYEVENT_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -99,7 +99,7 @@ _EXTERN NSString* const kGDataEventVisibilityConfidential _INITIALIZE_AS(@"http: } // a side-effect of calling setRecurrence is to switch reminder elements -// between recurrence (in the event) and non-recurrence (in the first +// between recurrence (in the event) and non-recurrence (in the first // event time) - (GDataRecurrence *)recurrence; - (void)setRecurrence:(GDataRecurrence *)obj; diff --git a/Source/Clients/Calendar/GDataEntryEvent.m b/Source/Clients/Calendar/GDataEntryEvent.m index 81e310e7..f31d6131 100644 --- a/Source/Clients/Calendar/GDataEntryEvent.m +++ b/Source/Clients/Calendar/GDataEntryEvent.m @@ -72,11 +72,11 @@ - (void)addReminder:(GDataReminder *)obj { @implementation GDataEntryEvent - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + // EventEntry extensions [self addExtensionDeclarationForParentClass:entryClass childClasses: @@ -85,12 +85,12 @@ - (void)addExtensionDeclarations { [GDataEventStatus class], [GDataVisibility class], [GDataTransparency class], [GDataWho class], [GDataWhen class], [GDataOriginalEvent class], - [GDataComment class], nil]; - + [GDataComment class], nil]; + // a reminder may be at the event entry level (declared above) for // recurrence events, or inside a GDataWhen for single events [self addExtensionDeclarationForParentClass:[GDataWhen class] - childClass:[GDataReminder class]]; + childClass:[GDataReminder class]]; } - (NSString *)suffixAfterPoundSign:(NSString *)str { @@ -105,7 +105,7 @@ - (NSString *)suffixAfterPoundSign:(NSString *)str { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSString *visibility = [self suffixAfterPoundSign:[[self visibility] stringValue]]; NSString *transparency = [self suffixAfterPoundSign:[[self transparency] stringValue]]; NSString *eventStatus = [self suffixAfterPoundSign:[[self eventStatus] stringValue]]; @@ -133,7 +133,7 @@ - (NSMutableArray *)itemsForDescription { { @"comment", @"comment", kGDataDescLabelIfNonNil }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -173,7 +173,7 @@ - (GDataRecurrence *)recurrence { - (void)setRecurrence:(GDataRecurrence *)obj { BOOL hadRecurrence = ([self recurrence] != nil); BOOL willHaveRecurrence = (obj != nil); - + if (hadRecurrence && !willHaveRecurrence) { [self setNonRecurrenceReminders:[self recurrenceReminders]]; [self setRecurrenceReminders:nil]; @@ -181,7 +181,7 @@ - (void)setRecurrence:(GDataRecurrence *)obj { [self setRecurrenceReminders:[self nonRecurrenceReminders]]; [self setNonRecurrenceReminders:nil]; } - + [self setObject:obj forExtensionClass:[GDataRecurrence class]]; } @@ -248,7 +248,7 @@ - (void)addNonRecurrenceReminder:(GDataReminder *)obj { if ([whens count] > 0) { GDataWhen *when = [whens objectAtIndex:0]; [when addReminder:obj]; - } + } } - (NSArray *)reminders { diff --git a/Source/Clients/Calendar/GDataEntryMessage.h b/Source/Clients/Calendar/GDataEntryMessage.h index cc6b964f..81e38728 100644 --- a/Source/Clients/Calendar/GDataEntryMessage.h +++ b/Source/Clients/Calendar/GDataEntryMessage.h @@ -29,7 +29,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAENTRYMESSAGE_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN diff --git a/Source/Clients/Calendar/GDataEntryMessage.m b/Source/Clients/Calendar/GDataEntryMessage.m index 75283d71..fc46bd3a 100644 --- a/Source/Clients/Calendar/GDataEntryMessage.m +++ b/Source/Clients/Calendar/GDataEntryMessage.m @@ -26,7 +26,7 @@ @implementation GDataEntryMessage + (GDataEntryMessage *)message { GDataEntryMessage *entry = [self object]; - + [entry setNamespaces:[GDataEntryBase baseGDataNamespaces]]; return entry; @@ -43,11 +43,11 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + // EntryMessage extensions [self addExtensionDeclarationForParentClass:entryClass childClasses: @@ -55,7 +55,7 @@ - (void)addExtensionDeclarations { [GDataRating class], [GDataGeoPt class], [GDataWho class], - nil]; + nil]; } #if !GDATA_SIMPLE_DESCRIPTIONS @@ -82,7 +82,7 @@ - (GDataRating *)rating { } - (void)setRating:(GDataRating *)obj { - [self setObject:obj forExtensionClass:[GDataRating class]]; + [self setObject:obj forExtensionClass:[GDataRating class]]; } - (GDataWhen *)time { @@ -90,7 +90,7 @@ - (GDataWhen *)time { } - (void)setTime:(GDataWhen *)obj { - [self setObject:obj forExtensionClass:[GDataWhen class]]; + [self setObject:obj forExtensionClass:[GDataWhen class]]; } - (GDataGeoPt *)geoPt { @@ -98,7 +98,7 @@ - (GDataGeoPt *)geoPt { } - (void)setGeoPt:(GDataGeoPt *)obj { - [self setObject:obj forExtensionClass:[GDataGeoPt class]]; + [self setObject:obj forExtensionClass:[GDataGeoPt class]]; } - (NSArray *)participants { @@ -106,11 +106,11 @@ - (NSArray *)participants { } - (void)setParticipants:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataWho class]]; + [self setObjects:array forExtensionClass:[GDataWho class]]; } - (void)addParticipant:(GDataWho *)obj { - [self addObject:obj forExtensionClass:[GDataWho class]]; + [self addObject:obj forExtensionClass:[GDataWho class]]; } @end diff --git a/Source/Clients/Calendar/GDataFeedEvent.m b/Source/Clients/Calendar/GDataFeedEvent.m index d953a1b5..db2d36fa 100644 --- a/Source/Clients/Calendar/GDataFeedEvent.m +++ b/Source/Clients/Calendar/GDataFeedEvent.m @@ -32,12 +32,12 @@ + (GDataFeedEvent *)eventFeedWithXMLData:(NSData *)data { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class feedClass = [self class]; [self addExtensionDeclarationForParentClass:feedClass - childClass:[GDataWhere class]]; + childClass:[GDataWhere class]]; } - (Class)classForEntries { diff --git a/Source/Clients/Calendar/GDataOriginalEvent.m b/Source/Clients/Calendar/GDataOriginalEvent.m index 1c80d2e7..037ec358 100644 --- a/Source/Clients/Calendar/GDataOriginalEvent.m +++ b/Source/Clients/Calendar/GDataOriginalEvent.m @@ -41,7 +41,7 @@ + (NSString *)extensionElementLocalName { return @"originalEvent"; } + (GDataOriginalEvent *)originalEventWithID:(NSString *)originalID href:(NSString *)feedHref originalStartTime:(GDataWhen *)startTime { - + GDataOriginalEvent *obj = [self object]; [obj setHref:feedHref]; [obj setOriginalID:originalID]; @@ -50,27 +50,27 @@ + (GDataOriginalEvent *)originalEventWithID:(NSString *)originalID } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + [self addExtensionDeclarationForParentClass:[self class] childClass:[GDataWhen class]]; } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObjects: + NSArray *attrs = [NSArray arrayWithObjects: kIDAttr, kHrefAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [super itemsForDescription]; - - // add extensions + + // add extensions [self addToArray:items objectDescriptionIfNonNil:[self originalStartTime] withName:@"startTime"]; - + return items; } #endif diff --git a/Source/Clients/Calendar/GDataQueryCalendar.m b/Source/Clients/Calendar/GDataQueryCalendar.m index da8c3a70..2b13c473 100644 --- a/Source/Clients/Calendar/GDataQueryCalendar.m +++ b/Source/Clients/Calendar/GDataQueryCalendar.m @@ -38,7 +38,7 @@ @implementation GDataQueryCalendar + (GDataQueryCalendar *)calendarQueryWithFeedURL:(NSURL *)feedURL { - return [self queryWithFeedURL:feedURL]; + return [self queryWithFeedURL:feedURL]; } - (GDataDateTime *)minimumStartTime { @@ -139,10 +139,10 @@ - (NSString *)currentTimeZoneName { } - (void)setCurrentTimeZoneName:(NSString *)str { - + // replace underscores with spaces in the param value NSMutableString *mutableStr = [NSMutableString stringWithString:str]; - + [mutableStr replaceOccurrencesOfString:@" " withString:@"_" options:0 diff --git a/Source/Clients/Calendar/GDataRecurrence.m b/Source/Clients/Calendar/GDataRecurrence.m index d3ef4e62..ed7c58d8 100644 --- a/Source/Clients/Calendar/GDataRecurrence.m +++ b/Source/Clients/Calendar/GDataRecurrence.m @@ -46,12 +46,12 @@ + (GDataRecurrence *)recurrenceWithString:(NSString *)str { } - (void)addParseDeclarations { - + [self addContentValueDeclaration]; } - (NSString *)stringValue { - return [self contentStringValue]; + return [self contentStringValue]; } - (void)setStringValue:(NSString *)str { diff --git a/Source/Clients/Calendar/GDataRecurrenceException.h b/Source/Clients/Calendar/GDataRecurrenceException.h index e7dfca7d..8ceaa446 100644 --- a/Source/Clients/Calendar/GDataRecurrenceException.h +++ b/Source/Clients/Calendar/GDataRecurrenceException.h @@ -21,7 +21,7 @@ #import "GDataObject.h" -// a gd:recurrenceException link, possibly containing an entryLink or +// a gd:recurrenceException link, possibly containing an entryLink or // an originalEvent // // @@ -43,7 +43,7 @@ } + (GDataRecurrenceException *)recurrenceExceptionWithEntryLink:(GDataEntryLink *)entryLink originalEvent:(GDataOriginalEvent *)originalEvent - isSpecialized:(BOOL)isSpecialized; + isSpecialized:(BOOL)isSpecialized; - (id)initWithXMLElement:(NSXMLElement *)element parent:(GDataObject *)parent; - (NSXMLElement *)XMLElement; diff --git a/Source/Clients/Calendar/GDataRecurrenceException.m b/Source/Clients/Calendar/GDataRecurrenceException.m index 852124a6..c6cf4fdb 100644 --- a/Source/Clients/Calendar/GDataRecurrenceException.m +++ b/Source/Clients/Calendar/GDataRecurrenceException.m @@ -25,7 +25,7 @@ #import "GDataEntryLink.h" @implementation GDataRecurrenceException -// a gd:recurrenceException link, possibly containing an entryLink or +// a gd:recurrenceException link, possibly containing an entryLink or // an originalEvent // // @@ -83,7 +83,7 @@ - (id)copyWithZone:(NSZone *)zone { - (BOOL)isEqual:(GDataRecurrenceException *)other { if (self == other) return YES; if (![other isKindOfClass:[GDataRecurrenceException class]]) return NO; - + return [super isEqual:other] && AreBoolsEqual([self isSpecialized], [other isSpecialized]) && AreEqualOrBothNil([self entryLink], [other entryLink]) @@ -93,13 +93,13 @@ - (BOOL)isEqual:(GDataRecurrenceException *)other { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [NSMutableArray array]; - + if ([self isSpecialized]) { [self addToArray:items objectDescriptionIfNonNil:@"true" withName:@"specialized"]; } [self addToArray:items objectDescriptionIfNonNil:entryLink_ withName:@"entryLink"]; [self addToArray:items objectDescriptionIfNonNil:originalEvent_ withName:@"originalEvent"]; - + return items; } #endif @@ -107,32 +107,32 @@ - (NSMutableArray *)itemsForDescription { - (NSXMLElement *)XMLElement { NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:@"gd:recurrenceException"]; - + if ([self isSpecialized]) { [self addToElement:element attributeValueIfNonNil:@"true" withName:@"specialized"]; - } - + } + if ([self entryLink]) { [element addChild:[[self entryLink] XMLElement]]; } - + if ([self originalEvent]) { [element addChild:[[self originalEvent] XMLElement]]; } - + return element; } - (BOOL)isSpecialized { - return isSpecialized_; + return isSpecialized_; } - (void)setIsSpecialized:(BOOL)isSpecialized { - isSpecialized_ = isSpecialized; + isSpecialized_ = isSpecialized; } - (GDataEntryLink *)entryLink { - return entryLink_; + return entryLink_; } - (void)setEntryLink:(GDataEntryLink *)entryLink { @@ -141,11 +141,11 @@ - (void)setEntryLink:(GDataEntryLink *)entryLink { } - (GDataOriginalEvent *)originalEvent { - return originalEvent_; + return originalEvent_; } - (void)setOriginalEvent:(GDataOriginalEvent *)originalEvent { - [originalEvent_ autorelease]; + [originalEvent_ autorelease]; originalEvent_ = [originalEvent retain]; } diff --git a/Source/Clients/Calendar/GDataReminder.h b/Source/Clients/Calendar/GDataReminder.h index 1adf4b57..48d212dd 100644 --- a/Source/Clients/Calendar/GDataReminder.h +++ b/Source/Clients/Calendar/GDataReminder.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAREMINDER_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -40,7 +40,7 @@ _EXTERN NSString* const kGDataReminderMethodAlert _INITIALIZE_AS(@"alert"); _EXTERN NSString* const kGDataReminderMethodNone _INITIALIZE_AS(@"none"); _EXTERN NSString* const kGDataReminderMethodAll _INITIALIZE_AS(@"all"); -// reminder, as in +// reminder, as in // // // http://code.google.com/apis/gdata/common-elements.html#gdReminder diff --git a/Source/Clients/Calendar/GDataReminder.m b/Source/Clients/Calendar/GDataReminder.m index 7c06922d..107148fd 100644 --- a/Source/Clients/Calendar/GDataReminder.m +++ b/Source/Clients/Calendar/GDataReminder.m @@ -31,7 +31,7 @@ @implementation GDataReminder -// reminder, as in +// reminder, as in // // // http://code.google.com/apis/gdata/common-elements.html#gdReminder @@ -45,10 +45,10 @@ + (GDataReminder *)reminder { } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObjects: - kDaysAttr, kHoursAttr, kMinutesAttr, + NSArray *attrs = [NSArray arrayWithObjects: + kDaysAttr, kHoursAttr, kMinutesAttr, kAbsoluteTimeAttr, kMethodAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } diff --git a/Source/Clients/Calendar/GDataServiceGoogleCalendar.h b/Source/Clients/Calendar/GDataServiceGoogleCalendar.h index 4c129d75..ad757dcc 100644 --- a/Source/Clients/Calendar/GDataServiceGoogleCalendar.h +++ b/Source/Clients/Calendar/GDataServiceGoogleCalendar.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATASERVICEGOOGLECALENDAR_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -44,10 +44,10 @@ _EXTERN NSString* const kGDataGoogleCalendarDefaultAllCalendarsFeed _INITIALIZE_ _EXTERN NSString* const kGDataGoogleCalendarDefaultPrivateFullFeed _INITIALIZE_AS(@"https://www.google.com/calendar/feeds/default/private/full"); -// QuickAdd: +// QuickAdd: // // Google Calendar can parse natural language text to create a -// Calendar entry. Create the entry by setting the content, +// Calendar entry. Create the entry by setting the content, // then insert it into the calendar: // // GDataEntryCalendarEvent *newEvent = [GDataEntryCalendarEvent calendarEvent]; diff --git a/Source/Clients/Calendar/GDataServiceGoogleCalendar.m b/Source/Clients/Calendar/GDataServiceGoogleCalendar.m index a612decb..063c706a 100644 --- a/Source/Clients/Calendar/GDataServiceGoogleCalendar.m +++ b/Source/Clients/Calendar/GDataServiceGoogleCalendar.m @@ -102,13 +102,13 @@ + (NSString *)serviceID { } + (NSString *)serviceRootURLString { - return @"https://www.google.com/calendar/feeds/"; + return @"https://www.google.com/calendar/feeds/"; } + (NSString *)authorizationScope { // avoid Calendar's "Unknown authorization header" error by specifying a // non-https scope - return @"http://www.google.com/calendar/feeds/"; + return @"http://www.google.com/calendar/feeds/"; } + (NSString *)defaultServiceVersion { diff --git a/Source/Clients/Calendar/GDataWebContent.h b/Source/Clients/Calendar/GDataWebContent.h index a5768182..809fc8c6 100644 --- a/Source/Clients/Calendar/GDataWebContent.h +++ b/Source/Clients/Calendar/GDataWebContent.h @@ -25,7 +25,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAWEBCONTENT_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -37,7 +37,7 @@ _EXTERN NSString* const kGDataLinkRelWebContent _INITIALIZE_AS(@"http://schemas. // Calendar Web Content element, inside a , as in // -// // // @@ -75,7 +75,7 @@ _EXTERN NSString* const kGDataLinkRelWebContent _INITIALIZE_AS(@"http://schemas. // returning a dictionary of prefs simplifies key-value coding access - (NSDictionary *)gadgetPreferenceDictionary; - + @end #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE diff --git a/Source/Clients/Calendar/GDataWebContent.m b/Source/Clients/Calendar/GDataWebContent.m index 6d640588..1820379a 100644 --- a/Source/Clients/Calendar/GDataWebContent.m +++ b/Source/Clients/Calendar/GDataWebContent.m @@ -34,10 +34,10 @@ + (NSString *)extensionElementPrefix { return kGDataNamespaceGCalPrefix; } + (NSString *)extensionElementLocalName { return @"webContentGadgetPref"; } @end -@implementation GDataWebContent +@implementation GDataWebContent // Calendar Web Content element, inside a , as in // -// // // @@ -60,49 +60,49 @@ + (GDataWebContent *)webContentWithURL:(NSString *)urlString } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // gadget preference support [self addExtensionDeclarationForParentClass:[self class] childClass:[GDataWebContentGadgetPref class]]; } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObjects: + NSArray *attrs = [NSArray arrayWithObjects: kHeightAttr, kWidthAttr, kURLAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [super itemsForDescription]; - + // make an array of name=value items for gadget prefs NSArray *prefs = [self gadgetPreferences]; NSMutableArray *prefsItems = [NSMutableArray array]; NSUInteger numPrefs = [prefs count]; - + if (numPrefs) { for (NSUInteger idx = 0; idx < numPrefs; idx++) { GDataWebContentGadgetPref *pref = [prefs objectAtIndex:idx]; - - NSString *str = [NSString stringWithFormat:@"%@=%@", + + NSString *str = [NSString stringWithFormat:@"%@=%@", [pref name], [pref value]]; - + [prefsItems addObject:str]; } NSString *allPrefs = [prefsItems componentsJoinedByString:@","]; [self addToArray:items objectDescriptionIfNonNil:allPrefs withName:@"gadgetPrefs"]; } - + return items; } #endif - (NSNumber *)height { - return [self intNumberForAttribute:kHeightAttr]; + return [self intNumberForAttribute:kHeightAttr]; } - (void)setHeight:(NSNumber *)num { @@ -110,7 +110,7 @@ - (void)setHeight:(NSNumber *)num { } - (NSNumber *)width { - return [self intNumberForAttribute:kWidthAttr]; + return [self intNumberForAttribute:kWidthAttr]; } - (void)setWidth:(NSNumber *)num { @@ -118,7 +118,7 @@ - (void)setWidth:(NSNumber *)num { } - (NSString *)URLString { - return [self stringValueForAttribute:kURLAttr]; + return [self stringValueForAttribute:kURLAttr]; } - (void)setURLString:(NSString *)str { @@ -136,7 +136,7 @@ - (void)setDisplay:(NSString *)str { // extensions - (NSArray *)gadgetPreferences { - return [self objectsForExtensionClass:[GDataWebContentGadgetPref class]]; + return [self objectsForExtensionClass:[GDataWebContentGadgetPref class]]; } - (void)setGadgetPreferences:(NSArray *)array { @@ -144,15 +144,15 @@ - (void)setGadgetPreferences:(NSArray *)array { } - (void)addGadgetPreference:(GDataWebContentGadgetPref *)obj { - [self addObject:obj forExtensionClass:[GDataWebContentGadgetPref class]]; + [self addObject:obj forExtensionClass:[GDataWebContentGadgetPref class]]; } // returning a dictionary simplifies key-value coding access - (NSDictionary *)gadgetPreferenceDictionary { - + // step through all preferences and add their name/values to a dictionary NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - + for (GDataWebContentGadgetPref *pref in [self gadgetPreferences]) { [dictionary setObject:[pref value] forKey:[pref name]]; } diff --git a/Source/Clients/Contacts/GDataContactElements.h b/Source/Clients/Contacts/GDataContactElements.h index b7f43e8c..ddaca52a 100644 --- a/Source/Clients/Contacts/GDataContactElements.h +++ b/Source/Clients/Contacts/GDataContactElements.h @@ -33,7 +33,7 @@ #define _INITIALIZE_AS(x) #endif -// gender +// gender _EXTERN NSString* kGDataContactGenderFemale _INITIALIZE_AS(@"female"); _EXTERN NSString* kGDataContactGenderMale _INITIALIZE_AS(@"male"); @@ -60,7 +60,7 @@ _EXTERN NSString* kGDataContactWebsiteLinkWork _INITIALIZE_AS(@"work"); @end // related calendar link -@interface GDataContactCalendarLink : GDataContactLink +@interface GDataContactCalendarLink : GDataContactLink @end // directory server, like directory.domain.com @@ -104,7 +104,7 @@ _EXTERN NSString* kGDataContactWebsiteLinkWork _INITIALIZE_AS(@"work"); @end // related website link -@interface GDataContactWebsiteLink : GDataContactLink +@interface GDataContactWebsiteLink : GDataContactLink @end #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE diff --git a/Source/Clients/Contacts/GDataContactEvent.h b/Source/Clients/Contacts/GDataContactEvent.h index d258a591..5c435e75 100644 --- a/Source/Clients/Contacts/GDataContactEvent.h +++ b/Source/Clients/Contacts/GDataContactEvent.h @@ -40,7 +40,7 @@ _EXTERN NSString* kGDataContactEventOther _INITIALIZE_AS(@"other"); + (id)eventWithRel:(NSString *)rel label:(NSString *)label when:(GDataWhen *)when; - + - (NSString *)label; - (void)setLabel:(NSString *)str; diff --git a/Source/Clients/Contacts/GDataContactJot.m b/Source/Clients/Contacts/GDataContactJot.m index 1f13b882..061079b4 100644 --- a/Source/Clients/Contacts/GDataContactJot.m +++ b/Source/Clients/Contacts/GDataContactJot.m @@ -34,7 +34,7 @@ + (NSString *)extensionElementLocalName { return @"jot"; } + (id)jotWithRel:(NSString *)rel value:(NSString *)value { - + GDataContactJot *obj = [self object]; [obj setRel:rel]; [obj setStringValue:value]; @@ -42,16 +42,16 @@ + (id)jotWithRel:(NSString *)rel } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObject:kRelAttr]; + NSArray *attrs = [NSArray arrayWithObject:kRelAttr]; [self addLocalAttributeDeclarations:attrs]; - + [self addContentValueDeclaration]; } #pragma mark - - (NSString *)rel { - return [self stringValueForAttribute:kRelAttr]; + return [self stringValueForAttribute:kRelAttr]; } - (void)setRel:(NSString *)str { @@ -59,7 +59,7 @@ - (void)setRel:(NSString *)str { } - (NSString *)stringValue { - return [self contentStringValue]; + return [self contentStringValue]; } - (void)setStringValue:(NSString *)str { diff --git a/Source/Clients/Contacts/GDataContactLanguage.m b/Source/Clients/Contacts/GDataContactLanguage.m index 434a9acc..d44501c3 100644 --- a/Source/Clients/Contacts/GDataContactLanguage.m +++ b/Source/Clients/Contacts/GDataContactLanguage.m @@ -34,7 +34,7 @@ + (NSString *)extensionElementLocalName { return @"language"; } + (id)languageWithCode:(NSString *)code label:(NSString *)label { - + GDataContactLanguage *obj = [self object]; [obj setLabel:label]; [obj setCode:code]; @@ -43,7 +43,7 @@ + (id)languageWithCode:(NSString *)code - (void)addParseDeclarations { NSArray *attrs = [NSArray arrayWithObjects:kLabelAttr, kCodeAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } diff --git a/Source/Clients/Contacts/GDataContactLink.h b/Source/Clients/Contacts/GDataContactLink.h index 209e156f..6b0b95cb 100644 --- a/Source/Clients/Contacts/GDataContactLink.h +++ b/Source/Clients/Contacts/GDataContactLink.h @@ -22,7 +22,7 @@ #import "GDataObject.h" @interface GDataContactLink : GDataObject - + + (id)linkWithRel:(NSString *)rel label:(NSString *)label href:(NSString *)href; diff --git a/Source/Clients/Contacts/GDataContactLink.m b/Source/Clients/Contacts/GDataContactLink.m index 0d496e81..9cdee217 100644 --- a/Source/Clients/Contacts/GDataContactLink.m +++ b/Source/Clients/Contacts/GDataContactLink.m @@ -33,7 +33,7 @@ @implementation GDataContactLink + (id)linkWithRel:(NSString *)rel label:(NSString *)label href:(NSString *)href { - + GDataContactLink *obj = [self object]; [obj setRel:rel]; [obj setLabel:label]; @@ -42,9 +42,9 @@ + (id)linkWithRel:(NSString *)rel } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObjects: + NSArray *attrs = [NSArray arrayWithObjects: kHrefAttr, kLabelAttr, kRelAttr, kPrimaryAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } @@ -55,7 +55,7 @@ - (NSArray *)attributesIgnoredForEquality { #pragma mark - - (NSString *)label { - return [self stringValueForAttribute:kLabelAttr]; + return [self stringValueForAttribute:kLabelAttr]; } - (void)setLabel:(NSString *)str { @@ -63,7 +63,7 @@ - (void)setLabel:(NSString *)str { } - (NSString *)rel { - return [self stringValueForAttribute:kRelAttr]; + return [self stringValueForAttribute:kRelAttr]; } - (void)setRel:(NSString *)str { @@ -71,7 +71,7 @@ - (void)setRel:(NSString *)str { } - (NSString *)href { - return [self stringValueForAttribute:kHrefAttr]; + return [self stringValueForAttribute:kHrefAttr]; } - (void)setHref:(NSString *)str { @@ -79,7 +79,7 @@ - (void)setHref:(NSString *)str { } - (BOOL)isPrimary { - return [self boolValueForAttribute:kPrimaryAttr defaultValue:NO]; + return [self boolValueForAttribute:kPrimaryAttr defaultValue:NO]; } - (void)setIsPrimary:(BOOL)flag { diff --git a/Source/Clients/Contacts/GDataContactPriority.m b/Source/Clients/Contacts/GDataContactPriority.m index 8168a981..bde28c12 100644 --- a/Source/Clients/Contacts/GDataContactPriority.m +++ b/Source/Clients/Contacts/GDataContactPriority.m @@ -40,14 +40,14 @@ + (id)priorityWithRel:(NSString *)rel { } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObject:kRelAttr]; + NSArray *attrs = [NSArray arrayWithObject:kRelAttr]; [self addLocalAttributeDeclarations:attrs]; } #pragma mark - - (NSString *)rel { - return [self stringValueForAttribute:kRelAttr]; + return [self stringValueForAttribute:kRelAttr]; } - (void)setRel:(NSString *)str { diff --git a/Source/Clients/Contacts/GDataContactRelation.m b/Source/Clients/Contacts/GDataContactRelation.m index aa90fa73..9669ac6a 100644 --- a/Source/Clients/Contacts/GDataContactRelation.m +++ b/Source/Clients/Contacts/GDataContactRelation.m @@ -36,7 +36,7 @@ + (NSString *)extensionElementLocalName { return @"relation"; } + (id)relationWithRel:(NSString *)rel label:(NSString *)label value:(NSString *)value { - + GDataContactRelation *obj = [self object]; [obj setRel:rel]; [obj setLabel:label]; @@ -46,16 +46,16 @@ + (id)relationWithRel:(NSString *)rel - (void)addParseDeclarations { NSArray *attrs = [NSArray arrayWithObjects: - kRelAttr, kLabelAttr, nil]; + kRelAttr, kLabelAttr, nil]; [self addLocalAttributeDeclarations:attrs]; - + [self addContentValueDeclaration]; } #pragma mark - - (NSString *)rel { - return [self stringValueForAttribute:kRelAttr]; + return [self stringValueForAttribute:kRelAttr]; } - (void)setRel:(NSString *)str { @@ -63,7 +63,7 @@ - (void)setRel:(NSString *)str { } - (NSString *)label { - return [self stringValueForAttribute:kLabelAttr]; + return [self stringValueForAttribute:kLabelAttr]; } - (void)setLabel:(NSString *)str { @@ -71,7 +71,7 @@ - (void)setLabel:(NSString *)str { } - (NSString *)stringValue { - return [self contentStringValue]; + return [self contentStringValue]; } - (void)setStringValue:(NSString *)str { diff --git a/Source/Clients/Contacts/GDataContactSensitivity.m b/Source/Clients/Contacts/GDataContactSensitivity.m index 8754628d..d2daf029 100644 --- a/Source/Clients/Contacts/GDataContactSensitivity.m +++ b/Source/Clients/Contacts/GDataContactSensitivity.m @@ -40,14 +40,14 @@ + (id)sensitivityWithRel:(NSString *)rel { } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObject:kRelAttr]; + NSArray *attrs = [NSArray arrayWithObject:kRelAttr]; [self addLocalAttributeDeclarations:attrs]; } #pragma mark - - (NSString *)rel { - return [self stringValueForAttribute:kRelAttr]; + return [self stringValueForAttribute:kRelAttr]; } - (void)setRel:(NSString *)str { diff --git a/Source/Clients/Contacts/GDataContacts.h b/Source/Clients/Contacts/GDataContacts.h index a695089a..b6454151 100644 --- a/Source/Clients/Contacts/GDataContacts.h +++ b/Source/Clients/Contacts/GDataContacts.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataContacts.h // diff --git a/Source/Clients/Contacts/GDataEntryContact.m b/Source/Clients/Contacts/GDataEntryContact.m index 1774477b..79450c5c 100644 --- a/Source/Clients/Contacts/GDataEntryContact.m +++ b/Source/Clients/Contacts/GDataEntryContact.m @@ -25,7 +25,7 @@ // phonetic name @interface GDataContactYomiName : GDataValueElementConstruct @end - + @implementation GDataContactYomiName + (NSString *)extensionElementURI { return kGDataNamespaceContact; } + (NSString *)extensionElementPrefix { return kGDataNamespaceContactPrefix; } @@ -69,7 +69,7 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; // ContactEntry extensions @@ -89,7 +89,7 @@ - (NSMutableArray *)itemsForDescription { { @"version>=3:yomi", @"yomi", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -116,7 +116,7 @@ - (void)setYomi:(NSString *)str { if ([str length] > 0) { obj = [GDataContactYomiName valueWithString:str]; } - [self setObject:obj forExtensionClass:[GDataContactYomiName class]]; + [self setObject:obj forExtensionClass:[GDataContactYomiName class]]; } @@ -139,7 +139,7 @@ - (void)removeGroupMembershipInfo:(GDataGroupMembershipInfo *)obj { - (GDataGroupMembershipInfo *)groupMembershipInfoWithHref:(NSString *)href { GDataGroupMembershipInfo *groupInfo; - + groupInfo = [GDataUtilities firstObjectFromArray:[self groupMembershipInfos] withValue:href forKeyPath:@"href"]; diff --git a/Source/Clients/Contacts/GDataEntryContactGroup.m b/Source/Clients/Contacts/GDataEntryContactGroup.m index f0556913..f37d0b9f 100644 --- a/Source/Clients/Contacts/GDataEntryContactGroup.m +++ b/Source/Clients/Contacts/GDataEntryContactGroup.m @@ -39,7 +39,7 @@ - (NSString *)identifier { } - (void)setIdentifier:(NSString *)str { - [self setStringValue:str]; + [self setStringValue:str]; } @end @@ -52,9 +52,9 @@ + (NSString *)coreProtocolVersionForServiceVersion:(NSString *)serviceVersion { + (GDataEntryContactGroup *)contactGroupEntryWithTitle:(NSString *)title { GDataEntryContactGroup *obj = [self object]; - + [obj setNamespaces:[GDataContactConstants contactNamespaces]]; - + [obj setTitleWithString:title]; return obj; } @@ -70,29 +70,29 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + // ContactEntry extensions - + [self addExtensionDeclarationForParentClass:entryClass childClasses: [GDataExtendedProperty class], [GDataContactSystemGroup class], - nil]; + nil]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"systemGroup", @"systemGroup.identifier", kGDataDescValueLabeled }, { @"extProps", @"extendedProperties", kGDataDescArrayCount }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; diff --git a/Source/Clients/Contacts/GDataFeedContact.m b/Source/Clients/Contacts/GDataFeedContact.m index 60ca1368..6c8ae5cd 100644 --- a/Source/Clients/Contacts/GDataFeedContact.m +++ b/Source/Clients/Contacts/GDataFeedContact.m @@ -49,12 +49,12 @@ + (GDataFeedContact *)contactFeed { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class feedClass = [self class]; [self addExtensionDeclarationForParentClass:feedClass - childClass:[GDataWhere class]]; + childClass:[GDataWhere class]]; } - (Class)classForEntries { diff --git a/Source/Clients/Contacts/GDataFeedContactGroup.m b/Source/Clients/Contacts/GDataFeedContactGroup.m index 0b067afe..bc65869f 100644 --- a/Source/Clients/Contacts/GDataFeedContactGroup.m +++ b/Source/Clients/Contacts/GDataFeedContactGroup.m @@ -55,7 +55,7 @@ - (Class)classForEntries { - (id)entryForSystemGroupID:(NSString *)str { GDataEntryContactGroup *obj; - + obj = [GDataUtilities firstObjectFromArray:[self entries] withValue:str forKeyPath:@"systemGroup.identifier"]; diff --git a/Source/Clients/Contacts/GDataGroupMembershipInfo.h b/Source/Clients/Contacts/GDataGroupMembershipInfo.h index d005d22c..ccaf6db7 100644 --- a/Source/Clients/Contacts/GDataGroupMembershipInfo.h +++ b/Source/Clients/Contacts/GDataGroupMembershipInfo.h @@ -22,7 +22,7 @@ #import "GDataObject.h" // -// group membership info +// group membership info // // // diff --git a/Source/Clients/Contacts/GDataGroupMembershipInfo.m b/Source/Clients/Contacts/GDataGroupMembershipInfo.m index a65e15b3..ba3f47b1 100644 --- a/Source/Clients/Contacts/GDataGroupMembershipInfo.m +++ b/Source/Clients/Contacts/GDataGroupMembershipInfo.m @@ -19,15 +19,15 @@ #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CONTACTS_SERVICE -#import "GDataGroupMembershipInfo.h" +#import "GDataGroupMembershipInfo.h" #import "GDataContactConstants.h" static NSString* const kHrefAttr = @"href"; static NSString* const kDeletedAttr = @"deleted"; -@implementation GDataGroupMembershipInfo +@implementation GDataGroupMembershipInfo // -// group membership info +// group membership info // // // @@ -38,7 +38,7 @@ + (NSString *)extensionElementPrefix { return kGDataNamespaceContactPrefix; } + (NSString *)extensionElementLocalName { return @"groupMembershipInfo"; } + (GDataGroupMembershipInfo *)groupMembershipInfoWithHref:(NSString *)str { - + GDataGroupMembershipInfo *obj = [self object]; [obj setHref:str]; return obj; @@ -46,14 +46,14 @@ + (GDataGroupMembershipInfo *)groupMembershipInfoWithHref:(NSString *)str { - (void)addParseDeclarations { NSArray *attrs = [NSArray arrayWithObjects:kHrefAttr, kDeletedAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } #pragma mark - - (NSString *)href { - return [self stringValueForAttribute:kHrefAttr]; + return [self stringValueForAttribute:kHrefAttr]; } - (void)setHref:(NSString *)str { @@ -61,7 +61,7 @@ - (void)setHref:(NSString *)str { } - (BOOL)isDeleted { - return [self boolValueForAttribute:kDeletedAttr defaultValue:NO]; + return [self boolValueForAttribute:kDeletedAttr defaultValue:NO]; } - (void)setIsDeleted:(BOOL)flag { diff --git a/Source/Clients/Contacts/GDataQueryContact.h b/Source/Clients/Contacts/GDataQueryContact.h index 5781537d..2e647474 100644 --- a/Source/Clients/Contacts/GDataQueryContact.h +++ b/Source/Clients/Contacts/GDataQueryContact.h @@ -25,7 +25,7 @@ #import "GDataQuery.h" -@interface GDataQueryContact : GDataQuery +@interface GDataQueryContact : GDataQuery + (GDataQueryContact *)contactQueryWithFeedURL:(NSURL *)feedURL; diff --git a/Source/Clients/Contacts/GDataQueryContact.m b/Source/Clients/Contacts/GDataQueryContact.m index bd2bd63e..15add8a7 100644 --- a/Source/Clients/Contacts/GDataQueryContact.m +++ b/Source/Clients/Contacts/GDataQueryContact.m @@ -27,11 +27,11 @@ @implementation GDataQueryContact + (GDataQueryContact *)contactQueryWithFeedURL:(NSURL *)feedURL { - return [self queryWithFeedURL:feedURL]; + return [self queryWithFeedURL:feedURL]; } -+ (GDataQueryContact *)contactQueryForUserID:(NSString *)userID { - ++ (GDataQueryContact *)contactQueryForUserID:(NSString *)userID { + NSURL *url = [GDataServiceGoogleContact contactFeedURLForUserID:userID]; return [self contactQueryWithFeedURL:url]; } @@ -43,7 +43,7 @@ - (NSString *)groupIdentifier { } - (void)setGroupIdentifier:(NSString *)str { - + [self addCustomParameterWithName:kGroupParamName value:str]; } diff --git a/Source/Clients/Docs/GDataDocs.h b/Source/Clients/Docs/GDataDocs.h index c0e3b10c..cd7dda62 100644 --- a/Source/Clients/Docs/GDataDocs.h +++ b/Source/Clients/Docs/GDataDocs.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataDocs.h // diff --git a/Source/Clients/Docs/GDataQueryDocs.h b/Source/Clients/Docs/GDataQueryDocs.h index 7116fef9..810ead97 100644 --- a/Source/Clients/Docs/GDataQueryDocs.h +++ b/Source/Clients/Docs/GDataQueryDocs.h @@ -21,7 +21,7 @@ #import "GDataQuery.h" -// Document-specific query params, per +// Document-specific query params, per // http://code.google.com/apis/document/reference.html#Parameters #undef _EXTERN @@ -41,7 +41,7 @@ _EXTERN NSString* const kGDataQueryDocsTitle _INITIALIZE_AS(@"title"); _EXTERN NSString* const kGDataQueryDocsStarred _INITIALIZE_AS(@"starred"); -@interface GDataQueryDocs : GDataQuery +@interface GDataQueryDocs : GDataQuery + (GDataQueryDocs *)documentQueryWithFeedURL:(NSURL *)feedURL; diff --git a/Source/Clients/Docs/GDataServiceGoogleDocs.h b/Source/Clients/Docs/GDataServiceGoogleDocs.h index 870179d1..9c5a9226 100644 --- a/Source/Clients/Docs/GDataServiceGoogleDocs.h +++ b/Source/Clients/Docs/GDataServiceGoogleDocs.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATASERVICEDOCS_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -50,7 +50,7 @@ _EXTERN NSString* const kGDataGoogleDocsFeedTypeRevisions _INITIALIZE_AS(@" // _EXTERN NSString* const kGDataGoogleDocsDefaultPrivateFullFeed _INITIALIZE_AS(@"http://docs.google.com/feeds/documents/private/full"); // _EXTERN NSString* const kGDataGoogleDocsDefaultACLExpandedFeed _INITIALIZE_AS(@"http://docs.google.com/feeds/documents/private/expandAcl"); -@interface GDataServiceGoogleDocs : GDataServiceGoogle +@interface GDataServiceGoogleDocs : GDataServiceGoogle // // utilities for making feed URLs diff --git a/Source/Clients/Photos/GDataEXIFTags.h b/Source/Clients/Photos/GDataEXIFTags.h index f75cd25e..a84b9136 100644 --- a/Source/Clients/Photos/GDataEXIFTags.h +++ b/Source/Clients/Photos/GDataEXIFTags.h @@ -34,11 +34,11 @@ @end // -// a group of exif tags, like +// a group of exif tags, like // -// +// // 0.0 -// Nokia +// Nokia // // @@ -58,7 +58,7 @@ textValue:(NSString *)value; // tagDictionary returns a dictionary of exif tags, with -// tag names as keys, and tag values as objects. +// tag names as keys, and tag values as objects. // This is to facilitate key-value coding access to the tags. - (NSDictionary *)tagDictionary; diff --git a/Source/Clients/Photos/GDataEXIFTags.m b/Source/Clients/Photos/GDataEXIFTags.m index 86b03d64..c44dd8ed 100644 --- a/Source/Clients/Photos/GDataEXIFTags.m +++ b/Source/Clients/Photos/GDataEXIFTags.m @@ -22,13 +22,13 @@ #import "GDataEXIFTags.h" #import "GDataPhotoConstants.h" -@implementation GDataEXIFTag +@implementation GDataEXIFTag + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosEXIFPrefix; } + (NSString *)extensionElementURI { return kGDataNamespacePhotosEXIF; } -+ (NSString *)extensionElementLocalName { ++ (NSString *)extensionElementLocalName { // wildcard * matches all elements with the proper namespace URI - return @"*"; + return @"*"; } #pragma mark - @@ -51,11 +51,11 @@ - (NSString *)name { @end -@implementation GDataEXIFTags -// for exif:tags, like -// +@implementation GDataEXIFTags +// for exif:tags, like +// // 0.0 -// Nokia +// Nokia // + (NSString *)extensionElementURI { return kGDataNamespacePhotosEXIF; } @@ -68,19 +68,19 @@ + (GDataEXIFTags *)EXIFTags { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // media:group may contain media:content [self addExtensionDeclarationForParentClass:[self class] - childClass:[GDataEXIFTag class]]; + childClass:[GDataEXIFTag class]]; } - (BOOL)isEqual:(GDataEXIFTags *)other { if (self == other) return YES; if (![other isKindOfClass:[GDataEXIFTags class]]) return NO; - + return [super isEqual:other]; } @@ -93,29 +93,29 @@ - (id)copyWithZone:(NSZone *)zone { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [NSMutableArray array]; - + // make an array of "name:value" items for each tag NSArray *tags = [self tags]; NSEnumerator *tagsEnum = [tags objectEnumerator]; NSMutableArray *tagsArray = [NSMutableArray array]; GDataEXIFTag *tag; while ((tag = [tagsEnum nextObject]) != nil) { - NSString *string = [NSString stringWithFormat:@"%@:%@", + NSString *string = [NSString stringWithFormat:@"%@:%@", [tag name], [tag stringValue]]; [tagsArray addObject:string]; } - - + + [self addToArray:items objectDescriptionIfNonNil:[tagsArray componentsJoinedByString:@" "] withName:@"tags"]; - + return items; } #endif - (NSXMLElement *)XMLElement { - + NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:@"exif:tags"]; return element; } @@ -128,7 +128,7 @@ - (NSArray *)tags { } - (void)setTags:(NSArray *)tags { - [self setObjects:tags forExtensionClass:[GDataEXIFTag class]]; + [self setObjects:tags forExtensionClass:[GDataEXIFTag class]]; } - (void)addTag:(GDataEXIFTag *)tag { @@ -156,7 +156,7 @@ - (NSString *)valueForTagName:(NSString *)name { - (void)removeTagWithName:(NSString *)name { GDataEXIFTag *tag = [self tagWithName:name]; if (tag) { - [self removeObject:tag forExtensionClass:[GDataEXIFTag class]]; + [self removeObject:tag forExtensionClass:[GDataEXIFTag class]]; } } @@ -171,17 +171,17 @@ - (void)setTagWithName:(NSString *)name // EXIFTagDictionary returns a dictionary of exif tags, with -// xml element names as keys, and tag values as values. +// xml element names as keys, and tag values as values. // This is to facilitate key-value coding access to the attributes - (NSDictionary *)tagDictionary { - + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; NSArray *tags = [self tags]; // Add in reverse order so the first tag in the array wins in the case of // duplicates. for (NSInteger idx = (NSInteger)[tags count] - 1; idx >= 0; idx--) { - + GDataEXIFTag *tag = [tags objectAtIndex:(NSUInteger)idx]; [dict setObject:[tag stringValue] forKey:[tag name]]; } diff --git a/Source/Clients/Photos/GDataEntryPhoto.h b/Source/Clients/Photos/GDataEntryPhoto.h index b38afe5b..b1943101 100644 --- a/Source/Clients/Photos/GDataEntryPhoto.h +++ b/Source/Clients/Photos/GDataEntryPhoto.h @@ -28,7 +28,7 @@ + (GDataEntryPhoto *)photoEntry; -// uploading photo data +// uploading photo data - (void)setPhotoData:(NSData *)data; // data will retained by the entry - (NSData *)photoData; @@ -39,7 +39,7 @@ // to move a photo to another album, set the photo entry's albumID // to the album's GPhotoID and update the photo entry (with -// fetchPhotoEntryByUpdatingEntry:) +// fetchPhotoEntryByUpdatingEntry:) - (NSString *)albumID; - (void)setAlbumID:(NSString *)str; @@ -68,7 +68,7 @@ - (void)setWidth:(NSNumber *)num; - (NSString *)videoStatus; -- (void)setVideoStatus:(NSString *)str; +- (void)setVideoStatus:(NSString *)str; // setGeoLocation requires an instance of a subclass of GDataGeo, not an // instance of GDataGeo; see GDataGeo.h diff --git a/Source/Clients/Photos/GDataEntryPhoto.m b/Source/Clients/Photos/GDataEntryPhoto.m index 4574928b..9172be9f 100644 --- a/Source/Clients/Photos/GDataEntryPhoto.m +++ b/Source/Clients/Photos/GDataEntryPhoto.m @@ -26,11 +26,11 @@ @implementation GDataEntryPhoto + (GDataEntryPhoto *)photoEntry { - + GDataEntryPhoto *entry = [self object]; [entry setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + return entry; } @@ -74,7 +74,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"albumID", @"albumID", kGDataDescValueLabeled }, { @"checksum", @"checksum", kGDataDescValueLabeled }, @@ -97,7 +97,7 @@ - (NSMutableArray *)itemsForDescription { { @"location", @"location", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -133,7 +133,7 @@ - (NSString *)albumID { - (void)setAlbumID:(NSString *)str { GDataObject *obj = [GDataPhotoAlbumID valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSString *)checksum { @@ -143,7 +143,7 @@ - (NSString *)checksum { - (void)setChecksum:(NSString *)str { GDataObject *obj = [GDataPhotoChecksum valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentCount { @@ -154,7 +154,7 @@ - (NSNumber *)commentCount { - (void)setCommentCount:(NSNumber *)num { GDataObject *obj = [GDataPhotoCommentCount valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentsEnabled { @@ -165,7 +165,7 @@ - (NSNumber *)commentsEnabled { - (void)setCommentsEnabled:(NSNumber *)num { GDataObject *obj = [GDataPhotoCommentingEnabled valueWithBool:[num boolValue]]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)height { @@ -176,7 +176,7 @@ - (NSNumber *)height { - (void)setHeight:(NSNumber *)num { GDataObject *obj = [GDataPhotoHeight valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)rotation { @@ -187,7 +187,7 @@ - (NSNumber *)rotation { - (void)setRotation:(NSNumber *)num { GDataObject *obj = [GDataPhotoRotation valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)size { @@ -198,7 +198,7 @@ - (NSNumber *)size { - (void)setSize:(NSNumber *)num { GDataObject *obj = [GDataPhotoSize valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataPhotoTimestamp *)timestamp { @@ -207,7 +207,7 @@ - (GDataPhotoTimestamp *)timestamp { } - (void)setTimestamp:(GDataPhotoTimestamp *)obj { - [self setObject:obj forExtensionClass:[GDataPhotoTimestamp class]]; + [self setObject:obj forExtensionClass:[GDataPhotoTimestamp class]]; } - (NSNumber *)width { @@ -218,7 +218,7 @@ - (NSNumber *)width { - (void)setWidth:(NSNumber *)num { GDataObject *obj = [GDataPhotoWidth valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSString *)videoStatus { @@ -228,7 +228,7 @@ - (NSString *)videoStatus { - (void)setVideoStatus:(NSString *)str { GDataPhotoVideoStatus *obj = [GDataPhotoVideoStatus valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataMediaGroup *)mediaGroup { @@ -255,7 +255,7 @@ - (GDataEXIFTags *)EXIFTags { } - (void)setEXIFTags:(GDataEXIFTags *)tags { - [self setObject:tags forExtensionClass:[GDataEXIFTags class]]; + [self setObject:tags forExtensionClass:[GDataEXIFTags class]]; } #pragma mark search response elements introduced in V2 diff --git a/Source/Clients/Photos/GDataEntryPhotoAlbum.m b/Source/Clients/Photos/GDataEntryPhotoAlbum.m index aab44bc6..8c4817d8 100644 --- a/Source/Clients/Photos/GDataEntryPhotoAlbum.m +++ b/Source/Clients/Photos/GDataEntryPhotoAlbum.m @@ -26,11 +26,11 @@ @implementation GDataEntryPhotoAlbum + (GDataEntryPhotoAlbum *)albumEntry { - + GDataEntryPhotoAlbum *entry = [self object]; [entry setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + return entry; } @@ -66,7 +66,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"access", @"access", kGDataDescValueLabeled }, { @"bytesUsed", @"bytesUsed", kGDataDescValueLabeled }, @@ -82,7 +82,7 @@ - (NSMutableArray *)itemsForDescription { { @"geoLocation", @"geoLocation", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -98,7 +98,7 @@ - (NSString *)access { - (void)setAccess:(NSString *)str { GDataPhotoAccess *obj = [GDataPhotoAccess valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoAccess class]]; + [self setObject:obj forExtensionClass:[GDataPhotoAccess class]]; } - (NSNumber *)bytesUsed { @@ -109,7 +109,7 @@ - (NSNumber *)bytesUsed { - (void)setBytesUsed:(NSNumber *)num { GDataPhotoBytesUsed *obj = [GDataPhotoBytesUsed valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentCount { @@ -120,7 +120,7 @@ - (NSNumber *)commentCount { - (void)setCommentCount:(NSNumber *)num { GDataPhotoCommentCount *obj = [GDataPhotoCommentCount valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentsEnabled { @@ -131,7 +131,7 @@ - (NSNumber *)commentsEnabled { - (void)setCommentsEnabled:(NSNumber *)num { GDataPhotoCommentingEnabled *obj = [GDataPhotoCommentingEnabled valueWithBool:[num boolValue]]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataPhotoTimestamp *)timestamp { @@ -149,7 +149,7 @@ - (NSString *)location { - (void)setLocation:(NSString *)str { GDataPhotoLocation *obj = [GDataPhotoLocation valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoLocation class]]; + [self setObject:obj forExtensionClass:[GDataPhotoLocation class]]; } - (NSString *)nickname { @@ -159,7 +159,7 @@ - (NSString *)nickname { - (void)setNickname:(NSString *)str { GDataPhotoNickname *obj = [GDataPhotoNickname valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; + [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; } - (NSNumber *)photosLeft { @@ -170,7 +170,7 @@ - (NSNumber *)photosLeft { - (void)setPhotosLeft:(NSNumber *)num { GDataPhotoNumberLeft *obj = [GDataPhotoNumberLeft valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)photosUsed { @@ -181,7 +181,7 @@ - (NSNumber *)photosUsed { - (void)setPhotosUsed:(NSNumber *)num { GDataPhotoNumberUsed *obj = [GDataPhotoNumberUsed valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSString *)username { @@ -191,7 +191,7 @@ - (NSString *)username { - (void)setUsername:(NSString *)str { GDataPhotoUser *obj = [GDataPhotoUser valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataGeo *)geoLocation { diff --git a/Source/Clients/Photos/GDataEntryPhotoBase.m b/Source/Clients/Photos/GDataEntryPhotoBase.m index 0a68d1ea..38556024 100644 --- a/Source/Clients/Photos/GDataEntryPhotoBase.m +++ b/Source/Clients/Photos/GDataEntryPhotoBase.m @@ -26,9 +26,9 @@ @implementation GDataEntryPhotoBase - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // common photo extensions [self addExtensionDeclarationForParentClass:[self class] childClass:[GDataPhotoGPhotoID class]]; @@ -36,7 +36,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; [self addToArray:items objectDescriptionIfNonNil:[self GPhotoID] withName:@"gphotoID"]; return items; @@ -50,17 +50,17 @@ + (NSString *)defaultServiceVersion { #pragma mark - - (NSString *)GPhotoID { - + GDataPhotoGPhotoID *obj = [self objectForExtensionClass:[GDataPhotoGPhotoID class]]; - + return [obj stringValue]; } - (void)setGPhotoID:(NSString *)str { - + if (str) { GDataPhotoGPhotoID *obj = [GDataPhotoGPhotoID valueWithString:str]; - + [self setObject:obj forExtensionClass:[GDataPhotoGPhotoID class]]; } else { [self setObject:nil forExtensionClass:[GDataPhotoGPhotoID class]]; @@ -70,7 +70,7 @@ - (void)setGPhotoID:(NSString *)str { // like in the Java library, we'll rename summary as description - (GDataTextConstruct *)photoDescription { - return [self summary]; + return [self summary]; } - (void)setPhotoDescription:(GDataTextConstruct *)obj { diff --git a/Source/Clients/Photos/GDataEntryPhotoComment.m b/Source/Clients/Photos/GDataEntryPhotoComment.m index 36f5d655..43f631e0 100644 --- a/Source/Clients/Photos/GDataEntryPhotoComment.m +++ b/Source/Clients/Photos/GDataEntryPhotoComment.m @@ -26,13 +26,13 @@ @implementation GDataEntryPhotoComment + (GDataEntryPhotoComment *)commentEntryWithString:(NSString *)commentStr { - + GDataEntryPhotoComment *entry = [self object]; [entry setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + [entry setContent:[GDataEntryContent contentWithString:commentStr]]; - + return entry; } @@ -47,12 +47,12 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // common photo extensions Class entryClass = [self class]; - + [self addExtensionDeclarationForParentClass:entryClass childClasses: [GDataPhotoAlbumID class], @@ -62,12 +62,12 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + [self addToArray:items objectDescriptionIfNonNil:[self albumID] withName:@"albumID"]; [self addToArray:items objectDescriptionIfNonNil:[self photoID] withName:@"photoID"]; - + return items; } #endif @@ -81,7 +81,7 @@ - (NSString *)albumID { - (void)setAlbumID:(NSString *)str { GDataObject *obj = [GDataPhotoAlbumID valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSString *)photoID { @@ -91,7 +91,7 @@ - (NSString *)photoID { - (void)setPhotoID:(NSString *)str { GDataObject *obj = [GDataPhotoPhotoID valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } diff --git a/Source/Clients/Photos/GDataEntryPhotoTag.m b/Source/Clients/Photos/GDataEntryPhotoTag.m index 2fc7a2ac..3f69e77a 100644 --- a/Source/Clients/Photos/GDataEntryPhotoTag.m +++ b/Source/Clients/Photos/GDataEntryPhotoTag.m @@ -26,13 +26,13 @@ @implementation GDataEntryPhotoTag + (GDataEntryPhotoTag *)tagEntryWithString:(NSString *)tagStr { - + GDataEntryPhotoTag *entry = [self object]; [entry setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + [entry setTitle:[GDataTextConstruct textConstructWithString:tagStr]]; - + return entry; } @@ -47,23 +47,23 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // common photo extensions Class entryClass = [self class]; - + [self addExtensionDeclarationForParentClass:entryClass childClass:[GDataPhotoWeight class]]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + [self addToArray:items objectDescriptionIfNonNil:[self weight] withName:@"weight"]; - + return items; } #endif @@ -78,7 +78,7 @@ - (NSNumber *)weight { - (void)setWeight:(NSNumber *)num { GDataPhotoWeight *obj = [GDataPhotoWeight valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } @end diff --git a/Source/Clients/Photos/GDataEntryPhotoUser.m b/Source/Clients/Photos/GDataEntryPhotoUser.m index 07b5a2c4..e78709a6 100644 --- a/Source/Clients/Photos/GDataEntryPhotoUser.m +++ b/Source/Clients/Photos/GDataEntryPhotoUser.m @@ -26,11 +26,11 @@ @implementation GDataEntryPhotoUser + (GDataEntryPhotoUser *)userEntry { - + GDataEntryPhotoUser *entry = [self object]; [entry setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + return entry; } @@ -45,12 +45,12 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // common photo extensions Class entryClass = [self class]; - + [self addExtensionDeclarationForParentClass:entryClass childClasses: [GDataPhotoMaxPhotosPerAlbum class], @@ -64,7 +64,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"maxPhotosPerAlbum", @"maxPhotosPerAlbum", kGDataDescValueLabeled }, { @"nickname", @"nickname", kGDataDescValueLabeled }, @@ -74,10 +74,10 @@ - (NSMutableArray *)itemsForDescription { { @"username", @"username", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; - return items; + return items; } #endif @@ -90,7 +90,7 @@ - (NSNumber *)maxPhotosPerAlbum { // long long - (void)setMaxPhotosPerAlbum:(NSNumber *)num { GDataPhotoMaxPhotosPerAlbum *obj = [GDataPhotoMaxPhotosPerAlbum valueWithNumber:num]; - [self setObject:obj forExtensionClass:[GDataPhotoMaxPhotosPerAlbum class]]; + [self setObject:obj forExtensionClass:[GDataPhotoMaxPhotosPerAlbum class]]; } - (NSString *)nickname { @@ -100,7 +100,7 @@ - (NSString *)nickname { - (void)setNickname:(NSString *)str { GDataPhotoNickname *obj = [GDataPhotoNickname valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; + [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; } - (NSString *)thumbnail { @@ -110,7 +110,7 @@ - (NSString *)thumbnail { - (void)setThumbnail:(NSString *)str { GDataPhotoThumbnail *obj = [GDataPhotoThumbnail valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoThumbnail class]]; + [self setObject:obj forExtensionClass:[GDataPhotoThumbnail class]]; } - (NSNumber *)quotaLimit { // long long @@ -120,7 +120,7 @@ - (NSNumber *)quotaLimit { // long long - (void)setQuotaLimit:(NSNumber *)num { GDataPhotoQuotaLimit *obj = [GDataPhotoQuotaLimit valueWithNumber:num]; - [self setObject:obj forExtensionClass:[GDataPhotoQuotaLimit class]]; + [self setObject:obj forExtensionClass:[GDataPhotoQuotaLimit class]]; } - (NSNumber *)quotaUsed { // long long @@ -130,7 +130,7 @@ - (NSNumber *)quotaUsed { // long long - (void)setQuotaUsed:(NSNumber *)num { GDataPhotoQuotaUsed *obj = [GDataPhotoQuotaUsed valueWithNumber:num]; - [self setObject:obj forExtensionClass:[GDataPhotoQuotaUsed class]]; + [self setObject:obj forExtensionClass:[GDataPhotoQuotaUsed class]]; } - (NSString *)username { @@ -140,7 +140,7 @@ - (NSString *)username { - (void)setUsername:(NSString *)str { GDataPhotoUser *obj = [GDataPhotoUser valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } diff --git a/Source/Clients/Photos/GDataFeedPhoto.h b/Source/Clients/Photos/GDataFeedPhoto.h index 3272a5af..3e9f4967 100644 --- a/Source/Clients/Photos/GDataFeedPhoto.h +++ b/Source/Clients/Photos/GDataFeedPhoto.h @@ -58,7 +58,7 @@ - (void)setWidth:(NSNumber *)num; - (NSString *)videoStatus; -- (void)setVideoStatus:(NSString *)str; +- (void)setVideoStatus:(NSString *)str; // setGeoLocation requires an instance of a subclass of GDataGeo, not an // instance of GDataGeo; see GDataGeo.h diff --git a/Source/Clients/Photos/GDataFeedPhoto.m b/Source/Clients/Photos/GDataFeedPhoto.m index aad23a5f..6b866884 100644 --- a/Source/Clients/Photos/GDataFeedPhoto.m +++ b/Source/Clients/Photos/GDataFeedPhoto.m @@ -26,11 +26,11 @@ @implementation GDataFeedPhoto + (GDataFeedPhoto *)photoFeed { - + GDataFeedPhoto *feed = [self object]; - + [feed setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + return feed; } @@ -101,7 +101,7 @@ - (NSString *)albumID { - (void)setAlbumID:(NSString *)str { GDataObject *obj = [GDataPhotoAlbumID valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSString *)checksum { @@ -111,7 +111,7 @@ - (NSString *)checksum { - (void)setChecksum:(NSString *)str { GDataObject *obj = [GDataPhotoChecksum valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentCount { @@ -122,7 +122,7 @@ - (NSNumber *)commentCount { - (void)setCommentCount:(NSNumber *)num { GDataObject *obj = [GDataPhotoCommentCount valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentsEnabled { @@ -133,7 +133,7 @@ - (NSNumber *)commentsEnabled { - (void)setCommentsEnabled:(NSNumber *)num { GDataObject *obj = [GDataPhotoCommentingEnabled valueWithBool:[num boolValue]]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)height { @@ -144,7 +144,7 @@ - (NSNumber *)height { - (void)setHeight:(NSNumber *)num { GDataObject *obj = [GDataPhotoHeight valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)rotation { @@ -155,7 +155,7 @@ - (NSNumber *)rotation { - (void)setRotation:(NSNumber *)num { GDataObject *obj = [GDataPhotoRotation valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)size { @@ -166,7 +166,7 @@ - (NSNumber *)size { - (void)setSize:(NSNumber *)num { GDataObject *obj = [GDataPhotoSize valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataPhotoTimestamp *)timestamp { @@ -175,7 +175,7 @@ - (GDataPhotoTimestamp *)timestamp { } - (void)setTimestamp:(GDataPhotoTimestamp *)obj { - [self setObject:obj forExtensionClass:[GDataPhotoTimestamp class]]; + [self setObject:obj forExtensionClass:[GDataPhotoTimestamp class]]; } - (NSNumber *)width { @@ -191,12 +191,12 @@ - (NSString *)videoStatus { - (void)setVideoStatus:(NSString *)str { GDataPhotoVideoStatus *obj = [GDataPhotoVideoStatus valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (void)setWidth:(NSNumber *)num { GDataObject *obj = [GDataPhotoWidth valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataMediaGroup *)mediaGroup { @@ -223,7 +223,7 @@ - (GDataEXIFTags *)EXIFTags { } - (void)setEXIFTags:(GDataEXIFTags *)tags { - [self setObject:tags forExtensionClass:[GDataEXIFTags class]]; + [self setObject:tags forExtensionClass:[GDataEXIFTags class]]; } @end diff --git a/Source/Clients/Photos/GDataFeedPhotoAlbum.m b/Source/Clients/Photos/GDataFeedPhotoAlbum.m index b540ec02..39108494 100644 --- a/Source/Clients/Photos/GDataFeedPhotoAlbum.m +++ b/Source/Clients/Photos/GDataFeedPhotoAlbum.m @@ -26,11 +26,11 @@ @implementation GDataFeedPhotoAlbum + (GDataFeedPhotoAlbum *)albumFeed { - + GDataFeedPhotoAlbum *entry = [self object]; - + [entry setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + return entry; } @@ -43,11 +43,11 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class feedClass = [self class]; - + // common photo extensions [self addExtensionDeclarationForParentClass:feedClass childClasses: @@ -65,7 +65,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"access", @"access", kGDataDescValueLabeled }, { @"bytesUsed", @"bytesUsed", kGDataDescValueLabeled }, @@ -82,7 +82,7 @@ - (NSMutableArray *)itemsForDescription { { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -98,7 +98,7 @@ - (NSString *)access { - (void)setAccess:(NSString *)str { GDataPhotoAccess *obj = [GDataPhotoAccess valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoAccess class]]; + [self setObject:obj forExtensionClass:[GDataPhotoAccess class]]; } - (NSNumber *)bytesUsed { @@ -109,7 +109,7 @@ - (NSNumber *)bytesUsed { - (void)setBytesUsed:(NSNumber *)num { GDataPhotoBytesUsed *obj = [GDataPhotoBytesUsed valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentCount { @@ -120,7 +120,7 @@ - (NSNumber *)commentCount { - (void)setCommentCount:(NSNumber *)num { GDataPhotoCommentCount *obj = [GDataPhotoCommentCount valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)commentsEnabled { @@ -131,7 +131,7 @@ - (NSNumber *)commentsEnabled { - (void)setCommentsEnabled:(NSNumber *)num { GDataPhotoCommentingEnabled *obj = [GDataPhotoCommentingEnabled valueWithBool:[num boolValue]]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataPhotoTimestamp *)timestamp { @@ -149,7 +149,7 @@ - (NSString *)location { - (void)setLocation:(NSString *)str { GDataPhotoLocation *obj = [GDataPhotoLocation valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoLocation class]]; + [self setObject:obj forExtensionClass:[GDataPhotoLocation class]]; } - (NSString *)nickname { @@ -159,7 +159,7 @@ - (NSString *)nickname { - (void)setNickname:(NSString *)str { GDataPhotoNickname *obj = [GDataPhotoNickname valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; + [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; } - (NSNumber *)photosLeft { @@ -170,7 +170,7 @@ - (NSNumber *)photosLeft { - (void)setPhotosLeft:(NSNumber *)num { GDataPhotoNumberLeft *obj = [GDataPhotoNumberLeft valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSNumber *)photosUsed { @@ -181,7 +181,7 @@ - (NSNumber *)photosUsed { - (void)setPhotosUsed:(NSNumber *)num { GDataPhotoNumberUsed *obj = [GDataPhotoNumberUsed valueWithNumber:num]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (NSString *)username { @@ -191,7 +191,7 @@ - (NSString *)username { - (void)setUsername:(NSString *)str { GDataPhotoUser *obj = [GDataPhotoUser valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } - (GDataGeo *)geoLocation { diff --git a/Source/Clients/Photos/GDataFeedPhotoBase.m b/Source/Clients/Photos/GDataFeedPhotoBase.m index 65368968..a09d2557 100644 --- a/Source/Clients/Photos/GDataFeedPhotoBase.m +++ b/Source/Clients/Photos/GDataFeedPhotoBase.m @@ -26,9 +26,9 @@ @implementation GDataFeedPhotoBase - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // common photo extensions [self addExtensionDeclarationForParentClass:[self class] childClass:[GDataPhotoGPhotoID class]]; @@ -36,7 +36,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; [self addToArray:items objectDescriptionIfNonNil:[self GPhotoID] withName:@"gphotoID"]; return items; @@ -54,17 +54,17 @@ + (NSString *)defaultServiceVersion { #pragma mark - - (NSString *)GPhotoID { - + GDataPhotoGPhotoID *obj = [self objectForExtensionClass:[GDataPhotoGPhotoID class]]; - + return [obj stringValue]; } - (void)setGPhotoID:(NSString *)str { - + if (str) { GDataPhotoGPhotoID *obj = [GDataPhotoGPhotoID valueWithString:str]; - + [self setObject:obj forExtensionClass:[GDataPhotoGPhotoID class]]; } else { [self setObject:nil forExtensionClass:[GDataPhotoGPhotoID class]]; @@ -74,7 +74,7 @@ - (void)setGPhotoID:(NSString *)str { // like in the Java library, we'll rename subtitle as description - (GDataTextConstruct *)photoDescription { - return [self subtitle]; + return [self subtitle]; } - (void)setPhotoDescription:(GDataTextConstruct *)obj { @@ -82,7 +82,7 @@ - (void)setPhotoDescription:(GDataTextConstruct *)obj { } - (void)setPhotoDescriptionWithString:(NSString *)str { - [self setSubtitle:[GDataTextConstruct textConstructWithString:str]]; + [self setSubtitle:[GDataTextConstruct textConstructWithString:str]]; } #pragma mark - diff --git a/Source/Clients/Photos/GDataFeedPhotoUser.m b/Source/Clients/Photos/GDataFeedPhotoUser.m index f1de3b0d..380c7f9b 100644 --- a/Source/Clients/Photos/GDataFeedPhotoUser.m +++ b/Source/Clients/Photos/GDataFeedPhotoUser.m @@ -25,11 +25,11 @@ @implementation GDataFeedPhotoUser + (GDataFeedPhotoUser *)userFeed { - + GDataFeedPhotoUser *feed = [self object]; - + [feed setNamespaces:[GDataPhotoConstants photoNamespaces]]; - + return feed; } @@ -42,9 +42,9 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + // common photo extensions Class feedClass = [self class]; @@ -61,7 +61,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"maxPhotosPerAlbum", @"maxPhotosPerAlbum", kGDataDescValueLabeled }, { @"nickname", @"nickname", kGDataDescValueLabeled }, @@ -71,7 +71,7 @@ - (NSMutableArray *)itemsForDescription { { @"username", @"username", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -87,7 +87,7 @@ - (NSNumber *)maxPhotosPerAlbum { // long long - (void)setMaxPhotosPerAlbum:(NSNumber *)num { GDataPhotoMaxPhotosPerAlbum *obj = [GDataPhotoMaxPhotosPerAlbum valueWithNumber:num]; - [self setObject:obj forExtensionClass:[GDataPhotoMaxPhotosPerAlbum class]]; + [self setObject:obj forExtensionClass:[GDataPhotoMaxPhotosPerAlbum class]]; } - (NSString *)nickname { @@ -97,7 +97,7 @@ - (NSString *)nickname { - (void)setNickname:(NSString *)str { GDataPhotoNickname *obj = [GDataPhotoNickname valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; + [self setObject:obj forExtensionClass:[GDataPhotoNickname class]]; } - (NSString *)thumbnail { @@ -107,7 +107,7 @@ - (NSString *)thumbnail { - (void)setThumbnail:(NSString *)str { GDataPhotoThumbnail *obj = [GDataPhotoThumbnail valueWithString:str]; - [self setObject:obj forExtensionClass:[GDataPhotoThumbnail class]]; + [self setObject:obj forExtensionClass:[GDataPhotoThumbnail class]]; } - (NSNumber *)quotaLimit { // long long @@ -117,7 +117,7 @@ - (NSNumber *)quotaLimit { // long long - (void)setQuotaLimit:(NSNumber *)num { GDataPhotoQuotaLimit *obj = [GDataPhotoQuotaLimit valueWithNumber:num]; - [self setObject:obj forExtensionClass:[GDataPhotoQuotaLimit class]]; + [self setObject:obj forExtensionClass:[GDataPhotoQuotaLimit class]]; } - (NSNumber *)quotaUsed { // long long @@ -127,7 +127,7 @@ - (NSNumber *)quotaUsed { // long long - (void)setQuotaUsed:(NSNumber *)num { GDataPhotoQuotaUsed *obj = [GDataPhotoQuotaUsed valueWithNumber:num]; - [self setObject:obj forExtensionClass:[GDataPhotoQuotaUsed class]]; + [self setObject:obj forExtensionClass:[GDataPhotoQuotaUsed class]]; } - (NSString *)username { @@ -137,7 +137,7 @@ - (NSString *)username { - (void)setUsername:(NSString *)str { GDataPhotoUser *obj = [GDataPhotoUser valueWithString:str]; - [self setObject:obj forExtensionClass:[obj class]]; + [self setObject:obj forExtensionClass:[obj class]]; } @end diff --git a/Source/Clients/Photos/GDataPhotoElements.h b/Source/Clients/Photos/GDataPhotoElements.h index 7eec4d30..64cb20b9 100644 --- a/Source/Clients/Photos/GDataPhotoElements.h +++ b/Source/Clients/Photos/GDataPhotoElements.h @@ -25,7 +25,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAPHOTOELEMENTS_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -116,16 +116,16 @@ _EXTERN NSString* const kGDataPhotoStatusFailed _INITIALIZE_AS(@"failed"); @interface GDataPhotoHeight : GDataValueElementConstruct @end -// unapplied rotation in int degrees, 90 +// unapplied rotation in int degrees, 90 @interface GDataPhotoRotation : GDataValueElementConstruct @end -// photo size in bytes 149351 +// photo size in bytes 149351 @interface GDataPhotoSize : GDataValueElementConstruct @end -// photo timestamp, in milliseconds since 1-January-1970, -// like 1168640584000 +// photo timestamp, in milliseconds since 1-January-1970, +// like 1168640584000 @interface GDataPhotoTimestamp : GDataValueElementConstruct + (GDataPhotoTimestamp *)timestampWithDate:(NSDate *)date; - (NSDate *)dateValue; diff --git a/Source/Clients/Photos/GDataPhotoElements.m b/Source/Clients/Photos/GDataPhotoElements.m index 33b934d7..c43b7c2f 100644 --- a/Source/Clients/Photos/GDataPhotoElements.m +++ b/Source/Clients/Photos/GDataPhotoElements.m @@ -33,14 +33,14 @@ + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } + (NSString *)extensionElementLocalName { return @"albumid"; } @end -@implementation GDataPhotoCommentCount +@implementation GDataPhotoCommentCount // comment count, like 11 + (NSString *)extensionElementURI { return kGDataNamespacePhotos; } + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } + (NSString *)extensionElementLocalName { return @"commentCount"; } @end -@implementation GDataPhotoCommentingEnabled +@implementation GDataPhotoCommentingEnabled // comment count, like true + (NSString *)extensionElementURI { return kGDataNamespacePhotos; } + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } @@ -146,22 +146,22 @@ + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } + (NSString *)extensionElementLocalName { return @"height"; } @end -// unapplied rotation in int degrees, 90 +// unapplied rotation in int degrees, 90 @implementation GDataPhotoRotation + (NSString *)extensionElementURI { return kGDataNamespacePhotos; } + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } + (NSString *)extensionElementLocalName { return @"rotation"; } @end -// photo size in bytes 149351 +// photo size in bytes 149351 @implementation GDataPhotoSize + (NSString *)extensionElementURI { return kGDataNamespacePhotos; } + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } + (NSString *)extensionElementLocalName { return @"size"; } @end -// photo timestamp, in milliseconds since 1-January-1970, -// like 1168640584000 +// photo timestamp, in milliseconds since 1-January-1970, +// like 1168640584000 @implementation GDataPhotoTimestamp + (NSString *)extensionElementURI { return kGDataNamespacePhotos; } + (NSString *)extensionElementPrefix { return kGDataNamespacePhotosPrefix; } @@ -176,17 +176,17 @@ + (GDataPhotoTimestamp *)timestampWithDate:(NSDate *)date { - (NSDate *)dateValue { // date in XML here is like Java's date, milliseconds since 1970 NSTimeInterval secs = [self doubleValue] / 1000.0; - NSDate *date = [NSDate dateWithTimeIntervalSince1970:secs]; + NSDate *date = [NSDate dateWithTimeIntervalSince1970:secs]; return date; } - (void)setDateValue:(NSDate *)date { NSTimeInterval secs = [date timeIntervalSince1970] * 1000.0; - [self setDoubleValue:floor(secs)]; + [self setDoubleValue:floor(secs)]; } - (NSString *)description { - return [[self dateValue] description]; + return [[self dateValue] description]; } @end diff --git a/Source/Clients/Photos/GDataPhotos.h b/Source/Clients/Photos/GDataPhotos.h index 2e43f285..ec30bd43 100644 --- a/Source/Clients/Photos/GDataPhotos.h +++ b/Source/Clients/Photos/GDataPhotos.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataPhotos.h // diff --git a/Source/Clients/Photos/GDataQueryGooglePhotos.h b/Source/Clients/Photos/GDataQueryGooglePhotos.h index 87e6d021..7f5d114a 100644 --- a/Source/Clients/Photos/GDataQueryGooglePhotos.h +++ b/Source/Clients/Photos/GDataQueryGooglePhotos.h @@ -26,7 +26,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAQUERYGOOGLEPHOTOS_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -35,7 +35,7 @@ _EXTERN const NSInteger kGDataGooglePhotosImageSizeDownloadable _INITIALIZE_AS(-1); -@interface GDataQueryGooglePhotos : GDataQuery +@interface GDataQueryGooglePhotos : GDataQuery + (GDataQueryGooglePhotos *)photoQueryWithFeedURL:(NSURL *)feedURL; @@ -63,7 +63,7 @@ _EXTERN const NSInteger kGDataGooglePhotosImageSizeDownloadable _INITIALIZE_AS(- - (void)setTag:(NSString *)tag; - (NSString *)tag; - + @end #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_PHOTOS_SERVICE diff --git a/Source/Clients/Photos/GDataQueryGooglePhotos.m b/Source/Clients/Photos/GDataQueryGooglePhotos.m index fcd58d33..b50a5e18 100644 --- a/Source/Clients/Photos/GDataQueryGooglePhotos.m +++ b/Source/Clients/Photos/GDataQueryGooglePhotos.m @@ -35,13 +35,13 @@ @implementation GDataQueryGooglePhotos + (GDataQueryGooglePhotos *)photoQueryWithFeedURL:(NSURL *)feedURL { - return [self queryWithFeedURL:feedURL]; + return [self queryWithFeedURL:feedURL]; } + (GDataQueryGooglePhotos *)photoQueryForUserID:(NSString *)userID albumID:(NSString *)albumIDorNil albumName:(NSString *)albumNameOrNil - photoID:(NSString *)photoIDorNil { + photoID:(NSString *)photoIDorNil { NSURL *url; url = [GDataServiceGooglePhotos photoFeedURLForUserID:userID albumID:albumIDorNil @@ -54,7 +54,7 @@ + (GDataQueryGooglePhotos *)photoQueryForUserID:(NSString *)userID - (NSString *)stringParamOrNilForInt:(NSInteger)val { if (val > 0) { - return [NSString stringWithFormat:@"%ld", (long)val]; + return [NSString stringWithFormat:@"%ld", (long)val]; } return nil; } @@ -89,20 +89,20 @@ - (NSString *)access { - (void)setImageSize:(NSInteger)val { NSString *valStr; - + if (val == kGDataGooglePhotosImageSizeDownloadable) { valStr = kImageSizeOriginalPhoto; // imgmax=d } else { valStr = [self stringParamOrNilForInt:val]; } - + [self addCustomParameterWithName:kImageSizeParamName - value:valStr]; + value:valStr]; } - (NSInteger)imageSize { NSString *valStr = [self valueForParameterWithName:kImageSizeParamName]; - + if ([valStr isEqual:kImageSizeOriginalPhoto]) { return kGDataGooglePhotosImageSizeDownloadable; } diff --git a/Source/Clients/Photos/GDataServiceGooglePhotos.h b/Source/Clients/Photos/GDataServiceGooglePhotos.h index ad4c3e91..b73facde 100644 --- a/Source/Clients/Photos/GDataServiceGooglePhotos.h +++ b/Source/Clients/Photos/GDataServiceGooglePhotos.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATASERVICEGOOGLEPHOTOS_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -52,7 +52,7 @@ _EXTERN NSString* const kGDataGooglePhotosKindUser _INITIALIZE_AS(@"user"); _EXTERN NSString* const kGDataGooglePhotosDropBoxUploadURL _INITIALIZE_AS(@"https://photos.googleapis.com/data/upload/resumable/media/create-session/feed/api/user/default/albumid/default"); _EXTERN NSString* const kGDataGooglePhotosDropBoxAlbumID _INITIALIZE_AS(@"default"); -@interface GDataServiceGooglePhotos : GDataServiceGoogle +@interface GDataServiceGooglePhotos : GDataServiceGoogle + (NSString *)serviceRootURLString; diff --git a/Source/Clients/Spreadsheets/GDataEntrySpreadsheet.m b/Source/Clients/Spreadsheets/GDataEntrySpreadsheet.m index 67d30469..359f3e00 100644 --- a/Source/Clients/Spreadsheets/GDataEntrySpreadsheet.m +++ b/Source/Clients/Spreadsheets/GDataEntrySpreadsheet.m @@ -63,7 +63,7 @@ - (id)init { #pragma mark - - (GDataLink *)spreadsheetLink { - return [self alternateLink]; + return [self alternateLink]; } - (GDataLink *)tablesFeedLink { diff --git a/Source/Clients/Spreadsheets/GDataEntrySpreadsheetCell.m b/Source/Clients/Spreadsheets/GDataEntrySpreadsheetCell.m index b74669d0..352ab0a8 100644 --- a/Source/Clients/Spreadsheets/GDataEntrySpreadsheetCell.m +++ b/Source/Clients/Spreadsheets/GDataEntrySpreadsheetCell.m @@ -34,13 +34,13 @@ + (NSString *)coreProtocolVersionForServiceVersion:(NSString *)serviceVersion { } + (GDataEntrySpreadsheetCell *)spreadsheetCellEntryWithCell:(GDataSpreadsheetCell *)cell { - + GDataEntrySpreadsheetCell *entry = [self object]; [entry setNamespaces:[GDataSpreadsheetConstants spreadsheetNamespaces]]; - + [entry setCell:cell]; - + return entry; } @@ -56,16 +56,16 @@ + (void)load { // spreadsheet categories do not use the standard Kind scheme // (kGDataCategoryScheme) so cannot be registered with +registerEntryClass [GDataEntryBase registerEntryClass:[self class] - forCategoryWithScheme:nil + forCategoryWithScheme:nil term:kGDataCategorySpreadsheetCell]; } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + // SpreadsheetCell extensions [self addExtensionDeclarationForParentClass:entryClass childClass:[GDataSpreadsheetCell class]]; @@ -73,11 +73,11 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + [self addToArray:items objectDescriptionIfNonNil:[self cell] withName:@"cell"]; - + return items; } #endif @@ -98,9 +98,9 @@ + (NSString *)defaultServiceVersion { #pragma mark - - (GDataSpreadsheetCell *)cell { - GDataSpreadsheetCell *obj = + GDataSpreadsheetCell *obj = (GDataSpreadsheetCell *) [self objectForExtensionClass:[GDataSpreadsheetCell class]]; - + return obj; } @@ -111,7 +111,7 @@ - (void)setCell:(GDataSpreadsheetCell *)cell { #pragma mark - - (GDataLink *)sourceLink { // cell source - return [self linkWithRelAttributeValue:kGDataLinkSource]; + return [self linkWithRelAttributeValue:kGDataLinkSource]; } @end diff --git a/Source/Clients/Spreadsheets/GDataEntrySpreadsheetList.m b/Source/Clients/Spreadsheets/GDataEntrySpreadsheetList.m index 49711360..78ec6859 100644 --- a/Source/Clients/Spreadsheets/GDataEntrySpreadsheetList.m +++ b/Source/Clients/Spreadsheets/GDataEntrySpreadsheetList.m @@ -48,17 +48,17 @@ + (void)load { // spreadsheet categories do not use the standard Kind scheme // (kGDataCategoryScheme) so cannot be registered with +registerEntryClass [GDataEntryBase registerEntryClass:[self class] - forCategoryWithScheme:nil + forCategoryWithScheme:nil term:kGDataCategorySpreadsheetList]; } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - - + + // SpreadsheetList extensions [self addExtensionDeclarationForParentClass:entryClass childClass:[GDataSpreadsheetCustomElement class]]; @@ -66,24 +66,24 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + // make a string of custom elements like {a:b, c:d} NSMutableString *str = [NSMutableString string]; NSArray *customElements = [self customElements]; NSEnumerator *elementEnumerator = [customElements objectEnumerator]; GDataSpreadsheetCustomElement *obj; - + while ((obj = [elementEnumerator nextObject]) != nil) { [str appendFormat:@"%@%@:%@", ([str length] == 0 ? @"" : @" "), [obj name], [obj stringValue]]; } - + if ([str length] > 0) { [self addToArray:items objectDescriptionIfNonNil:str withName:@"customElements"]; } - + return items; } #endif @@ -117,14 +117,14 @@ - (void)setCustomElements:(NSArray *)array { // additional convenience routines - (GDataSpreadsheetCustomElement *)customElementForName:(NSString *)name { - + // look through the elements for a matching name, not case sensitive NSArray *customElements = [self customElements]; - + NSEnumerator *elementEnumerator = [customElements objectEnumerator]; GDataSpreadsheetCustomElement *obj; while ((obj = [elementEnumerator nextObject]) != nil) { - + if ([[obj name] caseInsensitiveCompare:name] == NSOrderedSame) { return obj; } @@ -133,15 +133,15 @@ - (GDataSpreadsheetCustomElement *)customElementForName:(NSString *)name { } - (void)setCustomElement:(GDataSpreadsheetCustomElement *)obj { - + NSString *name = [obj name]; GDataSpreadsheetCustomElement *oldObj = [self customElementForName:name]; if (obj != oldObj) { - + if (oldObj) { [self removeObject:oldObj forExtensionClass:[GDataSpreadsheetCustomElement class]]; } - + if (obj) { [self addObject:obj forExtensionClass:[GDataSpreadsheetCustomElement class]]; } @@ -149,19 +149,19 @@ - (void)setCustomElement:(GDataSpreadsheetCustomElement *)obj { } - (NSDictionary *)customElementDictionary { - - // step through the custom elements, and build a dictionary + + // step through the custom elements, and build a dictionary // mapping object names to objects NSArray *customElements = [self customElements]; - + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; NSEnumerator *elementEnumerator = [customElements objectEnumerator]; GDataSpreadsheetCustomElement *obj; - + while ((obj = [elementEnumerator nextObject]) != nil) { [dict setObject:obj forKey:[obj name]]; } - return dict; + return dict; } @end diff --git a/Source/Clients/Spreadsheets/GDataEntryWorksheet.m b/Source/Clients/Spreadsheets/GDataEntryWorksheet.m index 4eee5f08..de9e6d3d 100644 --- a/Source/Clients/Spreadsheets/GDataEntryWorksheet.m +++ b/Source/Clients/Spreadsheets/GDataEntryWorksheet.m @@ -52,34 +52,34 @@ + (void)load { // spreadsheet categories do not use the standard Kind scheme // (kGDataCategoryScheme) so cannot be registered with +registerEntryClass [GDataEntryBase registerEntryClass:[self class] - forCategoryWithScheme:kGDataCategorySchemeSpreadsheet + forCategoryWithScheme:kGDataCategorySchemeSpreadsheet term:kGDataCategoryWorksheet]; } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + // Worksheet extensions [self addExtensionDeclarationForParentClass:entryClass childClass:[GDataColumnCount class]]; [self addExtensionDeclarationForParentClass:entryClass - childClass:[GDataRowCount class]]; + childClass:[GDataRowCount class]]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + NSString *colStr = [NSString stringWithFormat:@"%d", (int) [self columnCount]]; NSString *rowStr = [NSString stringWithFormat:@"%d", (int) [self rowCount]]; - + [self addToArray:items objectDescriptionIfNonNil:colStr withName:@"cols"]; [self addToArray:items objectDescriptionIfNonNil:rowStr withName:@"rows"]; - + return items; } #endif @@ -105,7 +105,7 @@ + (NSString *)defaultServiceVersion { - (NSInteger)rowCount { GDataRowCount *rowCount = [self objectForExtensionClass:[GDataRowCount class]]; - + return [rowCount count]; } @@ -116,7 +116,7 @@ - (void)setRowCount:(NSInteger)val { - (NSInteger)columnCount { GDataColumnCount *columnCount = [self objectForExtensionClass:[GDataColumnCount class]]; - + return [columnCount count]; } @@ -128,7 +128,7 @@ - (void)setColumnCount:(NSInteger)val { #pragma mark - - (GDataLink *)spreadsheetLink { - return [self alternateLink]; + return [self alternateLink]; } - (GDataLink *)cellsLink { diff --git a/Source/Clients/Spreadsheets/GDataFeedSpreadsheet.m b/Source/Clients/Spreadsheets/GDataFeedSpreadsheet.m index 80827927..7cb55455 100644 --- a/Source/Clients/Spreadsheets/GDataFeedSpreadsheet.m +++ b/Source/Clients/Spreadsheets/GDataFeedSpreadsheet.m @@ -39,7 +39,7 @@ + (void)load { // spreadsheet categories do not use the standard Kind scheme // (kGDataCategoryScheme) so cannot be registered with +registerEntryClass [GDataFeedBase registerFeedClass:[self class] - forCategoryWithScheme:nil + forCategoryWithScheme:nil term:kGDataCategorySpreadsheet]; } diff --git a/Source/Clients/Spreadsheets/GDataFeedSpreadsheetCell.m b/Source/Clients/Spreadsheets/GDataFeedSpreadsheetCell.m index d6ee533a..e91bc020 100644 --- a/Source/Clients/Spreadsheets/GDataFeedSpreadsheetCell.m +++ b/Source/Clients/Spreadsheets/GDataFeedSpreadsheetCell.m @@ -58,18 +58,18 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - - + + // Worksheet extensions [self addExtensionDeclarationForParentClass:entryClass childClasses: [GDataColumnCount class], [GDataRowCount class], - nil]; + nil]; } - (id)init { @@ -83,15 +83,15 @@ - (id)init { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + NSString *colStr = [NSString stringWithFormat:@"%d", (int) [self columnCount]]; NSString *rowStr = [NSString stringWithFormat:@"%d", (int) [self rowCount]]; - + [self addToArray:items objectDescriptionIfNonNil:colStr withName:@"cols"]; [self addToArray:items objectDescriptionIfNonNil:rowStr withName:@"rows"]; - + return items; } #endif @@ -107,16 +107,16 @@ + (NSString *)defaultServiceVersion { #pragma mark - - (NSInteger)rowCount { - GDataRowCount *rowCount = + GDataRowCount *rowCount = (GDataRowCount *) [self objectForExtensionClass:[GDataRowCount class]]; - + return [rowCount count]; } - (NSInteger)columnCount { - GDataColumnCount *columnCount = + GDataColumnCount *columnCount = (GDataColumnCount *) [self objectForExtensionClass:[GDataColumnCount class]]; - + return [columnCount count]; } diff --git a/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.h b/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.h index 297a6387..9ceaec8e 100644 --- a/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.h +++ b/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.h @@ -21,7 +21,7 @@ #import "GDataQuery.h" -@interface GDataQuerySpreadsheet : GDataQuery +@interface GDataQuerySpreadsheet : GDataQuery + (GDataQuerySpreadsheet *)spreadsheetQueryWithFeedURL:(NSURL *)feedURL; diff --git a/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.m b/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.m index a5e83d2c..abbd9192 100644 --- a/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.m +++ b/Source/Clients/Spreadsheets/GDataQuerySpreadsheet.m @@ -35,7 +35,7 @@ @implementation GDataQuerySpreadsheet + (GDataQuerySpreadsheet *)spreadsheetQueryWithFeedURL:(NSURL *)feedURL { - return [self queryWithFeedURL:feedURL]; + return [self queryWithFeedURL:feedURL]; } - (NSString *)titleQuery { @@ -82,7 +82,7 @@ - (BOOL)isReverseSort { // cell feed parameters - (NSString *)stringParamOrNilForInt:(NSInteger)val { if (val > 0) { - return [NSString stringWithFormat:@"%ld", (long)val]; + return [NSString stringWithFormat:@"%ld", (long)val]; } return nil; } diff --git a/Source/Clients/Spreadsheets/GDataRowColumnCount.m b/Source/Clients/Spreadsheets/GDataRowColumnCount.m index c7c6216d..cd3f34ad 100644 --- a/Source/Clients/Spreadsheets/GDataRowColumnCount.m +++ b/Source/Clients/Spreadsheets/GDataRowColumnCount.m @@ -76,7 +76,7 @@ - (id)initWithXMLElement:(NSXMLElement *)element if (self) { NSString *countStr = [self stringValueFromElement:element]; if (countStr) { - [self setCount:[countStr intValue]]; + [self setCount:[countStr intValue]]; } } return self; @@ -95,7 +95,7 @@ - (id)copyWithZone:(NSZone *)zone { - (BOOL)isEqual:(GDataRowColumnCount *)other { if (self == other) return YES; if (![other isKindOfClass:[GDataRowColumnCount class]]) return NO; - + return [super isEqual:other] && ([self count] == [other count]); } @@ -103,33 +103,33 @@ - (BOOL)isEqual:(GDataRowColumnCount *)other { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [NSMutableArray array]; - + NSString *str = [NSString stringWithFormat:@"%ld", (long) [self count]]; [self addToArray:items objectDescriptionIfNonNil:str withName:@"count"]; - + return items; } #endif - (NSXMLElement *)XMLElement { - + NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:@"gs:count"]; - + NSInteger count = [self count]; if (count >= 0) { NSString *str = [NSString stringWithFormat:@"%ld", (long) [self count]]; [element addStringValue:str]; } - + return element; } - (NSInteger)count { - return count_; + return count_; } - (void)setCount:(NSInteger)val { - count_ = val; + count_ = val; } @end diff --git a/Source/Clients/Spreadsheets/GDataServiceGoogleSpreadsheet.h b/Source/Clients/Spreadsheets/GDataServiceGoogleSpreadsheet.h index dc12f409..6fa22b9d 100644 --- a/Source/Clients/Spreadsheets/GDataServiceGoogleSpreadsheet.h +++ b/Source/Clients/Spreadsheets/GDataServiceGoogleSpreadsheet.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATASERVICEGOOGLESPREADSHEET_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -34,7 +34,7 @@ _EXTERN NSString* const kGDataGoogleSpreadsheetsPrivateFullFeed _INITIALIZE_AS(@"https://spreadsheets.google.com/feeds/spreadsheets/private/full"); -@interface GDataServiceGoogleSpreadsheet : GDataServiceGoogle +@interface GDataServiceGoogleSpreadsheet : GDataServiceGoogle // clients may use these fetch methods of GDataServiceGoogle // diff --git a/Source/Clients/Spreadsheets/GDataSpreadsheet.h b/Source/Clients/Spreadsheets/GDataSpreadsheet.h index 04e56139..9fdd6544 100644 --- a/Source/Clients/Spreadsheets/GDataSpreadsheet.h +++ b/Source/Clients/Spreadsheets/GDataSpreadsheet.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataSpreadsheet.h // diff --git a/Source/Clients/Spreadsheets/GDataSpreadsheetCell.m b/Source/Clients/Spreadsheets/GDataSpreadsheetCell.m index 76600699..5aba13c0 100644 --- a/Source/Clients/Spreadsheets/GDataSpreadsheetCell.m +++ b/Source/Clients/Spreadsheets/GDataSpreadsheetCell.m @@ -40,7 +40,7 @@ + (GDataSpreadsheetCell *)cellWithRow:(NSInteger)row inputString:(NSString *)inputStr numericValue:(NSNumber *)numericValue resultString:(NSString *)resultStr { - + GDataSpreadsheetCell *obj = [self object]; [obj setRow:row]; [obj setColumn:column]; @@ -81,7 +81,7 @@ - (id)initWithXMLElement:(NSXMLElement *)element [self setNumericValue:[self doubleNumberForAttributeName:@"numericValue" fromElement:element]]; - + [self setResultString:[self stringValueFromElement:element]]; } @@ -108,7 +108,7 @@ - (id)copyWithZone:(NSZone *)zone { - (BOOL)isEqual:(GDataSpreadsheetCell *)other { if (self == other) return YES; if (![other isKindOfClass:[GDataSpreadsheetCell class]]) return NO; - + return [super isEqual:other] && ([self row] == [other row]) && ([self column] == [other column]) @@ -120,17 +120,17 @@ - (BOOL)isEqual:(GDataSpreadsheetCell *)other { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [NSMutableArray array]; - + [self addToArray:items objectDescriptionIfNonNil:inputString_ withName:@"inputString"]; [self addToArray:items objectDescriptionIfNonNil:numericValue_ withName:@"numericValue"]; [self addToArray:items objectDescriptionIfNonNil:resultString_ withName:@"resultString"]; - + return items; } #endif - (NSXMLElement *)XMLElement { - + NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:@"gs:cell"]; if (row_ > 0) { @@ -139,7 +139,7 @@ - (NSXMLElement *)XMLElement { if (column_ > 0) { [self addToElement:element attributeValueWithInteger:column_ withName:@"col"]; } - + [self addToElement:element attributeValueIfNonNil:inputString_ withName:@"inputValue"]; [self addToElement:element @@ -147,28 +147,28 @@ - (NSXMLElement *)XMLElement { withName:@"numericValue"]; if ([resultString_ length] > 0) { - [element addStringValue:resultString_]; + [element addStringValue:resultString_]; } - + return element; } - (NSInteger)row { - return row_; + return row_; } - (void)setRow:(NSInteger)row { - row_ = row; + row_ = row; } - (NSInteger)column { - return column_; + return column_; } - (void)setColumn:(NSInteger)column { - column_ = column; + column_ = column; } - (NSString *)inputString { - return inputString_; + return inputString_; } - (void)setInputString:(NSString *)str { [inputString_ autorelease]; @@ -180,11 +180,11 @@ - (NSNumber *)numericValue { } - (void)setNumericValue:(NSNumber *)num { [numericValue_ autorelease]; - numericValue_ = [num copy]; + numericValue_ = [num copy]; } - (NSString *)resultString { - return resultString_; + return resultString_; } - (void)setResultString:(NSString *)str { [resultString_ autorelease]; diff --git a/Source/Clients/Spreadsheets/GDataSpreadsheetCustomElement.m b/Source/Clients/Spreadsheets/GDataSpreadsheetCustomElement.m index 7927bd7e..7854080b 100644 --- a/Source/Clients/Spreadsheets/GDataSpreadsheetCustomElement.m +++ b/Source/Clients/Spreadsheets/GDataSpreadsheetCustomElement.m @@ -19,7 +19,7 @@ #import "GDataEntrySpreadsheet.h" // for namespaces -@implementation GDataSpreadsheetCustomElement +@implementation GDataSpreadsheetCustomElement // arbitrary spreadsheet custom tag, like // fitz@gmail.com @@ -30,20 +30,20 @@ @implementation GDataSpreadsheetCustomElement + (NSString *)extensionElementURI { return kGDataNamespaceGSpreadCustom; } + (NSString *)extensionElementPrefix { return kGDataNamespaceGSpreadCustomPrefix; } -+ (NSString *)extensionElementLocalName { ++ (NSString *)extensionElementLocalName { // wildcard * matches all elements with the proper namespace URI - return @"*"; + return @"*"; } + (GDataSpreadsheetCustomElement *)elementWithName:(NSString *)name stringValue:(NSString *)stringValue { - + GDataSpreadsheetCustomElement *obj = [self object]; [obj setName:name]; [obj setStringValue:stringValue]; - + // we don't want the element to have the default name gsx:* - [obj setElementName:[NSString stringWithFormat:@"%@:%@", + [obj setElementName:[NSString stringWithFormat:@"%@:%@", [self extensionElementPrefix], name]]; return obj; } @@ -53,7 +53,7 @@ - (id)initWithXMLElement:(NSXMLElement *)element self = [super initWithXMLElement:element parent:parent]; if (self) { - + name_ = [[element localName] copy]; stringValue_ = [[self stringValueFromElement:element] copy]; } @@ -72,18 +72,18 @@ - (void)dealloc { - (id)copyWithZone:(NSZone *)zone { GDataSpreadsheetCustomElement* newObj = [super copyWithZone:zone]; - + [newObj setName:[self name]]; [newObj setStringValue:[self stringValue]]; - + return newObj; } - (BOOL)isEqual:(GDataSpreadsheetCustomElement *)other { - + if (self == other) return YES; if (![other isKindOfClass:[GDataSpreadsheetCustomElement class]]) return NO; - + return [super isEqual:other] && AreEqualOrBothNil([self name], [other name]) && AreEqualOrBothNil([self stringValue], [other stringValue]); @@ -92,10 +92,10 @@ - (BOOL)isEqual:(GDataSpreadsheetCustomElement *)other { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { NSMutableArray *items = [NSMutableArray array]; - + [self addToArray:items objectDescriptionIfNonNil:name_ withName:@"name"]; [self addToArray:items objectDescriptionIfNonNil:stringValue_ withName:@"stringValue"]; - + return items; } #endif @@ -103,11 +103,11 @@ - (NSMutableArray *)itemsForDescription { - (NSXMLElement *)XMLElement { NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:[self elementName]]; - + if (stringValue_) { [element addStringValue:stringValue_]; } - + return element; } diff --git a/Source/Clients/YouTube/GDataEntryYouTubeChannel.m b/Source/Clients/YouTube/GDataEntryYouTubeChannel.m index 00f27d0d..5f8e2a60 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeChannel.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeChannel.m @@ -56,12 +56,12 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"feedLinks", @"feedLinks", kGDataDescArrayCount }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -91,7 +91,7 @@ - (NSString *)channelType { #pragma mark - - (NSArray *)feedLinks { - return [self objectsForExtensionClass:[GDataFeedLink class]]; + return [self objectsForExtensionClass:[GDataFeedLink class]]; } #pragma mark Convenience accessors diff --git a/Source/Clients/YouTube/GDataEntryYouTubeComplaint.m b/Source/Clients/YouTube/GDataEntryYouTubeComplaint.m index de5a9d4a..12095828 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeComplaint.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeComplaint.m @@ -25,11 +25,11 @@ @implementation GDataEntryYouTubeComplaint + (GDataEntryYouTubeComplaint *)complaintEntry { - + GDataEntryYouTubeComplaint *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } diff --git a/Source/Clients/YouTube/GDataEntryYouTubeFeedLinkBase.m b/Source/Clients/YouTube/GDataEntryYouTubeFeedLinkBase.m index 26067a61..447c9040 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeFeedLinkBase.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeFeedLinkBase.m @@ -28,9 +28,9 @@ @implementation GDataEntryYouTubeFeedLinkBase - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; // YouTube element extensions diff --git a/Source/Clients/YouTube/GDataEntryYouTubeFriend.m b/Source/Clients/YouTube/GDataEntryYouTubeFriend.m index e2ccde77..60396c8e 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeFriend.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeFriend.m @@ -26,11 +26,11 @@ @implementation GDataEntryYouTubeFriend + (GDataEntryYouTubeFriend *)friendEntry { - + GDataEntryYouTubeFriend *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } @@ -45,9 +45,9 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; // YouTube element extensions @@ -60,9 +60,9 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + [self addToArray:items objectDescriptionIfNonNil:[self username] withName:@"username"]; [self addToArray:items objectDescriptionIfNonNil:[self status] withName:@"status"]; diff --git a/Source/Clients/YouTube/GDataEntryYouTubePlaylist.m b/Source/Clients/YouTube/GDataEntryYouTubePlaylist.m index ecec3c81..cb7366d2 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubePlaylist.m +++ b/Source/Clients/YouTube/GDataEntryYouTubePlaylist.m @@ -25,11 +25,11 @@ @implementation GDataEntryYouTubePlaylist + (GDataEntryYouTubePlaylist *)playlistEntry { - + GDataEntryYouTubePlaylist *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } @@ -44,22 +44,22 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + [self addExtensionDeclarationForParentClass:entryClass childClass:[GDataYouTubePosition class]]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - [self addToArray:items objectDescriptionIfNonNil:[self position] withName:@"position"]; - + [self addToArray:items objectDescriptionIfNonNil:[self position] withName:@"position"]; + return items; } #endif diff --git a/Source/Clients/YouTube/GDataEntryYouTubePlaylistLink.m b/Source/Clients/YouTube/GDataEntryYouTubePlaylistLink.m index bb5c696d..116ee422 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubePlaylistLink.m +++ b/Source/Clients/YouTube/GDataEntryYouTubePlaylistLink.m @@ -26,11 +26,11 @@ @implementation GDataEntryYouTubePlaylistLink + (GDataEntryYouTubePlaylistLink *)playlistLinkEntry { - + GDataEntryYouTubePlaylistLink *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } @@ -45,9 +45,9 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; // YouTube element extensions @@ -57,7 +57,7 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; if ([self isPrivate]) [items addObject:@"private"]; diff --git a/Source/Clients/YouTube/GDataEntryYouTubeRating.m b/Source/Clients/YouTube/GDataEntryYouTubeRating.m index e9191912..a46387e9 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeRating.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeRating.m @@ -42,9 +42,9 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; // YouTube element extensions @@ -54,9 +54,9 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + [self addToArray:items objectDescriptionIfNonNil:[self rating] withName:@"rating"]; return items; diff --git a/Source/Clients/YouTube/GDataEntryYouTubeSubscription.m b/Source/Clients/YouTube/GDataEntryYouTubeSubscription.m index 985ba308..3f3d61e5 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeSubscription.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeSubscription.m @@ -26,11 +26,11 @@ @implementation GDataEntryYouTubeSubscription + (GDataEntryYouTubeSubscription *)subscriptionEntry { - + GDataEntryYouTubeSubscription *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } @@ -45,11 +45,11 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; - + // YouTube element extensions [self addExtensionDeclarationForParentClass:entryClass childClasses: @@ -57,7 +57,7 @@ - (void)addExtensionDeclarations { [GDataYouTubeQueryString class], [GDataYouTubePlaylistTitle class], nil]; - + } #if !GDATA_SIMPLE_DESCRIPTIONS @@ -80,11 +80,11 @@ - (NSMutableArray *)itemsForDescription { #pragma mark - - (NSString *)subscriptionType { - + NSArray *subs; - + subs = [self categoriesWithScheme:kGDataSchemeYouTubeSubscription]; - + if ([subs count] > 0) { GDataCategory *subscription = [subs objectAtIndex:0]; NSString *term = [subscription term]; diff --git a/Source/Clients/YouTube/GDataEntryYouTubeUserProfile.m b/Source/Clients/YouTube/GDataEntryYouTubeUserProfile.m index afc1f81d..f9c26085 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeUserProfile.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeUserProfile.m @@ -26,11 +26,11 @@ @implementation GDataEntryYouTubeUserProfile + (GDataEntryYouTubeUserProfile *)userProfileEntry { - + GDataEntryYouTubeUserProfile *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } @@ -45,31 +45,31 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + [self addExtensionDeclarationForParentClass:[self class] childClasses: [GDataFeedLink class], - + // YouTube element extensions - [GDataYouTubeAge class], [GDataYouTubeBooks class], - [GDataYouTubeCompany class], [GDataYouTubeAboutMe class], - [GDataYouTubeGender class], [GDataYouTubeHobbies class], - [GDataYouTubeHometown class], [GDataYouTubeLocation class], - [GDataYouTubeMovies class], [GDataYouTubeMusic class], - [GDataYouTubeOccupation class], [GDataYouTubeRelationship class], + [GDataYouTubeAge class], [GDataYouTubeBooks class], + [GDataYouTubeCompany class], [GDataYouTubeAboutMe class], + [GDataYouTubeGender class], [GDataYouTubeHobbies class], + [GDataYouTubeHometown class], [GDataYouTubeLocation class], + [GDataYouTubeMovies class], [GDataYouTubeMusic class], + [GDataYouTubeOccupation class], [GDataYouTubeRelationship class], [GDataYouTubeSchool class], [GDataYouTubeUsername class], - [GDataYouTubeFirstName class], [GDataYouTubeLastName class], - [GDataYouTubeStatistics class], - + [GDataYouTubeFirstName class], [GDataYouTubeLastName class], + [GDataYouTubeStatistics class], + // media extensions [GDataMediaThumbnail class], nil]; } #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"statistics", @"statistics", kGDataDescValueLabeled }, { @"age", @"age", kGDataDescValueLabeled }, @@ -91,7 +91,7 @@ - (NSMutableArray *)itemsForDescription { { @"feedLinks", @"feedLinks", kGDataDescArrayCount }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; @@ -105,11 +105,11 @@ + (NSString *)defaultServiceVersion { #pragma mark - - (NSString *)channelType { - + NSArray *channelCats; - + channelCats = [self categoriesWithScheme:kGDataSchemeYouTubeChannel]; - + if ([channelCats count] > 0) { GDataCategory *category = [channelCats objectAtIndex:0]; NSString *term = [category term]; @@ -130,7 +130,7 @@ - (void)setStatistics:(GDataYouTubeStatistics *)obj { - (NSString *)aboutMe { GDATA_DEBUG_ASSERT_MIN_SERVICE_V2(); - + GDataYouTubeAboutMe *obj = [self objectForExtensionClass:[GDataYouTubeAboutMe class]]; return [obj stringValue]; } @@ -302,7 +302,7 @@ - (void)setLastName:(NSString *)str { } - (NSArray *)feedLinks { - return [self objectsForExtensionClass:[GDataFeedLink class]]; + return [self objectsForExtensionClass:[GDataFeedLink class]]; } #pragma mark Convenience accessors diff --git a/Source/Clients/YouTube/GDataEntryYouTubeVideo.m b/Source/Clients/YouTube/GDataEntryYouTubeVideo.m index 94724a78..3bc38b75 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeVideo.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeVideo.m @@ -26,11 +26,11 @@ @implementation GDataEntryYouTubeVideo + (GDataEntryYouTubeVideo *)videoEntry { - + GDataEntryYouTubeVideo *entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } @@ -45,31 +45,31 @@ + (void)load { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + Class entryClass = [self class]; [self addExtensionDeclarationForParentClass:entryClass childClasses: [GDataComment class], [GDataYouTubeRating class], - + // YouTube element extensions [GDataYouTubeStatistics class], [GDataYouTubeNonEmbeddable class], [GDataYouTubeLocation class], [GDataYouTubeRecordedDate class], [GDataYouTubeAccessControl class], - + // YouTubeMediaGroup encapsulates YouTubeMediaContent [GDataYouTubeMediaGroup class], nil]; - + // Geo [GDataGeo addGeoExtensionDeclarationsToObject:self - forParentClass:entryClass]; - + forParentClass:entryClass]; + // the publication state element is an extension to the Atom publishing // control element Class atomPubControlClass = [GDataAtomPubControl class]; @@ -220,14 +220,14 @@ - (GDataYouTubePublicationState *)publicationState { } - (void)setGDataYouTubePublicationState:(GDataYouTubePublicationState *)obj { - + GDataAtomPubControl *atomPubControl = [self atomPubControl]; - + if (obj != nil && atomPubControl == nil) { // to add the publication state, we need to make an atomPubControl element - atomPubControl = [GDataAtomPubControl atomPubControl]; + atomPubControl = [GDataAtomPubControl atomPubControl]; } - + [atomPubControl setObject:obj forExtensionClass:[GDataYouTubePublicationState class]]; } @@ -271,15 +271,15 @@ - (void)setGeoLocation:(GDataGeo *)geo { #pragma mark - - (GDataLink *)videoResponsesLink { - return [self linkWithRelAttributeValue:kGDataLinkYouTubeResponses]; + return [self linkWithRelAttributeValue:kGDataLinkYouTubeResponses]; } - (GDataLink *)ratingsLink { - return [self linkWithRelAttributeValue:kGDataLinkYouTubeRatings]; + return [self linkWithRelAttributeValue:kGDataLinkYouTubeRatings]; } - (GDataLink *)complaintsLink { - return [self linkWithRelAttributeValue:kGDataLinkYouTubeComplaints]; + return [self linkWithRelAttributeValue:kGDataLinkYouTubeComplaints]; } - (GDataLink *)captionTracksLink { diff --git a/Source/Clients/YouTube/GDataEntryYouTubeVideoMessage.m b/Source/Clients/YouTube/GDataEntryYouTubeVideoMessage.m index da63793f..92ae9cbc 100644 --- a/Source/Clients/YouTube/GDataEntryYouTubeVideoMessage.m +++ b/Source/Clients/YouTube/GDataEntryYouTubeVideoMessage.m @@ -25,13 +25,13 @@ @implementation GDataEntryYouTubeVideoMessage + (GDataEntryYouTubeVideoMessage *)videoMessageEntry { - + GDataEntryYouTubeVideoMessage *entry; - + entry = [self object]; [entry setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return entry; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeComment.h b/Source/Clients/YouTube/GDataFeedYouTubeComment.h index bb218a96..871fbf60 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeComment.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeComment.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeComment : GDataFeedBase +@interface GDataFeedYouTubeComment : GDataFeedBase + (GDataFeedYouTubeComment *)commentFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeComment.m b/Source/Clients/YouTube/GDataFeedYouTubeComment.m index 3ae06dc3..40a2ff4f 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeComment.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeComment.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeComment + (GDataFeedYouTubeComment *)commentFeed { - + GDataFeedYouTubeComment *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeComplaint.h b/Source/Clients/YouTube/GDataFeedYouTubeComplaint.h index a8248a46..6c376ba2 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeComplaint.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeComplaint.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeComplaint : GDataFeedBase +@interface GDataFeedYouTubeComplaint : GDataFeedBase + (GDataFeedYouTubeComplaint *)complaintFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeComplaint.m b/Source/Clients/YouTube/GDataFeedYouTubeComplaint.m index 251e6a89..9e828219 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeComplaint.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeComplaint.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeComplaint + (GDataFeedYouTubeComplaint *)complaintFeed { - + GDataFeedYouTubeComplaint *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeFriend.h b/Source/Clients/YouTube/GDataFeedYouTubeFriend.h index 2c01c51b..f5db88e4 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeFriend.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeFriend.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeFriend : GDataFeedBase +@interface GDataFeedYouTubeFriend : GDataFeedBase + (GDataFeedYouTubeFriend *)friendFeed; // to get the user profile link, use [[feed links] relatedLink] diff --git a/Source/Clients/YouTube/GDataFeedYouTubeFriend.m b/Source/Clients/YouTube/GDataFeedYouTubeFriend.m index 1b71a8bc..5742a93a 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeFriend.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeFriend.m @@ -26,11 +26,11 @@ @implementation GDataFeedYouTubeFriend + (GDataFeedYouTubeFriend *)friendFeed { - + GDataFeedYouTubeFriend *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubePlaylist.h b/Source/Clients/YouTube/GDataFeedYouTubePlaylist.h index d4a61fbe..7b549b5b 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubePlaylist.h +++ b/Source/Clients/YouTube/GDataFeedYouTubePlaylist.h @@ -22,7 +22,7 @@ #import "GDataFeedBase.h" #import "GDataYouTubeMediaElements.h" -@interface GDataFeedYouTubePlaylist : GDataFeedBase +@interface GDataFeedYouTubePlaylist : GDataFeedBase + (GDataFeedYouTubePlaylist *)playlistFeed; - (BOOL)isPrivate; diff --git a/Source/Clients/YouTube/GDataFeedYouTubePlaylist.m b/Source/Clients/YouTube/GDataFeedYouTubePlaylist.m index 2b23e001..b7c4e6e7 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubePlaylist.m +++ b/Source/Clients/YouTube/GDataFeedYouTubePlaylist.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubePlaylist + (GDataFeedYouTubePlaylist *)playlistFeed { - + GDataFeedYouTubePlaylist *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } @@ -58,9 +58,9 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + NSMutableArray *items = [super itemsForDescription]; - + if ([self isPrivate]) [items addObject:@"private"]; [self addToArray:items objectDescriptionIfNonNil:[self mediaGroup] withName:@"mediaGroup"]; diff --git a/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.h b/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.h index feca8f63..9cd427bd 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.h +++ b/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubePlaylistLink : GDataFeedBase +@interface GDataFeedYouTubePlaylistLink : GDataFeedBase + (GDataFeedYouTubePlaylistLink *)playlistLinkFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.m b/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.m index d7c44a3a..48a1c693 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.m +++ b/Source/Clients/YouTube/GDataFeedYouTubePlaylistLink.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubePlaylistLink + (GDataFeedYouTubePlaylistLink *)playlistLinkFeed { - + GDataFeedYouTubePlaylistLink *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeRating.h b/Source/Clients/YouTube/GDataFeedYouTubeRating.h index ff1e1a8e..2c18f3b1 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeRating.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeRating.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeRating : GDataFeedBase +@interface GDataFeedYouTubeRating : GDataFeedBase + (GDataFeedYouTubeRating *)ratingFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeRating.m b/Source/Clients/YouTube/GDataFeedYouTubeRating.m index c662d15f..f3613b71 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeRating.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeRating.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeRating + (GDataFeedYouTubeRating *)ratingFeed { - + GDataFeedYouTubeRating *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeSubscription.h b/Source/Clients/YouTube/GDataFeedYouTubeSubscription.h index 2ff09cd9..af04f26d 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeSubscription.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeSubscription.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeSubscription : GDataFeedBase +@interface GDataFeedYouTubeSubscription : GDataFeedBase + (GDataFeedYouTubeSubscription *)subscriptionFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeSubscription.m b/Source/Clients/YouTube/GDataFeedYouTubeSubscription.m index 8ce1d051..068a4749 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeSubscription.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeSubscription.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeSubscription + (GDataFeedYouTubeSubscription *)subscriptionFeed { - + GDataFeedYouTubeSubscription *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.h b/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.h index 4190dfcf..e1656a5d 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeUserProfile : GDataFeedBase +@interface GDataFeedYouTubeUserProfile : GDataFeedBase + (GDataFeedYouTubeUserProfile *)userProfileFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.m b/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.m index 265a4c85..a9fdce4f 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeUserProfile.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeUserProfile + (GDataFeedYouTubeUserProfile *)userProfileFeed { - + GDataFeedYouTubeUserProfile *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeVideo.h b/Source/Clients/YouTube/GDataFeedYouTubeVideo.h index b9cad362..3aac14e4 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeVideo.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeVideo.h @@ -21,7 +21,7 @@ #import "GDataFeedBase.h" -@interface GDataFeedYouTubeVideo : GDataFeedBase +@interface GDataFeedYouTubeVideo : GDataFeedBase + (GDataFeedYouTubeVideo *)videoFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeVideo.m b/Source/Clients/YouTube/GDataFeedYouTubeVideo.m index a1660fed..468667eb 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeVideo.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeVideo.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeVideo + (GDataFeedYouTubeVideo *)videoFeed { - + GDataFeedYouTubeVideo *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.h b/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.h index 34d2ab03..8734351a 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.h +++ b/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.h @@ -25,7 +25,7 @@ // but this feed class derives just from GDataFeedBase, not from the // video feed class -@interface GDataFeedYouTubeVideoMessage : GDataFeedBase +@interface GDataFeedYouTubeVideoMessage : GDataFeedBase + (GDataFeedYouTubeVideoMessage *)videoMessageFeed; @end diff --git a/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.m b/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.m index 2d2a9b63..f1a09f49 100644 --- a/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.m +++ b/Source/Clients/YouTube/GDataFeedYouTubeVideoMessage.m @@ -25,11 +25,11 @@ @implementation GDataFeedYouTubeVideoMessage + (GDataFeedYouTubeVideoMessage *)videoMessageFeed { - + GDataFeedYouTubeVideoMessage *feed = [self object]; - + [feed setNamespaces:[GDataYouTubeConstants youTubeNamespaces]]; - + return feed; } diff --git a/Source/Clients/YouTube/GDataQueryYouTube.h b/Source/Clients/YouTube/GDataQueryYouTube.h index 7527b210..d0190882 100644 --- a/Source/Clients/YouTube/GDataQueryYouTube.h +++ b/Source/Clients/YouTube/GDataQueryYouTube.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAQUERYYOUTUBE_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -50,8 +50,8 @@ _EXTERN NSString* const kGDataYouTubeCaptionTrackFormatSubrip _INITIALIZE_AS // http://code.google.com/apis/youtube/reference.html#Parameters -@interface GDataQueryYouTube : GDataQuery - +@interface GDataQueryYouTube : GDataQuery + + (GDataQueryYouTube *)youTubeQueryWithFeedURL:(NSURL *)feedURL; - (void)setVideoQuery:(NSString *)str; diff --git a/Source/Clients/YouTube/GDataQueryYouTube.m b/Source/Clients/YouTube/GDataQueryYouTube.m index 3a225a66..3431e61b 100644 --- a/Source/Clients/YouTube/GDataQueryYouTube.m +++ b/Source/Clients/YouTube/GDataQueryYouTube.m @@ -40,7 +40,7 @@ @implementation GDataQueryYouTube + (GDataQueryYouTube *)youTubeQueryWithFeedURL:(NSURL *)feedURL { - return [self queryWithFeedURL:feedURL]; + return [self queryWithFeedURL:feedURL]; } diff --git a/Source/Clients/YouTube/GDataServiceGoogleYouTube.h b/Source/Clients/YouTube/GDataServiceGoogleYouTube.h index d3232a00..e584dca5 100644 --- a/Source/Clients/YouTube/GDataServiceGoogleYouTube.h +++ b/Source/Clients/YouTube/GDataServiceGoogleYouTube.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATASERVICEYOUTUBE_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -68,7 +68,7 @@ _EXTERN NSString* const kGDataYouTubeUserFeedIDRecommendations _INITIALIZE // how the account was created. @interface GDataServiceGoogleYouTube : GDataServiceGoogle { - NSString *developerKey_; // required for uploading + NSString *developerKey_; // required for uploading } + (NSString *)serviceRootURLString; @@ -96,11 +96,11 @@ _EXTERN NSString* const kGDataYouTubeUserFeedIDRecommendations _INITIALIZE // Note: // // A developer key is required for uploading, and for updating or deleting -// videos. Entries in feeds retrieved without a developer key will -// not have edit links. +// videos. Entries in feeds retrieved without a developer key will +// not have edit links. - (NSString *)youTubeDeveloperKey; - (void)setYouTubeDeveloperKey:(NSString *)str; - + // clients may use these fetch methods of GDataServiceGoogle // // - (GDataServiceTicket *)fetchFeedWithURL:(NSURL *)feedURL delegate:(id)delegate didFinishSelector:(SEL)finishedSelector; @@ -120,7 +120,7 @@ _EXTERN NSString* const kGDataYouTubeUserFeedIDRecommendations _INITIALIZE // // The class of the returned feed or entry is determined by the URL fetched. -+ (NSString *)serviceRootURLString; ++ (NSString *)serviceRootURLString; + (NSString *)serviceUploadRootURLString; diff --git a/Source/Clients/YouTube/GDataYouTube.h b/Source/Clients/YouTube/GDataYouTube.h index e74e7be2..6fd2ebc8 100644 --- a/Source/Clients/YouTube/GDataYouTube.h +++ b/Source/Clients/YouTube/GDataYouTube.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GDataYouTube.h // diff --git a/Source/Clients/YouTube/GDataYouTubeElements.m b/Source/Clients/YouTube/GDataYouTubeElements.m index 8de79964..8255298f 100644 --- a/Source/Clients/YouTube/GDataYouTubeElements.m +++ b/Source/Clients/YouTube/GDataYouTubeElements.m @@ -47,7 +47,7 @@ + (NSString *)extensionElementLocalName { return @"aspectRatio"; } @end // user's books, like Pride and Prejudice -@implementation GDataYouTubeBooks +@implementation GDataYouTubeBooks + (NSString *)extensionElementURI { return kGDataNamespaceYouTube; } + (NSString *)extensionElementPrefix { return kGDataNamespaceYouTubePrefix; } + (NSString *)extensionElementLocalName { return @"books"; } diff --git a/Source/Clients/YouTube/GDataYouTubeMediaElements.h b/Source/Clients/YouTube/GDataYouTubeMediaElements.h index 96d6eda6..30e08b78 100644 --- a/Source/Clients/YouTube/GDataYouTubeMediaElements.h +++ b/Source/Clients/YouTube/GDataYouTubeMediaElements.h @@ -24,7 +24,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAYOUTUBEMEDIAELEMENTS_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -38,7 +38,7 @@ _EXTERN const int kGDataYouTubeMediaContentFormatMobileRTSPStream _INITIALIZE_AS #import "GDataMedia.h" #import "GDataYouTubeElements.h" -// media content with YouTube's addition of an integer format attribute, +// media content with YouTube's addition of an integer format attribute, // like yt:format="1" // // Note: iPhone seems to support playback of RTSP streams (formats 1 and 6) @@ -48,7 +48,7 @@ _EXTERN const int kGDataYouTubeMediaContentFormatMobileRTSPStream _INITIALIZE_AS - (void)setYouTubeFormatNumber:(NSNumber *)num; @end -// media rating with YouTube's addition of a country attribute, +// media rating with YouTube's addition of a country attribute, // like yt:country="USA" @interface GDataMediaRating (YouTubeExtensions) - (NSString *)youTubeCountry; diff --git a/Source/Clients/YouTube/GDataYouTubeMediaElements.m b/Source/Clients/YouTube/GDataYouTubeMediaElements.m index def1e313..638de86e 100644 --- a/Source/Clients/YouTube/GDataYouTubeMediaElements.m +++ b/Source/Clients/YouTube/GDataYouTubeMediaElements.m @@ -35,11 +35,11 @@ + (NSString *)extensionElementLocalName { return @"format"; } @implementation GDataMediaContent (YouTubeExtensions) -// media content with YouTube's addition of an integer format attribute, +// media content with YouTube's addition of an integer format attribute, // like yt:format="1" - (NSNumber *)youTubeFormatNumber { NSString *str = [self attributeValueForExtensionClass:[GDataYouTubeFormatAttribute class]]; - NSNumber *number = [NSNumber numberWithInt:[str intValue]]; + NSNumber *number = [NSNumber numberWithInt:[str intValue]]; return number; } @@ -86,7 +86,7 @@ + (NSString *)extensionElementLocalName { return @"country"; } @implementation GDataMediaRating (YouTubeExtensions) -// media rating with YouTube's addition of a country attribute, +// media rating with YouTube's addition of a country attribute, // like yt:country="USA" - (NSString *)youTubeCountry { NSString *str = [self attributeValueForExtensionClass:[GDataYouTubeCountryAttribute class]]; @@ -111,7 +111,7 @@ + (NSString *)extensionElementLocalName { return @"type"; } @end @implementation GDataMediaCredit (YouTubeExtensions) -// media credit with YouTube's addition of a type attribute, +// media credit with YouTube's addition of a type attribute, // like yt:type="partner" - (NSString *)youTubeCreditType { NSString *str = [self attributeValueForExtensionClass:[GDataYouTubeTypeAttribute class]]; @@ -129,9 +129,9 @@ @implementation GDataYouTubeMediaGroup // a media group with YouTube extensions - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + [self addExtensionDeclarationForParentClass:[self class] childClasses: [GDataYouTubeAspectRatio class], @@ -140,7 +140,7 @@ - (void)addExtensionDeclarations { [GDataYouTubeVideoID class], [GDataYouTubeUploadedDate class], nil]; - + // add the yt:format attribute to GDataMediaContent [self addAttributeExtensionDeclarationForParentClass:[GDataMediaContent class] childClass:[GDataYouTubeFormatAttribute class]]; @@ -205,7 +205,7 @@ - (void)setIsPrivate:(BOOL)flag { // videoID available in v2.0 - (NSString *)videoID { GDataYouTubeVideoID *obj; - + obj = [self objectForExtensionClass:[GDataYouTubeVideoID class]]; return [obj stringValue]; } @@ -218,7 +218,7 @@ - (void)setVideoID:(NSString *)str { // uploadedDate available in v2.0 - (GDataDateTime *)uploadedDate { GDataYouTubeUploadedDate *obj; - + obj = [self objectForExtensionClass:[GDataYouTubeUploadedDate class]]; return [obj dateTimeValue]; } diff --git a/Source/Clients/YouTube/GDataYouTubePublicationState.h b/Source/Clients/YouTube/GDataYouTubePublicationState.h index 74984bf1..a5108f76 100644 --- a/Source/Clients/YouTube/GDataYouTubePublicationState.h +++ b/Source/Clients/YouTube/GDataYouTubePublicationState.h @@ -39,8 +39,8 @@ _EXTERN NSString* const kGDataYouTubePubStateDeleted _INITIALIZE_AS(@"deleted _EXTERN NSString* const kGDataYouTubePubStateRestricted _INITIALIZE_AS(@"restricted"); -// yt:state is an extension to GDataAtomPubControl for YouTube video entries, -// as in +// yt:state is an extension to GDataAtomPubControl for YouTube video entries, +// as in // // // diff --git a/Source/Clients/YouTube/GDataYouTubePublicationState.m b/Source/Clients/YouTube/GDataYouTubePublicationState.m index 913d1e83..a0c37140 100644 --- a/Source/Clients/YouTube/GDataYouTubePublicationState.m +++ b/Source/Clients/YouTube/GDataYouTubePublicationState.m @@ -19,8 +19,8 @@ #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE -// yt:state is an extension to GDataAtomPubControl for YouTube video entries, -// as in +// yt:state is an extension to GDataAtomPubControl for YouTube video entries, +// as in // // // @@ -37,18 +37,18 @@ static NSString *const kReasonCodeAttr = @"reasonCode"; static NSString *const kHelpURLAttr = @"helpUrl"; -@implementation GDataYouTubePublicationState +@implementation GDataYouTubePublicationState + (NSString *)extensionElementURI { return kGDataNamespaceYouTube; } + (NSString *)extensionElementPrefix { return kGDataNamespaceYouTubePrefix; } + (NSString *)extensionElementLocalName { return @"state"; } - (void)addParseDeclarations { - + NSArray *attrs = [NSArray arrayWithObjects: kNameAttr, kReasonCodeAttr, kHelpURLAttr, nil]; - - [self addLocalAttributeDeclarations:attrs]; + + [self addLocalAttributeDeclarations:attrs]; [self addContentValueDeclaration]; } @@ -80,7 +80,7 @@ - (void)setHelpURLString:(NSString *)str { } - (NSString *)errorDescription { - return [self contentStringValue]; + return [self contentStringValue]; } - (void)setErrorDescription:(NSString *)str { diff --git a/Source/Clients/YouTube/GDataYouTubeStatistics.h b/Source/Clients/YouTube/GDataYouTubeStatistics.h index ae81df32..c2171e96 100644 --- a/Source/Clients/YouTube/GDataYouTubeStatistics.h +++ b/Source/Clients/YouTube/GDataYouTubeStatistics.h @@ -22,11 +22,11 @@ #import "GDataObject.h" #import "GDataDateTime.h" -// -@interface GDataYouTubeStatistics : GDataObject +@interface GDataYouTubeStatistics : GDataObject + (GDataYouTubeStatistics *)youTubeStatistics; // long long value diff --git a/Source/Clients/YouTube/GDataYouTubeStatistics.m b/Source/Clients/YouTube/GDataYouTubeStatistics.m index 3cc93e01..6154b60f 100644 --- a/Source/Clients/YouTube/GDataYouTubeStatistics.m +++ b/Source/Clients/YouTube/GDataYouTubeStatistics.m @@ -29,9 +29,9 @@ static NSString* const kLastWebAccessAttr = @"lastWebAccess"; static NSString* const kTotalUploadViewsAttr = @"totalUploadViews"; -@implementation GDataYouTubeStatistics -// + (NSString *)extensionElementURI { return kGDataNamespaceYouTube; } @@ -44,31 +44,31 @@ + (GDataYouTubeStatistics *)youTubeStatistics { } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: + + NSArray *attrs = [NSArray arrayWithObjects: kViewCountAttr, kVideoWatchCountAttr, kSubscriberCountAttr, kFavoriteCountAttr, kLastWebAccessAttr, kTotalUploadViewsAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } - (void)addAttributesToElement:(NSXMLElement *)element { - + // this overrides the base class's method // // as in the java, skip adding attributes that are zero - + NSString *name; NSDictionary *attributes = [self attributes]; NSEnumerator *enumerator = [attributes keyEnumerator]; while ((name = [enumerator nextObject]) != nil) { - + NSString *value = [attributes valueForKey:name]; - + // add it if it's not "0" if (![value isEqual:@"0"]) { - + [self addToElement:element attributeValueIfNonNil:value withName:name]; } } @@ -109,7 +109,7 @@ - (void)setFavoriteCount:(NSNumber *)num { } - (GDataDateTime *)lastWebAccess { - return [self dateTimeForAttribute:kLastWebAccessAttr]; + return [self dateTimeForAttribute:kLastWebAccessAttr]; } - (void)setLastWebAccess:(GDataDateTime *)dateTime { diff --git a/Source/Elements/GDataMoney.m b/Source/Elements/GDataMoney.m index 97be632c..ed3540fc 100644 --- a/Source/Elements/GDataMoney.m +++ b/Source/Elements/GDataMoney.m @@ -41,9 +41,9 @@ + (GDataMoney *)moneyWithAmount:(NSNumber *)amount } - (void)addParseDeclarations { - NSArray *attrs = [NSArray arrayWithObjects: + NSArray *attrs = [NSArray arrayWithObjects: kAmountAttr, kCurrencyCodeAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } @@ -58,7 +58,7 @@ - (void)setAmount:(NSNumber *)num { } - (NSString *)currencyCode { - return [self stringValueForAttribute:kCurrencyCodeAttr]; + return [self stringValueForAttribute:kCurrencyCodeAttr]; } - (void)setCurrencyCode:(NSString *)str { diff --git a/Source/Elements/GDataName.m b/Source/Elements/GDataName.m index acc1be88..33d10134 100644 --- a/Source/Elements/GDataName.m +++ b/Source/Elements/GDataName.m @@ -93,7 +93,7 @@ @implementation GDataNameElement + (id)nameElementWithString:(NSString *)str { // the contacts API does not want empty name elements if ([str length] == 0) return nil; - + GDataNameElement *obj = [self object]; [obj setStringValue:str]; return obj; diff --git a/Source/GData.h b/Source/GData.h index 2814a9f8..e8fee11e 100644 --- a/Source/GData.h +++ b/Source/GData.h @@ -13,7 +13,7 @@ * limitations under the License. */ -// +// // GData.h // diff --git a/Source/Introspection/GDataAtomCategoryGroup.m b/Source/Introspection/GDataAtomCategoryGroup.m index f844e538..6a4425b3 100644 --- a/Source/Introspection/GDataAtomCategoryGroup.m +++ b/Source/Introspection/GDataAtomCategoryGroup.m @@ -68,7 +68,7 @@ - (NSMutableArray *)itemsForDescription { { @"categories", @"categories", kGDataDescArrayDescs }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; diff --git a/Source/Introspection/GDataAtomCollection.m b/Source/Introspection/GDataAtomCollection.m index 1342cffe..cefb4814 100644 --- a/Source/Introspection/GDataAtomCollection.m +++ b/Source/Introspection/GDataAtomCollection.m @@ -79,7 +79,7 @@ - (NSMutableArray *)itemsForDescription { { @"accepts", @"serviceAcceptStrings", kGDataDescArrayDescs }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; diff --git a/Source/Introspection/GDataAtomServiceDocument.m b/Source/Introspection/GDataAtomServiceDocument.m index 37aa1fb5..011d7145 100644 --- a/Source/Introspection/GDataAtomServiceDocument.m +++ b/Source/Introspection/GDataAtomServiceDocument.m @@ -37,12 +37,12 @@ - (void)addExtensionDeclarations { #if !GDATA_SIMPLE_DESCRIPTIONS - (NSMutableArray *)itemsForDescription { - + static struct GDataDescriptionRecord descRecs[] = { { @"workspaces", @"workspaces", kGDataDescArrayDescs }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; diff --git a/Source/Introspection/GDataAtomWorkspace.m b/Source/Introspection/GDataAtomWorkspace.m index e9d68d4c..9db3238d 100644 --- a/Source/Introspection/GDataAtomWorkspace.m +++ b/Source/Introspection/GDataAtomWorkspace.m @@ -47,7 +47,7 @@ - (NSMutableArray *)itemsForDescription { { @"collections", @"collections", kGDataDescArrayDescs }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; diff --git a/Source/Media/GDataMediaCategory.m b/Source/Media/GDataMediaCategory.m index 68898a36..914128d2 100644 --- a/Source/Media/GDataMediaCategory.m +++ b/Source/Media/GDataMediaCategory.m @@ -42,12 +42,12 @@ + (GDataMediaCategory *)mediaCategoryWithString:(NSString *)str { } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: + + NSArray *attrs = [NSArray arrayWithObjects: kLabelAttr, kSchemeAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; - + [self addContentValueDeclaration]; } diff --git a/Source/Media/GDataMediaContent.h b/Source/Media/GDataMediaContent.h index 4c42761b..8fb00985 100644 --- a/Source/Media/GDataMediaContent.h +++ b/Source/Media/GDataMediaContent.h @@ -24,20 +24,20 @@ // media:content element // -// // // http://search.yahoo.com/mrss diff --git a/Source/Media/GDataMediaContent.m b/Source/Media/GDataMediaContent.m index 3fa47c32..4f6c8a83 100644 --- a/Source/Media/GDataMediaContent.m +++ b/Source/Media/GDataMediaContent.m @@ -41,20 +41,20 @@ @implementation GDataMediaContent // media:content element // -// // // http://search.yahoo.com/mrss @@ -65,21 +65,21 @@ + (NSString *)extensionElementPrefix { return kGDataNamespaceMediaPrefix; } + (NSString *)extensionElementLocalName { return @"content"; } + (GDataMediaContent *)mediaContentWithURLString:(NSString *)urlString { - + GDataMediaContent *obj = [self object]; [obj setURLString:urlString]; return obj; } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: - kURLAttr, kFileSizeAttr, kTypeAttr, - kMediumAttr, kIsDefaultAttr, kExpressionAttr, + + NSArray *attrs = [NSArray arrayWithObjects: + kURLAttr, kFileSizeAttr, kTypeAttr, + kMediumAttr, kIsDefaultAttr, kExpressionAttr, kBitrateAttr, kFramerateAttr, kSamplingRateAttr, kChannelsAttr, kDurationAttr, kHeightAttr, kWidthAttr, kLangAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } @@ -115,7 +115,7 @@ - (void)setMedium:(NSString *)str { - (NSNumber *)isDefault { BOOL flag = [self boolValueForAttribute:kIsDefaultAttr defaultValue:NO]; - return flag ? [NSNumber numberWithBool:flag] : nil; + return flag ? [NSNumber numberWithBool:flag] : nil; } - (void)setIsDefault:(NSNumber *)num { BOOL flag = [num boolValue]; @@ -179,7 +179,7 @@ - (void)setWidth:(NSNumber *)num { } - (NSString *)lang { - return [self stringValueForAttribute:kLangAttr]; + return [self stringValueForAttribute:kLangAttr]; } - (void)setLang:(NSString *)str { [self setStringValue:str forAttribute:kLangAttr]; diff --git a/Source/Media/GDataMediaCredit.m b/Source/Media/GDataMediaCredit.m index dd5e6224..6c469817 100644 --- a/Source/Media/GDataMediaCredit.m +++ b/Source/Media/GDataMediaCredit.m @@ -41,12 +41,12 @@ + (GDataMediaCredit *)mediaCreditWithString:(NSString *)str { } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: + + NSArray *attrs = [NSArray arrayWithObjects: kRoleAttr, kSchemeAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; - + [self addContentValueDeclaration]; } diff --git a/Source/Media/GDataMediaGroup.h b/Source/Media/GDataMediaGroup.h index d619acc9..6c668081 100644 --- a/Source/Media/GDataMediaGroup.h +++ b/Source/Media/GDataMediaGroup.h @@ -26,7 +26,7 @@ #undef _EXTERN #undef _INITIALIZE_AS #ifdef GDATAMEDIAGROUP_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GDATA_EXTERN @@ -61,7 +61,7 @@ _EXTERN NSString* const kGDataNamespaceMediaPrefix _INITIALIZE_AS(@"media"); @end -// for media:group, like +// for media:group, like // // TODO: Currently, just the set needed for Google Photos is implemented @@ -69,7 +69,7 @@ _EXTERN NSString* const kGDataNamespaceMediaPrefix _INITIALIZE_AS(@"media"); // MediaCopyright // MediaHash // MediaText -// +// @interface GDataMediaGroup : GDataObject @@ -79,11 +79,11 @@ _EXTERN NSString* const kGDataNamespaceMediaPrefix _INITIALIZE_AS(@"media"); - (NSArray *)mediaCategories; - (void)setMediaCategories:(NSArray *)array; -- (void)addMediaCategory:(GDataMediaCategory *)attribute; +- (void)addMediaCategory:(GDataMediaCategory *)attribute; - (NSArray *)mediaContents; - (void)setMediaContents:(NSArray *)array; -- (void)addMediaContent:(GDataMediaContent *)attribute; +- (void)addMediaContent:(GDataMediaContent *)attribute; - (NSArray *)mediaCredits; - (void)setMediaCredits:(NSArray *)array; @@ -110,7 +110,7 @@ _EXTERN NSString* const kGDataNamespaceMediaPrefix _INITIALIZE_AS(@"media"); - (GDataMediaDescription *)mediaDescription; - (void)setMediaDescription:(GDataMediaDescription *)obj; - + - (GDataMediaTitle *)mediaTitle; - (void)setMediaTitle:(GDataMediaTitle *)obj; diff --git a/Source/Media/GDataMediaGroup.m b/Source/Media/GDataMediaGroup.m index 0ac750d6..9c9f797d 100644 --- a/Source/Media/GDataMediaGroup.m +++ b/Source/Media/GDataMediaGroup.m @@ -49,7 +49,7 @@ + (NSString *)extensionElementLocalName { return @"title"; } @implementation GDataMediaGroup -// for media:group, like +// for media:group, like // + (NSString *)extensionElementURI { return kGDataNamespaceMedia; } @@ -64,9 +64,9 @@ + (id)mediaGroup { } - (void)addExtensionDeclarations { - + [super addExtensionDeclarations]; - + [self addExtensionDeclarationForParentClass:[self class] childClasses: [GDataMediaContent class], @@ -79,8 +79,8 @@ - (void)addExtensionDeclarations { [GDataMediaThumbnail class], [GDataMediaKeywords class], [GDataMediaTitle class], - nil]; - + nil]; + // still unsupported: // MediaCopyright, MediaHash, MediaText } @@ -121,11 +121,11 @@ - (NSArray *)mediaCategories { } - (void)setMediaCategories:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaCategory class]]; + [self setObjects:array forExtensionClass:[GDataMediaCategory class]]; } - (void)addMediaCategory:(GDataMediaCategory *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaCategory class]]; + [self addObject:attribute forExtensionClass:[GDataMediaCategory class]]; } // MediaContents @@ -136,11 +136,11 @@ - (NSArray *)mediaContents { } - (void)setMediaContents:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaContent class]]; + [self setObjects:array forExtensionClass:[GDataMediaContent class]]; } - (void)addMediaContent:(GDataMediaContent *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaContent class]]; + [self addObject:attribute forExtensionClass:[GDataMediaContent class]]; } // MediaCredits @@ -151,11 +151,11 @@ - (NSArray *)mediaCredits { } - (void)setMediaCredits:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaCredit class]]; + [self setObjects:array forExtensionClass:[GDataMediaCredit class]]; } - (void)addMediaCredit:(GDataMediaCredit *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaCredit class]]; + [self addObject:attribute forExtensionClass:[GDataMediaCredit class]]; } // MediaPlayers @@ -166,11 +166,11 @@ - (NSArray *)mediaPlayers { } - (void)setMediaPlayers:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaPlayer class]]; + [self setObjects:array forExtensionClass:[GDataMediaPlayer class]]; } - (void)addMediaPlayer:(GDataMediaPlayer *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaPlayer class]]; + [self addObject:attribute forExtensionClass:[GDataMediaPlayer class]]; } // MediaRatings @@ -181,11 +181,11 @@ - (NSArray *)mediaRatings { } - (void)setMediaRatings:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaRating class]]; + [self setObjects:array forExtensionClass:[GDataMediaRating class]]; } - (void)addMediaRating:(GDataMediaRating *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaRating class]]; + [self addObject:attribute forExtensionClass:[GDataMediaRating class]]; } // MediaRatings @@ -196,11 +196,11 @@ - (NSArray *)mediaRestrictions { } - (void)setMediaRestrictions:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaRestriction class]]; + [self setObjects:array forExtensionClass:[GDataMediaRestriction class]]; } - (void)addMediaRestriction:(GDataMediaRestriction *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaRestriction class]]; + [self addObject:attribute forExtensionClass:[GDataMediaRestriction class]]; } // MediaThumbnails @@ -211,35 +211,35 @@ - (NSArray *)mediaThumbnails { } - (void)setMediaThumbnails:(NSArray *)array { - [self setObjects:array forExtensionClass:[GDataMediaThumbnail class]]; + [self setObjects:array forExtensionClass:[GDataMediaThumbnail class]]; } - (void)addMediaThumbnail:(GDataMediaThumbnail *)attribute { - [self addObject:attribute forExtensionClass:[GDataMediaThumbnail class]]; + [self addObject:attribute forExtensionClass:[GDataMediaThumbnail class]]; } // MediaKeywords - (GDataMediaKeywords *)mediaKeywords { - GDataMediaKeywords *obj = + GDataMediaKeywords *obj = [self objectForExtensionClass:[GDataMediaKeywords class]]; return obj; } - (void)setMediaKeywords:(GDataMediaKeywords *)obj { - [self setObject:obj forExtensionClass:[GDataMediaKeywords class]]; + [self setObject:obj forExtensionClass:[GDataMediaKeywords class]]; } // MediaDescription - (GDataMediaDescription *)mediaDescription { - GDataMediaDescription *obj = + GDataMediaDescription *obj = [self objectForExtensionClass:[GDataMediaDescription class]]; return obj; } - (void)setMediaDescription:(GDataMediaDescription *)obj { - [self setObject:obj forExtensionClass:[GDataMediaDescription class]]; + [self setObject:obj forExtensionClass:[GDataMediaDescription class]]; } // MediaTitle @@ -251,7 +251,7 @@ - (GDataMediaTitle *)mediaTitle { } - (void)setMediaTitle:(GDataMediaTitle *)obj { - [self setObject:obj forExtensionClass:[GDataMediaTitle class]]; + [self setObject:obj forExtensionClass:[GDataMediaTitle class]]; } @end diff --git a/Source/Media/GDataMediaKeywords.m b/Source/Media/GDataMediaKeywords.m index 05fb1958..6657ac12 100644 --- a/Source/Media/GDataMediaKeywords.m +++ b/Source/Media/GDataMediaKeywords.m @@ -44,7 +44,7 @@ + (GDataMediaKeywords *)keywordsWithStrings:(NSArray *)array { + (GDataMediaKeywords *)keywordsWithString:(NSString *)str { // takes a string with a comma-separated list of keywords GDataMediaKeywords* obj = [self object]; - + NSArray *array = [GDataMediaKeywords keywordsFromString:str]; [obj setKeywords:array]; return obj; @@ -57,7 +57,7 @@ - (NSMutableArray *)itemsForDescription { { @"keywords", @"stringValue", kGDataDescValueLabeled }, { nil, nil, (GDataDescRecTypes)0 } }; - + NSMutableArray *items = [super itemsForDescription]; [self addDescriptionRecords:descRecs toItems:items]; return items; diff --git a/Source/Media/GDataMediaPlayer.h b/Source/Media/GDataMediaPlayer.h index 558028c8..1e271845 100644 --- a/Source/Media/GDataMediaPlayer.h +++ b/Source/Media/GDataMediaPlayer.h @@ -38,7 +38,7 @@ - (void)setHeight:(NSNumber *)num; - (NSNumber *)width; // int -- (void)setWidth:(NSNumber *)num; +- (void)setWidth:(NSNumber *)num; @end #endif // #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_*_SERVICE diff --git a/Source/Media/GDataMediaPlayer.m b/Source/Media/GDataMediaPlayer.m index 923746bf..6476d39c 100644 --- a/Source/Media/GDataMediaPlayer.m +++ b/Source/Media/GDataMediaPlayer.m @@ -43,10 +43,10 @@ + (GDataMediaPlayer *)mediaPlayerWithURLString:(NSString *)str { } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: + + NSArray *attrs = [NSArray arrayWithObjects: kURLAttr, kHeightAttr, kWidthAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } diff --git a/Source/Media/GDataMediaRating.m b/Source/Media/GDataMediaRating.m index 846d1620..9ac089f2 100644 --- a/Source/Media/GDataMediaRating.m +++ b/Source/Media/GDataMediaRating.m @@ -40,11 +40,11 @@ + (GDataMediaRating *)mediaRatingWithString:(NSString *)str { } - (void)addParseDeclarations { - + NSArray *attrs = [NSArray arrayWithObject:kSchemeAttr]; - + [self addLocalAttributeDeclarations:attrs]; - + [self addContentValueDeclaration]; } diff --git a/Source/Media/GDataMediaRestriction.m b/Source/Media/GDataMediaRestriction.m index bcf5cb7b..e781292b 100644 --- a/Source/Media/GDataMediaRestriction.m +++ b/Source/Media/GDataMediaRestriction.m @@ -46,12 +46,12 @@ + (GDataMediaRestriction *)mediaRestrictionWithString:(NSString *)str } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: + + NSArray *attrs = [NSArray arrayWithObjects: kRelationshipAttr, kTypeAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; - + [self addContentValueDeclaration]; } diff --git a/Source/Media/GDataMediaThumbnail.h b/Source/Media/GDataMediaThumbnail.h index 4ea55153..58e21056 100644 --- a/Source/Media/GDataMediaThumbnail.h +++ b/Source/Media/GDataMediaThumbnail.h @@ -25,7 +25,7 @@ // media:thumbnail element // -// // // http://search.yahoo.com/mrss diff --git a/Source/Media/GDataMediaThumbnail.m b/Source/Media/GDataMediaThumbnail.m index 558864a5..bf74a619 100644 --- a/Source/Media/GDataMediaThumbnail.m +++ b/Source/Media/GDataMediaThumbnail.m @@ -31,7 +31,7 @@ @implementation GDataMediaThumbnail // media:thumbnail element // -// // // http://search.yahoo.com/mrss @@ -42,17 +42,17 @@ + (NSString *)extensionElementPrefix { return kGDataNamespaceMediaPrefix; } + (NSString *)extensionElementLocalName { return @"thumbnail"; } + (GDataMediaThumbnail *)mediaContentWithURL:(NSString *)urlString { - + GDataMediaThumbnail *obj = [self object]; [obj setURLString:urlString]; return obj; } - (void)addParseDeclarations { - - NSArray *attrs = [NSArray arrayWithObjects: + + NSArray *attrs = [NSArray arrayWithObjects: kURLAttr, kHeightAttr, kWidthAttr, kTimeAttr, nil]; - + [self addLocalAttributeDeclarations:attrs]; } @@ -83,19 +83,19 @@ - (void)setWidth:(NSNumber *)num { } - (GDataNormalPlayTime *)time { - + GDataNormalPlayTime *playTime = nil; - + NSString *timeStr = [self stringValueForAttribute:kTimeAttr]; if ([timeStr length] > 0) { playTime = [GDataNormalPlayTime normalPlayTimeWithString:timeStr]; } - + return playTime; } - (void)setTime:(GDataNormalPlayTime *)playTime { - + NSString *timeStr = [[self time] HHMMSSString]; [self setStringValue:timeStr forAttribute:kTimeAttr]; diff --git a/Source/Media/GDataNormalPlayTime.m b/Source/Media/GDataNormalPlayTime.m index 826c45ae..d6053300 100644 --- a/Source/Media/GDataNormalPlayTime.m +++ b/Source/Media/GDataNormalPlayTime.m @@ -23,9 +23,9 @@ @implementation GDataNormalPlayTime + (GDataNormalPlayTime *)normalPlayTimeWithString:(NSString *)str { - + GDataNormalPlayTime *npt = [[[GDataNormalPlayTime alloc] init] autorelease]; - + [npt setFromString:str]; return npt; } @@ -41,29 +41,29 @@ - (void)setTimeOffsetInMilliseconds:(long long)ms { } - (BOOL)isNow { - return isNow_; + return isNow_; } - (void)setIsNow:(BOOL)isNow { - isNow_ = isNow; + isNow_ = isNow; } - (NSString *)HHMMSSString { // hh:mm:ss.fraction or "now" if (isNow_) { return kNowString; } - + long fractional = (long) (ms_ % 1000LL); long totalSeconds = (long) (ms_ / 1000LL); long seconds = totalSeconds % 60L; long totalMinutes = totalSeconds / 60L; long minutes = totalMinutes % 60L; long hours = totalMinutes / 60L; - + if (fractional > 0) { return [NSString stringWithFormat:@"%ld:%02ld:%02ld.%03ld", hours, minutes, seconds, fractional]; - } + } return [NSString stringWithFormat:@"%ld:%02ld:%02ld", hours, minutes, seconds]; } @@ -74,7 +74,7 @@ - (NSString *)secondsString { // seconds.fraction or "now" } int seconds = (int) (ms_ / 1000LL); int fractional = (int) (ms_ % 1000LL); - + if (fractional == 0) { return [NSString stringWithFormat:@"%d", seconds]; } @@ -84,47 +84,47 @@ - (NSString *)secondsString { // seconds.fraction or "now" - (void)setFromString:(NSString *)str { NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; NSString *trimmedStr = [str stringByTrimmingCharactersInSet:whitespace]; - + // handle "now" if ([trimmedStr caseInsensitiveCompare:@"now"] == NSOrderedSame) { isNow_ = YES; ms_ = -1; return; } - + // parse hh:mm:ss.fff or ss.fff into milliseconds long seconds = 0; long thousandths = 0; - + NSScanner *scanner = [NSScanner scannerWithString:str]; NSCharacterSet *period = [NSCharacterSet characterSetWithCharactersInString:@"."]; NSCharacterSet *colon = [NSCharacterSet characterSetWithCharactersInString:@":"]; - + int scannedInt; if ([scanner scanInt:&scannedInt]) { seconds = scannedInt; - + if ([scanner scanCharactersFromSet:colon intoString:NULL] && [scanner scanInt:&scannedInt]) { // push seconds to minutes seconds = seconds * 60 + scannedInt; } - + if ([scanner scanCharactersFromSet:colon intoString:NULL] && [scanner scanInt:&scannedInt]) { // push minutes to hours, seconds to minutes seconds = seconds * 60 + scannedInt; } - + if ([scanner scanCharactersFromSet:period intoString:NULL] && [scanner scanInt:&scannedInt]) { - + // append 000 and take the first 3 digits to create thousands NSString *paddedFraction = [NSString stringWithFormat:@"%d000", scannedInt]; NSString *thousandthsStr = [paddedFraction substringToIndex:3]; thousandths = [thousandthsStr intValue]; } - } + } ms_ = seconds * 1000 + thousandths; isNow_ = NO; } diff --git a/Source/Networking/GDataAuthenticationFetcher.m b/Source/Networking/GDataAuthenticationFetcher.m index fda0e493..2daa2892 100755 --- a/Source/Networking/GDataAuthenticationFetcher.m +++ b/Source/Networking/GDataAuthenticationFetcher.m @@ -68,7 +68,7 @@ + (GTMBridgeFetcher *)authTokenFetcherWithUsername:(NSString *)username accountType:(NSString *)accountType // nil for HOSTED_OR_GOOGLE additionalParameters:(NSDictionary *)params customHeaders:(NSDictionary *)headers { // nil or map of custom headers to set - + if ([username length] == 0 || [password length] == 0) return nil; if ([domain length] == 0) { diff --git a/Source/Tests/GDataDateTimeTest.m b/Source/Tests/GDataDateTimeTest.m index 7a0032fa..231a60e9 100644 --- a/Source/Tests/GDataDateTimeTest.m +++ b/Source/Tests/GDataDateTimeTest.m @@ -28,8 +28,8 @@ @interface GDataDateTimeTest : XCTestCase @implementation GDataDateTimeTest - (void)testGDataDateTime { - - const NSCalendarUnit kComponents = + + const NSCalendarUnit kComponents = NSCalendarUnitEra | NSCalendarUnitYear | NSCalendarUnitMonth @@ -37,7 +37,7 @@ - (void)testGDataDateTime { | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; - + struct DateTimeTestRecord { NSString *dateTimeStr; NSInteger year; @@ -50,27 +50,27 @@ - (void)testGDataDateTime { BOOL isUniversalTime; BOOL hasTime; }; - + struct DateTimeTestRecord tests[] = { { @"2006-10-14T15:00:00-01:00", 2006, 10, 14, 15, 0, 0, -60*60, 0, 1 }, { @"2006-10-14T15:00:00Z", 2006, 10, 14, 15, 0, 0, 0, 1, 1 }, { @"2006-10-14", 2006, 10, 14, 12, 0, 0, 0, 1, 0 }, { nil, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; - + int idx; for (idx = 0; tests[idx].dateTimeStr != nil; idx++) { - + NSString *testString1 = tests[idx].dateTimeStr; GDataDateTime *dateTime = [GDataDateTime dateTimeWithRFC3339String:testString1]; NSString *outputString = [dateTime RFC3339String]; - - XCTAssertEqualObjects(outputString, testString1, @"failed to recreate string %@ as %@", testString1, outputString); + + XCTAssertEqualObjects(outputString, testString1, @"failed to recreate string %@ as %@", testString1, outputString); NSDate *outputDate = [dateTime date]; - + NSCalendar *cal = [dateTime calendar]; - NSDateComponents *outputComponents = [cal components:kComponents + NSDateComponents *outputComponents = [cal components:kComponents fromDate:outputDate]; XCTAssertEqual([outputComponents year], tests[idx].year, @"bad year"); XCTAssertEqual([outputComponents month], tests[idx].month, @"bad month"); @@ -82,7 +82,7 @@ - (void)testGDataDateTime { XCTAssertEqual([[dateTime timeZone] secondsFromGMT], tests[idx].timeZoneOffsetSeconds, @"bad timezone"); XCTAssertEqual([dateTime isUniversalTime], tests[idx].isUniversalTime, @"bad Zulu value"); XCTAssertEqual([dateTime hasTime], tests[idx].hasTime, @"bad hasTime value"); - + if ([dateTime hasTime]) { // remove the time, test the output [dateTime setHasTime:NO]; @@ -116,7 +116,7 @@ - (void)testTimeZonePreservation { dc.timeZone = denverTZ; NSDate *date = dc.date; - GDataDateTime *dateTime = [GDataDateTime dateTimeWithDate:date + GDataDateTime *dateTime = [GDataDateTime dateTimeWithDate:date timeZone:denverTZ]; NSTimeZone *testTZ = [dateTime timeZone]; XCTAssertEqualObjects(testTZ, denverTZ, @"Time zone changed"); diff --git a/Source/Tests/GDataElementsTest.m b/Source/Tests/GDataElementsTest.m index 720f0da4..c26cd1ac 100644 --- a/Source/Tests/GDataElementsTest.m +++ b/Source/Tests/GDataElementsTest.m @@ -39,13 +39,13 @@ - (NSString *)entryNamespaceString { " xmlns:gcs='http://schemas.google.com/codesearch/2006'" " xmlns:gf='http://schemas.google.com/finance/2007'" " xmlns:wt='http://schemas.google.com/webmasters/tools/2007'" - " xmlns:media='http://search.yahoo.com/mrss/'" + " xmlns:media='http://search.yahoo.com/mrss/'" " xmlns:gphoto='http://schemas.google.com/photos/2007'" " xmlns:exif='http://schemas.google.com/photos/exif/2007'" " xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'" " xmlns:georss='http://www.georss.org/georss'" " xmlns:gml='http://www.opengis.net/gml' "; - + return kNamespaceString; } @@ -74,7 +74,7 @@ - (NSArray *)entryNamespaceNodes { return namespaces; } -// Allocate a GDataObject of a known class, initialized from the +// Allocate a GDataObject of a known class, initialized from the // given XML. // // For XML needing but lacking namespace information, it will @@ -83,25 +83,25 @@ - (NSArray *)entryNamespaceNodes { - (id)GDataObjectForClassName:(Class)gdataClass XMLString:(NSString *)xmlString shouldWrapWithNamespaceAndEntry:(BOOL)shouldWrap { - - + + NSString *wrappedXMLString = xmlString; - + if (shouldWrap) { // make an outer element with the namespace NSString * const kNamespaceWrapperString = @"%@"; - + wrappedXMLString = [NSString stringWithFormat: kNamespaceWrapperString, [self entryNamespaceString], xmlString]; } - + // make an XML element for the wrapped XML, then extract the inner element NSError *error = nil; NSXMLElement *entryXML = [[[NSXMLElement alloc] initWithXMLString:wrappedXMLString error:&error] autorelease]; XCTAssertNil(error, @"%@ on wrapped XML:%@", error, wrappedXMLString); - + // skip over non-element children to find the first element NSXMLElement *element; NSUInteger index = 0; @@ -109,7 +109,7 @@ - (id)GDataObjectForClassName:(Class)gdataClass element = (NSXMLElement *) [entryXML childAtIndex:index]; ++index; } while (element != nil && ![element isKindOfClass:[NSXMLElement class]]); - + XCTAssertNotNil(element, @"Cannot get child element of %@", entryXML); // allocate our GData object from the inner element @@ -122,26 +122,26 @@ - (id)GDataObjectForClassName:(Class)gdataClass // as path elements, like foo.0.bar + (id)valueInObject:(id)obj forKeyPathIncludingArrays:(NSString *)keyPath { - + NSArray *pathList = [keyPath componentsSeparatedByString:@"."]; NSMutableArray *partialKeyPathList = [NSMutableArray array]; // step through keys in the path id targetObj = obj; for (NSUInteger idx = 0; idx < [pathList count]; idx++) { - + // if a key is an integer or "@count", then evaluate the array or set // preceding it and extract the object indexed by the integer or the count // of array objects id thisKey = [pathList objectAtIndex:idx]; if ([thisKey isEqual:@"@count"] - || [thisKey isEqual:@"0"] + || [thisKey isEqual:@"0"] || [thisKey intValue] > 0) { - + NSString *partialPathString = [partialKeyPathList componentsJoinedByString:@"."]; - + NSArray *targetArray = [targetObj valueForKeyPath:partialPathString]; - + [partialKeyPathList removeAllObjects]; if ([thisKey isEqual:@"@count"]) { @@ -158,10 +158,10 @@ + (id)valueInObject:(id)obj if ([partialKeyPathList count]) { // find the final target object given the accumulated keys in the path NSString *finalKeyPathString = [partialKeyPathList componentsJoinedByString:@"."]; - + @try { targetObj = [targetObj valueForKeyPath:finalKeyPathString]; - } + } @catch(NSException *exc) { NSLog(@"testing class:%@ keyPath:\"%@\"", [obj class], keyPath); @throw; @@ -172,12 +172,12 @@ + (id)valueInObject:(id)obj // runElementTests: takes an array of ElementTestKeyPathValues, where the // first is (class, xml) and later ones are (test path, expected value) -// +// // Empty strings mark end-of-element, nils mark end-of-test-array // // We'll test each element this way: // -// 1. Generate the NSXMLElement from an XML string (wrapped by an outer +// 1. Generate the NSXMLElement from an XML string (wrapped by an outer // element with the namespace) // 2. Extract the inner element we care about // 3. Create a GData object for the element (obj1) @@ -195,24 +195,24 @@ - (void)runElementTests:(ElementTestKeyPathValues *)tests { for (int testIndex = 0; tests[testIndex].str1 != nil; testIndex++) { - + // get the GData class and the XML string from the table NSString *className = tests[testIndex].str1; NSString *testXMLString = tests[testIndex].str2; - + #ifdef GDATA_TARGET_NAMESPACE - className = [NSString stringWithFormat:@"%s_%@", + className = [NSString stringWithFormat:@"%s_%@", GDATA_TARGET_NAMESPACE_STRING, className]; #endif Class gdataClass = NSClassFromString(className); XCTAssertNotNil(gdataClass, @"Cannot make class for class name: %@", className); - + // make a GDataObject instance with the XML GDataObject *obj1 = [self GDataObjectForClassName:gdataClass XMLString:testXMLString shouldWrapWithNamespaceAndEntry:YES]; - + // make a copy of the object, and verify that it equals the original GDataObject *obj1copy = [[obj1 copy] autorelease]; XCTAssertTrue([obj1 isEqual:obj1copy], @@ -254,37 +254,37 @@ - (void)runElementTests:(ElementTestKeyPathValues *)tests { // step through each test for this element, evaluate the key-value path, // and compare the result to the expected value string // - // also, track if tests of unknownChildren or unknownAttributes are + // also, track if tests of unknownChildren or unknownAttributes are // performed BOOL testedForUnknownChildren = NO; BOOL testedForUnknownAttributes = NO; - + while (1) { - + ++testIndex; - + NSString *keyPath = tests[testIndex].str1; NSString *expectedValue = tests[testIndex].str2; - + if (keyPath == nil || [keyPath length] == 0) break; - + #if GDATA_USES_LIBXML // skip the XMLStrings until we can normalize whitespace and closing // brackets and other minor differences if ([keyPath hasSuffix:@".XMLString"]) continue; #endif - + NSString *result = [GDataElementsTest valueInObject:obj2 forKeyPathIncludingArrays:keyPath]; - + // if the result wasn't a string but responds to stringValue, then // invoke that to get a string if ([expectedValue isKindOfClass:[NSString class]] && ![result isKindOfClass:[NSString class]] && [result respondsToSelector:@selector(stringValue)]) { - - result = [(id)result stringValue]; + + result = [(id)result stringValue]; } - + #ifdef GDATA_TARGET_NAMESPACE // tests for class name need the prefix added if ([keyPath hasSuffix:@"className"] @@ -294,45 +294,45 @@ - (void)runElementTests:(ElementTestKeyPathValues *)tests { GDATA_TARGET_NAMESPACE_STRING, expectedValue]; } #endif - - XCTAssertTrue(AreEqualOrBothNil(result, expectedValue), - @"failed %@ testing key path %@:\n %@ \n!= \n %@", + + XCTAssertTrue(AreEqualOrBothNil(result, expectedValue), + @"failed %@ testing key path %@:\n %@ \n!= \n %@", obj2, keyPath, result, expectedValue); - + if ([keyPath hasPrefix:@"unknownChildren"]) testedForUnknownChildren = YES; if ([keyPath hasPrefix:@"unknownAttributes"]) testedForUnknownAttributes = YES; } - + // if there were no explicit tests on this test object for unknown children // or attributes, then verify now that there are in fact no unknown children // or attributes present in the object - + if (!testedForUnknownChildren) { NSString *keyPath = @"unknownChildren.@count.stringValue"; NSString *expectedValue = @"0"; - NSString *result = [GDataElementsTest valueInObject:obj2 + NSString *result = [GDataElementsTest valueInObject:obj2 forKeyPathIncludingArrays:keyPath]; - + // this object should have no unparsed children XCTAssertTrue(AreEqualOrBothNil(result, expectedValue), - @"failed %@ testing:\n %@ \n!= \n %@\n unknown children: %@", - obj2, result, expectedValue, - [GDataElementsTest valueInObject:obj2 - forKeyPathIncludingArrays:@"unknownChildren"]); + @"failed %@ testing:\n %@ \n!= \n %@\n unknown children: %@", + obj2, result, expectedValue, + [GDataElementsTest valueInObject:obj2 + forKeyPathIncludingArrays:@"unknownChildren"]); } - + if (!testedForUnknownAttributes) { NSString *keyPath = @"unknownAttributes.@count.stringValue"; NSString *expectedValue = @"0"; - NSString *result = [GDataElementsTest valueInObject:obj2 + NSString *result = [GDataElementsTest valueInObject:obj2 forKeyPathIncludingArrays:keyPath]; - + // this object should have no unparsed attributes XCTAssertTrue(AreEqualOrBothNil(result, expectedValue), @"failed %@ testing:\n %@ \n!= \n %@ \n%@", obj2, result, expectedValue, - [GDataElementsTest valueInObject:obj2 - forKeyPathIncludingArrays:@"unknownAttributes"]); + [GDataElementsTest valueInObject:obj2 + forKeyPathIncludingArrays:@"unknownAttributes"]); } } } @@ -340,17 +340,17 @@ - (void)runElementTests:(ElementTestKeyPathValues *)tests { - (void)testElements { - + // this method tests base elements, using runElementTests: above - - // The tests mostly include static strings, but we'll generate a few + + // The tests mostly include static strings, but we'll generate a few // strings dynamically first. - - // Test a non-ASCII character and some html characters in a TextConstruct. + + // Test a non-ASCII character and some html characters in a TextConstruct. // We'll allocate it dynamically since source code cannot contain non-ASCII. NSString *const templateStr = @"Test ellipsis (%C) and others \"<&>"; NSString *textConstructTestResult = [NSString stringWithFormat:templateStr, (unichar)8230]; - + // To test an inline feed, we'll read in the cells feed test file, // strip the prefix, and wrap it in a gd:feedLink NSBundle *testBundle = [NSBundle bundleForClass:[self class]]; @@ -371,9 +371,9 @@ - (void)testElements { NSString *inlinedLinkStr = [NSString stringWithFormat:@"%@", inlinedFeedContentStr]; - + ElementTestKeyPathValues tests[] = - { + { { @"GDataCategory", @"" }, @@ -385,7 +385,7 @@ - (void)testElements { { @"unknownAttributes.1.XMLString", @"unkAttr2=\"EFGHI\"" }, { @"unknownAttributes.@count", @"2" }, { @"", @"" }, - + { @"GDataComment", @" " " " " " }, @@ -408,13 +408,13 @@ - (void)testElements { { @"unknownAttributes.@count", @"0" }, { @"unknownChildren.@count", @"0" }, { @"", @"" }, - + { @"GDataEmail", @"" }, { @"label", @"Personal" }, { @"address", @"fubar@gmail.com" }, { @"primary", @"1" }, { @"", @"" }, - + // testing an inline contact entry { @"GDataEntryLink", @"" @@ -432,7 +432,7 @@ - (void)testElements { { @"entry.emailAddresses.0.address", @"jo@example.com" }, { @"entry.primaryPhoneNumber", @"(650) 555-1212" }, { @"", @"" }, - + { @"GDataExtendedProperty", @"" }, @@ -451,7 +451,7 @@ - (void)testElements { { @"namespaces.", @"" }, { @"unknownChildren.@count.stringValue", @"0" }, { @"", @"" }, - + { @"GDataExtendedProperty", @"" "cuckoowhoodle buzz" }, { @"name", @"fred" }, @@ -461,14 +461,14 @@ - (void)testElements { { @"XMLValuesDictionary.nackro", @"whoodle buzz" }, { @"unknownChildren.@count.stringValue", @"0" }, { @"", @"" }, - + { @"GDataFeedLink", @"" }, { @"href", @"http://example.com/Jo/posts/MyFirstPost/comments" }, { @"countHint", @"10" }, { @"isReadOnly", @"1" }, { @"", @"" }, - + // testing an inline feedLink { @"GDataFeedLink", inlinedFeedLinkStr }, { @"href", nil }, @@ -477,13 +477,13 @@ - (void)testElements { { @"feed.columnCount", @"20" }, { @"feed.entries.0.cell.column", @"1" }, { @"", @"" }, - + { @"GDataGenerator", @" CL2" }, { @"name", @"CL2" }, { @"version", @"1.0" }, { @"URI", @"http://www.google.com/calendar/" }, { @"", @"" }, - + { @"GDataGeoPt", @"" }, { @"label", @"My GeoPt" }, { @"lat", @"27.98778" }, @@ -491,7 +491,7 @@ - (void)testElements { { @"elev", @"8850" }, { @"time.RFC3339String", @"1996-12-19T16:39:57-08:00" }, { @"", @"" }, - + { @"GDataIM", @"" }, { @"protocol", kGDataIMProtocolMSN }, @@ -500,7 +500,7 @@ - (void)testElements { { @"primary", @"1" }, { @"rel", @"http://schemas.google.com/g/2005#other" }, { @"", @"" }, - + { @"GDataLink", @"" }, @@ -511,7 +511,7 @@ - (void)testElements { { @"content", nil }, { @"ETag", @"abcdefg" }, { @"", @"" }, - + { @"GDataLink", inlinedLinkStr }, { @"rel", @"fuzzrel" }, { @"ETag", nil }, @@ -519,14 +519,14 @@ - (void)testElements { { @"content.childObject.className", @"GDataFeedSpreadsheetCell" }, { @"content.childObject.categories.0.term", kGDataCategorySpreadsheetCell }, { @"content.childObject.columnCount", @"20" }, - { @"content.childObject.entries.0.cell.column", @"1" }, + { @"content.childObject.entries.0.cell.column", @"1" }, { @"", @"" }, - + { @"GDataMoney", @"" }, { @"amount", @"10.52" }, { @"currencyCode", @"USD" }, { @"", @"" }, - + { @"GDataName", @"Fred" "Old" "Flintstone" @@ -550,7 +550,7 @@ - (void)testElements { { @"originalStartTime.endTime", nil }, { @"originalStartTime.value", nil }, { @"", @"" }, - + { @"GDataOrganization", @"" "Acme Corp" @@ -578,7 +578,7 @@ - (void)testElements { { @"URI", @"http://foo.com/" }, { @"email", @"test@froo.net" }, { @"", @"" }, - + { @"GDataPhoneNumber", @"(425) 555-8080 ext. 52585" }, { @"rel", kGDataPhoneNumberWork }, @@ -586,7 +586,7 @@ - (void)testElements { { @"primary", @"1" }, { @"stringValue", @"(425) 555-8080 ext. 52585" }, { @"", @"" }, - + { @"GDataPostalAddress", @"500 West 45th Street\nNew York, NY 10036" }, { @"label", @"work" }, { @"primary", @"1" }, @@ -627,11 +627,11 @@ - (void)testElements { { @"street", @"27, rue Pasteur" }, { @"subregion", @"County Fin" }, { @"", @"" }, - + { @"GDataRating", @"" }, { @"rel", kGDataRatingPrice }, { @"value", @"5" }, - { @"min", @"1" }, + { @"min", @"1" }, { @"max", @"5" }, { @"average", @"2.3" }, { @"numberOfRaters", @"132" }, @@ -641,7 +641,7 @@ - (void)testElements { "60314T060000\nDURATION:PT3600S" }, { @"stringValue", @"DTSTART;TZID=America/Los_Angeles:20060314T060000\nDURATION:PT3600S" }, { @"", @"" }, - + { @"GDataRecurrenceException", @" " "" @@ -652,7 +652,7 @@ - (void)testElements { { @"originalEvent.originalID", @"i8fl1nrv2bl57c1qgr3f0onmgg" }, { @"originalEvent.originalStartTime.startTime.RFC3339String", @"2007-05-01T00:00:00Z" }, { @"", @"" }, - + { @"GDataReminder", @"" }, { @"minutes", @"15" }, { @"method", @"email" }, @@ -663,11 +663,11 @@ - (void)testElements { { @"lang", @"en" }, { @"type", @"text" }, { @"", @"" }, - + { @"GDataTextConstruct", @"Test ellipsis (…) and others "<&>" }, { @"stringValue", textConstructTestResult }, // defined above - { @"", @"" }, - + { @"", @"" }, + { @"GDataValueConstruct", @"" }, { @"stringValue", @"America/Los_Angeles" }, { @"", @"" }, @@ -675,31 +675,31 @@ - (void)testElements { { @"GDataValueConstruct", @"" }, { @"doubleValue", @"1.51" }, { @"", @"" }, - + { @"GDataValueConstruct", @"" }, { @"doubleValue", @"0" }, { @"", @"" }, - + { @"GDataValueConstruct", @"" }, { @"doubleValue", (id)kCFNumberPositiveInfinity }, { @"", @"" }, - + { @"GDataValueConstruct", @"" }, { @"doubleValue", (id)kCFNumberNegativeInfinity }, { @"", @"" }, - + { @"GDataValueConstruct", @"" }, { @"longLongValue", @"987654321987" }, { @"", @"" }, - + { @"GDataValueElementConstruct", @"America/Los_Angeles" }, { @"stringValue", @"America/Los_Angeles" }, { @"", @"" }, - + { @"GDataBoolValueConstruct", @"" }, { @"boolValue", @"1" }, { @"", @"" }, - + { @"GDataNameValueConstruct", @"" }, { @"stringValue", @"flintstone" }, { @"name", @"fred" }, @@ -709,7 +709,7 @@ - (void)testElements { { @"sourceURI", @"http://lh.google.com/image/Car.jpg" }, { @"type", @"image/jpeg" }, { @"", @"" }, - + { @"GDataEntryContent", @"Event title" }, { @"stringValue", @"Event title" }, { @"lang", @"en" }, @@ -733,12 +733,12 @@ - (void)testElements { { @"childObject.columnCount", @"20" }, { @"childObject.entries.0.cell.column", @"1" }, { @"", @"" }, - + { @"GDataWebContent", @"" "" "" }, - + { @"height", @"136" }, { @"width", @"300" }, { @"URLString", @"http://google.com/ig/modules/datetime.xml" }, @@ -748,14 +748,14 @@ - (void)testElements { { @"gadgetPreferenceDictionary.color", @"green" }, { @"gadgetPreferenceDictionary.sin", @"greed" }, { @"", @"" }, - + { @"GDataWhen", @"" }, { @"startTime.RFC3339String", @"2005-06-06" }, { @"endTime.RFC3339String", @"2005-06-07" }, { @"value", @"This weekend" }, { @"", @"" }, - + { @"GDataWhere", @" " "" }, @@ -764,8 +764,8 @@ - (void)testElements { { @"stringValue", @"The Pub" }, { @"entryLink.href", @"http://local.example.com/10018/JoesPub" }, { @"", @"" }, - - + + // TODO(grobbins): test embedded entries { @"GDataWho", @" " @@ -780,7 +780,7 @@ - (void)testElements { { @"entryLink.href", @"http://gmail.com/jo/contacts/Jo" }, { @"entryLink.isReadOnly", @"1" }, { @"", @"" }, - + // Atom publishing control { @"GDataAtomPubControl", @"Yes" }, { @"isDraft", @"1" }, @@ -793,16 +793,16 @@ - (void)testElements { { @"GDataAtomPubControl", @"Yes" }, { @"isDraft", @"1" }, { @"", @"" }, - + // Batch elements { @"GDataBatchOperation", @"" }, { @"type", @"insert" }, { @"", @"" }, - + { @"GDataBatchID", @"item2" }, { @"stringValue", @"item2" }, { @"", @"" }, - + { @"GDataBatchStatus", @"error" }, { @"code", @"404" }, @@ -810,7 +810,7 @@ - (void)testElements { { @"contentType", @"application-text" }, { @"stringValue", @"error" }, { @"", @"" }, - + { @"GDataBatchStatus", @"" }, { @"code", @"200" }, { @"reason", nil }, @@ -826,17 +826,17 @@ - (void)testElements { { @"contentType", nil }, { @"stringValue", @"" }, { @"", @"" }, - + { nil, nil } }; - + [self runElementTests:tests]; } - (void)testSpreadsheetElements { - + ElementTestKeyPathValues tests[] = - { + { { @"GDataSpreadsheetCell", @"0.0033" }, @@ -846,33 +846,33 @@ - (void)testSpreadsheetElements { { @"numericValue", @"0.0066" }, { @"resultString", @"0.0033" }, { @"", @"" }, - + { @"GDataRowCount", @"100" }, { @"count", @"100" }, { @"", @"" }, - + { @"GDataColumnCount", @"99" }, { @"count", @"99" }, { @"", @"" }, - + { @"GDataSpreadsheetCustomElement", @"" - "fitzy@gmail.com" }, + "fitzy@gmail.com" }, { @"name", @"e-mail" }, { @"stringValue", @"fitzy@gmail.com" }, { @"", @"" }, - + { nil, nil } }; - + [self runElementTests:tests]; - + } - (void)testMediaElements { - + ElementTestKeyPathValues tests[] = - { + { { @"GDataMediaContent", @"" }, { @"URLString", @"http://www.foo.com/keyframe.jpg" }, @@ -901,94 +901,94 @@ - (void)testMediaElements { { @"height", @"50" }, { @"time.timeOffsetInMilliseconds", @"43501123" }, { @"", @"" }, - + { @"GDataMediaKeywords", @"kitty, cat, big dog, yarn, fluffy" }, { @"keywords.0", @"kitty" }, { @"keywords.2", @"big dog" }, { @"keywords.@count", @"5" }, { @"", @"" }, - + { @"GDataMediaCredit", @"entity name" }, { @"role", @"producer" }, { @"scheme", @"urn:ebu" }, { @"stringValue", @"entity name" }, { @"", @"" }, - + { @"GDataMediaCategory", @"entity name" }, { @"label", @"fred" }, { @"scheme", @"urn:ebu" }, { @"stringValue", @"entity name" }, { @"", @"" }, - + { @"GDataMediaRating", @"adult" }, { @"scheme", @"simple" }, { @"stringValue", @"adult" }, { @"", @"" }, - + { @"GDataMediaPlayer", @"" }, { @"height", @"200" }, { @"width", @"400" }, { @"URLString", @"http://www.foo.com/player?id=1111" }, { @"", @"" }, - + { @"GDataMediaRestriction", @"au us" }, { @"relationship", @"allow" }, { @"type", @"country" }, { @"stringValue", @"au us" }, { @"", @"" }, - + { nil, nil } }; - + [self runElementTests:tests]; } - (void)testPhotoElements { - + ElementTestKeyPathValues tests[] = - { + { { @"GDataPhotoAlbumID", @"5024425138" }, { @"stringValue", @"5024425138" }, { @"", @"" }, - + { @"GDataPhotoCommentCount", @"11" }, { @"intValue", @"11" }, // test the int accessor { @"", @"" }, - + { @"GDataPhotoCommentingEnabled", @"true" }, { @"stringValue", @"true" }, { @"boolValue", @"1" }, // test the bool accessor, too { @"", @"" }, - + { @"GDataPhotoGPhotoID", @"512131187" }, { @"stringValue", @"512131187" }, { @"", @"" }, - + { @"GDataPhotoMaxPhotosPerAlbum", @"1000" }, { @"intValue", @"1000" }, { @"", @"" }, - + { @"GDataPhotoNickname", @"Jane Smith" }, { @"stringValue", @"Jane Smith" }, { @"", @"" }, - + { @"GDataPhotoQuotaUsed", @"312459331" }, { @"longLongValue", @"312459331" }, { @"", @"" }, - + { @"GDataPhotoQuotaLimit", @"1385222385" }, { @"longLongValue", @"1385222385" }, { @"", @"" }, - + { @"GDataPhotoThumbnail", @"http://picasaweb.google.com/image/.../Hello.jpg" }, { @"stringValue", @"http://picasaweb.google.com/image/.../Hello.jpg" }, { @"", @"" }, - + { @"GDataPhotoUser", @"Jane" }, { @"stringValue", @"Jane" }, { @"", @"" }, - + { @"GDataPhotoAccess", @"private" }, { @"stringValue", @"private" }, { @"", @"" }, @@ -996,51 +996,51 @@ - (void)testPhotoElements { { @"GDataPhotoBytesUsed", @"11876307" }, { @"longLongValue", @"11876307" }, { @"", @"" }, - + { @"GDataPhotoLocation", @"Tokyo, Japan" }, { @"stringValue", @"Tokyo, Japan" }, { @"", @"" }, - + { @"GDataPhotoNumberUsed", @"237" }, { @"intValue", @"237" }, { @"", @"" }, - + { @"GDataPhotoNumberLeft", @"763" }, { @"intValue", @"763" }, { @"", @"" }, - + { @"GDataPhotoChecksum", @"987123" }, { @"stringValue", @"987123" }, { @"", @"" }, - + { @"GDataPhotoHeight", @"1200" }, { @"longLongValue", @"1200" }, { @"", @"" }, - + { @"GDataPhotoRotation", @"90" }, { @"intValue", @"90" }, { @"", @"" }, - + { @"GDataPhotoSize", @"149351" }, { @"longLongValue", @"149351" }, { @"", @"" }, - + { @"GDataPhotoTimestamp", @"1168640584000" }, { @"longLongValue", @"1168640584000" }, { @"", @"" }, - + { @"GDataPhotoWidth", @"1600" }, { @"longLongValue", @"1600" }, { @"", @"" }, - + { @"GDataPhotoPhotoID", @"301521187" }, { @"stringValue", @"301521187" }, { @"", @"" }, - + { @"GDataPhotoWeight", @"3" }, { @"intValue", @"3" }, { @"", @"" }, - + { @"GDataEXIFTags", @"" "0.0" "Nokia6133" @@ -1051,17 +1051,17 @@ - (void)testPhotoElements { { @"tagDictionary.make", @"Nokia" }, { @"tagDictionary.model", @"6133" }, // first instance of "model" tag { @"", @"" }, - + { nil, nil } }; - + [self runElementTests:tests]; - + } - (void)testGeo { ElementTestKeyPathValues tests[] = - { + { // test explicit types - here we specify which subclass of GDataGeo // to instantiate { @"GDataGeoW3CPoint", @"55.701" @@ -1071,20 +1071,20 @@ - (void)testGeo { { @"coordinateString", @"55.701 12.552" }, { @"isPoint", @"1" }, { @"", @"" }, - + { @"GDataGeoRSSPoint", @"45.256 -71.92" }, { @"latitude", @"45.256" }, { @"longitude", @"-71.92" }, { @"", @"" }, - + { @"GDataGeoRSSWhere", @"45.256 -71.92" "" }, { @"latitude", @"45.256" }, { @"longitude", @"-71.92" }, { @"", @"" }, - + // test GDataGeo for implicit types - here we use - // a test class which incorporates uses GDataGeo's utilities for + // a test class which incorporates uses GDataGeo's utilities for // determining the subclass of GDataGeo to instantiate // // GDataGeoTestClass is defined below in this file @@ -1093,28 +1093,28 @@ - (void)testGeo { { @"geoLocation.latitude", @"55.701" }, { @"geoLocation.longitude", @"12.552" }, { @"", @"" }, - + { @"GDataGeoTestClass", @"0.256 -71.92" "" }, // RSSPoint { @"geoLocation.latitude", @"0.256" }, { @"geoLocation.longitude", @"-71.92" }, { @"", @"" }, - + { @"GDataGeoTestClass", @"-1.256 -71.92" // RSSWhere "" }, { @"geoLocation.latitude", @"-1.256" }, { @"geoLocation.longitude", @"-71.92" }, { @"", @"" }, - + { nil, nil } }; - + [self runElementTests:tests]; - + } - (void)testGDataExtendedProperty { - + // test the XMLValue key/value APIs NSString *key1 = @"noxweed"; NSString *value1 = @"horgood\nbatman"; @@ -1125,20 +1125,20 @@ - (void)testGDataExtendedProperty { GDataExtendedProperty *extProp; extProp = [GDataExtendedProperty propertyWithName:@"zum" value:nil]; - + [extProp setXMLValue:value1 forKey:key1]; [extProp setXMLValue:value2 forKey:key2]; - + NSString *testValue1 = [extProp XMLValueForKey:key1]; XCTAssertEqualObjects(testValue1, value1, @"bad XML value storage 1"); - + NSString *testValue2 = [extProp XMLValueForKey:key2]; XCTAssertEqualObjects(testValue2, value2, @"bad XML value storage 2"); - // convert to XML, then reinstantiate as a GDataObject, and test + // convert to XML, then reinstantiate as a GDataObject, and test // that everything was preserved NSXMLElement *element = [extProp XMLElement]; - + GDataExtendedProperty *extProp2; extProp2 = [[[GDataExtendedProperty alloc] initWithXMLElement:element parent:nil] autorelease]; @@ -1147,19 +1147,19 @@ - (void)testGDataExtendedProperty { testValue2 = [extProp2 XMLValueForKey:key2]; XCTAssertEqualObjects(testValue2, value2, @"bad XML value storage 2"); - + // verify that the default namespace is empty so that extended // properties stored as XML children won't be considered part of the // atom namespace NSDictionary *namespaces = [extProp2 namespaces]; - XCTAssertEqualObjects([namespaces objectForKey:@""], @"", + XCTAssertEqualObjects([namespaces objectForKey:@""], @"", @"Missing default namespace from GDataObject"); - + #if !GDATA_USES_LIBXML // verify that the NSXMLElement really has the default namespace we expect // - // this is conditional to avoid a dependency on NSXMLElement's + // this is conditional to avoid a dependency on NSXMLElement's // namespaceForPrefix method in libxml builds // NSString *nsStr = [[element namespaceForPrefix:@""] XMLString]; @@ -1253,31 +1253,31 @@ - (void)testEntryInputStreams { } - (void)testChangedNamespace { - - // We'll allocate three objects which are equivalent except for + + // We'll allocate three objects which are equivalent except for // differing namespace prefix declarations. - + // create with normal namespaces, including default of atom NSString * const xml0 = @"" " " " " " "; - + // use gx instead of gd for namespace prefix NSString * const xml1 = @"" " " " " " "; - + // make gd the default prefix, declare atom explicitly NSString * const xml2 = @"" " " " " " "; - + GDataObject *obj0 = [self GDataObjectForClassName:[GDataComment class] XMLString:xml0 shouldWrapWithNamespaceAndEntry:NO]; @@ -1287,12 +1287,12 @@ - (void)testChangedNamespace { XMLString:xml1 shouldWrapWithNamespaceAndEntry:NO]; XCTAssertNotNil(obj1, @"%@", obj1); - + GDataObject *obj2 = [self GDataObjectForClassName:[GDataComment class] XMLString:xml2 shouldWrapWithNamespaceAndEntry:NO]; XCTAssertNotNil(obj2, @"%@", obj2); - + XCTAssertEqualObjects(obj0, obj1, @"namespace interpretations should have made matching objects\n %@\n!=\n %@", [obj0 XMLElement], [obj1 XMLElement]); XCTAssertEqualObjects(obj1, obj2, @"namespace interpretations should have made matching objects\n %@\n!=\n %@", @@ -1372,11 +1372,11 @@ - (void)testDescriptionGeneration { - (void)testControlCharacterRemoval { NSString *str = [NSString stringWithFormat:@"bunnyrabbit%C%C%C", (unichar) 0, (unichar) 1, (unichar) 2]; - + GDataTextConstruct *tc = [GDataTextConstruct textConstructWithString:str]; NSXMLElement *elem = [tc XMLElement]; NSString *elemStr = [elem XMLString]; - + NSString *className = [GDataTextConstruct className]; NSString *expectedStr = [NSString stringWithFormat:@"<%@>bunnyrabbit", className, className]; @@ -1385,30 +1385,30 @@ - (void)testControlCharacterRemoval { } - (void)testProperties { - + NSString * const xml = @"" " " " " " "; - + GDataObject *obj = [self GDataObjectForClassName:[GDataComment class] XMLString:xml shouldWrapWithNamespaceAndEntry:NO]; XCTAssertNotNil(obj, @"%@", obj); - + NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"0", @"zero", @"1", @"one", nil]; - + // set all properties [obj setProperties:dict]; - + // change one property [obj setProperty:@"2" forKey:@"two"]; - + // delete one property [obj setProperty:nil forKey:@"zero"]; - + XCTAssertNil([obj propertyForKey:@"zero"], @"prop 0 problem"); XCTAssertEqualObjects([obj propertyForKey:@"one"], @"1", @"prop 1 problem"); XCTAssertEqualObjects([obj propertyForKey:@"two"], @"2", @"prop 2 problem"); @@ -1431,13 +1431,13 @@ @implementation GDataGeoTestClass - (void)addExtensionDeclarations { [super addExtensionDeclarations]; - + [GDataGeo addGeoExtensionDeclarationsToObject:self forParentClass:[self class]]; } - (NSXMLElement *)XMLElement { - + NSXMLElement *element = [self XMLElementWithExtensionsAndDefaultName:@"GDataGeoTestClass"]; return element; } diff --git a/Source/Tests/GDataFrameworkTest.m b/Source/Tests/GDataFrameworkTest.m index 1d1f105d..27206df7 100644 --- a/Source/Tests/GDataFrameworkTest.m +++ b/Source/Tests/GDataFrameworkTest.m @@ -25,17 +25,17 @@ @interface GDataFrameworkTest : XCTestCase @implementation GDataFrameworkTest - (void)testFrameworkVersion { - + NSUInteger major = NSUIntegerMax; NSUInteger minor = NSUIntegerMax; NSUInteger release = NSUIntegerMax; - + GDataFrameworkVersion(&major, &minor, &release); XCTAssertTrue(major != NSUIntegerMax, @"version unset"); XCTAssertTrue(minor != NSUIntegerMax, @"version unset"); XCTAssertTrue(release != NSUIntegerMax, @"version unset"); - + // Check that the Framework bundle's Info.plist has the proper version, // matching the GDataFrameworkVersion call @@ -47,14 +47,14 @@ - (void)testFrameworkVersion { NSDictionary *infoDict = [frameworkBundle infoDictionary]; XCTAssertNotNil(infoDict, @"Could not find GDataFramework-Info.plist"); - + if (infoDict) { - + NSString *binaryVersionStr = GDataFrameworkVersionString(); - + NSString *plistVersionStr = [infoDict valueForKey:@"CFBundleVersion"]; - XCTAssertEqualObjects(plistVersionStr, binaryVersionStr, + XCTAssertEqualObjects(plistVersionStr, binaryVersionStr, @"Binary/plist version mismatch"); } } diff --git a/Source/Tests/GDataNormalPlayTimeTest.m b/Source/Tests/GDataNormalPlayTimeTest.m index b270b63f..b678ad87 100644 --- a/Source/Tests/GDataNormalPlayTimeTest.m +++ b/Source/Tests/GDataNormalPlayTimeTest.m @@ -36,7 +36,7 @@ - (void)testGDataNormalPlayTime { NSString *secondsStr; NSString *hhmmssStr; }; - + struct NPTTestRecord tests[] = { { @"123", 123000, NO, @"123", @"0:02:03" }, { @"123.45", 123450, NO, @"123.450", @"0:02:03.450" }, @@ -46,30 +46,30 @@ - (void)testGDataNormalPlayTime { { @"flubber", 0, NO, @"0", @"0:00:00" }, { nil, 0, 0, 0, 0 } }; - + int idx; for (idx = 0; tests[idx].str != nil; idx++) { - + // make an NPT object from the string GDataNormalPlayTime *npt = [GDataNormalPlayTime normalPlayTimeWithString:tests[idx].str]; - + // ensure the ms are as expected long long ms = [npt timeOffsetInMilliseconds]; XCTAssertEqual(ms, tests[idx].ms, @"unexpected ms for NPT %@", tests[idx].str); - + // ensure seconds string is as expected NSString *secondsStr = [npt secondsString]; // seconds.fraction or "now" XCTAssertEqualObjects(secondsStr, tests[idx].secondsStr, @"unexpected seconds string for NPT %@", tests[idx].str); - + // ensure the HMS strings is as expected NSString *hhmmssStr = [npt HHMMSSString]; // hh:mm:ss.fraction or "now" XCTAssertEqualObjects(hhmmssStr, tests[idx].hhmmssStr, @"unexpected HHMMSS string for NPT %@", tests[idx].str); - + // ensure "is now" flag is correct BOOL isNow = [npt isNow]; XCTAssertTrue(isNow == tests[idx].isNow, @"isNow unexpected for NPT %d", tests[idx].isNow); } - + // garbage in, zero out GDataNormalPlayTime *npt = [GDataNormalPlayTime normalPlayTimeWithString:@"hooyah"]; XCTAssertEqual([npt timeOffsetInMilliseconds], 0ll, diff --git a/Source/Tests/GDataServiceTest.m b/Source/Tests/GDataServiceTest.m index 3a1fab34..4d24fb6c 100644 --- a/Source/Tests/GDataServiceTest.m +++ b/Source/Tests/GDataServiceTest.m @@ -445,7 +445,7 @@ - (void)testFetch { // verify the underlying fetcher got a 304 (not modified) status #if 0 // TODO: The python test server doesn't provide 304s for ETag matches - + STAssertEquals([[ticket_ objectFetcher] statusCode], (NSInteger)kGTMSessionFetcherStatusNotModified, @"fetching cached copy of %@", feedURL); diff --git a/Source/Tests/GDataUtilitiesTest.m b/Source/Tests/GDataUtilitiesTest.m index 0ed1190b..30e8cd95 100644 --- a/Source/Tests/GDataUtilitiesTest.m +++ b/Source/Tests/GDataUtilitiesTest.m @@ -25,26 +25,26 @@ @interface GDataUtilitiesTest : XCTestCase @implementation GDataUtilitiesTest - (void)testControlsFiltering { - + NSString *input; NSString *output; - + input = nil; output = [GDataUtilities stringWithControlsFilteredForString:input]; XCTAssertNil(output, @"nil test"); - + input = @""; output = [GDataUtilities stringWithControlsFilteredForString:input]; XCTAssertEqualObjects(output, input, @"empty string"); - + input = @"Fred & Wilma"; output = [GDataUtilities stringWithControlsFilteredForString:input]; XCTAssertEqualObjects(output, input, @"plain string"); - + input = [NSString stringWithFormat:@"Nuts%CBolts", (unichar) 0x0B]; // 0xB: vertical tab output = [GDataUtilities stringWithControlsFilteredForString:input]; XCTAssertEqualObjects(output, @"NutsBolts", @"vt failure"); - + // filter a string containing all chars from 0x01 to 0x7F NSMutableString *allCharStr = [NSMutableString string]; for (int idx = 1; idx <= 127; idx++) { @@ -58,29 +58,29 @@ - (void)testControlsFiltering { } - (void)testPercentEncodingUTF8 { - + NSString *input; NSString *output; - + input = nil; output = [GDataUtilities stringByPercentEncodingUTF8ForString:input]; XCTAssertNil(output, @"nil test"); - + input = @""; output = [GDataUtilities stringByPercentEncodingUTF8ForString:input]; XCTAssertEqualObjects(output, input, @"empty string"); - + input = @"Fred & Wilma"; output = [GDataUtilities stringByPercentEncodingUTF8ForString:input]; XCTAssertEqualObjects(output, input, @"plain string"); - + input = [NSString stringWithFormat:@"The Beach at S%Cte", (unichar) 0x00E8]; output = [GDataUtilities stringByPercentEncodingUTF8ForString:input]; XCTAssertEqualObjects(output, @"The Beach at S%C3%A8te", @"8-bit failure"); input = @"\ttab\tline1\rline2%percent\nline3"; output = [GDataUtilities stringByPercentEncodingUTF8ForString:input]; - XCTAssertEqualObjects(output, @"%09tab%09line1%0Dline2%25percent%0Aline3", + XCTAssertEqualObjects(output, @"%09tab%09line1%0Dline2%25percent%0Aline3", @"control char"); input = [NSString stringWithFormat:@"photo%C.jpg", (unichar) 0x53C3]; diff --git a/Source/Tests/main.m b/Source/Tests/main.m index 4b278612..382f50ac 100644 --- a/Source/Tests/main.m +++ b/Source/Tests/main.m @@ -20,10 +20,10 @@ int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - + NSLog(@"DevelopmentTestTool running"); - + [pool release]; - + return 0; }