PageRenderTime 18ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Blogger/GDataEntryBlogPost.m

http://macfuse.googlecode.com/
Objective C | 120 lines | 67 code | 29 blank | 24 comment | 1 complexity | ecd36bf77a38d340bbb8b2480594c6f6 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  1. /* Copyright (c) 2009 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // GDataEntryBlogPost.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE
  19. #import "GDataEntryBlogPost.h"
  20. #import "GDataBloggerConstants.h"
  21. #import "GDataThreadingElements.h"
  22. #import "GDataMediaThumbnail.h"
  23. @implementation GDataEntryBlogPost
  24. + (GDataEntryBlogPost *)postEntry {
  25. GDataEntryBlogPost *obj = [self object];
  26. [obj setNamespaces:[GDataBloggerConstants bloggerNamespaces]];
  27. return obj;
  28. }
  29. #pragma mark -
  30. //+ (NSString *)standardEntryKind {
  31. // return kGDataCategoryBloggerPost;
  32. //}
  33. //
  34. //+ (void)load {
  35. // [self registerEntryClass];
  36. //}
  37. - (void)addExtensionDeclarations {
  38. [super addExtensionDeclarations];
  39. [self addExtensionDeclarationForParentClass:[self class]
  40. childClasses:
  41. [GDataMediaThumbnail class],
  42. [GDataThreadingTotal class],
  43. nil];
  44. }
  45. #if !GDATA_SIMPLE_DESCRIPTIONS
  46. - (NSMutableArray *)itemsForDescription {
  47. static struct GDataDescriptionRecord descRecs[] = {
  48. { @"thumbnail", @"thumbnail", kGDataDescValueLabeled },
  49. { @"total", @"total", kGDataDescValueLabeled },
  50. { nil, nil, (GDataDescRecTypes)0 }
  51. };
  52. NSMutableArray *items = [super itemsForDescription];
  53. [self addDescriptionRecords:descRecs toItems:items];
  54. return items;
  55. }
  56. #endif
  57. + (NSString *)defaultServiceVersion {
  58. return kGDataBloggerDefaultServiceVersion;
  59. }
  60. #pragma mark -
  61. - (GDataMediaThumbnail *)thumbnail {
  62. GDataMediaThumbnail *obj;
  63. obj = [self objectForExtensionClass:[GDataMediaThumbnail class]];
  64. return obj;
  65. }
  66. - (void)setThumbnail:(GDataMediaThumbnail *)obj {
  67. [self setObject:obj forExtensionClass:[GDataMediaThumbnail class]];
  68. }
  69. - (NSNumber *)total {
  70. GDataThreadingTotal *obj;
  71. obj = [self objectForExtensionClass:[GDataThreadingTotal class]];
  72. return [obj intNumberValue];
  73. }
  74. - (void)setTotal:(NSNumber *)num {
  75. GDataThreadingTotal *obj = [GDataThreadingTotal valueWithNumber:num];
  76. [self setObject:obj forExtensionClass:[GDataThreadingTotal class]];
  77. }
  78. #pragma mark -
  79. - (GDataLink *)enclosureLink {
  80. return [self linkWithRelAttributeValue:kGDataLinkBloggerEnclosure];
  81. }
  82. - (GDataLink *)repliesAtomLink {
  83. return [self linkWithRelAttributeValue:kGDataLinkBloggerReplies
  84. type:kGDataLinkTypeAtom];
  85. }
  86. - (GDataLink *)repliesHTMLLink {
  87. return [self linkWithRelAttributeValue:kGDataLinkBloggerReplies
  88. type:kGDataLinkTypeHTML];
  89. }
  90. @end
  91. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE