/core/externals/update-engine/externals/gdata-objectivec-client/Source/Elements/GDataExtendedProperty.h

http://macfuse.googlecode.com/ · C++ Header · 82 lines · 31 code · 18 blank · 33 comment · 2 complexity · 0ad4039a02f7eabef869484a1751ec21 MD5 · raw file

  1. /* Copyright (c) 2007 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. // GDataExtendedProperty.h
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_CALENDAR_SERVICE \
  19. || GDATA_INCLUDE_CONTACTS_SERVICE
  20. #import "GDataObject.h"
  21. #undef _EXTERN
  22. #undef _INITIALIZE_AS
  23. #ifdef GDATAEXTENDEDPROPERTY_DEFINE_GLOBALS
  24. #define _EXTERN
  25. #define _INITIALIZE_AS(x) =x
  26. #else
  27. #define _EXTERN GDATA_EXTERN
  28. #define _INITIALIZE_AS(x)
  29. #endif
  30. _EXTERN NSString* const kGDataExtendedPropertyRealmShared _INITIALIZE_AS(@"http://schemas.google.com/g/2005#shared");
  31. // an element with a name="" and a value="" attribute, as in
  32. // <gd:extendedProperty name='X-MOZ-ALARM-LAST-ACK' value='2006-10-03T19:01:14Z'/>
  33. //
  34. // or an arbitrary XML blob, as in
  35. // <gd:extendedProperty name='com.myCompany.myProperties'> <myXMLBlob /> </gd:extendedProperty>
  36. //
  37. // Servers may impose additional restrictions on names or on the size
  38. // or composition of the values.
  39. @interface GDataExtendedProperty : GDataObject <GDataExtension>
  40. + (id)propertyWithName:(NSString *)name
  41. value:(NSString *)value;
  42. - (NSString *)value;
  43. - (void)setValue:(NSString *)str;
  44. - (NSString *)name;
  45. - (void)setName:(NSString *)str;
  46. - (NSString *)realm;
  47. - (void)setRealm:(NSString *)str;
  48. - (NSArray *)XMLValues;
  49. - (void)setXMLValues:(NSArray *)arr;
  50. - (void)addXMLValue:(NSXMLNode *)node;
  51. // Obj-C style interface to XML values storage
  52. //
  53. // keys are XMLValue node names, values are XMLValue node string values,
  54. // as in
  55. // <key1>value1</key1>
  56. // <key2>value2</key2>
  57. //
  58. // Behavior is undefined if child nodes are in some other format.
  59. - (void)setXMLValue:(NSString *)value forKey:(NSString *)key;
  60. - (NSString *)XMLValueForKey:(NSString *)key;
  61. - (NSDictionary *)XMLValuesDictionary;
  62. - (void)setXMLValuesDictionary:(NSDictionary *)dict;
  63. @end
  64. #endif // #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_*_SERVICE