/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Blogger/GDataThreadingElements.h

http://macfuse.googlecode.com/ · C++ Header · 97 lines · 41 code · 21 blank · 35 comment · 1 complexity · a63fe53b9a3525215ede81ca6cc71e76 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. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE
  16. //
  17. // GDataThreadingElements.h
  18. //
  19. // Implements extensions described in http://www.ietf.org/rfc/rfc4685.txt
  20. //
  21. // There are several "thr" threading element extensions:
  22. // 1. The simple <thr:total> value element
  23. // 2. The custom <thr:in-reply-to> element
  24. // 3. The thr:count and thr:updated attribute extensions added to atom:link
  25. //
  26. #import "GDataObject.h"
  27. #import "GDataValueConstruct.h"
  28. #import "GDataLink.h"
  29. #undef _EXTERN
  30. #undef _INITIALIZE_AS
  31. #ifdef GDATATHREADINGELEMENTS_DEFINE_GLOBALS
  32. #define _EXTERN
  33. #define _INITIALIZE_AS(x) =x
  34. #else
  35. #define _EXTERN GDATA_EXTERN
  36. #define _INITIALIZE_AS(x)
  37. #endif
  38. _EXTERN NSString* const kGDataNamespaceAtomThreading _INITIALIZE_AS(@"http://purl.org/syndication/thread/1.0");
  39. _EXTERN NSString* const kGDataNamespaceAtomThreadingPrefix _INITIALIZE_AS(@"thr");
  40. @interface GDataThreadingTotal : GDataValueElementConstruct <GDataExtension>
  41. // thr:total extension element
  42. //
  43. // allocate with [GDataThreadingTotal valueWithInt:x]
  44. @end
  45. // for in-reply-to elements, like
  46. //
  47. // <thr:in-reply-to
  48. // href="http://blogName.blogspot.com/2007/04/first-post.html"
  49. // ref="tag:blogger.com,1999:blog-blogID.post-postID"
  50. // type="text/html"/>
  51. @interface GDataInReplyTo : GDataObject <GDataExtension>
  52. + (GDataInReplyTo *)inReplyToWithHref:(NSString *)href
  53. ref:(NSString *)ref
  54. source:(NSString *)source
  55. type:(NSString *)type;
  56. - (NSString *)href;
  57. - (void)setHref:(NSString *)str;
  58. - (NSString *)ref;
  59. - (void)setRef:(NSString *)str;
  60. - (NSString *)source;
  61. - (void)setSource:(NSString *)str;
  62. - (NSString *)type;
  63. - (void)setType:(NSString *)str;
  64. @end
  65. @interface GDataThreadingLink : NSObject
  66. // This utility class has class methods for adding and accessing threading
  67. // attribute extensions on atom:link elements
  68. + (void)addThreadingLinkExtensionDeclarationsToObject:(GDataObject *)object;
  69. + (NSNumber *)threadingCountForLink:(GDataLink *)link;
  70. + (void)setThreadingCount:(NSNumber *)number
  71. forLink:(GDataLink *)link;
  72. + (GDataDateTime *)threadingUpdatedDateForLink:(GDataLink *)link;
  73. + (void)setThreadingUpdatedDate:(GDataDateTime *)dateTime
  74. forLink:(GDataLink *)link;
  75. @end
  76. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_BLOGGER_SERVICE