PageRenderTime 57ms CodeModel.GetById 35ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 0ms

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