2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FApp_AppResourceString.h
20 * @brief This is the header file of the _AppResourceString class.
23 #ifndef _FAPP_INTERNAL_APP_RESOURCE_STRING_H_
24 #define _FAPP_INTERNAL_APP_RESOURCE_STRING_H_
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
29 namespace Tizen { namespace Locales { class Locale; } }
32 typedef _xmlDoc* xmlDocPtr;
34 namespace Tizen { namespace App
37 class _AppResourceString
38 : public Tizen::Base::Object
42 * This is the destructor for this class.
46 virtual ~_AppResourceString(void);
49 * Gets the string at the specified resource ID.
52 * @return An error code
53 * @param[in] resourceId The resource ID describing the String resource
54 * @param[out] loadedString The string obtained from the loaded application resource
55 * @exception E_SUCCESS The method was successful.
56 * @exception E_FAILURE The argument passed is not found.
57 * @exception E_INVALID_STATE The state of XML context is not in a valid state.
58 * @exception E_INVALID_ARG The argument passed to a method contains an invalid resource ID.
60 result GetString(const Tizen::Base::String resourceId, Tizen::Base::String& loadedString);
63 * Initializes this instance.
66 result Construct(void);
69 * Initializes this instance with the specified locale.
72 result Construct(const Tizen::Locales::Locale& locale);
75 result Initialize(void);
77 result Construct(const AppId& appId);
79 result Initialize(const AppId& appId);
82 result InitializeStringInfo(void);
83 result InitializeStringInfo(const AppId& appId);
84 static bool HasSpecialString(const Tizen::Base::String& resourceStr);
85 static result ConvertToCstyleString(const Tizen::Base::String& resourceStr, Tizen::Base::String& convertedStr);
86 static xmlDocPtr ParseXmlFile(const Tizen::Base::String& path);
90 * This is the default constructor for this class.
94 _AppResourceString(void);
97 * This is the copy constructor for this class.
101 _AppResourceString(const _AppResourceString& source);
104 * This is the assignment operator for this class.
106 _AppResourceString& operator =(const _AppResourceString& source);
111 Tizen::Base::Runtime::Mutex* __pLockOfParser;
113 friend class _AppResourceImpl;
114 }; // _AppResourceString
118 #endif // _FAPP_INTERNAL_APP_RESOURCE_STRING_H_