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