/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Maps/GDataMapConstants.m

http://macfuse.googlecode.com/ · Objective C · 69 lines · 25 code · 16 blank · 28 comment · 1 complexity · d10fd6e5a69e032deea20324dabc1b2b 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. // GDataEntryMap.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_MAPS_SERVICE
  19. #define GDATAMAPCONSTANTS_DEFINE_GLOBALS 1
  20. #import "GDataMapConstants.h"
  21. #import "GDataEntryBase.h"
  22. @implementation GDataMapConstants
  23. + (NSDictionary *)mapsNamespaces {
  24. // default namespace "atom"
  25. NSDictionary *baseNS = [GDataEntryBase baseGDataNamespaces];
  26. NSMutableDictionary *namespaces;
  27. namespaces = [NSMutableDictionary dictionaryWithDictionary:baseNS];
  28. [namespaces setObject:kGDataNamespaceKML
  29. forKey:@"kml"];
  30. return namespaces;
  31. }
  32. + (NSDictionary *)mapsServerNamespaces {
  33. // temporary workaround until the library can create from scratch
  34. // elements with a non-atom default namespace
  35. // (or until the Maps server can send XML with a non-kml namespace)
  36. //
  37. // For creating entries and feeds from scratch, we'll use the namespace
  38. // set above, with the default namespace "atom"
  39. //
  40. // For updating entries, which presumably came from the server, we'll use
  41. // this namespace set, with the default namespace "kml"
  42. NSDictionary *baseNS = [GDataEntryBase baseGDataNamespaces];
  43. NSMutableDictionary *namespaces;
  44. namespaces = [NSMutableDictionary dictionaryWithDictionary:baseNS];
  45. // kml is the default namespace; atom is explicitly "atom"
  46. [namespaces setObject:kGDataNamespaceKML
  47. forKey:@""];
  48. [namespaces setObject:kGDataNamespaceAtom
  49. forKey:kGDataNamespaceAtomPrefix];
  50. return namespaces;
  51. }
  52. @end
  53. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_MAPS_SERVICE