2 * Copyright (C) 2013 HERE Global B.V. All rights reserved.
3 * This software, including documentation, is protected by copyright controlled by
4 * HERE Global B.V. (“Software”). All rights are reserved. Copying, including reproducing,
5 * storing, adapting or translating, any or all of this material requires the prior
6 * written consent of HERE Global B.V. You may use this
7 * Software in accordance with the terms and conditions defined in the
8 * HERE Location Platform Services Terms and Conditions, available at
9 * http://developer.here.com/terms-conditions-base
11 * As an additional permission to the above, you may distribute Software,
12 * in object code format as part of an Application, according to, and subject to, terms and
13 * conditions defined in the Tizen Software Development kit (“SDK”) License Agreement.
14 * You may distribute such object code format Application under terms of your choice,
15 * provided that the header and source files of the Software have not been modified.
18 #ifndef APPLICATIONCONTEXT_H
19 #define APPLICATIONCONTEXT_H
21 #include "common/HereMaps_global.h"
25 HERE_MAPS_BEGIN_NAMESPACE
28 * This class encapsulates the credentials required to use the Geocoding API.
29 * The credentials consists of the app code and app id.
31 * The class is a singleton.
33 class EXPORT_API ApplicationContext
37 * This is the destructor.
39 ~ApplicationContext();
42 * This method sets the preferred language, using a two-letter BCP-47 code
43 * supplied by the caller.
45 * @param sLanguage A const reference to a string containing a two-letter
46 * code identifying the preferred map language.
48 void SetPreferredLanguage(const String& sLanguage);
51 * This method retrieves a string containing a BCP-47 code that indicates
52 * the preferred language.
54 * @return A constant reference to a string containing a two-letter BCP-47
55 * code indicating the preferred language.
57 const String& GetPreferredLanguage() const;
60 * This method retrieves the app code.
62 * @return A constant reference to a string containing the app code.
64 const String& GetAppCode() const;
67 * This method retrieves the app id.
69 * @return A constant reference to a string containing the app id.
71 const String& GetAppId() const;
73 #ifdef TIZEN_MIGRATION
75 * This method retrieves the request app id.
77 * @return A constant reference to a string containing the request app id.
79 const String& GetRequestAppId() const;
83 * This is a static method which returns the singleton's instance.
85 * @return A static reference to the instance of this singleton class.
87 static ApplicationContext& GetInstance();
89 #ifdef TIZEN_MIGRATION
91 * This method initialises the singleton object.
93 * @param sAppCode A constant reference to a string containing the app code.
95 * @param sAppId A constant reference to a string containing the app id.
97 * @param sRequestAppId A constant reference to a string containing the request app id.
99 * @return A Boolean indicating the result of initialization,
100 * <code>true</code> on success, <code>false</code> on failure. Note
101 * that if the object already exists and has been initialized,
102 * further attempts to call this methods fail (the return value is
103 * <code>false</code>.
105 bool Initialize(const String& sAppCode, const String& sAppId, const String& sRequestAppId = "");
108 * This method initialises the singleton object.
110 * @param sAppCode A constant reference to a string containing the app code.
112 * @param sAppId A constant reference to a string containing the app id.
114 * @return A Boolean indicating the result of initialization,
115 * <code>true</code> on success, <code>false</code> on failure. Note
116 * that if the object already exists and has been initialized,
117 * further attempts to call this methods fail (the return value is
118 * <code>false</code>.
120 bool Initialize(const String& sAppCode, const String& sAppId);
124 * This method queries initialisation status.
126 * @return A Boolean indicating the status of initialization,
127 * <code>true</code> if the object is initialized, otherwise
128 * <code>false</code>.
130 bool IsInitialized() const;
133 * This method sets a flag to indicate whether a high-resolution map is to be used.
135 * @param haveHighResolution A Boolean, <code>true</code> to indicate that a
136 * high-resolution map is to be used, otherwise <code>false</code>.
138 void SetHighResolutionMap(bool haveHighResolution);
141 * This method retrieves a Boolean value indicating whether a high-resolution map is used.
143 * @return A Boolean, <code>true</code> to indicate that a
144 * high-resolution map is (to be) used, otherwise <code>false</code>.
146 bool HaveHighResolutionMap() const;
150 * This method is a private constructor for the singleton.
152 ApplicationContext();
154 HERE_MAPS_NO_COPY_NO_ASSIGN(ApplicationContext);
156 class ApplicationContextImpl;
157 ApplicationContextImpl* m_pImpl;
160 HERE_MAPS_END_NAMESPACE
162 #endif // APPLICATIONCONTEXT_H