src/FWeb_HistoryItemImpl.cpp
src/FWebWebHistory.cpp
src/FWeb_WebHistoryImpl.cpp
+ src/FWebBookmarkItem.cpp
+ src/FWeb_BookmarkItemImpl.cpp
+ src/FWebWebBookmark.cpp
+ src/FWeb_WebBookmarkImpl.cpp
src/controls/FWebCtrlWeb.cpp
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_AuthConfirmPopup.cpp
src/controls/FWebCtrlGeolocationPermissionManager.cpp
src/controls/FWebCtrl_GeolocationPermissionManagerImpl.cpp
src/controls/FWebCtrl_InputPickerPopup.cpp
+ src/controls/FWebCtrl_UserConfirmPopup.cpp
+ src/controls/FWebCtrl_WebPopup.cpp
+ src/controls/FWebCtrl_CertificatePopup.cpp
)
## Add Definitions
ADD_DEFINITIONS(${OSP_DEFINITIONS} -D_MODEL_RES_WVGA)
TARGET_LINK_LIBRARIES(${this_target} "-losp-media" )
TARGET_LINK_LIBRARIES(${this_target} "-losp-net" )
TARGET_LINK_LIBRARIES(${this_target} "-lecore" )
+TARGET_LINK_LIBRARIES(${this_target} "-lecore_imf" )
+TARGET_LINK_LIBRARIES(${this_target} "-lecore_imf_evas" )
TARGET_LINK_LIBRARIES(${this_target} "-lelementary" )
TARGET_LINK_LIBRARIES(${this_target} "-levas" )
TARGET_LINK_LIBRARIES(${this_target} "-leina" )
)
INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp
- FILES_MATCHING PATTERN "libosp-*" PATTERN
+ FILES_MATCHING PATTERN "libosp-*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ)
INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp/browser-plugin
- FILES_MATCHING PATTERN "libweb-*" PATTERN
+ FILES_MATCHING PATTERN "libweb-*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ)
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ)
-INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/browser-plugin/debug
+INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/browser-plugin/debug
FILES_MATCHING PATTERN "libweb-*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
#include <FWebHistoryItem.h>
#include <FWebWebHistory.h>
+#include <FWebBookmarkItem.h>
+#include <FWebWebBookmark.h>
//Controls namespace
#include <FWebControls.h>
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebBookmarkItem.h
+ * @brief This is the header file for the %BookmarkItem class.
+ *
+ * This header file contains the declarations of the %BookmarkItem class.
+ */
+
+#ifndef _FWEB_BOOKMARK_ITEM_H_
+#define _FWEB_BOOKMARK_ITEM_H_
+
+#include <FBaseString.h>
+
+namespace Tizen { namespace Graphics
+{
+class Bitmap;
+}} // Tizen::Graphics
+
+namespace Tizen { namespace Web
+{
+class _BookmarkItemImpl;
+
+/**
+ * A unique ID. This ID is unique within a local storage only. @n
+ * @c RecordId is assigned by the local storage when a record is saved to the storage. @n
+ *
+ *
+ * @since 2.1
+ */
+typedef int RecordId;
+
+/**
+ * The root folder ID. @n
+ * In fact, it is symbolic value because the root folder record doesn't exist physically.
+ *
+ * @since 2.1
+ */
+const RecordId ROOT_FOLDER_ID = -1;
+
+/**
+* @class BookmarkItem
+* @brief This class is used for accessing a bookmark item stored in the WebBookmark class.
+*
+* @since 2.1
+* @final This class is not intended for extension.
+*
+* The %BookmarkItem class provides access to the WebBookmark class.
+* Each item contains the title, the URL of the page, the item type and parent folder id.
+*/
+class _OSP_EXPORT_ BookmarkItem
+ : public Tizen::Base::Object
+{
+public:
+
+ /**
+ * Copying of objects using this copy constructor is allowed.
+ * This is the copy constructor for the %BookmarkItem class. @n
+ * It creates an instance of %BookmarkItem with the values of the specified instance.
+ *
+ * @since 2.1
+ *
+ * @param[in] setting An instance of %BookmarkItem
+ */
+ BookmarkItem(const BookmarkItem& rhs);
+
+ /**
+ * This destructor overrides Tizen::Base::Object::~Object().
+ *
+ * @since 2.1
+ */
+ virtual ~BookmarkItem(void);
+
+ /**
+ * Gets the title from the current bookmark item.
+ *
+ * @since 2.1
+ *
+ * @return The title of the current bookmark item
+ */
+ Tizen::Base::String GetTitle(void) const;
+
+ /**
+ * Gets the URL from the current bookmark item.
+ *
+ * @since 2.1
+ *
+ * @return The URL of the current bookmark item @n
+ * If the item type is folder, this method will return the empty string.
+ * @see IsFolder()
+ */
+ Tizen::Base::String GetUrl(void) const;
+
+ /**
+ * Gets the favicon image from current bookmark item.
+ *
+ * @since 2.1
+ *
+ * @return The image
+ *
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM Either of the following conditions has occurred: @n
+ * - The method cannot proceed due to a severe system error. @n
+ * - The method has failed because it doesn¡¯t work on a service application.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ Tizen::Graphics::Bitmap* GetFaviconN(void) const;
+
+ /**
+ * Gets the parent folder id of the current bookmark item.
+ *
+ * @since 2.1
+ *
+ * @return The parent folder id of the current bookmark item @n
+ * If the current bookmark item is the one in topmost level, this method will return ::ROOT_FOLDER_ID.
+ */
+ RecordId GetParentFolderId(void) const;
+
+ /**
+ * Checks whether the type of current bookmark item is folder or not.
+ *
+ * @since 2.1
+ *
+ * @return @c true if the type of current bookmark item is folder, @n
+ * else @c false
+ */
+ bool IsFolder(void) const;
+
+ /**
+ * Gets the hash value of the current instance.
+ *
+ * @since 2.1
+ *
+ * @return The hash value of the current instance
+ */
+ virtual int GetHashCode(void) const;
+
+ /**
+ * Compares two instances of the %BookmarkItem class.
+ *
+ * @since 2.1
+ *
+ * @return @c true if the two instances match, or if and only if the two instances contain the same elements, @n
+ * else @c false @n
+ * @param[in] obj The object to compare with the current instance
+ * @see Tizen::Base::Object::Equals()
+ */
+ virtual bool Equals(const Object& obj) const;
+
+ /**
+ * Copying of objects using this copy assignment operator is allowed.
+ *
+ * @since 2.1
+ *
+ * @param[in] setting The instance of the %BookmarkItem class to assign from
+ */
+ BookmarkItem& operator =(const BookmarkItem& rhs);
+
+private:
+ //
+ // This default constructor is intentionally declared as private to implement the Singleton semantic
+ //
+ // @remarks This constructor is hidden.
+ //
+ BookmarkItem(void);
+
+private:
+ _BookmarkItemImpl* __pBookmarkItemImpl;
+
+ friend class _BookmarkItemImpl;
+
+ friend class _WebBookmarkImpl;
+};
+
+}}
+#endif // _FWEB_BOOKMARK_ITEM_H_
/**
*
- * @class AuthenticationChallenge
+ * @class AuthenticationChallenge
* @brief This class handles the HyperText Transfer Protocol (HTTP) authentication requests.
*
- * @since 2.0
+ * @since 2.0
*
* The %AuthenticationChallenge class sends the user ID and password to the server requesting user authentication.
* @n
/**
* This destructor overrides Tizen::Base::Object::~Object().
*
- * @since 2.0
+ * @since 2.0
*/
virtual ~AuthenticationChallenge(void);
/**
* Sends the user ID and password to the host.
*
- * @since 2.0
+ * @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.privacy
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.privacy
*
- * @param[in] userId The user ID for authentication
- * @param[in] password The password for authentication
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] userId The user ID for authentication
+ * @param[in] password The password for authentication
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void Process(const UserId& userId, const Tizen::Base::String& password);
/**
* Cancels the authentication request.
*
- * @since 2.0
+ * @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.privacy
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.privacy
*
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void Cancel(void);
//\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* @file FWebCtrlGeolocationPermissionManager.h\r
* @brief This is the header file for the %GeolocationPermissionManager class.\r
- * @visibility partner-manufacturer\r
+ * @privlevel platform\r
*\r
* This header file contains the declarations of the %GeolocationPermissionManager class.\r
*\r
- * @endif\r
*/\r
#ifndef _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_\r
#define _FWEB_CTRL_GEOLOCATION_PERMISSION_MANAGER_H_\r
class _GeolocationPermissionManagerImpl;\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* @class GeolocationPermissionManager\r
* @brief This class provides methods to manage geolocation permissions.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-manufacturer\r
- * @privilege %http://tizen.org/privilege/web.privacy\r
- *\r
* The %GeolocationPermissionManager class provides methods to manage geolocation permissions decided by a user from origins using html5 JavaScript geolocation APIs.\r
* @n\r
* Origin consists of the scheme, host, and port.\r
- * @endif\r
*/\r
\r
class _OSP_EXPORT_ GeolocationPermissionManager\r
public:\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* Gets the origin list stored at the geolocation database.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-manufacturer\r
- * @privilege %http://tizen.org/privilege/web.privacy\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/geolocationpermission.read\r
*\r
- * @return A pointer to IList containing origin(Tizen::Base::String) list, @n\r
- * else @c null if no geolocation permission data exists\r
- * @exception E_SUCCESS The method is successful.\r
- * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.\r
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- * @remarks The specific error code can be accessed using the GetLastResult() method.\r
- * @endif\r
+ * @return A pointer to IList containing origin(Tizen::Base::String) list, @n\r
+ * else @c null if no geolocation permission data exists\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method.\r
*/\r
Tizen::Base::Collection::IList* GetOriginListN(void) const;\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* Checks whether geolocation permission is allowed or not for the specified @c origin.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-manufacturer\r
- * @privilege %http://tizen.org/privilege/web.privacy\r
- *\r
- * @return @c true if geolocation permission is allowed, @n\r
- * else @c false\r
- * @param[in] origin The origin\r
- * @exception E_SUCCESS The method is successful.\r
- * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.\r
- * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.\r
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- * @remarks The specific error code can be accessed using the GetLastResult() method.\r
- * @endif\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/geolocationpermission.read\r
+ *\r
+ * @return @c true if geolocation permission is allowed, @n\r
+ * else @c false\r
+ * @param[in] origin The origin\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.\r
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method.\r
*/\r
bool IsPermissionAllowed(const Tizen::Base::String& origin) const;\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* Removes the geolocation data for the specified @c origin.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-manufacturer\r
- * @privilege %http://tizen.org/privilege/web.privacy\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/geolocationpermission.write\r
*\r
- * @return An error code\r
- * @param[in] origin The origin\r
- * @exception E_SUCCESS The method is successful.\r
- * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.\r
- * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.\r
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @return An error code\r
+ * @param[in] origin The origin\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_DATA_NOT_FOUND There is no permission data for the specified @c origin.\r
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
* @see RemoveAll()\r
- * @endif\r
*/\r
result Remove(const Tizen::Base::String& origin);\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* Removes all elements in the list.\r
* \r
* @since 2.0\r
*\r
- * @visibility partner-manufacturer\r
- * @privilege %http://tizen.org/privilege/web.privacy\r
+ * @privlevel platform\r
+ * @privilege http://tizen.org/privilege/geolocationpermission.write\r
*\r
- * @return An error code\r
- * @exception E_SUCCESS The method is successful.\r
- * @exception E_SERVICE_BUSY The dedicated service module is too busy to handle another request.\r
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @return An error code\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
* @see Remove()\r
- * @endif\r
*/\r
result RemoveAll(void);\r
\r
/**\r
- * @if VISPARTNER-MANUFACTURER\r
* Gets the geolocation permission manager instance.\r
*\r
* @since 2.0\r
*\r
- * @visibility partner-manufacturer\r
- * @privilege %http://tizen.org/privilege/web.privacy\r
- *\r
- * @return A pointer to the %GeolocationPermissionManager instance, @n\r
- * else @c null if it fails\r
- * @exception E_SUCCESS The method is successful.\r
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
- * @remarks The specific error code can be accessed using the GetLastResult() method.\r
- * @endif\r
+ * @return A pointer to the %GeolocationPermissionManager instance, @n\r
+ * else @c null if it fails\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.\r
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method.\r
*/\r
static GeolocationPermissionManager* GetInstance(void);\r
\r
//\r
virtual ~GeolocationPermissionManager(void);\r
\r
- /**\r
- * Initializes this instance of the %Web control with the specified parameters.\r
- *\r
- * @since 2.0\r
- *\r
- * @return An error code\r
- */\r
+ //\r
+ // Initializes this instance of the %Web control with the specified parameters.\r
+ //\r
+ // @since 2.0\r
+ //\r
+ // @return An error code\r
+ //\r
result Construct(void);\r
\r
//\r
// The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.\r
//\r
- // @param[in] rhs The instance of the % GeolocationPermissionManager class to copy from\r
+ // @param[in] rhs The instance of the % GeolocationPermissionManager class to copy from\r
// @remarks This constructor is hidden.\r
//\r
GeolocationPermissionManager(const GeolocationPermissionManager& rhs);\r
//\r
// Initializes the geolocation permission manager instance.\r
//\r
- // @since 2.0\r
+ // @since 2.0\r
//\r
static void InitGeolocationPermissionManager(void);\r
\r
//\r
// Destroys the geolocation permission manager instance.\r
//\r
- // @since 2.0\r
+ // @since 2.0\r
//\r
static void DestroyGeolocationPermissionManager(void);\r
\r
//\r
// The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.\r
//\r
- // @param[in] rhs An instance of % GeolocationPermissionManager to assign from\r
+ // @param[in] rhs An instance of % GeolocationPermissionManager to assign from\r
// @remarks This operator is hidden.\r
//\r
GeolocationPermissionManager& operator=(const GeolocationPermissionManager& rhs);\r
{
/**
- * @class HitElementResult
+ * @class HitElementResult
* @brief This class provides methods to retrieve information from the HyperText Markup Language (HTML) element, pointed by the x and y coordinates.
*
- * @since 2.0
+ * @since 2.0
*
* The %HitElementResult class provides methods to retrieve information from the HTML element, such as tag name, attributes and content.
* @n
* @since 2.0
*
* @return @c true if the element is an image element, @n
- * else @c false
+ * else @c false
*/
bool HasImage(void) const;
* @since 2.0
*
* @return @c true if there is a URL linked to the element, @n
- * else @c false
+ * else @c false
*/
bool HasUrl(void) const;
/**
* @interface IJavaScriptBridge
- * @brief This interface provides a communication channel between JavaScript and native object.
+ * @brief This interface provides a communication channel between JavaScript and native object.
*
- * @since 2.0
+ * @since 2.0
*
* The %IJavaScriptBridge interface provides a communication channel between JavaScript and C++ object.
*/
/**
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
*
- * @since 2.0
+ * @since 2.0
*/
virtual ~IJavaScriptBridge(void) {}
/**
* Called asynchronously on invocation request from JavaScript side through the requestToNative() method.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] pArg The parameters delivered by JavaScript
+ * @param[in] pArg The parameters delivered by JavaScript
*/
virtual void HandleJavaScriptRequestN(Tizen::Web::Json::IJsonValue* pArg) = 0;
*
* @since 2.0
*
- * @return The name of %IJavaScriptBridge
+ * @return The name of %IJavaScriptBridge
*/
virtual Tizen::Base::String GetName(void) = 0;
*
* Defines the type of %Web navigation.
*
- * @since 2.0
+ * @since 2.0
*/
enum WebNavigationType
{
*
* Defines the types of loading errors.
*
- * @since 2.0
+ * @since 2.0
*/
enum LoadingErrorType
{
WEB_BAD_URL, /**< The URL is invalid */
WEB_HTTP_RESPONSE, /**< The hypertext transfer protocol (HTTP) response */
WEB_OUT_OF_MEMORY, /**< The memory is not enough to load the page */
- WEB_FILE_ACCESS_FAILED, /**< The file access failed */
+ WEB_FILE_ACCESS_FAILED, /**< The file access failed */
WEB_REQUEST_MAX_EXCEEDED, /**< The request has failed because the total number of requests have exceeded the maximum limit */
WEB_INVALID_CERTIFICATE /**< The hypertext transfer protocol secure (HTTPS) request has failed due to an invalid certificate or CA */
};
*
* Defines the decision policy.
*
- * @since 2.0
+ * @since 2.0
*/
enum DecisionPolicy
{
* @interface ILoadingListener
* @brief This interface is for receiving the events that occur during the loading of data.
*
- * @since 2.0
+ * @since 2.0
*
* The %ILoadingListener interface receives the events that occur during the loading of data.
* To listen to the events occurred during a data loading operation, implement this listener. If there is no
/**
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
*
- * @since 2.0
+ * @since 2.0
*/
virtual ~ILoadingListener(void) {}
/**
* Called when an authentication is requested.
*
- * @since 2.0
+ * @since 2.0
*
* @return @c true if the ownership is taken by the application, @n
- * else @c false, and a default dialog for the ID and password is displayed @n
+ * else @c false, and a default dialog for the ID and password is displayed @n
* If this method returns @c true, the application must delete the AuthenticationChallenge instance.
* @param[in] host The host requiring the authentication
* @param[in] realm The description to help save the user credentials for future visits
- * @param[in] authentication The handler to send a user response to the server that requested the authentication
+ * @param[in] authentication The handler to send a user response to the server that requested the authentication
*/
virtual bool OnHttpAuthenticationRequestedN(const Tizen::Base::String& host, const Tizen::Base::String& realm, const Tizen::Web::Controls::AuthenticationChallenge& authentication) = 0;
/**
* Called when the authentication request is cancelled.
*
- * @since 2.0
+ * @since 2.0
*/
virtual void OnHttpAuthenticationCanceled(void) = 0;
/**
* Called when the loading operation starts.
*
- * @since 2.0
+ * @since 2.0
*/
virtual void OnLoadingStarted(void) = 0;
/**
* Called when the loading operation is cancelled.
*
- * @since 2.0
+ * @since 2.0
*/
virtual void OnLoadingCanceled(void) = 0;
/**
* Called when the loading operation fails.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] error The error that occurred during loading
- * @param[in] reason The reason for the loading failure, @n
- * - WEB_HTTP_RESPONSE: The HTTP state code such as "404" @n
- * - WEB_MIME_NOT_SUPPORTED: The Multipurpose Internet Mail Extensions (MIME) type such as "application/rdf+xml" is not supported @n
- * - WEB_BAD_URL: The URL is incorrect
+ * @param[in] error The error that occurred during loading
+ * @param[in] reason The reason for the loading failure, @n
+ * - @c WEB_HTTP_RESPONSE: The HTTP state code such as "404" @n
+ * - @c WEB_MIME_NOT_SUPPORTED: The Multipurpose Internet Mail Extensions (MIME) type such as "application/rdf+xml" is not supported @n
+ * - @c WEB_BAD_URL: The URL is incorrect
*/
virtual void OnLoadingErrorOccurred(LoadingErrorType error, const Tizen::Base::String& reason) = 0;
/**
* Called when the loading operation is completed.
*
- * @since 2.0
+ * @since 2.0
*/
virtual void OnLoadingCompleted(void) = 0;
* Called when the loading progress for the current page is requested. @n
* The progress rate is displayed as a percentage.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] progress The progress rate ranging from [0~100]
+ * @param[in] progress The progress rate ranging from [@c 0 ~ @c 100]
*/
virtual void OnEstimatedProgress(int progress) = 0;
/**
* Called when the title of the new page has been received.
*
- * @since 2.0
+ * @since 2.0
*/
virtual void OnPageTitleReceived(const Tizen::Base::String& title) = 0;
* If an application wants to handle the URL, it must return @c true. If an application returns @c false, the request of the URL continues with the
* browser engine.
*
- * @since 2.0
+ * @since 2.0
*
- * @return @c true if the application handles the URL after the request is canceled in the browser engine, @n
+ * @return @c true if the application handles the URL after the request is canceled in the browser engine, @n
* else @c false if the browser engine proceeds with the requested URL
- * @param[in] url The URL that is requested
- * @param[in] type The type indicating how the URL is triggered
+ * @param[in] url The URL that is requested
+ * @param[in] type The type indicating how the URL is triggered
*/
virtual bool OnLoadingRequested(const Tizen::Base::String& url, WebNavigationType type) = 0;
/**
* Called to notify an application of the content type of the data to be downloaded. @n
- * - To handle data by itself, the application must return WEB_DECISION_DOWNLOAD. The data is routed to IWebDownloadListener to be downloaded incrementally. @n
- * - If an application returns WEB_DECISION_CONTINUE, the browser engine continues the downloading and tries to parse the data. @n
- * - If an application returns WEB_DECISION_IGNORE, the browser engine cancels the downloading of the data.
+ * - To handle data by itself, the application must return @c WEB_DECISION_DOWNLOAD. The data is routed to IWebDownloadListener to be downloaded incrementally. @n
+ * - If an application returns @c WEB_DECISION_CONTINUE, the browser engine continues the downloading and tries to parse the data. @n
+ * - If an application returns @c WEB_DECISION_IGNORE, the browser engine cancels the downloading of the data.
*
- * @since 2.0
+ * @since 2.0
*
- * @return DecisionPolicy A value of the enumerator DecisionPolicy
- * @param[in] mime The content type of the data that is downloaded
- * @param[in] httpHeader The HTTP header string
+ * @return DecisionPolicy A value of the enumerator DecisionPolicy
+ * @param[in] mime The content type of the data that is downloaded
+ * @param[in] httpHeader The HTTP header string
*/
virtual DecisionPolicy OnWebDataReceived(const Tizen::Base::String& mime, const Tizen::Net::Http::HttpHeader& httpHeader) = 0;
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ILoadingListener_Reserved1(void) {}
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ILoadingListener_Reserved2(void) {}
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ILoadingListener_Reserved3(void) {}
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ILoadingListener_Reserved4(void) {}
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ILoadingListener_Reserved5(void) {}
/**
* @interface ITextSearchListener
- * @brief This interface is for receiving the result of the search operation made by asynchronous methods.
+ * @brief This interface is for receiving the result of the search operation made by asynchronous methods.
*
- * @since 2.0
+ * @since 2.0
*
* The %ITextSearchListener interface receives the result of the search operation made by asynchronous methods.
*/
/**
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
*
- * @since 2.0
+ * @since 2.0
*/
virtual ~ITextSearchListener(void) {}
/**
* Called when the text is found.
*
- * @since 2.0
+ * @since 2.0
*
* @param[in] totalCount The total count of matches
- * @param[in] currentOrdinal The ordinal of currently selected match @n
+ * @param[in] currentOrdinal The ordinal of currently selected match @n
* If there is no match, it will be set to zero.
*/
virtual void OnTextFound(int totalCount, int currentOrdinal) = 0;
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ITextSearchListener_Reserved1(void) {};
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void ITextSearchListener_Reserved2(void) {};
};
* @interface IWebDownloadListener
* @brief This interface downloads data from the internet.
*
- * @since 2.0
+ * @since 2.0
*
* The %IWebDownloadListener interface downloads data from the internet.
* An application receives content from a network incrementally
* @endcode
*
* As soon as the first chunk of data is received, OnWebDataReceived() is fired with the MIME type.
- * If you want to download the data, return WEB_DECISION_DOWNLOAD.
+ * If you want to download the data, return @c WEB_DECISION_DOWNLOAD.
*
* @code
* DecisionPolicy
/**
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
*
- * @since 2.0
+ * @since 2.0
*/
virtual ~IWebDownloadListener(void) {}
/**
* Called when the HyperText Transfer Protocol (HTTP) protocol receives the next chunked data.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] chunk The chunked data
- * @remarks The received data size is less than the capacity of the specified Tizen::Base::ByteBuffer by @c 1.
+ * @param[in] chunk The chunked data
+ * @remarks The received data size is less than the capacity of the specified Tizen::Base::ByteBuffer by @c 1.
*/
virtual void OnWebChunkedDataReceived(const Tizen::Base::ByteBuffer& chunk) = 0;
/**
* Called when the downloading of the content is completed.
*
- * @since 2.0
+ * @since 2.0
*/
virtual void OnWebDataDownloadCompleted(void) = 0;
/**
* Called when an error has occurred while downloading content.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] error The type of error that occurred while downloading data
+ * @param[in] error The type of error that occurred while downloading data
*/
virtual void OnWebDownloadFailed(LoadingErrorType error) = 0;
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void IWebDownloadListener_Reserved1(void) {}
//
// Gets the Impl instance.
//
- // @since 2.0
+ // @since 2.0
//
virtual void IWebDownloadListener_Reserved2(void) {}
/**
* @interface IWebKeypadEventListener
- * @brief This interface provides a listener for keypad events invoked by the <textarea> or <input> tag, which has "text" or "password" value as its attribute.
+ * @brief This interface provides a listener for keypad events invoked by the <textarea> or <input> tag, which has "text" or "password" value as its attribute.
*
- * @since 2.0
+ * @since 2.0
*
* The %IWebKeypadEventListener interface provides a listener for keypad events invoked by the <textarea> or <input> tag, which has "text" or "password" value as its attribute.
* It also enables the implementer class to receive the overlay keypad related events.
virtual ~IWebKeypadEventListener(void) {}
/**
- * Called when the keypad is about to be shown on the screen.
+ * Called when the keypad is about to be shown on the screen. @n
+ * When the overlay keypad appears on the screen, the current Form's
+ * area is adjusted to account for the space that is taken up by the overlay keypad.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] source The source of the event
- * @remarks When the overlay keypad appears on the screen, the current Form's
- * area is adjusted to account for the space that is taken up by the overlay keypad.
- * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
+ * @param[in] source The source of the event
+ * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
*/
virtual void OnWebKeypadWillOpen(Tizen::Web::Controls::Web& source) = 0;
/**
- * Called when the keypad is shown on the screen.
+ * Called when the keypad is shown on the screen. @n
+ * When the overlay keypad appears on the screen, the current Form's
+ * area is adjusted to account for the space that is taken up by the overlay keypad.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] source The source of the event
- * @remarks When the overlay keypad appears on the screen, the current Form's
- * area is adjusted to account for the space that is taken up by the overlay keypad.
- * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
+ * @param[in] source The source of the event
+ * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
*/
virtual void OnWebKeypadOpened(Tizen::Web::Controls::Web& source) = 0;
*
* @since 2.0
*
- * @param[in] source The source of the event
- * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
+ * @param[in] source The source of the event
+ * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
*/
virtual void OnWebKeypadClosed(Tizen::Web::Controls::Web& source) = 0;
/**
* Called when the keypad bounds are changed, for instance when the predictive text window which is located in the upper side of the keypad is shown.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] source The source of the event
- * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
+ * @param[in] source The source of the event
+ * @see Tizen::Ui::Controls::Form::GetClientAreaBounds()
*/
virtual void OnWebKeypadBoundsChanged(Tizen::Web::Controls::Web& source) {};
/**
* This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
*
- * @since 2.0
+ * @since 2.0
*/
virtual ~IWebUiEventListener(void) {}
/**
* Called when the layout of a page is updated. @n
- * The application must call Control::Show() if the screen needs to be updated.
+ * The application must call Tizen::Ui::Control::Show() if the screen needs to be updated.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] source The source of the event
+ * @param[in] source The source of the event
*/
virtual void OnWebPageShowRequested(Tizen::Web::Controls::Web& source) = 0;
/**
* Called when a request for creating a new window is received. @n
- * The returned Web control instance must be constructed by using a child window's Construct() method.
+ * The returned %Web control instance must be constructed by using a child window's Construct() method.
*
- * @since 2.0
+ * @since 2.0
*
- * @return A pointer to the new WebWindow instance
+ * @return A pointer to the new WebWindow instance
*/
virtual Tizen::Web::Controls::Web* OnWebWindowCreateRequested(void) = 0;
/**
* Called when a request for closing the window is received. @n
* This event is called from the parent window's listener that invoked the child window. @n
- * The application must free the resource allocated for the Web Control.
+ * The application must free the resource allocated for the %Web Control.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] source The source of the closing event
+ * @param[in] source The source of the closing event
*/
virtual void OnWebWindowCloseRequested(Tizen::Web::Controls::Web& source) = 0;
/**
* Called when the selected block of a page is updated.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] source The source of the event
- * @param[in] startPoint The starting point of the selected block
- * @param[in] endPoint The ending point of the selected block
+ * @param[in] source The source of the event
+ * @param[in] startPoint The starting point of the selected block
+ * @param[in] endPoint The ending point of the selected block
*/
virtual void OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint) = 0;
--- /dev/null
+//\r
+// Open Service Platform\r
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the License);\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+\r
+/*\r
+* @file FWebCtrlIWebUiEventListenerF.h\r
+* @brief This is the header file for the %IWebUiEventListenerF interface.\r
+*\r
+* This header file contains the declarations of the %IWebUiEventListenerF interface.\r
+*/\r
+#ifndef _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_F_H\r
+#define _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_F_H_\r
+\r
+#include <FBaseRtIEventListener.h>\r
+#include <FWebCtrlWeb.h>\r
+#include <FGrpPoint.h>\r
+\r
+namespace Tizen { namespace Web { namespace Controls\r
+{\r
+\r
+/*\r
+* @interface IWebUiEventListenerF\r
+* @brief This interface is used for receiving user interface (UI) related events caused by the layout changes of a control.\r
+*\r
+* @since 2.1\r
+*\r
+* The %IWebUiEventListenerF interface is used for receiving user interface (UI) related events caused by the layout changes of a control.\r
+* The browser engine requests a screen update through this interface when the layout of a page is changed.\r
+*/\r
+class _OSP_EXPORT_ IWebUiEventListenerF\r
+ : public virtual Tizen::Base::Runtime::IEventListener\r
+{\r
+public:\r
+ /*\r
+ * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.\r
+ *\r
+ * @since 2.1\r
+ */\r
+ virtual ~IWebUiEventListenerF (void) {}\r
+\r
+ /*\r
+ * Called when the layout of a page is updated. @n\r
+ * The application must call Tizen::Ui::Control::Show() if the screen needs to be updated.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @param[in] source The source of the event\r
+ */\r
+ virtual void OnWebPageShowRequested(Tizen::Web::Controls::Web& source) = 0;\r
+\r
+ /*\r
+ * Called when a request for creating a new window is received. @n\r
+ * The returned %Web control instance must be constructed by using a child window's Construct() method.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @return A pointer to the new WebWindow instance\r
+ */\r
+ virtual Tizen::Web::Controls::Web* OnWebWindowCreateRequested(void) = 0;\r
+\r
+ /*\r
+ * Called when a request for closing the window is received. @n\r
+ * This event is called from the parent window's listener that invoked the child window. @n\r
+ * The application must free the resource allocated for the %Web Control.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @param[in] source The source of the closing event\r
+ */\r
+ virtual void OnWebWindowCloseRequested(Tizen::Web::Controls::Web& source) = 0;\r
+\r
+ /*\r
+ * Called when the selected block of a page is updated.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @param[in] source The source of the event\r
+ * @param[in] startPoint The starting point of the selected block\r
+ * @param[in] endPoint The ending point of the selected block\r
+ */\r
+ virtual void OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graphics::FloatPoint& startPoint, Tizen::Graphics::FloatPoint& endPoint) = 0;\r
+\r
+protected:\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.\r
+ //\r
+ // Gets the Impl instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ virtual void IWebUiEventListenerF_Reserved1(void) {};\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.\r
+ //\r
+ // Gets the Impl instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ virtual void IWebUiEventListenerF_Reserved2(void) {};\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.\r
+ //\r
+ // Gets the Impl instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ virtual void IWebUiEventListenerF_Reserved3(void) {};\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.\r
+ //\r
+ // Gets the Impl instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ virtual void IWebUiEventListenerF_Reserved4(void) {};\r
+\r
+ //\r
+ // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.\r
+ //\r
+ // Gets the Impl instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ virtual void IWebUiEventListenerF_Reserved5(void) {};\r
+}; // IWebUiEventListenerF\r
+\r
+}}} // Tizen::Web::Controls\r
+#endif // _FWEB_CTRL_IWEB_UI_EVENT_LISTENER_F_H_\r
{
/**
- * @class PageNavigationList
- * @brief This class contains the back and forward list for a Web control.
+ * @class PageNavigationList
+ * @brief This class contains the back and forward list for a %Web control.
*
- * @since 2.0
+ * @since 2.0
*
* The %PageNavigationList class provides the back and forward list for a Web control.
* @n
* @since 2.0
*
* @return The current history item, @n
- * else @c null if no history item exists
+ * else @c null if no history item exists
*/
const Tizen::Web::HistoryItem* GetCurrentItem(void) const;
* @since 2.0
*
* @return A pointer to the history item at the specified @c index
- * @param[in] index The index of an element @n
- * The value of the index must be greater than or equal to @c 0.
- * @exception E_OUT_OF_RANGE The specified @c index is out of range.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] index The index of an element @n
+ * The value of the index must be greater than or equal to @c 0.
+ * @exception E_OUT_OF_RANGE The specified @c index is out of range.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
const Tizen::Web::HistoryItem* GetItemAt(int index) const;
//
// The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
//
- // @param[in] item The instance of the %PageNavigationList class to copy from
+ // @param[in] item The instance of the %PageNavigationList class to copy from
// @remarks This constructor is hidden.
//
PageNavigationList(const PageNavigationList& item);
//
// The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
//
- // @param[in] item The instance of the %PageNavigationList class to assign from
+ // @param[in] item The instance of the %PageNavigationList class to assign from
// @remarks This operator is hidden.
//
PageNavigationList& operator =(const PageNavigationList& item);
class IWebDownloadListener;
class IWebKeypadEventListener;
class IWebUiEventListener;
+class IWebUiEventListenerF;
class IWebUiListener;
class HitElementResult;
class PageNavigationList;
{
/**
- * @class Web
- * @brief This class provides methods for embedding a browser in an application.
+ * @class Web
+ * @brief This class provides methods for embedding a browser in an application.
*
- * @since 2.0
+ * @since 2.0
*
* The %Web class provides methods for embedding a browser in an application to load and render various types of %Web content. Similar to adding UI controls, the %Web content can be added to the application by adding a %Web control.
* @n
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @return An error code
- * @param[in] rect The rectangle size of the control
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM The method has failed.
- * @exception E_INVALID_OPERATION The control has not been constructed as yet.
- * @exception E_INVALID_ARG The specified @c rect is invalid.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @return An error code
+ * @param[in] rect The rectangle size of the control
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method has failed.
+ * @exception E_INVALID_ARG The specified @c rect is invalid.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result Construct(const Tizen::Graphics::Rectangle& rect);
+ /*
+ * Initializes this instance of the %Web control with the specified parameters.
+ *
+ * @since 2.1
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
+ *
+ * @return An error code
+ * @param[in] rect The rectangle size of the control
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method has failed.
+ * @exception E_INVALID_ARG The specified @c rect is invalid.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ */
+ result Construct(const Tizen::Graphics::FloatRectangle& rect);
+
/**
* Loads the resource specified by the URL.
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @param[in] url The resource to load
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] url The resource to load
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void LoadUrl(const Tizen::Base::String& url);
/**
* Loads the resource specified by the URL with the given header of HTTP request.
*
- * @since 2.0
+ * @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return An error code
- * @param[in] url The resource to load
- * @param[in] header The header of the HTTP request
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The url or the header is invalid.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @param[in] url The resource to load
+ * @param[in] header The header of the HTTP request
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_HEADER The header object does not contain any header fields.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result LoadUrl(const Tizen::Base::String& url, const Tizen::Net::Http::HttpHeader& header);
* Load the resource specified by the URL with the given header and body of HTTP request.
* The header must include content-type entity-header field that is needed to check mime-type of the message body.
*
- * @since 2.0
+ * @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return An error code
- * @param[in] url The resource to load
- * @param[in] header The header of the HTTP request
- * @param[in] body The message body of the HTTP request
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The header is invalid.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @param[in] url The resource to load
+ * @param[in] header The header of the HTTP request
+ * @param[in] body The message body of the HTTP request
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_HEADER The header object does not contain any header fields.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result LoadUrlWithPostRequest(const Tizen::Base::String& url, const Tizen::Net::Http::HttpHeader& header, const Tizen::Base::ByteBuffer& body);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @param[in] baseUrl The uniform resource locator (URL) of the content
- * @param[in] content The content
- * @param[in] mime The MIME type of the content
- * @param[in] encoding The <a href= "../org.tizen.native.appprogramming/html/guide/web/supported_web_features.htm">text encoding</a> of the content
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] baseUrl The uniform resource locator (URL) of the content
+ * @param[in] content The content
+ * @param[in] mime The MIME type of the content
+ * @param[in] encoding The <a href= "../org.tizen.native.appprogramming/html/guide/web/supported_web_features.htm">text encoding</a> of the content
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The content buffer is empty @b Since: @b 2.1
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void LoadData(const Tizen::Base::String& baseUrl, const Tizen::Base::ByteBuffer& content, const Tizen::Base::String& mime, const Tizen::Base::String& encoding = "UTF-8");
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void StopLoading(void);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void Reload(void);
* @since 2.0
*
* @return @c true if a page is loading, @n
- * else @c false
+ * else @c false
*/
bool IsLoading(void) const;
* @since 2.0
*
* @return @c true if a back history item exists, @n
- * else @c false
+ * else @c false
*/
bool CanGoBack(void) const;
* @since 2.0
*
* @return @c true if a forward history item exists, @n
- * else @c false
+ * else @c false
*/
bool CanGoForward(void) const;
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void GoBack(void);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void GoForward(void);
* @since 2.0
*
* @return A pointer to PageNavigationList containing the history items of the %Web control
- * @exception E_SUCCESS The method is successful.
- * @exception E_DATA_NOT_FOUND There is no history data.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Web::Controls::PageNavigationList* GetBackForwardListN(void) const;
* @since 2.0
*
* @return @c true if the specified @c word is found, @n
- * else @c false
- * @param[in] word The string to search for
- * @param[in] searchForward Set to @c true to search for the word in the forward direction from the current position, @n
+ * else @c false
+ * @param[in] word The string to search for
+ * @param[in] searchForward Set to @c true to search for the word in the forward direction from the current position, @n
* else @c false to search for the word in the backward direction from the current position
*/
bool SearchText(const Tizen::Base::String& word, bool searchForward = true);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return An error code
- * @param[in] setting The setting to update
- * @exception E_SUCCESS The method is successful.
- * @exception E_FAILURE The method has failed.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @param[in] setting The setting to update
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result SetSetting(const Tizen::Web::Controls::WebSetting& setting);
* @since 2.0
*
* @return A HitElementResult of the pointed element
- * @param[in] point The x and y coordinates
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified @c point is invalid.
- * @exception E_OBJ_NOT_FOUND The specified element is not found.
- * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] point The x and y coordinates
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c point is invalid.
+ * @exception E_UNSUPPORTED_FORMAT The image format is not supported.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Web::Controls::HitElementResult* GetElementByPointN(const Tizen::Graphics::Point& point) const;
+ /*
+ * Gets the information of the element pointed by the specified coordinates.
+ *
+ * @since 2.1
+ *
+ * @return A HitElementResult of the pointed element
+ * @param[in] point The x and y coordinates
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c point is invalid.
+ * @exception E_UNSUPPORTED_FORMAT The image format is not supported.
+ * @exception E_SYSTEM The method cannot proceed due to a severe system error.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ Tizen::Web::Controls::HitElementResult* GetElementByPointN(const Tizen::Graphics::FloatPoint& point) const;
+
/**
* Evaluates the JavaScript string and returns the result.
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return The result of the evaluated JavaScript, @n
- * else an empty string if an error occurs
- * @param[in] scriptCode The JavaScript code as string
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * else an empty string if an error occurs
+ * @param[in] scriptCode The JavaScript code as string
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Base::String* EvaluateJavascriptN(const Tizen::Base::String& scriptCode);
* @since 2.0
*
* @return An error code
- * @param[in] level The zoom-out level @n
- * The value ranges between @c 0.3 and @c 2.0. When the page view is at its original size, the level is @c 1.0. @n If the
- * specified level is less than @c 1.0, the page view is reduced. @n If the specified level is greater than @c 1.0, the page view is
- * magnified.
- * @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c level is less than @c 0.3 or greater than @c 2.0.
+ * @param[in] level The zoom-out level @n
+ * The value ranges between @c 0.3 and @c 2.0. When the page view is at its original size, the level is @c 1.0. @n If the
+ * specified level is less than @c 1.0, the page view is reduced. @n If the specified level is greater than @c 1.0, the page view is
+ * magnified.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified @c level is less than @c 0.3 or greater than @c 2.0.
*/
result SetZoomLevel(float level);
Tizen::Base::String GetUrl(void) const;
/**
- * Checks whether the specified multipurpose internet mail extensions (MIME) type is supported by Tizen.
+ * Checks whether the specified multipurpose internet mail extensions (MIME) type is supported by %Tizen.
*
* @since 2.0
*
* @return @c true if the specified MIME type is supported, @n
- * else @c false
- * @param[in] mime The MIME type
+ * else @c false
+ * @param[in] mime The MIME type
*/
bool IsMimeSupported(const Tizen::Base::String& mime) const;
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @param[in] pLoadingListener The listener receives the events that occurs while loading the data
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] pLoadingListener The listener receives the events that occurs while loading the data
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void SetLoadingListener(Tizen::Web::Controls::ILoadingListener* pLoadingListener);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
- * @param[in] pDownLoadListener The listener to receive the data from a network incrementally
- * @exception E_SUCCESS The method is successful.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @param[in] pDownLoadListener The listener to receive the data from a network incrementally
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
void SetDownloadListener(Tizen::Web::Controls::IWebDownloadListener* pDownLoadListener);
* @since 2.0
*
* @return An error code
- * @param[in] startPoint The starting point for the text selection block
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG There is nothing to select from the starting point specified.
+ * @param[in] startPoint The starting point for the text selection block
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG There is nothing to select from the starting point specified.
*/
result SetBlockSelectionPosition(const Tizen::Graphics::Point& startPoint);
+ /*
+ * Sets the starting point for the text selection block. @n
+ * It sets the selection block around the nearest word bound.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[in] startPoint The starting point for the text selection block
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG There is nothing to select from the starting point specified.
+ */
+ result SetBlockSelectionPosition(const Tizen::Graphics::FloatPoint& startPoint);
+
/**
* Releases the currently selected block.
*
* @since 2.0
*
* @return An error code
- * @exception E_SUCCESS The method is successful.
+ * @exception E_SUCCESS The method is successful.
*
*/
result ReleaseBlock(void);
* @since 2.0
*
* @return An error code
- * @param[out] startPoint The starting point of the selected text block
- * @param[out] endPoint The ending point of the selected text block
- * @exception E_SUCCESS The method is successful.
+ * @param[out] startPoint The starting point of the selected text block
+ * @param[out] endPoint The ending point of the selected text block
+ * @exception E_SUCCESS The method is successful.
*/
result GetBlockRange(Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint) const;
+ /*
+ * Gets the starting point and the ending point of the selected text block. @n
+ * When this method is called without the selection block, the startPoint and endPoint have (0.0,0.0) values for the x and y coordinates.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @param[out] startPoint The starting point of the selected text block
+ * @param[out] endPoint The ending point of the selected text block
+ * @exception E_SUCCESS The method is successful.
+ */
+ result GetBlockRange(Tizen::Graphics::FloatPoint& startPoint, Tizen::Graphics::FloatPoint& endPoint) const;
+
+
/**
* Gets the text of the selected text block.
*
* @since 2.0
*
* @return The selected text, @n
- * else an empty string if there is no selection block
+ * else an empty string if there is no selection block
*/
Tizen::Base::String GetTextFromBlock(void) const;
*
* @since 2.0
*
- * @param[in] enable Set to @c true to enable the scrolling of the web page, @n
- * else @c false
- * @exception E_SUCCESS The method is successful.
+ * @param[in] enable Set to @c true to enable the scrolling of the web page, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
*/
result SetScrollEnabled(bool enable);
* @since 2.0
*
* @return @c true if the web page scroll is enabled, @n
- * else @c false
+ * else @c false
*/
bool IsScrollEnabled(void) const;
*
* @since 2.0
*
- * @param[in] pUiEventListener The listener to receive the user interface (UI) related events
+ * @param[in] pUiEventListener The listener to receive the user interface (UI) related events
*/
void SetWebUiEventListener(Tizen::Web::Controls::IWebUiEventListener* pUiEventListener);
+ /*
+ * Registers a user interface (UI) event listener.
+ *
+ * @since 2.1
+ *
+ * @param[in] pUiEventListener The listener to receive the user interface (UI) related events
+ */
+ void SetWebUiEventListenerF(Tizen::Web::Controls::IWebUiEventListenerF* pUiEventListener);
+
/**
* Checks whether the %Web control uses private browsing.
*
* @since 2.0
*
* @return @c true if private browsing is enabled, @n
- * else @c false
+ * else @c false
*/
bool IsPrivateBrowsingEnabled(void) const;
*
* @since 2.0
*
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
+ *
* @return The result of setting the private browsing
- * @param[in] enable Set to @c true to enable private browsing, @n
- * else @c false
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM The method has failed.
+ * @param[in] enable Set to @c true to enable private browsing, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result SetPrivateBrowsingEnabled(bool enable);
/**
+ * Clears the back and forward navigation list.
+ *
+ * @since 2.1
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @see CanGoBack()
+ * @see CanGoForward()
+ * @see GoBack()
+ * @see GoForward()
+ */
+ result ClearHistory(void);
+
+ /**
* Clears the application's cache.
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return An error code
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM The method has failed.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result ClearCache(void);
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return An error code
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM The method has failed.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result ClearCookie(void);
/**
+ * Clears the application's all stored form datas.
+ *
+ * @since 2.1
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ */
+ result ClearFormData(void);
+
+ /**
+ * Clears the application's all stored id/password datas.
+ *
+ * @since 2.1
+ *
+ * @privleve public
+ * @privilege http://tizen.org/privilege/web.service
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ */
+ result ClearLoginFormData(void);
+
+ /**
* Checks whether the %Web control allows cookie. @n
* Returns @c true if cookie is enabled.
*
* @since 2.0
*
* @return @c true if cookie is allowed, @n
- * else @c false
+ * else @c false
*/
bool IsCookieEnabled(void) const;
*
* @since 2.0
*
- * @privilege %http://tizen.org/privilege/web.service
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
*
* @return The result of enabling or disabling cookie
- * @param[in] enable Set to @c true if the web control allows a cookie, @n
- * else @c false
- * @exception E_SUCCESS The method is successful.
- * @exception E_SYSTEM The method has failed.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @param[in] enable Set to @c true if the web control allows a cookie, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
*/
result SetCookieEnabled(bool enable);
/**
* Saves the current web page as a pdf file. The size parameter is used to set size of the pdf file using millimeter.
*
- * @since 2.0
+ * @since 2.0
*
* @return An error code
- * @param[in] filePath The path of the pdf file that is created
- * @param[in] pSize The width and height of the pdf file in millimeter. The width and height must be greater than 0. @n
- * If the parameter contains @c null, the method uses the default size of the web page that is shown on the screen.
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
- * - The specified path is invalid.
- * - The specified size is invalid.
- * @exception E_INACCESSIBLE_PATH The file path is not allowed for the application to write.
+ * @param[in] filePath The path of the pdf file that is created
+ * @param[in] pSize The width and height of the pdf file in millimeter. The width and height must be greater than @c 0. @n
+ * If the parameter contains @c null, the method uses the default size of the web page that is shown on the screen.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified path is invalid.
+ * - The specified size is invalid.
+ * @exception E_INACCESSIBLE_PATH The file path is not allowed for the application to write.
*/
result SavePageAsPdf(const Tizen::Base::String& filePath, const Tizen::Graphics::Dimension* pSize = null);
* @since 2.0
*
* @return An error code
- * @param[in] jsBridge The JavaScript bridge to add
- * @exception E_SUCCESS The method is successful.
- * @exception E_OBJ_ALREADY_EXIST A JavaScript bridge with the same name already exists.
+ * @param[in] jsBridge The JavaScript bridge to add
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OBJ_ALREADY_EXIST A JavaScript bridge with the same name already exists.
*/
result AddJavaScriptBridge(const IJavaScriptBridge& jsBridge);
* @since 2.0
*
* @return An error code
- * @param[in] jsBridge The JavaScript bridge to remove
- * @exception E_SUCCESS The method is successful.
+ * @param[in] jsBridge The JavaScript bridge to remove
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OBJ_NOT_FOUND The specified element is not found.
*/
result RemoveJavaScriptBridge(const IJavaScriptBridge& jsBridge);
*
* @since 2.0
*
- * @param[in] pKeypadEventListener The event listener to set
+ * @param[in] pKeypadEventListener The event listener to set
* @remarks The interfaces of IWebKeypadEventListener are called only when the input style of the keypad is @c INPUT_STYLE_OVERLAY.
- * @see WebSetting::SetInputStyle()
+ * @see WebSetting::SetInputStyle()
*/
void SetWebKeypadEventListener(IWebKeypadEventListener* pKeypadEventListener);
* Searches for all instances of the text on the current page and then highlights them. @n
* The current matched block will indicate the first match.
*
- * @since 2.0
+ * @since 2.0
*
* @return An error code
*
- * @param[in] text The string to search for
- * @param[in] caseSensitive Set to @c true to search for the text with case-sensitive mode, @n
- * else @c false to search for the text in the backward direction from the current position
- * @exception E_SUCCESS The method is successful.
- * @exception E_INVALID_ARG The specified @c text is invalid.
+ * @param[in] text The string to search for
+ * @param[in] caseSensitive Set to @c true to search for the text with case-sensitive mode, @n
+ * else @c false to search for the text in the backward direction from the current position
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified @c text is invalid.
* @remarks This method operates asynchronously.
- * @see Tizen::Web::Controls::ITextSearchListener::OnTextFound()
+ * @see Tizen::Web::Controls::ITextSearchListener::OnTextFound()
*/
result SearchTextAllAsync(const Tizen::Base::String& text, bool caseSensitive);
/**
* Scrolls the current matched block to the next text matched by SearchTextAllAsync()
*
- * @since 2.0
+ * @since 2.0
*
* @return An error code
*
- * @param[in] searchForward Set to @c true to search for the text in the forward direction from the current position, @n
- * @exception E_SUCCESS The method is successful.
- * @exception E_OBJ_NOT_FOUND The next instance is not found.
- * @exception E_INVALID_OPERATION The SearchTextAllAsync() method is not called.
+ * @param[in] searchForward Set to @c true to search for the text in the forward direction from the current position, @n
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OBJ_NOT_FOUND The next instance is not found.
+ * @exception E_INVALID_OPERATION The SearchTextAllAsync() method is not called.
* @remarks This method operates asynchronously.
- * @see Tizen::Web::Controls::ITextSearchListener::OnTextFound()
+ * @see Tizen::Web::Controls::ITextSearchListener::OnTextFound()
*/
result SearchNextAsync(bool searchForward = true);
/**
* Sets a text search listener.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] pTextSearchListener The result of the search operation made by asynchronous methods
+ * @param[in] pTextSearchListener The result of the search operation made by asynchronous methods
*/
void SetTextSearchListener(ITextSearchListener* pTextSearchListener);
/**
* Gets the favicon image from current page.
*
- * @since 2.0
+ * @since 2.0
*
* @return The image
- *
- * @exception E_SUCCESS The method is successful.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
- *
*/
Tizen::Graphics::Bitmap* GetFaviconN(void) const;
/**
* Informs the browser engine to stop the screen operations such as updating a screen until %Web calls the Resume() method. @n
- * It is useful when a Web control is not visible and does not need to update its screen.
+ * It is useful when a %Web control is not visible and does not need to update its screen.
*
* @since 2.0
*/
*/
void Resume(void);
+ /**
+ * Scrolls the web page by the given dx and dy.
+ *
+ * @since 2.1
+ *
+ * @param[in] diff The x and y coordinates
+ */
+ void ScrollBy(const Tizen::Graphics::Point& diff);
+
+ /**
+ * Sets the scrolled position of the web page.
+ *
+ * @since 2.1
+ *
+ * @param[in] dest The x and y coordinates
+ */
+ void ScrollTo(const Tizen::Graphics::Point& dest);
+
+ /**
+ * Gets the current scroll position of the web page.
+ *
+ * @since 2.1
+ *
+ * @return The x and y coordinates
+ */
+ Tizen::Graphics::Point GetScrollPosition(void) const;
+
+ /**
+ * Gets the size of current web page.
+ *
+ * @since 2.1
+ *
+ * @return The size of current web page.
+ */
+ Tizen::Graphics::Dimension GetPageSize(void) const;
+
private:
//
// The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
//
- // @param[in] item The instance of the %Web class to copy from
+ // @param[in] item The instance of the %Web class to copy from
// @remarks This constructor is hidden.
//
Web(const Web& item);
//
// The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
//
- // @param[in] item The instance of the %Web class to assign from
+ // @param[in] item The instance of the %Web class to assign from
// @remarks This operator is hidden.
//
Web& operator =(const Web& item);
*
* Defines the types of cache mode.
*
- * @since 2.0
+ * @since 2.0
*/
enum CacheMode
{
*
* Defines the types of certification error handling mode.
*
- * @since 2.0
+ * @since 2.0
*/
enum CertificateErrorHandlingMode
{
*
* @since 2.0
*
- * @param[in] setting An instance of %WebSetting
+ * @param[in] setting An instance of %WebSetting
*/
WebSetting(const WebSetting& setting);
/**
* Sets a cache control strategy for a %Web control.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] mode A cache mode
+ * @param[in] mode A cache mode
*/
void SetCacheControl(CacheMode mode);
*
* @since 2.0
*
- * @param[in] fontSize The font size
+ * @param[in] fontSize The font size
*/
void SetFontSize(int fontSize);
*
* @since 2.0
*
- * @param[in] enable Set to @c true if the %Web control uses JavaScript, @n
- * else @c false
+ * @param[in] enable Set to @c true if the %Web control uses JavaScript, @n
+ * else @c false
*/
void SetJavascriptEnabled(bool enable);
*
* @since 2.0
*
- * @param[in] enable Set to @c true if the %Web control must load images included in the content, @n
- * else @c false
+ * @param[in] enable Set to @c true if the %Web control must load images included in the content, @n
+ * else @c false
*/
void SetAutoImageLoadEnabled(bool enable);
*
* @since 2.0
*
- * @param[in] inputStyle The input style of keypad
- * @remarks If an application sets the input style to INPUT_STYLE_OVERLAY, the application must implement IWebKeypadEventListener to rearrange the layout of the current Form.
+ * @param[in] inputStyle The input style of keypad
+ * @remarks If an application sets the input style to @c INPUT_STYLE_OVERLAY, the application must implement IWebKeypadEventListener to rearrange the layout of the current Form.
*
*/
void SetInputStyle(Tizen::Ui::Controls::InputStyle inputStyle);
/**
- * Gets the value of the cache control strategy for a %Web control.
+ * Gets the value of the cache control strategy for a %Web control. @n
+ * The default is @c WEB_CACHE_VALIDATED.
*
* @since 2.0
*
CacheMode GetCacheControl(void) const;
/**
- * Gets the font size of the content.
+ * Gets the font size of the content. @n
+ * The default is @c 17.
*
* @since 2.0
*
int GetFontSize(void) const;
/**
- * Gets the text encoding of the content of a %Web control.
+ * Gets the text encoding of the content of a %Web control. @n
+ * The default is UTF-8.
*
* @since 2.0
*
/**
* Checks whether a %Web control uses JavaScript. @n
- * Returns @c true if JavaScript is enabled.
+ * The default is true.
*
* @since 2.0
*
* @return @c true if JavaScript is enabled and used by a %Web control, @n
- * else @c false
+ * else @c false
*/
bool IsJavascriptEnabled(void) const;
/**
* Checks whether a %Web control loads images included in the content automatically. @n
- * Returns @c true if auto image loading is enabled.
+ * The default is true.
*
* @since 2.0
*
* @return @c true if auto image loading is enabled, @n
- * else @c false
+ * else @c false
*/
bool IsAutoImageLoadEnabled(void) const;
/**
- * Gets the input style of the keypad, which is displayed for the <input> or <textarea> tag.
+ * Gets the input style of the keypad, which is displayed for the <input> or <textarea> tag. @n
+ * The default is @c INPUT_STYLE_FULLSCREEN.
*
* @since 2.0
*
- * @return The input style of keypad @n
- * The default value of the input style is INPUT_STYLE_FULLSCREEN.
+ * @return The input style of keypad
*/
Tizen::Ui::Controls::InputStyle GetInputStyle(void) const;
/**
- * Sets a certificate error handling mode for a %Web control.
- *
- * @since 2.0
- *
- * @param[in] mode A certificate error handling mode
- */
+ * Sets a certificate error handling mode for a %Web control.
+ *
+ * @since 2.0
+ *
+ * @param[in] mode A certificate error handling mode
+ */
void SetCertificateErrorHandlingMode(CertificateErrorHandlingMode mode);
/**
- * Gets the value of the certificate error handling mode for a %Web control.
- *
- * @since 2.0
- *
- * @return A certificate error handling mode
- */
+ * Gets the value of the certificate error handling mode for a %Web control. @n
+ * The default is @c WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM.
+ *
+ * @since 2.0
+ *
+ * @return A certificate error handling mode
+ */
CertificateErrorHandlingMode GetCertificateErrorHandlingMode(void) const;
/**
* Sets a user agent for a %Web control.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] agent The user agent
+ * @param[in] agent The user agent
*/
void SetUserAgent(const Tizen::Base::String& agent);
/**
* Gets a value of user agent for a %Web control.
*
- * @since 2.0
+ * @since 2.0
*
* @return The value of user agent
*/
/**
* Decides if a %Web control loads the resized contents to fit width automatically.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] enable Set to @c true if the %Web control should load contents to fit width, @n
- * else @c false
+ * @param[in] enable Set to @c true if the %Web control should load contents to fit width, @n
+ * else @c false
*/
void SetAutoFittingEnabled(bool enable);
/**
- * Checks whether a %Web control loads the resize contents to fit width. Returns true if auto fitting is enabled.
+ * Checks whether a %Web control loads the resize contents to fit width. @n
+ * The default is true.
*
- * @since 2.0
+ * @since 2.0
*
- * @return @c true if auto fitting is enabled, @n
- * else @c false
+ * @return @c true if auto fitting is enabled, @n
+ * else @c false
*/
bool IsAutoFittingEnabled(void) const;
/**
* Decides if a %Web control allows JavaScript to open new window.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] enable Set to @c true if the %Web control should allow JavaScript to open new window, @n
- * else @c false
+ * @param[in] enable Set to @c true if the %Web control should allow JavaScript to open new window, @n
+ * else @c false
*/
void SetJavaScriptPopupEnabled(bool enable);
/**
- * Checks whether a %Web control allows JavaScript to open new window. Returns true if opening new window by JavaScript is enabled.
+ * Checks whether a %Web control allows JavaScript to open new window. Returns true if opening new window by JavaScript is enabled. @n
+ * The default is true.
*
- * @since 2.0
+ * @since 2.0
*
- * @return @c true if opening new window by JavaScript is enabled, @n
- * else @c false
+ * @return @c true if opening new window by JavaScript is enabled, @n
+ * else @c false
*/
bool IsJavaScriptPopupEnabled(void) const;
/**
* Decides if a %Web control supports html5 geolocation feature.
*
- * @since 2.0
+ * @since 2.0
*
- * @param[in] enable Set to @c true if the %Web control should support html5 geolocation feature, @n
- * else @c false
+ * @param[in] enable Set to @c true if the %Web control should support html5 geolocation feature, @n
+ * else @c false
*/
void SetGeolocationEnabled(bool enable);
/**
- * Checks whether a %Web control supports html5 geolocation feature. Returns true if html5 geolocation feature is enabled.
+ * Checks whether a %Web control supports html5 geolocation feature. Returns true if html5 geolocation feature is enabled. @n
+ * The default is true.
*
- * @since 2.0
+ * @since 2.0
*
- * @return @c true if html5 geolocation feature is enabled, @n
- * else @c false
+ * @return @c true if html5 geolocation feature is enabled, @n
+ * else @c false
*/
bool IsGeolocationEnabled(void) const;
/**
+ * Decides if a %Web control saves form data automatically and supports autocomplete feature.
+ *
+ * @since 2.1
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
+ *
+ * @param[in] enable Set to @c true if the %Web control should save form data automatically and supports autocomplete feature, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ */
+ void SetAutoFormDataShowEnabled(bool enable);
+
+ /**
+ * Checks whether %Web control saves form data automatically and supports autocomplete feature. Returns true if those are enabled. @n
+ * The default is true.
+ *
+ * @since 2.1
+ *
+ * @return @c true if saving form data and autocomplete feature are enabled, @n
+ * else @c false
+ */
+ bool IsAutoFormDataShowEnabled(void) const;
+
+ /**
+ * Decides if a %Web control saves id/password for login form automatically and supports autofill feature.
+ *
+ * @since 2.1
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.service
+ *
+ * @param[in] enable Set to @c true if the %Web control should save login id/password automatically and supports autofill feature, @n
+ * else @c false
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ */
+ void SetAutoLoginFormFillEnabled(bool enable);
+
+ /**
+ * Checks whether %Web control saves id/password for login form automatically and supports autofill feature. Returns true if those are enabled. @n
+ * The default is true.
+ *
+ * @since 2.1
+ *
+ * @return @c true if saving id/password for login form and autofill feature are enabled, @n
+ * else @c false
+ */
+ bool IsAutoLoginFormFillEnabled(void) const;
+
+ /**
* Gets the hash value of the current instance.
*
* @since 2.0
*
* @since 2.0
*
- * @return @c true if the two instances match, @n
- * else @c false
- * @param[in] obj The object to compare with the current instance
- * @remarks This method returns @c true if and only if the two instances contain the same elements.
- * @see Tizen::Object::Equals()
+ * @return @c true if the two instances match, or if and only if the two instances contain the same elements, @n
+ * else @c false
+ * @param[in] obj The object to compare with the current instance
+ * @see Tizen::Base::Object::Equals()
*/
virtual bool Equals(const Object& obj) const;
/**
* Copying of objects using this copy assignment operator is allowed.
*
- * @since 2.0
+ * @since 2.0
*
* @param[in] setting The instance of the %WebSetting class to assign from
*/
--- /dev/null
+//\r
+// Open Service Platform\r
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the License);\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+// http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+//\r
+\r
+/**\r
+* @file FWebCtrlWebStorageManager.h\r
+* @brief This is the header file for the %WebStorageManager class.\r
+*\r
+* This header file contains the declarations of the %WebStorageManager class for a %Web control.\r
+*/\r
+#ifndef _FWEB_CTRL_WEB_STORAGE_MANAGER_H_\r
+#define _FWEB_CTRL_WEB_STORAGE_MANAGER_H_\r
+\r
+#include <FBaseString.h>\r
+\r
+namespace Tizen { namespace Base { namespace Collection\r
+{\r
+class IList;\r
+}}} // Tizen::Base::Collection\r
+\r
+namespace Tizen { namespace Web { namespace Controls\r
+{\r
+class _WebStorageManagerImpl;\r
+}}} // Tizen::Web::Control\r
+\r
+namespace Tizen { namespace Web { namespace Controls\r
+{\r
+\r
+/**\r
+* @enum WebStorageType\r
+*\r
+* Defines the web storage type.\r
+*\r
+* @since 2.1\r
+*/\r
+enum WebStorageType\r
+{\r
+ WEB_STORAGE_TYPE_APPLICATION_CACHE, /**< The application cache: the web storage type */\r
+ WEB_STORAGE_TYPE_INDEXED_DATABASE, /**< The indexed database: the web storage type */\r
+ WEB_STORAGE_TYPE_WEB_SQL_DATABASE, /**< The web database: the web storage type */\r
+ WEB_STORAGE_TYPE_WEB_STORAGE, /**< The web storage: the web storage type */\r
+ WEB_STORAGE_TYPE_FILE_SYSTEM /**< The file system: the web storage type */\r
+};\r
+\r
+/**\r
+* @class WebStorageManager\r
+* @brief This class holds the setting values for a %Web control.\r
+*\r
+* @since 2.1\r
+* @final This class is not intended for extension.\r
+*\r
+* The %WebStorageManager\r
+*/\r
+class _OSP_EXPORT_ WebStorageManager\r
+ : public Tizen::Base::Object\r
+{\r
+public:\r
+\r
+ /**\r
+ * Gets the list of origins for the given storage type.\r
+ * The WEB_STORAGE_TYPE_INDEXED_DATABASE is not supported.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @privlevel public\r
+ * @privilege http://tizen.org/privilege/web.privacy\r
+ *\r
+ * @return A pointer to IList containing origin(Tizen::Base::String) list, @n\r
+ * else @c null if no web storage data exists\r
+ * @param[in] storageType The web storage type\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_UNSUPPORTED_TYPE The specified storageType is not supported.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method.\r
+ */\r
+ Tizen::Base::Collection::IList* GetOriginListN(WebStorageType storageType) const;\r
+\r
+ /**\r
+ * Sets the default quota for the given origin for the given storage type.\r
+ * Only the WEB_STORAGE_TYPE_WEB_SQL_DATABASE and the WEB_STORAGE_TYPE_APPLICATION_CACHE are supported.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @privlevel public\r
+ * @privilege http://tizen.org/privilege/web.privacy\r
+ *\r
+ * @return An error code\r
+ * @param[in] storageType The web storage type\r
+ * @param[in] origin The origin\r
+ * @param[in] quota The quota of the web storage to set in bytes\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_UNSUPPORTED_TYPE The specified storageType is not supported.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ */\r
+ result SetQuotaForOrigin(WebStorageType storageType, const Tizen::Base::String& origin, long quota);\r
+\r
+\r
+ /**\r
+ * Gets the quota for the given origin for the given storage type.\r
+ * Only the WEB_STORAGE_TYPE_WEB_SQL_DATABASE is supported.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @privlevel public\r
+ * @privilege http://tizen.org/privilege/web.privacy\r
+ *\r
+ * @return The usage of the web storage in bytes\r
+ * @param[in] storageType The web storage type\r
+ * @param[in] origin The origin\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_UNSUPPORTED_TYPE The specified storageType is not supported.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ */\r
+ long GetQuotaForOrigin(WebStorageType storageType, , const Tizen::Base::String& origin);\r
+\r
+ /**\r
+ * Gets the usage for the given origin for the given storage type.\r
+ * The WEB_STORAGE_TYPE_INDEXED_DATABASE and the WEB_STORAGE_TYPE_FILE_SYSTEM are not supported.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @privlevel public\r
+ * @privilege http://tizen.org/privilege/web.privacy\r
+ *\r
+ * @return The usage of the web storage in bytes\r
+ * @param[in] storageType The web storage type\r
+ * @param[in] origin The origin\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_UNSUPPORTED_TYPE The specified storageType is not supported.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method.\r
+ */\r
+ long GetUsageForOrigin(WebStorageType storageType, const Tizen::Base::String& origin) const;\r
+\r
+ /**\r
+ * Removes the data for the given origin for the given storage type.\r
+ * The WEB_STORAGE_TYPE_INDEXED_DATABASE is not supported.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @privlevel public\r
+ * @privilege http://tizen.org/privilege/web.privacy\r
+ *\r
+ * @return An error code\r
+ * @param[in] storageType The web storage type\r
+ * @param[in] origin The origin\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_UNSUPPORTED_TYPE The specified storageType is not supported.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @see RemoveAll()\r
+ */\r
+ result Remove(WebStorageType storageType, const Tizen::Base::String& origin);\r
+\r
+ /**\r
+ * Removes all data for the given storage type.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @privlevel public\r
+ * @privilege http://tizen.org/privilege/web.privacy\r
+ *\r
+ * @return An error code\r
+ * @param[in] storageType The web storage type\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_UNSUPPORTED_TYPE The specified storageType is not supported.\r
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.\r
+ * @see Remove()\r
+ */\r
+ result RemoveAll(WebStorageType storageType);\r
+\r
+ /**\r
+ * Gets the web storage manager instance.\r
+ *\r
+ * @since 2.1\r
+ *\r
+ * @return A pointer to the %WebStorageManager instance, @n\r
+ * else @c null if it fails\r
+ * @exception E_SUCCESS The method is successful.\r
+ * @exception E_OUT_OF_MEMORY The memory is insufficient.\r
+ * @remarks The specific error code can be accessed using the GetLastResult() method.\r
+ */\r
+ static WebStorageManager* GetInstance(void);\r
+\r
+private:\r
+ //\r
+ // This default constructor is intentionally declared as private to implement the Singleton semantic.\r
+ //\r
+ // @remarks This constructor is hidden.\r
+ //\r
+ WebStorageManager(void);\r
+\r
+ //\r
+ // This destructor is intentionally declared as private to implement the Singleton semantic.\r
+ //\r
+ // @remarks This destructor is hidden.\r
+ //\r
+ virtual ~WebStorageManager(void);\r
+\r
+ // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.\r
+ //\r
+ // @param[in] rhs The instance of the % WebStorageManager class to copy from\r
+ // @remarks This constructor is hidden.\r
+ //\r
+ WebStorageManager(const WebStorageManager& rhs);\r
+\r
+ //\r
+ // Initializes the web storage manager instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ static void InitWebStorageManager(void);\r
+\r
+ //\r
+ // Destroys the web storage manager instance.\r
+ //\r
+ // @since 2.1\r
+ //\r
+ static void DestroyWebStorageManager(void);\r
+\r
+ //\r
+ // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.\r
+ //\r
+ // @param[in] rhs An instance of % WebStorageManager to assign from\r
+ // @remarks This operator is hidden.\r
+ //\r
+ WebStorageManager& operator=(const WebStorageManager& rhs);\r
+\r
+private:\r
+ _WebStorageManagerImpl* __pWebStorageManagerImpl;\r
+\r
+ static WebStorageManager* __pInstance;\r
+\r
+ friend class _WebStorageManagerImpl;\r
+\r
+ friend struct std::default_delete<WebStorageManager>;\r
+}; // WebStorageManager\r
+\r
+}}} // Tizen::Web::Controls\r
+#endif // _FWEB_CTRL_WEB_STORAGE_MANAGER_H_\r
#include <FBaseObject.h>
#include <FBaseString.h>
-#include <FGrpBitmap.h>
+
+namespace Tizen { namespace Graphics
+{
+class Bitmap;
+}} // Tizen::Graphics
namespace Tizen { namespace Web
{
* @return The image
*
* @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM Either of the following conditions has occurred: @n
+ * - The method cannot proceed due to a severe system error. @n
+ * - The method has failed because it doesn¡¯t work on a service application.
* @remarks The specific error code can be accessed using the GetLastResult() method.
*/
Tizen::Graphics::Bitmap* GetFaviconN(void) const;
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+* @file FWebWebBookmark.h
+* @brief This is the header file for the % WebBookmark class.
+*
+* This header file contains the declarations of the % WebBookmark class.
+*/
+
+#ifndef _FWEB_WEB_BOOKMARK_H_
+#define _FWEB_WEB_BOOKMARK_H_
+
+#include <FBaseString.h>
+#include <FWebBookmarkItem.h>
+
+namespace Tizen { namespace Graphics
+{
+class Bitmap;
+}} // Tizen::Graphics
+
+namespace Tizen { namespace Web
+{
+class _WebBookmarkImpl;
+
+/**
+ * @class WebBookmark
+ * @brief This class provides methods to manage bookmark items of the browser.
+ *
+ * @since 2.1
+ * @final This class is not intended for extension.
+ *
+ * @privilege http://tizen.org/privilege/bookmark.read and http://tizen.org/privilege/bookmark.write @n
+ * Both privileges are required.
+ *
+ * The %WebBookmark class provides methods to get bookmark information of the browser and organize it.
+ * The bookmark system has hierarchical structure with the parent folder id supporting multiple folders and The bookmark items are represented by the BookmarkItem class. @n
+ * If you use these APIs to backup and restore the bookmark, add bookmark items and folders recursively from the topmost level.
+ */
+class _OSP_EXPORT_ WebBookmark
+ : public Tizen::Base::Object
+{
+public:
+ /**
+ * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor. *
+ *
+ * @since 2.1
+ */
+ WebBookmark(void);
+
+ /**
+ * This destructor overrides Osp::Base::Object::~Object().
+ *
+ * @since 2.1
+ */
+ virtual ~ WebBookmark(void);
+
+ /**
+ * Initializes this instance of %WebBookmark.
+ *
+ * @since 2.1
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM A system error has occurred.
+ */
+ result Construct(void);
+
+ /**
+ * Adds a bookmark folder.
+ *
+ * @since 2.1
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/bookmark.write
+ *
+ * @return An error code
+ * @param[in] title The title of bookmark item
+ * @param[out] folderId The current folder id
+ * @param[in] parentId The parent folder id
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified title is an empty string. @n
+ * - The specified parentId is invalid..
+ * @exception E_OBJ_ALREADY_EXIST A folder with the same title and parent id already exists.
+ * @exception E_SYSTEM The method has failed.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @see BookmarkItem::GetParentFolderId()
+ */
+ result AddFolder(const Tizen::Base::String& title, RecordId& folderId, RecordId parentId = ROOT_FOLDER_ID);
+
+
+ /**
+ * Adds a bookmark contents.
+ *
+ * @since 2.1
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/bookmark.write
+ *
+ * @return An error code
+ * @param[in] title The title of bookmark item
+ * @param[in] url The url of bookmark item
+ * @param[out] bookmarkId The current bookmark id
+ * @param[in] parentId The parent folder id
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG Either of the following conditions has occurred: @n
+ * - The specified title is an empty string. @n
+ * - The specified url is an empty string. @n
+ * - The specified folderId is invalid.
+ * @exception E_OBJ_ALREADY_EXIST A folder with the same title and parent id already exists.
+ * @exception E_SYSTEM The method has failed.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @see BookmarkItem::GetParentFolderId()
+ */
+ result AddBookmark(const Tizen::Base::String& title, const Tizen::Base::String& url, RecordId& bookmarkId, RecordId parentId = ROOT_FOLDER_ID);
+
+ /**
+ * Sets a favicon.
+ *
+ * @since 2.1
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/bookmark.write
+ *
+ * @return An error code
+ * @param[in] bookmarkId The bookmark id
+ * @param[in] favicon The favicon image
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_INVALID_ARG The specified bookmarkId is invalid.
+ * @exception E_INVALID_DATA The specified favicon data is invalid.
+ * @exception E_SYSTEM The method has failed.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @see BookmarkItem::GetFavicon()
+ */
+ result SetFavicon(RecordId bookmarkId, const Tizen::Graphics::Bitmap& favicon);
+
+ /**
+ * Gets the bookmark item pointed to by the specified index.
+ *
+ * @since 2.1
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/bookmark.read
+ *
+ * @return The bookmark item at the specified index
+ * @param[in] index The index of an element @n
+ * The value of the index must be greater than or equal to @c 0.
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_OUT_OF_RANGE The specified index is out of range.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ const BookmarkItem* GetItemAt(int index) const;
+
+ /**
+ * Gets the total number of items.
+ *
+ * @since 2.1
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/bookmark.read
+ *
+ * @return The total number of items
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
+ */
+ int GetItemCount(void) const;
+
+ /**
+ * Removes all elements.
+ *
+ * @since 2.1
+ *
+ * @privlevel platform
+ * @privilege http://tizen.org/privilege/bookmark.write
+ *
+ * @return An error code
+ * @exception E_SUCCESS The method is successful.
+ * @exception E_SYSTEM The method has failed.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ */
+ result RemoveAll(void);
+
+private:
+ //
+ // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @param[in] rhs The instance of the %WebBookmark class to copy from
+ // @remarks This constructor is hidden.
+ //
+ WebBookmark(const WebBookmark & rhs);
+
+ //
+ // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+ //
+ // @param[in] rhs An instance of %WebBookmark
+ // @remarks The method is declared but not implemented.
+ //
+ WebBookmark& operator=(const WebBookmark& rhs);
+
+private:
+ _WebBookmarkImpl * __pWebBookmarkImpl;
+
+ friend class _WebBookmarkImpl;
+}; // WebBookmark
+
+}} // Tizen::Web
+#endif // _FWEB_WEB_BOOKMARK_H_
+
* Initializes this instance of %WebHistory.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/web.privacy
*
- * @return An error code
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.privacy
+ *
+ * @return An error code
* @exception E_SUCCESS The method is successful.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
* Gets the history item pointed to by the specified @c index.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/web.privacy
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.privacy
*
* @return The history item at the specified @c index
* @param[in] index The index of an element @n
- * The value of the index must be greater than or equal to @c 0.
+ * The value of the index must be greater than or equal to @c 0.
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The specified @c index is out of range.
- * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
const HistoryItem* GetItemAt(int index) const;
* Gets the total number of items.
*
* @since 2.0
- * @privilege %http://tizen.org/privilege/web.privacy
+ *
+ * @privlevel public
+ * @privilege http://tizen.org/privilege/web.privacy
*
* @return The total number of items
- * @exception E_SUCCESS The method is successful.
+ * @exception E_SUCCESS The method is successful.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
- * @remarks The specific error code can be accessed using the GetLastResult() method.
+ * @remarks The specific error code can be accessed using the GetLastResult() method.
*/
int GetItemCount(void) const;
//
// The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
//
- // @param[in] item The instance of the %WebHistory class to copy from
+ // @param[in] item The instance of the %WebHistory class to copy from
// @remarks This constructor is hidden.
//
WebHistory(const WebHistory& item);
//
// The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
//
- // @param[in] item The instance of the %WebHistory class to assign from
+ // @param[in] item The instance of the %WebHistory class to assign from
// @remarks This operator is hidden.
//
WebHistory& operator =(const WebHistory& item);
Name: osp-web
Summary: osp web library
-Version: 1.2.0.0
+Version: 1.2.1.0
Release: 2
Group: System/Libraries
License: TO_BE/FILLED_IN
%files debug
%{_libdir}/osp/debug/*.so.*
-%{_libdir}/osp/browser-plugin/debug/*.so
\ No newline at end of file
+%{_libdir}/osp/browser-plugin/debug/*.so
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebHistoryItem.cpp
+ * @brief The file contains the definition of HistoryItem class.
+ *
+ * This file contains the definition of HistoryItem class.
+ */
+#include <new>
+#include <FBaseResult.h>
+#include <FBaseSysLog.h>
+#include <FGrpBitmap.h>
+#include <FWebBookmarkItem.h>
+#include "FWeb_BookmarkItemImpl.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+
+
+namespace Tizen { namespace Web
+{
+
+
+BookmarkItem::BookmarkItem(void)
+ : __pBookmarkItemImpl(new (std::nothrow) _BookmarkItemImpl())
+{
+ SysTryReturnVoidResult(NID_WEB, __pBookmarkItemImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
+
+BookmarkItem::BookmarkItem(const BookmarkItem& rhs)
+ : __pBookmarkItemImpl(new (std::nothrow) _BookmarkItemImpl(*_BookmarkItemImpl::GetInstance(&rhs)))
+{
+ SysTryReturnVoidResult(NID_WEB, __pBookmarkItemImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
+
+BookmarkItem::~BookmarkItem(void)
+{
+ delete __pBookmarkItemImpl;
+ __pBookmarkItemImpl = null;
+}
+
+
+String
+BookmarkItem::GetTitle(void) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pBookmarkItemImpl->GetTitle();
+}
+
+
+String
+BookmarkItem::GetUrl(void) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pBookmarkItemImpl->GetUrl();
+}
+
+
+Bitmap*
+BookmarkItem::GetFaviconN(void) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pBookmarkItemImpl->GetFaviconN();
+}
+
+
+RecordId
+BookmarkItem::GetParentFolderId(void) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pBookmarkItemImpl->GetParentFolderId();
+}
+
+
+bool
+BookmarkItem::IsFolder(void) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pBookmarkItemImpl->IsFolder();
+}
+
+
+int
+BookmarkItem::GetHashCode(void) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pBookmarkItemImpl->GetHashCode();
+}
+
+
+bool
+BookmarkItem::Equals(const Object& obj) const
+{
+ SysAssertf(__pBookmarkItemImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ const BookmarkItem* pRhs = dynamic_cast< const BookmarkItem* >(&obj);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ return __pBookmarkItemImpl->Equals(*pRhs->__pBookmarkItemImpl);
+}
+
+
+BookmarkItem&
+BookmarkItem::operator =(const BookmarkItem& rhs)
+{
+ if (&rhs == this)
+ {
+ return *this;
+ }
+
+ Object::operator =(rhs);
+ _BookmarkItemImpl* pImpl = _BookmarkItemImpl::GetInstance(this);
+ if (pImpl)
+ {
+ *pImpl = *_BookmarkItemImpl::GetInstance(&rhs);
+ }
+
+ return *this;
+}
+
+
+}} // Tizen::Web
#include <new>
#include <FBaseResult.h>
#include <FBaseSysLog.h>
+#include <FGrpBitmap.h>
#include <FWebHistoryItem.h>
#include "FWeb_HistoryItemImpl.h"
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebWebBookmark.cpp
+ * @brief The file contains the definition of WebBookmark class.
+ *
+ * This file contains the definition of WebBookmark class.
+ */
+#include <new>
+#include <unique_ptr.h>
+#include <FBaseResult.h>
+#include <FBaseSysLog.h>
+#include <FGrpBitmap.h>
+#include <FWebWebBookmark.h>
+#include <FSec_AccessController.h>
+#include "FWeb_WebBookmarkImpl.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+using namespace Tizen::Security;
+
+
+namespace Tizen { namespace Web
+{
+
+
+WebBookmark::WebBookmark(void)
+ : __pWebBookmarkImpl(null)
+{
+}
+
+
+WebBookmark::~WebBookmark(void)
+{
+ delete __pWebBookmarkImpl;
+ __pWebBookmarkImpl = null;
+}
+
+
+result
+WebBookmark::Construct(void)
+{
+ SysAssertf(__pWebBookmarkImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+ result r = E_SUCCESS;
+
+ std::unique_ptr<_WebBookmarkImpl> pWebBookmarkImpl(new (std::nothrow) _WebBookmarkImpl());
+ SysTryReturnResult(NID_WEB, pWebBookmarkImpl.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = pWebBookmarkImpl->Construct();
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pWebBookmarkImpl = pWebBookmarkImpl.release();
+
+ return r;
+}
+
+
+result
+WebBookmark::AddFolder(const String& title, RecordId& folderId, RecordId parentId)
+{
+ SysAssertf(__pWebBookmarkImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_BOOKMARK_WRITE);
+ SysTryReturnResult(NID_WEB, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+ r = __pWebBookmarkImpl->AddFolder(title, parentId, folderId);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SysLog(NID_WEB, "The current value of title is %ls, folderId is %d, parentId is %d", title.GetPointer(), folderId, parentId);
+
+ return E_SUCCESS;
+}
+
+
+result
+WebBookmark::AddBookmark(const String& title, const String& url, RecordId& bookmarkId, RecordId parentId)
+{
+ SysAssertf(__pWebBookmarkImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_BOOKMARK_WRITE);
+ SysTryReturnResult(NID_WEB, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+ r = __pWebBookmarkImpl->AddBookmark(title, url, parentId, bookmarkId);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SysLog(NID_WEB, "The current value of title is %ls, url is %ls, parentId is %d", title.GetPointer(), url.GetPointer(), parentId);
+
+ return E_SUCCESS;
+}
+
+
+result
+WebBookmark::SetFavicon(RecordId bookmarkId, const Bitmap& favicon)
+{
+ SysAssertf(__pWebBookmarkImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_BOOKMARK_WRITE);
+ SysTryReturnResult(NID_WEB, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+ r = __pWebBookmarkImpl->SetFavicon(bookmarkId, favicon);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SysLog(NID_WEB, "The current value of bookmarkId is %d", bookmarkId);
+
+ return E_SUCCESS;
+}
+
+
+const BookmarkItem*
+WebBookmark::GetItemAt(int index) const
+{
+ SysAssertf(__pWebBookmarkImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ ClearLastResult();
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_BOOKMARK_READ);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ const BookmarkItem* pItem = __pWebBookmarkImpl->GetItemAt(index);
+ SysTryReturn(NID_WEB, pItem, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ SysLog(NID_WEB, "The current value of index is %d", index);
+
+ return pItem;
+}
+
+
+int
+WebBookmark::GetItemCount(void) const
+{
+ SysAssertf(__pWebBookmarkImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_BOOKMARK_READ);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, -1, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ return __pWebBookmarkImpl->GetItemCount();
+}
+
+
+result
+WebBookmark::RemoveAll(void)
+{
+ SysAssertf(__pWebBookmarkImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_BOOKMARK_WRITE);
+ SysTryReturnResult(NID_WEB, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+ r = __pWebBookmarkImpl->RemoveAll();
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+}
+
+
+}} // Tizen::Web
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWeb_HistoryItemImplcpp
+ * @brief The file contains the definition of _HistoryItemImpl class.
+ *
+ * This file contains the definition of _HistoryItemImpl class.
+ */
+#include <favorites.h>
+#include <unique_ptr.h>
+#include <FBaseBoolean.h>
+#include <FBaseInteger.h>
+#include <FBaseSysLog.h>
+#include <FGrpBitmap.h>
+#include <FGrpDimension.h>
+#include <FWebBookmarkItem.h>
+#include "FWeb_BookmarkItemImpl.h"
+#include "FWebCtrl_Utility.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+using namespace Tizen::Web::Controls;
+
+
+namespace Tizen { namespace Web
+{
+
+
+_BookmarkItemImpl::_BookmarkItemImpl(void)
+ : __isFolder(false)
+ , __id(0)
+ , __parentId(0)
+ , __url(L"")
+ , __title(L"")
+
+{
+}
+
+
+_BookmarkItemImpl::~_BookmarkItemImpl(void)
+{
+}
+
+
+void
+_BookmarkItemImpl::SetBookmarkItem(RecordId id, const String& url, const String& title, RecordId parentId, bool isFolder)
+{
+ __id = id;
+ __url = url;
+ __title = title;
+ __parentId = parentId;
+ __isFolder = isFolder;
+}
+
+
+String
+_BookmarkItemImpl::GetTitle(void) const
+{
+ return __title;
+}
+
+
+String
+_BookmarkItemImpl::GetUrl(void) const
+{
+ return __url;
+}
+
+
+Bitmap*
+_BookmarkItemImpl::GetFaviconN(void) const
+{
+ result r = E_SUCCESS;
+
+ Evas* pEvas = _Utility::GetEvasFromUiApp();
+ SysTryReturn(NID_WEB, pEvas, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ Evas_Object* pIcon = null;
+ int ret = favorites_bookmark_get_favicon(__id, pEvas, &pIcon);
+ SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, null, E_SYSTEM, "[E_SYSTEM] Propagating.");
+
+ BufferInfo bufferInfo;
+ r = _Utility::GetPixelBufferFromEvasObject(pIcon, bufferInfo);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ const Dimension dimension(bufferInfo.width, bufferInfo.height);
+
+ ByteBuffer byteBuffer;
+ r = byteBuffer.Construct(reinterpret_cast < byte* >(bufferInfo.pPixels), 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 );
+ SysTryReturn(NID_WEB, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ std::unique_ptr<Bitmap> pImage(new (std::nothrow) Bitmap());
+ SysTryReturn(NID_WEB, pImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = pImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pImage.release();
+}
+
+
+RecordId
+_BookmarkItemImpl::GetParentFolderId(void) const
+{
+ return __parentId;
+}
+
+
+bool
+_BookmarkItemImpl::IsFolder(void) const
+{
+ return __isFolder;
+}
+
+
+bool
+_BookmarkItemImpl::Equals(const Object& obj) const
+{
+ const _BookmarkItemImpl* pRhs = dynamic_cast< const _BookmarkItemImpl* >(&obj);
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ return __id == pRhs->__id && __url == pRhs->__url && __title == pRhs->__title && __parentId == pRhs->__parentId
+ && __isFolder == pRhs->__isFolder;
+}
+
+
+int
+_BookmarkItemImpl::GetHashCode(void) const
+{
+ return Integer(__id).GetHashCode() + __url.GetHashCode() + __title.GetHashCode()
+ + Integer(__parentId).GetHashCode() + Boolean(__isFolder).GetHashCode();
+}
+
+
+_BookmarkItemImpl*
+_BookmarkItemImpl::GetInstance(BookmarkItem* pBookmarkItem)
+{
+ return pBookmarkItem->__pBookmarkItemImpl;
+}
+
+
+const _BookmarkItemImpl*
+_BookmarkItemImpl::GetInstance(const BookmarkItem* pBookmarkItem)
+{
+ return pBookmarkItem->__pBookmarkItemImpl;
+}
+
+
+}} // Tizen::Web
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWeb_HistoryItemImpl.h
+ * @brief The file contains the declaration of _HistoryItemImpl class.
+ *
+ * The file contains the declaration of _HistoryItemImpl class.
+ */
+#ifndef _FWEB_INTERNAL_BOOKMARK_ITEM_IMPL_H_
+#define _FWEB_INTERNAL_BOOKMARK_ITEM_IMPL_H_
+
+#include <FBaseString.h>
+
+namespace Tizen { namespace Web
+{
+class BookmarkItem;
+
+class _BookmarkItemImpl
+ : public Tizen::Base::Object
+{
+public:
+ _BookmarkItemImpl(void);
+
+ virtual ~_BookmarkItemImpl(void);
+
+ void SetBookmarkItem(RecordId id, const Tizen::Base::String& url, const Tizen::Base::String& title, RecordId parentId, bool isFolder);
+
+ Tizen::Base::String GetTitle(void) const;
+
+ Tizen::Base::String GetUrl(void) const;
+
+ Tizen::Graphics::Bitmap* GetFaviconN(void) const;
+
+ RecordId GetParentFolderId(void) const;
+
+ bool IsFolder(void) const;
+
+ virtual int GetHashCode(void) const;
+
+ virtual bool Equals(const Object& obj) const;
+
+ static _BookmarkItemImpl* GetInstance(BookmarkItem* pBookmarkItem);
+
+ static const _BookmarkItemImpl* GetInstance(const BookmarkItem* pBookmarkItem);
+
+private:
+ bool __isFolder;
+
+ RecordId __id;
+
+ RecordId __parentId;
+
+ Tizen::Base::String __url;
+
+ Tizen::Base::String __title;
+}; // _BookmarkItemImpl
+
+}} // Tizen::Web
+#endif // _FWEB_INTERNAL_BOOKMARK_ITEM_IMPL_H_
\ No newline at end of file
* This file contains the definition of _HistoryItemImpl class.
*/
#include <Ecore_Evas.h>
-#include <elm_config.h>
+//#include <elm_config.h>
#include <EWebKit2.h>
#include <favorites.h>
#include <unique_ptr.h>
-#include <FAppUiApp.h>
-#include <FAppIAppFrame.h>
#include <FBaseSysLog.h>
+#include <FGrpBitmap.h>
+#include <FGrpDimension.h>
#include <FBase_StringConverter.h>
-#include <FUiAnim_EflNode.h>
-#include <FUiAnim_VisualElementImpl.h>
-#include <FUiCtrlFrame.h>
-#include <FUi_ControlImpl.h>
#include <FWebHistoryItem.h>
#include "FWeb_HistoryItemImpl.h"
#include "FWebCtrl_Utility.h"
-using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Graphics;
-using namespace Tizen::Ui;
-using namespace Tizen::Ui::Controls;
-using namespace Tizen::Ui::Animations;
using namespace Tizen::Web::Controls;
{
result r = E_SUCCESS;
- BufferInfo bufferInfo;
- ByteBuffer byteBuffer;
- Evas_Object* pIcon = null;
-
- IAppFrame* pAppFrame = Application::GetInstance()->GetAppFrame();
- SysTryReturn(NID_WEB_CTRL, pAppFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- Frame* pFrame = pAppFrame->GetFrame();
- SysTryReturn(NID_WEB_CTRL, pFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- _ControlImpl* pControlimpl = _ControlImpl::GetInstance(*pFrame);
- SysTryReturn(NID_WEB_CTRL, pControlimpl, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- VisualElement* pVisual = pControlimpl->GetCore().GetVisualElement();
- SysTryReturn(NID_WEB_CTRL, pVisual, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- _VisualElementImpl* pWebVisualElementImpl = _VisualElementImpl::GetInstance(*pVisual);
- SysTryReturn(NID_WEB_CTRL,pWebVisualElementImpl, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- _EflNode* pEflNode = dynamic_cast< _EflNode* >(pWebVisualElementImpl->GetNativeNode());
- SysTryReturn(NID_WEB_CTRL, pEflNode, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- Evas* pEvas = pEflNode->GetEvas();
+ Evas* pEvas = _Utility::GetEvasFromUiApp();
SysTryReturn(NID_WEB_CTRL, pEvas, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ Evas_Object* pIcon = null;
if( __id == -1)
{
Ewk_Context* pDefaultContext = ewk_context_default_get();
}
else
{
- favorites_history_get_favicon(__id, pEvas, &pIcon);
+ int ret = favorites_history_get_favicon(__id, pEvas, &pIcon);
+ SysTryReturn(NID_WEB_CTRL, ret == FAVORITES_ERROR_NONE, null, E_SYSTEM, "[E_SYSTEM] Propagating.");
}
+ BufferInfo bufferInfo;
r = _Utility::GetPixelBufferFromEvasObject(pIcon, bufferInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
const Dimension dimension(bufferInfo.width, bufferInfo.height);
+ ByteBuffer byteBuffer;
r = byteBuffer.Construct(reinterpret_cast < byte* >(bufferInfo.pPixels), 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 );
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebWebHistory.cpp
+ * @brief The file contains the definition of WebHistory class.
+ *
+ * This file contains the definition of WebHistory class.
+ */
+#include <new>
+#include <favorites.h>
+#include <unique_ptr.h>
+#include <FBaseSysLog.h>
+#include <FGrpBitmap.h>
+#include <FWebBookmarkItem.h>
+#include <FWebWebBookmark.h>
+#include <FBase_StringConverter.h>
+#include "FWeb_BookmarkItemImpl.h"
+#include "FWeb_WebBookmarkImpl.h"
+#include "FWebCtrl_Utility.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Graphics;
+using namespace Tizen::Web::Controls;
+
+
+namespace Tizen { namespace Web
+{
+
+
+bool
+_BookmarkForEachCb(favorites_bookmark_entry_s* pItem, void* pUserData)
+{
+ SysAssertf(pItem && pUserData, "Failed to request");
+
+ result r = E_SUCCESS;
+
+ _WebBookmarkImpl* pImpl = reinterpret_cast< _WebBookmarkImpl* >(pUserData);
+
+ String url(pItem->address);
+ String title(pItem->title);
+
+ r = pImpl->AddItem(pItem->id, url, title, pItem->folder_id, pItem->is_folder);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return true;
+}
+
+
+_WebBookmarkImpl::_WebBookmarkImpl(void)
+{
+}
+
+
+_WebBookmarkImpl::~_WebBookmarkImpl(void)
+{
+}
+
+
+result
+_WebBookmarkImpl::Construct(void)
+{
+ result r = E_SUCCESS;
+
+ r = __bookmarkList.Construct();
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ int ret = favorites_bookmark_foreach(_BookmarkForEachCb, this);
+ SysTryCatch(NID_WEB, ret == FAVORITES_ERROR_NONE, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Failed to Set bookmark Callback.");
+
+ return E_SUCCESS;
+
+CATCH:
+ __bookmarkList.RemoveAll(true);
+
+ return r;
+}
+
+
+result
+_WebBookmarkImpl::AddFolder(const String& title, RecordId parentId, RecordId& folderId)
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<char[]> pTitle(_StringConverter::CopyToCharArrayN(title));
+ SysTryReturn(NID_WEB, pTitle.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ int realParentId = parentId;
+
+ if (parentId == ROOT_FOLDER_ID)
+ {
+ realParentId = GetRootFolderId();
+ }
+
+ int ret = favorites_bookmark_add(pTitle.get(), null, realParentId, 1, &folderId);
+ SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, ConvertErrorCode(ret), ConvertErrorCode(ret), "[%s] Propagating.", ConvertErrorCode(ret));
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebBookmarkImpl::AddBookmark(const String& title, const String& url, RecordId parentId, RecordId& bookmarkId)
+{
+ std::unique_ptr<char[]> pTitle(_StringConverter::CopyToCharArrayN(title));
+ SysTryReturn(NID_WEB, pTitle.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ std::unique_ptr<char[]> pUrl(_StringConverter::CopyToCharArrayN(url));
+ SysTryReturn(NID_WEB, pUrl.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ int realParentId = parentId;
+
+ if (parentId == ROOT_FOLDER_ID)
+ {
+ realParentId = GetRootFolderId();
+ }
+
+ int ret = favorites_bookmark_add(pTitle.get(), pUrl.get(), realParentId, 0, &bookmarkId);
+ SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, ConvertErrorCode(ret), ConvertErrorCode(ret), "[%s] Propagating.", ConvertErrorCode(ret));
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebBookmarkImpl::SetFavicon(RecordId bookmarkId, const Bitmap& favicon)
+{
+ SysTryReturnResult(NID_WEB, favicon.GetWidth() == 16 && favicon.GetHeight() == 16, E_INVALID_DATA, "The size of a favicon must be 16 X 16");
+ SysTryReturnResult(NID_WEB, favicon.GetPixelColorFormat() == BITMAP_PIXEL_FORMAT_ARGB8888, E_INVALID_DATA, "The pixel format of a favicon must be ARGB8888");
+
+ result r = E_SUCCESS;
+
+ Evas* pEvas = _Utility::GetEvasFromUiApp();
+ SysTryReturn(NID_WEB, pEvas, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ Evas_Object* pIcon = evas_object_image_filled_add(pEvas);
+ evas_object_image_colorspace_set(pIcon, EVAS_COLORSPACE_ARGB8888);
+ evas_object_image_filled_set(pIcon, EINA_TRUE);
+ evas_object_image_alpha_set(pIcon,EINA_TRUE);
+
+ Bitmap& temp = const_cast< Bitmap& >(favicon);
+
+ BufferInfo bufferInfo;
+ r = temp.Lock(bufferInfo);
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", r);
+
+ evas_object_image_size_set(pIcon, bufferInfo.width, bufferInfo.height);
+ evas_object_image_fill_set(pIcon, 0, 0, bufferInfo.width, bufferInfo.height);
+ evas_object_image_data_set(pIcon, bufferInfo.pPixels);
+
+ r = temp.Unlock();
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", r);
+
+ int ret = favorites_bookmark_set_favicon(bookmarkId, pIcon);
+ SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, ConvertErrorCode(ret), ConvertErrorCode(ret), "[%s] Propagating.", ConvertErrorCode(ret));
+
+ return E_SUCCESS;
+}
+
+
+const BookmarkItem*
+_WebBookmarkImpl::GetItemAt(int index) const
+{
+ SysTryReturn(NID_WEB,
+ (index >= 0 && index < GetItemCount()), null, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The index is out of range.");
+
+ return dynamic_cast < const BookmarkItem* >(__bookmarkList.GetAt(index));
+}
+
+
+int
+_WebBookmarkImpl::GetItemCount(void) const
+{
+ return __bookmarkList.GetCount();
+}
+
+
+int
+_WebBookmarkImpl::GetRootFolderId(void) const
+{
+ int folderId = 0;
+ int ret = favorites_bookmark_get_root_folder_id(&folderId);
+ SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, -1, ConvertErrorCode(ret), "[%s] Propagating.", ConvertErrorCode(ret));
+
+ return folderId;
+}
+
+
+result
+_WebBookmarkImpl::AddItem(RecordId id, const String& url, const String& title, RecordId parentId, bool isFolder)
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<BookmarkItem> pBookmarkItem(new (std::nothrow) BookmarkItem());
+ SysTryReturnResult(NID_WEB, pBookmarkItem.get(), E_OUT_OF_MEMORY, "Memory allocation failed");
+
+ _BookmarkItemImpl* pBookmarkItemImpl = _BookmarkItemImpl::GetInstance(pBookmarkItem.get());
+ SysTryReturn(NID_WEB, pBookmarkItemImpl, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pBookmarkItemImpl->SetBookmarkItem(id, url, title, parentId, isFolder);
+
+ r = __bookmarkList.Add(*pBookmarkItem.get());
+ SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ pBookmarkItem.release();
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebBookmarkImpl::RemoveAll(void)
+{
+ int ret = favorites_bookmark_delete_all_bookmarks();
+ SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, ConvertErrorCode(ret), ConvertErrorCode(ret), "[%s] Propagating.", ConvertErrorCode(ret));
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebBookmarkImpl::ConvertErrorCode(int err) const
+{
+ result r = E_SUCCESS;
+
+ switch (err)
+ {
+ case FAVORITES_ERROR_INVALID_PARAMETER:
+ r = E_INVALID_ARG;
+ break;
+
+ case FAVORITES_ERROR_ITEM_ALREADY_EXIST:
+ r = E_OBJ_ALREADY_EXIST;
+ break;
+
+ case FAVORITES_ERROR_DB_FAILED:
+ //fall through
+ default:
+ r = E_SYSTEM;
+ }
+
+ return r;
+}
+
+
+_WebBookmarkImpl*
+_WebBookmarkImpl::GetInstance(WebBookmark* pWebBookmark)
+{
+ return pWebBookmark->__pWebBookmarkImpl;
+}
+
+
+const _WebBookmarkImpl*
+_WebBookmarkImpl::GetInstance(const WebBookmark* pWebBookmark)
+{
+ return pWebBookmark->__pWebBookmarkImpl;
+}
+
+
+}} // Tizen::Web
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWeb_WebHistoryImpl.h
+ * @brief The file contains the declaration of _WebHistoryImpl class.
+ *
+ * The file contains the declaration of _WebHistoryImpl class.
+ */
+#ifndef _FWEB_INTERNAL_WEB_BOOKMARK_IMPL_H_
+#define _FWEB_INTERNAL_WEB_BOOKMARK_IMPL_H_
+
+#include <FBaseString.h>
+#include <FBaseColArrayList.h>
+
+namespace Tizen { namespace Web
+{
+class BookmarkItem;
+class WebBookmark;
+
+
+class _WebBookmarkImpl
+ : public Tizen::Base::Object
+{
+public:
+ _WebBookmarkImpl(void);
+
+ virtual ~_WebBookmarkImpl(void);
+
+ result Construct(void);
+
+ result AddFolder(const Tizen::Base::String& title, RecordId parentId, RecordId& folderId);
+
+ result AddBookmark(const Tizen::Base::String& title, const Tizen::Base::String& url, RecordId parentId, RecordId& bookmarkId);
+
+ result SetFavicon(RecordId bookmarkId, const Tizen::Graphics::Bitmap& favicon);
+
+ const BookmarkItem* GetItemAt(int index) const;
+
+ int GetItemCount(void) const;
+
+ RecordId GetRootFolderId(void) const;
+
+ result AddItem(RecordId id, const Tizen::Base::String& url, const Tizen::Base::String& title, RecordId parentId, bool isFolder);
+
+ result RemoveAll(void);
+
+ result ConvertErrorCode(int err) const;
+
+ static _WebBookmarkImpl* GetInstance(WebBookmark* pWebBookmark);
+
+ static const _WebBookmarkImpl* GetInstance(const WebBookmark* pWebBookmark);
+
+private:
+ Tizen::Base::Collection::ArrayList __bookmarkList;
+}; // _WebBookmarkImpl
+
+}} // Tizen::Web
+#endif // _FWEB_INTERNAL_WEB_BOOKMARK_IMPL_H_
\ No newline at end of file
{
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY);
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
-
std::unique_ptr<GeolocationPermissionManager> pInstance(new (std::nothrow) GeolocationPermissionManager());
SysTryReturnVoidResult(NID_WEB_CTRL, pInstance.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
ClearLastResult();
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY);
+ r = _AccessController::CheckUserPrivilege(_PRV_GEOLOCATIONPERMISSION_READ);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
IList* pList = __pGeolocationPermissionManagerImpl->GetOriginListN();
ClearLastResult();
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY);
+ r = _AccessController::CheckUserPrivilege(_PRV_GEOLOCATIONPERMISSION_READ);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
bool permission = __pGeolocationPermissionManagerImpl->IsPermissionAllowed(origin);
ClearLastResult();
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY);
+ r = _AccessController::CheckUserPrivilege(_PRV_GEOLOCATIONPERMISSION_WRITE);
SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
r = __pGeolocationPermissionManagerImpl->Remove(origin);
ClearLastResult();
result r = E_SUCCESS;
- r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY);
+ r = _AccessController::CheckUserPrivilege(_PRV_GEOLOCATIONPERMISSION_WRITE);
SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
r = __pGeolocationPermissionManagerImpl->RemoveAll();
return E_SUCCESS;
}
+result
+Web::Construct(const FloatRectangle& rect)
+{
+ SysAssertf(_pControlImpl == null, "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ _WebImpl* pWebImpl = _WebImpl::CreateWebImplN(const_cast< Web* >(this), rect);
+ SysTryReturn(NID_WEB_CTRL, pWebImpl, GetLastResult(), GetLastResult(), "[%s] This instance has not been constructed as yet.", GetErrorMessage(GetLastResult()));
+
+ _pControlImpl = pWebImpl;
+
+ SysLog(NID_WEB_CTRL, "rect.x : %f, rect.y : %f, rect.width : %f, rect.height : %f", rect.x, rect.y, rect.width, rect.height);
+
+ return E_SUCCESS;
+}
+
void
Web::LoadUrl(const String& url)
}
+HitElementResult*
+Web::GetElementByPointN(const FloatPoint& point) const
+{
+ const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ ClearLastResult();
+
+ const HitElementResult* pResult = pWebImpl->GetElementByPointN(point);
+ SysTryReturn(NID_WEB_CTRL, pResult, null, GetLastResult(), "[%s] Failed to get HitElementResult.", GetErrorMessage(GetLastResult()));
+
+ return const_cast< HitElementResult* >(pResult);
+}
+
+
String*
Web::EvaluateJavascriptN(const String& scriptCode)
{
Web::IsMimeSupported(const String& mime) const
{
const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
- SysAssertf(pWebImpl != null, "Not yet constructedl. Construct() should be called before use.");
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructedl. Construct() should be called before use.");
SysLog(NID_WEB_CTRL, "The current value of mime is %ls", mime.GetPointer());
result
+Web::SetBlockSelectionPosition(const FloatPoint& startPoint)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ result r = E_SUCCESS;
+
+ r = pWebImpl->SetBlockSelectionPosition(startPoint);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+}
+
+
+result
Web::ReleaseBlock(void)
{
_WebImpl* pWebImpl = _WebImpl::GetInstance(this);
}
+result
+Web::GetBlockRange(FloatPoint& startPoint, FloatPoint& endPoint) const
+{
+ const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ result r = E_SUCCESS;
+
+ r = pWebImpl->GetBlockRange(startPoint, endPoint);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+}
+
+
String
Web::GetTextFromBlock(void) const
{
}
+void
+Web::SetWebUiEventListenerF(IWebUiEventListenerF* pUiEventListener)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null, "Not yet constructedl. Construct() should be called before use.");
+
+ pWebImpl->SetWebUiEventListenerF(pUiEventListener);
+
+ SysLog(NID_WEB_CTRL, "The current value of pUiEventListener is %u", pUiEventListener);
+}
+
+
result
Web::SearchTextAllAsync(const String& text, bool caseSensitive)
{
result r = E_SUCCESS;
+ r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
r = pWebImpl->SetPrivateBrowsingEnabled(enable);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
result
+Web::ClearHistory(void)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ pWebImpl->ClearHistory();
+
+ return E_SUCCESS;
+}
+
+
+result
Web::ClearCache(void)
{
_WebImpl* pWebImpl = _WebImpl::GetInstance(this);
}
+result
+Web::ClearFormData(void)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ pWebImpl->ClearFormData();
+
+ return E_SUCCESS;
+}
+
+
+result
+Web::ClearLoginFormData(void)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ result r = E_SUCCESS;
+
+ r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ pWebImpl->ClearLoginFormData();
+
+ return E_SUCCESS;
+}
+
+
bool
Web::IsCookieEnabled(void) const
{
}
+void
+Web::ScrollBy(const Tizen::Graphics::Point& diff)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ pWebImpl->ScrollBy(diff);
+}
+
+
+void
+Web::ScrollTo(const Tizen::Graphics::Point& dest)
+{
+ _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ pWebImpl->ScrollTo(dest);
+}
+
+
+Point
+Web::GetScrollPosition(void) const
+{
+ const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ return pWebImpl->GetScrollPosition();
+}
+
+
+Dimension
+Web::GetPageSize(void) const
+{
+ const _WebImpl* pWebImpl = _WebImpl::GetInstance(this);
+ SysAssertf(pWebImpl != null && pWebImpl->HasValidNativeNode(), "Not yet constructed or Not attached to parent control.");
+
+ return pWebImpl->GetPageSize();
+}
+
+
}}} // Tizen::Web::Controls
}
+void
+WebSetting::SetAutoFormDataShowEnabled(bool enable)
+{
+ SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ __pWebSettingImpl->SetAutoFormDataShowEnabled(enable);
+
+ SysLog(NID_WEB_CTRL, "The current value of enable is %d", enable);
+}
+
+
+bool
+WebSetting::IsAutoFormDataShowEnabled(void) const
+{
+ SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pWebSettingImpl->IsAutoFormDataShowEnabled();
+}
+
+
+void
+WebSetting::SetAutoLoginFormFillEnabled(bool enable)
+{
+ SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ __pWebSettingImpl->SetAutoLoginFormFillEnabled(enable);
+
+ SysLog(NID_WEB_CTRL, "The current value of enable is %d", enable);
+}
+
+
+bool
+WebSetting::IsAutoLoginFormFillEnabled(void) const
+{
+ SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ return __pWebSettingImpl->IsAutoLoginFormFillEnabled();
+}
+
+
bool
WebSetting::Equals(const Object& obj) const
{
}
-_LocationSettingListener::_LocationSettingListener(Ewk_Geolocation_Permission_Data* pGeoLocationObject)
+_LocationSettingListener::_LocationSettingListener(Ewk_Geolocation_Permission_Request* pGeoLocationObject)
: __pGeoLocationObject(pGeoLocationObject)
{
}
String* pCategoryStr = static_cast< String* >(const_cast< Object* >(pAppData->GetValue(String("category"))));
String* pGPSStr = static_cast< String* >(const_cast< Object* >(pAppData->GetValue(String("GPS"))));
- Ewk_Geolocation_Permission_Request permistionRequest = ewk_geolocation_permission_request_get(__pGeoLocationObject);
if (pCategoryStr && pCategoryStr->Equals(String(L"Location")) && pGPSStr && pGPSStr->Equals(String(L"GPSEnabled")))
{
- ewk_geolocation_permission_request_allow_set(permistionRequest, true);
+ ewk_geolocation_permission_request_set(__pGeoLocationObject, true);
}
else
{
- ewk_geolocation_permission_request_allow_set(permistionRequest, false);
+ ewk_geolocation_permission_request_set(__pGeoLocationObject, false);
}
}
delete this;
, virtual public Tizen::Base::Runtime::IEventListener
{
public:
- _LocationSettingListener(Ewk_Geolocation_Permission_Data* pGeoLocationObject);
+ _LocationSettingListener(Ewk_Geolocation_Permission_Request* pGeoLocationObject);
virtual ~_LocationSettingListener(void);
void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData);
private:
- Ewk_Geolocation_Permission_Data* __pGeoLocationObject;
+ Ewk_Geolocation_Permission_Request* __pGeoLocationObject;
}; //_LocationSettingListener
* @file FWebCtrl_AuthConfirmPopup.cpp
* @brief The file contains the definition of _AuthConfirmPopup class.
*/
+#include <FBaseColArrayList.h>
+#include <FBaseSysLog.h>
#include <FGrpDimension.h>
#include <FGrpRectangle.h>
#include <FUiCtrlButton.h>
#include <FUiCtrlEditField.h>
#include <FUiCtrlLabel.h>
#include <FUiCtrlPanel.h>
-#include <FUiIActionEventListener.h>
#include <FUiLayout.h>
#include <FUiVerticalBoxLayout.h>
#include <FWebCtrlAuthenticationChallenge.h>
-#include <FBaseSysLog.h>
-#include <FUiCtrl_PopupImpl.h>
+#include <FSys_SystemResource.h>
#include <FUi_ControlManager.h>
#include <FUi_ResourceManager.h>
-#include <FSys_SystemResource.h>
#include "FWebCtrl_WebImpl.h"
#include "FWebCtrl_AuthConfirmPopup.h"
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-using namespace Tizen::Web::Controls;
-using namespace Tizen::Ui::Controls;
+using namespace Tizen::System;
using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
static const int AUTH_POPUP_TMP_LABLE_HEIGHT = 10;
+
namespace Tizen { namespace Web { namespace Controls
{
_AuthConfirmPopup::_AuthConfirmPopup(void)
- : __pPopup(null)
- , __pIdEditField(null)
+ : __pIdEditField(null)
, __pPwdEditField(null)
- , __pPanel(null)
, __pAuthHandler(null)
- , __modal(0)
{
}
+
_AuthConfirmPopup::~_AuthConfirmPopup(void)
{
}
// Authentication popup
result
-_AuthConfirmPopup::Construct(const Tizen::Base::String& host, const Tizen::Base::String& realm, AuthenticationChallenge* pAuth)
+_AuthConfirmPopup::Construct(const String& host, const String& realm, AuthenticationChallenge* pAuth)
{
- SysTryReturnResult(NID_WEB_CTRL, pAuth != null, E_INVALID_ARG, "[%s] invalid argument(s) is used. The AuthenticationChallenge is null.", GetErrorMessage(E_INVALID_ARG));
+ SysTryReturnResult(NID_WEB_CTRL, pAuth != null, E_INVALID_ARG, "invalid argument(s) is used. The AuthenticationChallenge is null.");
__pAuthHandler = pAuth;
- VerticalBoxLayout layout;
- result r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
+ result r = E_SUCCESS;
+ _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+ SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- Dimension dim;
- Dimension editDim;
Rectangle rect(0, 0, 0, 0);
+ rect.width = pPopupData->popupDim.width;
+ rect.height = (5*pPopupData->spacePad) + (pPopupData->editDim.height*2) + pPopupData->btnDim.height + 2*pPopupData->labelDim.height;
+ r = _WebPopup::Construct(true, Dimension(rect.width, rect.height));
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- int spacePad = 0;
- int buttonHeight = 0;
- int sideMargin = 0;
- int buttonWidth = 0;
+ SetTitleText("Authentication Required");
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ //host realm label
+ rect.height = 2*pPopupData->labelDim.height;
- GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, rect.width);
- GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, orientation, rect.height);
- GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, spacePad);
- GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, editDim);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, buttonHeight);
+ std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
+ SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
- std::unique_ptr<Popup> pPopup(new (std::nothrow) Popup());
- SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ String hostRealm(L"A username and password are being requested by ");
+ hostRealm.Append(host);
+ hostRealm.Append(L". The site says: \"");
+ hostRealm.Append(realm);
+ hostRealm.Append(L"\"");
+ r = pLabel->Construct(rect, hostRealm);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
- rect.height = ((5*spacePad) + (editDim.height*2) + buttonHeight);
- r = pPopup->Construct(layout,layout, true, Tizen::Graphics::Dimension(rect.width, rect.height));
+ r = AddControl(*pLabel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pPopup->SetTitleText("Authentication Dialog");
+ Label* pHostLabel = pLabel.release();
// Id Edit Field
rect.x = 0;
rect.y = 0;
- rect.height = editDim.height;
+ rect.height = pPopupData->editDim.height;
std::unique_ptr<EditField> pIdEditField(new (std::nothrow) EditField());
- SysTryReturnResult(NID_WEB_CTRL, pIdEditField.get(), r = E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pIdEditField.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
r = pIdEditField->Construct(rect, EDIT_FIELD_STYLE_NORMAL);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pIdEditField->SetGuideText(L"id");
- pIdEditField->SetGuideTextColor(Color(95, 95, 95));
+ pIdEditField->SetGuideText(L"User name");
+ pIdEditField->SetGuideTextColor(Color::GetColor(COLOR_ID_GREY));
+ pIdEditField->SetTextSize(35);;
- r = pPopup->AddControl(*pIdEditField);
+ r = AddControl(*pIdEditField);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pIdEditField = pIdEditField.release();
- // Pwd Edit Field
- rect.y = spacePad + editDim.height;
-
std::unique_ptr<EditField> pPwdEditField(new (std::nothrow) EditField());
- SysTryReturnResult(NID_WEB_CTRL, pPwdEditField.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pPwdEditField.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
r = pPwdEditField->Construct(rect, EDIT_FIELD_STYLE_PASSWORD);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pPwdEditField->SetGuideText(L"Password");
- pPwdEditField->SetGuideTextColor(Color(95, 95, 95));
+ pPwdEditField->SetGuideTextColor(Color::GetColor(COLOR_ID_GREY));
+ pPwdEditField->SetTextSize(35);;
- r = pPopup->AddControl(*pPwdEditField);
+ r = AddControl(*pPwdEditField);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pPwdEditField = pPwdEditField.release();
__pIdEditField->SetFocus();
- __pPopup = std::move(pPopup);
-
- r = AddButtons(spacePad, sideMargin, buttonHeight, rect);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(__pPopup->GetLayoutN()));
- SysTryReturn(NID_WEB_CTRL, pLayout.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- pLayout->SetHorizontalFitPolicy(*__pIdEditField, FIT_POLICY_PARENT);
- pLayout->SetHorizontalFitPolicy(*__pPwdEditField, FIT_POLICY_PARENT);
- pLayout->SetHorizontalFitPolicy(*__pPanel, FIT_POLICY_PARENT);
-
- pLayout->SetHorizontalAlignment(*__pIdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetHorizontalAlignment(*__pPwdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetHorizontalAlignment(*__pPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
-
- pLayout->SetHorizontalAlignment(*__pIdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetHorizontalAlignment(*__pPwdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetHorizontalAlignment(*__pPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
-
- pLayout->SetSpacing(*__pPwdEditField, spacePad);
- pLayout->SetSpacing(*__pPanel, spacePad);
-
- return E_SUCCESS;
-}
-
-
-result
-_AuthConfirmPopup::AddButtons(int spacePad, int sideMargin, int buttonHeight, Rectangle& rect)
-{
- result r = E_SUCCESS;
- int buttonWidth = 0;
- String buttonStr;
- Dimension editDim;
-
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();//_CONTROL_ORIENTATION_PORTRAIT;
- GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, editDim);
-
- //Button Left
- buttonWidth = (rect.width / 2) - (spacePad) - (sideMargin * 2);
-
- Tizen::System::_SystemResource* pSysResource = Tizen::System::_SystemResource::GetInstance();
- SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
- buttonStr = pSysResource->GetString("sys_string", "IDS_COM_SK_OK");
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- std::unique_ptr<Panel> pPanel(new (std::nothrow) Panel());
- SysTryReturnResult(NID_WEB_CTRL, pPanel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pPanel->Construct(Rectangle(0, 2 * (spacePad + editDim.height), rect.width, buttonHeight + spacePad));
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pPopup->AddControl(*pPanel);
+ //Add Buttons
+ ArrayList idList;
+ r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ idList.Add(*(new Integer(ID_BUTTON_AUTH_PROCESS)));
+ idList.Add(*(new Integer(ID_BUTTON_AUTH_CANCEL)));
- __pPanel = pPanel.release();
-
- std::unique_ptr<Button> pBtnSelection(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnSelection.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnSelection->Construct(Rectangle(sideMargin, 0, buttonWidth, buttonHeight), buttonStr);
+ ArrayList titleList;
+ r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_SK_OK"))));
+ titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL"))));
- pBtnSelection->SetActionId(ID_BUTTON_AUTH_PROCESS);
-
- r = __pPanel->AddControl(*pBtnSelection);
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pBtnSelection->AddActionEventListener(*this);
- pBtnSelection.release();
-
- // Button Right
- buttonStr = pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL");
-
- std::unique_ptr<Button> pBtnCancel(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnCancel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnCancel->Construct(Rectangle(buttonWidth + spacePad + sideMargin, 0, buttonWidth, buttonHeight), buttonStr);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
+ SysTryReturn(NID_WEB_CTRL, pLayout.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pBtnCancel->SetActionId(ID_BUTTON_AUTH_CANCEL);
+ pLayout->SetHorizontalFitPolicy(*pHostLabel, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*__pIdEditField, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*__pPwdEditField, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*pButtonPanel, FIT_POLICY_PARENT);
- r = __pPanel->AddControl(*pBtnCancel);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ pLayout->SetHorizontalAlignment(*pHostLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*__pIdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*__pPwdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pBtnCancel->AddActionEventListener(*this);
- pBtnCancel.release();
+ pLayout->SetSpacing(*__pPwdEditField, pPopupData->spacePad);
+ pLayout->SetSpacing(*pButtonPanel, pPopupData->spacePad);
return E_SUCCESS;
}
void
-_AuthConfirmPopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+_AuthConfirmPopup::OnActionPerformed(const Control& source, int actionId)
{
result r = E_SUCCESS;
}
-result
-_AuthConfirmPopup::ShowPopup(void)
-{
- result r = E_SUCCESS;
-
- r = __pPopup->SetShowState(true);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pPopup->Show();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pPopup->DoModal(__modal);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return E_SUCCESS;
-}
-
-
-result
-_AuthConfirmPopup::HidePopup(void)
-{
- result r = E_SUCCESS;
-
- r = __pPopup->SetShowState(false);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pPopup->EndModal(__modal);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return E_SUCCESS;
-}
-
-
}}} // Tizen::Web::Controls
#define _FWEB_CTRL_INTERNAL_AUTH_CONFIRM_POPUP_H_
#include <unique_ptr.h>
-#include <FBase.h>
#include <FBaseString.h>
-#include <FUi.h>
-#include <FUiIActionEventListener.h>
+#include "FWebCtrl_WebPopup.h"
namespace Tizen { namespace Ui
{
namespace Tizen { namespace Ui { namespace Controls
{
-class Popup;
+class EditField;
}}} // Tizen::Ui::Controls
namespace Tizen { namespace Web { namespace Controls
class _AuthConfirmPopup
- : public Tizen::Base::Object
- , virtual public Tizen::Ui::IActionEventListener
+ : public _WebPopup
{
public:
result Construct(const Tizen::Base::String& host, const Tizen::Base::String& realm, AuthenticationChallenge* pAuth);
- result ShowPopup(void);
-
- result HidePopup(void);
-
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
private:
_AuthConfirmPopup& operator =(const _AuthConfirmPopup&);
- result AddButtons(int spacePad, int sideMargin, int buttonHeight,Tizen::Graphics::Rectangle& rect);
-
private:
- std::unique_ptr<Tizen::Ui::Controls::Popup> __pPopup;
Tizen::Ui::Controls::EditField* __pIdEditField;
Tizen::Ui::Controls::EditField* __pPwdEditField;
- Tizen::Ui::Controls::Panel* __pPanel;
AuthenticationChallenge* __pAuthHandler;
- int __modal;
}; // _AuthConfirmPopup
}}} // Tizen::Web::Controls
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_CertificatePopup.cpp
+ * @brief The file contains the definition of _CertificatePopup class.
+ */
+#include <FBaseColArrayList.h>
+#include <FBaseSysLog.h>
+#include <FBaseUtilUri.h>
+#include <FGrpDimension.h>
+#include <FGrpRectangle.h>
+#include <FSecCertX509Certificate.h>
+#include <FUiCtrlButton.h>
+#include <FUiCtrlLabel.h>
+#include <FUiCtrlPanel.h>
+#include <FUiLayout.h>
+#include <FUiVerticalBoxLayout.h>
+#include <FUi_ControlManager.h>
+#include <FUi_ResourceManager.h>
+#include "FWebCtrl_CertificatePopup.h"
+#include "FWebCtrl_Utility.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::Security::Cert;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+
+_CertificatePopup::_CertificatePopup(void)
+{
+}
+
+
+_CertificatePopup::~_CertificatePopup(void)
+{
+}
+
+
+result
+_CertificatePopup::Construct(Ewk_Certificate_Policy_Decision* pPolicy)
+{
+ SysTryReturnResult(NID_WEB_CTRL, pPolicy, E_INVALID_ARG, "Certificate Policy pointer is null.");
+
+ String certString;
+ result r = GenerateCertifiate(pPolicy, certString);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+ SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, pPopupData->popupDim.height));
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SetTitleText(L"Certificate");
+
+ //Add TextBox
+ Rectangle rect(0, 0, 0, 0);
+
+ //label
+ rect.height = pPopupData->popupDim.height - 4*pPopupData->sideMargin - 2*pPopupData->btnDim.height;
+ rect.width = pPopupData->labelDim.width;
+
+ std::unique_ptr<TextBox> pTextBox(new (std::nothrow) TextBox());
+ SysTryReturnResult(NID_WEB_CTRL, pTextBox.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+ r = pTextBox->Construct(rect, TEXT_BOX_BORDER_ROUNDED);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pTextBox->SetTextSize(30);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pTextBox->SetAutoLinkMask(LINK_TYPE_NONE);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pTextBox->SetText(certString);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = AddControl(*pTextBox);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ TextBox* pCertBox = pTextBox.release();
+
+ //Add Panel
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ //Add Buttons
+ ArrayList idList;
+ r = idList.Construct();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_CLOSE)));
+
+ ArrayList titleList;
+ r = titleList.Construct();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ titleList.Add(*(new String(L"Close")));
+
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
+ SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pLayout->SetHorizontalFitPolicy(*pCertBox, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*pButtonPanel, FIT_POLICY_PARENT);
+
+ pLayout->SetHorizontalAlignment(*pCertBox, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+
+ pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
+
+ return E_SUCCESS;
+}
+
+
+void
+_CertificatePopup::OnActionPerformed(const Control& source, int actionId)
+{
+ result r = E_SUCCESS;
+
+ switch (actionId)
+ {
+ case ID_BUTTON_CERTIFICATE_CLOSE:
+ r = HidePopup();
+ if (IsFailed(r))
+ {
+ SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ delete this;
+}
+
+
+result
+_CertificatePopup::GenerateCertifiate(Ewk_Certificate_Policy_Decision* pPolicy, String& certString)
+{
+ SysTryReturnResult(NID_WEB_CTRL, pPolicy, E_INVALID_ARG, "Certificate Policy pointer is null.");
+
+ String pemString(ewk_certificate_policy_decision_certificate_pem_get(pPolicy));
+ std::unique_ptr<ByteBuffer> pByteBuf(StringUtil::StringToUtf8N(pemString));
+ SysTryReturnResult(NID_WEB_CTRL, pByteBuf.get(), E_INVALID_DATA, "Certificate pem information is Empty.");
+
+ X509Certificate certificate;
+ result r = certificate.Construct(*pByteBuf);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ //Issued to
+ certString.Append(L"ISSUED TO:\n\n");
+ String subject = certificate.GetSubject();
+
+ certString.Append(L"Common Name:\n");
+ certString.Append(GetStringOfToken(subject, L"/CN=")+L"\n");
+
+ certString.Append(L"Organization:\n");
+ certString.Append(GetStringOfToken(subject, L"/O=")+L"\n");
+
+ certString.Append(L"Organizational Unit:\n");
+ certString.Append(GetStringOfToken(subject, L"/OU=")+L"\n");
+
+ certString.Append(L"Serial Number:\n");
+ certString.Append(certificate.GetSerialNumber()+L"\n\n\n");
+
+ //Issued by
+ certString.Append(L"ISSUER:\n\n");
+ String issuer = certificate.GetIssuer();
+
+ certString.Append(L"Common Name:\n");
+ certString.Append(GetStringOfToken(issuer, L"/CN=")+L"\n");
+
+ certString.Append(L"Organization:\n");
+ certString.Append(GetStringOfToken(issuer, L"/O=")+L"\n");
+
+ certString.Append(L"Organizational Unit:\n");
+ certString.Append(GetStringOfToken(issuer, L"/OU=")+L"\n\n");
+
+ //Validity
+ certString.Append(L"VALIDITY:\n\n");
+ certString.Append(L"Valid From:\n");
+ certString.Append(certificate.GetNotBefore()+L"\n\n");
+
+ certString.Append(L"Valid Till:\n");
+ certString.Append(certificate.GetNotAfter()+L"\n\n\n");
+
+ //FingerPrints
+ certString.Append(L"FINGERPRINTS:\n\n");
+ certString.Append(L"Signature Algorithm:\n");
+ certString.Append(certificate.GetSignatureAlgorithm()+L"\n\n");
+
+ std::unique_ptr<ByteBuffer> pFingerPrint(certificate.GetFingerprintN());
+ if (pFingerPrint.get() && pFingerPrint->GetPointer())
+ {
+ String fingerPrint;
+ StringUtil::Utf8ToString((const char*)pFingerPrint->GetPointer(), fingerPrint);
+ certString.Append(fingerPrint+L"\n\n");
+ }
+
+ return E_SUCCESS;
+}
+
+
+String
+_CertificatePopup::GetStringOfToken(const String& parseString, const String& parseToken)
+{
+ String inString(parseString);
+ int index = 0;
+
+ String outString;
+ outString.Append(L"\n");
+
+ result r = inString.IndexOf(parseToken, 0, index);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, outString, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ int prsTokLen = parseToken.GetLength();
+ r = inString.Remove(0, index + prsTokLen);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, outString, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ while (true)
+ {
+ r = inString.IndexOf(parseToken, 0, index);
+
+ switch (r)
+ {
+ case E_SUCCESS:
+ r = inString.Remove(index, prsTokLen);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, outString, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ inString.Insert(L"\n", index);
+ continue;
+
+ case E_OBJ_NOT_FOUND:
+ r = inString.IndexOf('=', 0, index);
+ if (r == E_SUCCESS)
+ {
+ int slashIndex = 0;
+ r = inString.LastIndexOf('/', index - 3, slashIndex);
+
+ if (!IsFailed(r) && (slashIndex == index - 2 || slashIndex == index - 3))
+ {
+ inString.Remove(slashIndex, inString.GetLength() - slashIndex);
+ }
+ }
+ inString.Append(L"\n");
+ outString = inString;
+ return outString;
+
+ default:
+ return outString;
+ }
+ }
+}
+
+
+}}} // Tizen::Web::Controls
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_CertificatePopup.h
+ * @brief The file contains the definition of _CertificatePopup class.
+ */
+
+#ifndef _FWEB_CTRL_INTERNAL_CERTIFICATE_POPUP_H_
+#define _FWEB_CTRL_INTERNAL_CERTIFICATE_POPUP_H_
+
+#include <unique_ptr.h>
+#include <EWebKit2.h>
+#include <FBaseString.h>
+#include "FWebCtrl_WebPopup.h"
+
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+enum _CertificatePopupButtonId
+{
+ ID_BUTTON_CERTIFICATE_CLOSE
+};
+
+
+class _CertificatePopup
+ : public _WebPopup
+{
+
+public:
+ /**
+ * Constructor
+ */
+ _CertificatePopup(void);
+
+ /**
+ * Destructor
+ */
+ virtual ~_CertificatePopup(void);
+
+ result Construct(Ewk_Certificate_Policy_Decision* pPolicy);
+
+ virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+private:
+ _CertificatePopup(const _CertificatePopup&);
+
+ _CertificatePopup& operator =(const _CertificatePopup&);
+
+ result GetMessageFromPolicy(Tizen::Base::String& message);
+
+ result GenerateCertifiate(Ewk_Certificate_Policy_Decision* pPolicy, Tizen::Base::String& certString);
+
+ Tizen::Base::String GetStringOfToken(const Tizen::Base::String& parseString, const Tizen::Base::String& parseToken);
+
+}; // _CertificatePopup
+
+}}} // Tizen::Web::Controls
+#endif // _FWEB_CTRL_INTERNAL_CERTIFICATE_POPUP_H_
#include <unique_ptr.h>
#include <EWebKit2.h>
#include <net_connection.h>
-#include <vconf.h>
#include <FAppApp.h>
#include <FGrpPoint.h>
#include <FGrpRectangle.h>
{
+static const char PLUGIN_DIRECTORY_PATH[] = "/usr/lib/osp/browser-plugin/";
+
+
+extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[] = L"data/.webkit/customDatabase/";
+extern const wchar_t USER_CONFIRM_DB_NAME[] = L"userConfirm.db";
+extern const wchar_t GEOLOCATION_TABLE_NAME[] = L"geolocationPermission";
+extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[] = L"customProtocol";
+extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[] = L"customContent";
+
+
+static const int CUSTOM_DB_TABLE_COUNT= 3;
+
+
_EflWebkit::_EflWebkit(void)
: __pWebFrame(null)
{
r = CreateResourceDirectory();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = InitializeGeolocationDb();
+ r = InitializeCustomDb();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = SetProxyAddress();
result
_EflWebkit::CreateResourceDirectory(void) const
{
- String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + GEOLOCATION_DIRECTORY_PATH);
- String parentPath(L"");
+ String html5FeaturesPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH);
- if (!_FileImpl::IsFileExist(geolocationPath))
+ if (!_FileImpl::IsFileExist(html5FeaturesPath))
{
result r = E_SUCCESS;
- r = _DirectoryImpl::Create(geolocationPath, true);
- SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. create geolocation directory.");
+ r = _DirectoryImpl::Create(html5FeaturesPath, true);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. create html5 features directory.");
}
return E_SUCCESS;
result
-_EflWebkit::InitializeGeolocationDb(void) const
+_EflWebkit::InitializeCustomDb(void) const
{
result r = E_SUCCESS;
_DatabaseImpl db;
- String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + GEOLOCATION_DIRECTORY_PATH + GEOLOCATION_DB_NAME);
- String table(GEOLOCATION_TABLE_NAME);
+ String path(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+ String geolocationTable(GEOLOCATION_TABLE_NAME);
+ String protocolTable(CUSTOM_PROTOCOL_TABLE_NAME);
+ String contentTable(CUSTOM_CONTENT_TABLE_NAME);
- r = db.Construct(geolocationPath, "a+", null);
+ r = db.Construct(path, "a+", null);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + table + L"'"));
+ std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select count(name) from sqlite_master Where type='table' And name in ('" + geolocationTable + L"', '" + protocolTable + L"', '" + contentTable + L"')"));
+ if (pEnum.get())
+ {
+ int count = 0;
+
+ r = pEnum->MoveNext();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pEnum->GetIntAt(0, count);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (count == CUSTOM_DB_TABLE_COUNT)
+ {
+ return E_SUCCESS;
+ }
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + geolocationTable + L"'"));
+ if (!pEnum.get())
+ {
+ r = db.ExecuteSql(
+ L"CREATE TABLE IF NOT EXISTS " + geolocationTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, origin TEXT, permission INTEGER)",
+ true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + protocolTable + L"'"));
+ if (!pEnum.get())
+ {
+ r = db.ExecuteSql(
+ L"CREATE TABLE IF NOT EXISTS " + protocolTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, baseUrl TEXT, url TEXT, mime TEXT, allow INTEGER)",
+ true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + contentTable + L"'"));
if (!pEnum.get())
{
r = db.ExecuteSql(
- L"CREATE TABLE IF NOT EXISTS " + table + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, origin TEXT, permission INTEGER)",
+ L"CREATE TABLE IF NOT EXISTS " + contentTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, baseUrl TEXT, url TEXT, mime TEXT, allow INTEGER)",
true);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
namespace Tizen { namespace Web { namespace Controls
{
+_OSP_EXPORT_ extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[];
+_OSP_EXPORT_ extern const wchar_t USER_CONFIRM_DB_NAME[];
+_OSP_EXPORT_ extern const wchar_t GEOLOCATION_TABLE_NAME[];
+_OSP_EXPORT_ extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[];
+_OSP_EXPORT_ extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[];
+
class _EflWebkit
: public Tizen::Base::Object
{
result CreateResourceDirectory(void) const;
- result InitializeGeolocationDb() const;
+ result InitializeCustomDb() const;
_EflWebkit& operator =(const _EflWebkit&);
* @brief The file contains the definition of _GeolocationConfirmPopup class.
*/
#include <FAppApp.h>
+#include <FBaseColArrayList.h>
+#include <FBaseSysLog.h>
#include <FGrpDimension.h>
#include <FGrpRectangle.h>
#include <FIoDbEnumerator.h>
#include <FUiLayout.h>
#include <FUiVerticalBoxLayout.h>
#include <FWebCtrlAuthenticationChallenge.h>
-#include <FBaseSysLog.h>
#include <FIo_DatabaseImpl.h>
-#include <FUiCtrl_PopupImpl.h>
#include <FUi_ControlManager.h>
#include <FUi_ResourceManager.h>
+#include "FWebCtrl_EflWebkit.h"
#include "FWebCtrl_GeolocationConfirmPopup.h"
-#include "FWebCtrl_GeolocationPermissionManagerImpl.h"
+#include "FWebCtrl_WebPopup.h"
#include "FWebCtrl_Utility.h"
+using namespace Tizen::App;
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
using namespace Tizen::Io;
-using namespace Tizen::Web::Controls;
-using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui;
-
-
-static const int GEOLOCATION_POPUP_TMP_LABLE_HEIGHT = 10;
+using namespace Tizen::Ui::Controls;
namespace Tizen { namespace Web { namespace Controls
_GeolocationConfirmPopup::_GeolocationConfirmPopup(void)
- : __pPopup(null)
- , __pCheckButton(null)
+ : __pCheckButton(null)
, __pGeolocationHandler(null)
- , __modal(0)
{
}
result
-_GeolocationConfirmPopup::Construct(Ewk_Geolocation_Permission_Data* pPermission)
+_GeolocationConfirmPopup::Construct(Ewk_Geolocation_Permission_Request* pPermission)
{
- SysTryReturnResult(NID_WEB_CTRL, pPermission != null, E_INVALID_ARG, "[%s] Invalid argument(s) is used. pPermission is null." , GetErrorMessage(E_INVALID_ARG));
-
- Dimension dim;
- Dimension labelDim;
- Dimension checkDim;
+ SysTryReturnResult(NID_WEB_CTRL, pPermission != null, E_INVALID_ARG, "Invalid argument(s) is used. pPermission is null.");
- int spacePad = 0;
- int buttonHeight = 0;
- int sideMargin = 0;
- int buttonWidth = 0;
- int labelFontSize = 0;
+ result r = E_SUCCESS;
int popupMaxHeight = 0;
- int popupWidth = 0;
__pGeolocationHandler = pPermission;
- String host = ewk_geolocation_permission_request_host_get(__pGeolocationHandler);
- host.Append(" Requests your Location");
-
- VerticalBoxLayout layout;
- result r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
-
- GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, popupWidth);
- GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, popupMaxHeight);
- GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, spacePad);
- GET_SHAPE_CONFIG(LABEL::TEXT_FONT_SIZE, orientation, labelFontSize);
- GET_DIMENSION_CONFIG(LABEL::MIN_SIZE, orientation, labelDim);
- GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_HEIGHT, orientation, checkDim.height);
- GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, orientation, checkDim.width);
-
- popupWidth -= 2*sideMargin;
- labelDim.width = popupWidth - 2*sideMargin;
- labelDim.height = 3*labelFontSize;
+ const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(__pGeolocationHandler);
+ String origin = _Utility::CreateOrigin(pSecurityOrigin);
+ origin.Append(" Requests your Location");
- std::unique_ptr<Popup> pPopup(new (std::nothrow) Popup());
- SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+ SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- popupMaxHeight = labelDim.height*2 + checkDim.height + buttonHeight + 6*sideMargin;
+ popupMaxHeight = pPopupData->labelDim.height + pPopupData->checkDim.height + pPopupData->btnDim.height + 6*pPopupData->sideMargin;
- r = pPopup->Construct(layout, layout, false, Tizen::Graphics::Dimension(popupWidth, popupMaxHeight));
+ r = _WebPopup::Construct(false, Dimension(pPopupData->popupDim.width, popupMaxHeight));
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
Rectangle rect(0, 0, 0, 0);
//label
- rect.height = labelDim.height;
- rect.width = labelDim.width;
+ rect.height = pPopupData->labelDim.height;
+ rect.width = pPopupData->labelDim.width;
std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
- SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
- r = pLabel->Construct(rect, host);
+ r = pLabel->Construct(rect, origin);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pLabel->SetTextConfig(labelFontSize, LABEL_TEXT_STYLE_NORMAL);
+ pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
- r = pPopup->AddControl(*pLabel);
+ r = AddControl(*pLabel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- Label* pTmpLabel = pLabel.release();
+ Label* pHostLabel = pLabel.release();
//checkbutton
rect.y = 0;
- rect.height = checkDim.height;
+ rect.height = pPopupData->checkDim.height;
std::unique_ptr<CheckButton> pCheckButton (new (std::nothrow) CheckButton());
- SysTryReturnResult(NID_WEB_CTRL, pCheckButton.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pCheckButton.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
r = pCheckButton->Construct(Rectangle(0, 0, rect.width, rect.height), CHECK_BUTTON_STYLE_MARK, BACKGROUND_STYLE_DEFAULT, false, L"Remember Preference");
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- r = pPopup->AddControl(*pCheckButton);
+ r = AddControl(*pCheckButton);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pCheckButton = pCheckButton.release();
- //button
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, buttonHeight);
- buttonWidth = (popupWidth / 2) - (spacePad) - (sideMargin * 2);
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- std::unique_ptr<Panel> pPanel(new (std::nothrow) Panel());
- SysTryReturnResult(NID_WEB_CTRL, pPanel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pPanel->Construct(Rectangle(0, 0, rect.width, buttonHeight));
+ ArrayList idList;
+ r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ idList.Add(*(new Integer(ID_BUTTON_GEOLOCATION_PROCESS)));
+ idList.Add(*(new Integer(ID_BUTTON_GEOLOCATION_CANCEL)));
- r = pPopup->AddControl(*pPanel);
+ ArrayList titleList;
+ r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ titleList.Add(*(new String(L"Allow")));
+ titleList.Add(*(new String(L"Refuse")));
- Panel* pTmpPanel = pPanel.release();
-
- std::unique_ptr<Button> pBtnSelection(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnSelection.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnSelection->Construct(Rectangle(sideMargin, 0, buttonWidth, buttonHeight), "Allow");
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pBtnSelection->SetActionId(ID_BUTTON_GEOLOCATION_PROCESS);
-
- r = pTmpPanel->AddControl(*pBtnSelection);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pBtnSelection->AddActionEventListener(*this);
- pBtnSelection.release();
-
- // Button Right
- std::unique_ptr<Button> pBtnCancel(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnCancel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnCancel->Construct(Rectangle(buttonWidth + spacePad + sideMargin, 0, buttonWidth, buttonHeight), "Refuse");
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pBtnCancel->SetActionId(ID_BUTTON_GEOLOCATION_CANCEL);
-
- r = pTmpPanel->AddControl(*pBtnCancel);
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pBtnCancel->AddActionEventListener(*this);
- pBtnCancel.release();
-
- std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(pPopup->GetLayoutN()));
+ std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pLayout->SetHorizontalFitPolicy(*pTmpLabel, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*pHostLabel, FIT_POLICY_PARENT);
pLayout->SetHorizontalFitPolicy(*__pCheckButton, FIT_POLICY_PARENT);
- pLayout->SetHorizontalFitPolicy(*pTmpPanel, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*pButtonPanel, FIT_POLICY_PARENT);
- pLayout->SetHorizontalAlignment(*pTmpLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*pHostLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
pLayout->SetHorizontalAlignment(*__pCheckButton, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetHorizontalAlignment(*pTmpPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
-
- pLayout->SetSpacing(*__pCheckButton, 2*sideMargin);
- pLayout->SetSpacing(*pTmpPanel, 2*sideMargin);
+ pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- __pPopup = std::move(pPopup);
+ pLayout->SetSpacing(*__pCheckButton, 2*pPopupData->sideMargin);
+ pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
return E_SUCCESS;
}
void
-_GeolocationConfirmPopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+_GeolocationConfirmPopup::OnActionPerformed(const Control& source, int actionId)
{
result r = E_SUCCESS;
{
result r = E_SUCCESS;
- Ewk_Geolocation_Permission_Request permistionRequest = ewk_geolocation_permission_request_get(__pGeolocationHandler);
-
- ewk_geolocation_permission_request_allow_set(permistionRequest, static_cast < Eina_Bool >(enable));
+ ewk_geolocation_permission_request_set(__pGeolocationHandler, static_cast < Eina_Bool >(enable));
if (__pCheckButton->IsSelected())
{
_GeolocationConfirmPopup::AddGeolocationDb(bool enable)
{
_DatabaseImpl db;
- String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + GEOLOCATION_DIRECTORY_PATH + GEOLOCATION_DB_NAME);
+ String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
String table(GEOLOCATION_TABLE_NAME);
- const Ewk_Security_Origin* pOrigin = ewk_geolocation_permission_request_origin_get(__pGeolocationHandler);
- String origin = _GeolocationPermissionManagerImpl::CreateOrigin(pOrigin);
+ const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(__pGeolocationHandler);
+ String origin = _Utility::CreateOrigin(pSecurityOrigin);
result r = db.Construct(geolocationPath, "r+", null);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
-result
-_GeolocationConfirmPopup::ShowPopup(void)
-{
- result r = E_SUCCESS;
-
- r = __pPopup->SetShowState(true);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pPopup->Show();
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return E_SUCCESS;
-}
-
-
-result
-_GeolocationConfirmPopup::HidePopup(void)
-{
- result r = E_SUCCESS;
-
- r = __pPopup->SetShowState(false);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return E_SUCCESS;
-}
-
-
}}} // Tizen::Web::Controls
#include <unique_ptr.h>
#include <EWebKit2.h>
-#include <FBase.h>
#include <FBaseString.h>
-#include <FUi.h>
#include <FUiIActionEventListener.h>
-
-namespace Tizen { namespace Ui
-{
-class IActionEventListener;
-}} // Tizen::Ui
-
-namespace Tizen { namespace Ui { namespace Controls
-{
-class Popup;
-}}} // Tizen::Ui::Controls
+#include "FWebCtrl_WebPopup.h"
namespace Tizen { namespace Web { namespace Controls
{
+class _WebPopup;
+
enum _GeolocationPopupButtonId
{
ID_BUTTON_GEOLOCATION_PROCESS,
};
class _GeolocationConfirmPopup
- : public Tizen::Base::Object
- , virtual public Tizen::Ui::IActionEventListener
+ : public Tizen::Web::Controls::_WebPopup
{
public:
*/
virtual ~_GeolocationConfirmPopup(void);
- result Construct(Ewk_Geolocation_Permission_Data* pPermission);
-
- result ShowPopup(void);
-
- result HidePopup(void);
+ result Construct(Ewk_Geolocation_Permission_Request* pPermission);
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
_GeolocationConfirmPopup& operator =(const _GeolocationConfirmPopup&);
private:
- std::unique_ptr<Tizen::Ui::Controls::Popup> __pPopup;
-
Tizen::Ui::Controls::CheckButton* __pCheckButton;
- Ewk_Geolocation_Permission_Data* __pGeolocationHandler;
+ Ewk_Geolocation_Permission_Request* __pGeolocationHandler;
- int __modal;
}; // _GeolocationConfirmPopup
}}} // Tizen::Web::Controls
#include <FIoDbEnumerator.h>
#include <FWebCtrlGeolocationPermissionManager.h>
#include <FIo_DatabaseImpl.h>
+#include "FWebCtrl_EflWebkit.h"
#include "FWebCtrl_GeolocationPermissionManagerImpl.h"
-#include "FWebCtrl_Utility.h"
using namespace Tizen::Base;
{
result r = E_SUCCESS;
- String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + GEOLOCATION_DIRECTORY_PATH + GEOLOCATION_DB_NAME);
+ String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
r = __db.Construct(geolocationPath, "r+", null);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
-String
-_GeolocationPermissionManagerImpl::CreateOrigin(const void* ewkSecurityOrigin)
-{
- const Ewk_Security_Origin* pOrigin = reinterpret_cast< const Ewk_Security_Origin* >(ewkSecurityOrigin);
-
- String protocol(ewk_security_origin_protocol_get(pOrigin));
- String host(ewk_security_origin_host_get(pOrigin));
- int port = ewk_security_origin_port_get(pOrigin);
-
- String origin = protocol + L"://" + host;
-
- if (port)
- {
- origin.Append(L":");
- origin.Append(port);
- }
-
- SysLog(NID_WEB_CTRL, "The current value of origin is %ls", origin.GetPointer());
-
- return origin;
-}
-
-
_GeolocationPermissionManagerImpl*
_GeolocationPermissionManagerImpl::GetInstance(GeolocationPermissionManager* pGeolocationPermissionManager)
{
result RemoveAll(void);
- static Tizen::Base::String CreateOrigin(const void* ewkSecurityOrigin);
-
static _GeolocationPermissionManagerImpl* GetInstance(GeolocationPermissionManager* pGeolocationPermissionManager);
static const _GeolocationPermissionManagerImpl* GetInstance(const GeolocationPermissionManager* pGeolocationPermissionManager);
#include <EWebKit2.h>
#include <FBaseSysLog.h>
#include <FGrpPoint.h>
+#include <FUi_CoordinateSystemUtils.h>
#include <FUi_Control.h>
#include <FUi_TouchManager.h>
#include <FUi_UiTouchEvent.h>
r = pEnum->GetCurrent(pFingerInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
- Point firstFinger(pFingerInfo->GetPoint());
+ Point firstFinger(_CoordinateSystemUtils::ConvertToInteger(pFingerInfo->GetPoint()));
r = pEnum->MoveNext();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
r = pEnum->GetCurrent(pFingerInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
- Point secondFinger(pFingerInfo->GetPoint());
+ Point secondFinger(_CoordinateSystemUtils::ConvertToInteger(pFingerInfo->GetPoint()));
__pPinchListener->InitializeFactor();
{
__longPressed = false;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
Ewk_Event_Gesture gestureEvent;
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0, 0);
pSmartData->api->gesture_start(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
{
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_TAP, absPoint, Point(0, 0), 0, 1);
pSmartData->api->gesture_end(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_TAP, absPoint, Point(0, 0), 0, 2);
pSmartData->api->gesture_start(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
r = pEnum->GetCurrent(pFingerInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
- Point firstFinger(pFingerInfo->GetPoint());
+ Point firstFinger(_CoordinateSystemUtils::ConvertToInteger(pFingerInfo->GetPoint()));
r = pEnum->MoveNext();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
r = pEnum->GetCurrent(pFingerInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
- Point secondFinger(pFingerInfo->GetPoint());
+ Point secondFinger(_CoordinateSystemUtils::ConvertToInteger(pFingerInfo->GetPoint()));
__pPinchListener->InitializeFactor();
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0, 0);
pSmartData->api->gesture_move(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0, 0);
pSmartData->api->gesture_end(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_PAN, absPoint, Point(0, 0), 0, 0);
pSmartData->api->gesture_end(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_FLICK, absPoint, __velocity, 0, 0);
pSmartData->api->gesture_start(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
r = pEnum->GetCurrent(pFingerInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
- Point firstFinger(pFingerInfo->GetPoint());
+ Point firstFinger(_CoordinateSystemUtils::ConvertToInteger(pFingerInfo->GetPoint()));
r = pEnum->MoveNext();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
r = pEnum->GetCurrent(pFingerInfo);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
- Point secondFinger(pFingerInfo->GetPoint());
+ Point secondFinger(_CoordinateSystemUtils::ConvertToInteger(pFingerInfo->GetPoint()));
double zoomFactor = GetZoomFactor(firstFinger, secondFinger);
Point center(GetCenterPoint(firstFinger, secondFinger));
{
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_PINCH, absPoint, Point(0, 0), 0, 0);
pSmartData->api->gesture_end(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
Ewk_Event_Gesture gestureEvent;
- Point absPoint = __pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition());
+ Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(touchInfo.GetCurrentPosition())));
SetGestureEvent(gestureEvent, EWK_GESTURE_PINCH, absPoint, Point(0, 0), 0, 0);
pSmartData->api->gesture_end(const_cast<Ewk_View_Smart_Data*>(pSmartData), &gestureEvent);
#include <FUiLayout.h>
#include <FUiVerticalBoxLayout.h>
#include <FWebCtrlAuthenticationChallenge.h>
-#include <FUiCtrl_PopupImpl.h>
-#include <FUi_ResourceManager.h>
#include <FSys_SystemResource.h>
+#include <FUi_ResourceManager.h>
+//#include <FUiCtrl_PopupImpl.h>
#include "FWebCtrl_WebImpl.h"
#include "FWebCtrl_InputPickerPopup.h"
using namespace Tizen::Base;
using namespace Tizen::Graphics;
-using namespace Tizen::Web::Controls;
-using namespace Tizen::Ui::Controls;
-using namespace Tizen::Ui;
using namespace Tizen::Locales;
using namespace Tizen::System;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
namespace Tizen { namespace Web { namespace Controls
std::unique_ptr<Popup> pPopup(new (std::nothrow) Popup());
SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
- r = pPopup->Construct(layout, layout, true, Tizen::Graphics::Dimension(__popupWidth, __popupHeight));
+ r = pPopup->Construct(layout, layout, true, Dimension(__popupWidth, __popupHeight));
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pPopup = std::move(pPopup);
String buttonStr;
- Tizen::System::_SystemResource* pSysResource = Tizen::System::_SystemResource::GetInstance();
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
buttonStr = pSysResource->GetString("sys_string", "IDS_COM_SK_OK");
#include <unique_ptr.h>
#include <ewk_view.h>
-
#include <FBase.h>
#include <FBaseString.h>
#include <FGrpColor.h>
* @file FWebCtrl_AuthConfirmPopup.cpp
* @brief The file contains the definition of _AuthConfirmPopup class.
*/
+#include <FBaseColIList.h>
+#include <FBaseSysLog.h>
+#include <FGrpColor.h>
#include <FGrpDimension.h>
#include <FGrpRectangle.h>
#include <FUiCtrlButton.h>
#include <FUiCtrlEditField.h>
#include <FUiCtrlLabel.h>
#include <FUiCtrlPanel.h>
+#include <FUiCtrlTextBox.h>
#include <FUiLayout.h>
#include <FUiVerticalBoxLayout.h>
#include <FWebCtrlAuthenticationChallenge.h>
-#include <FBaseSysLog.h>
-#include <FUiCtrl_PopupImpl.h>
+#include <FSys_SystemResource.h>
#include <FUi_ControlManager.h>
#include <FUi_ResourceManager.h>
-#include <FGrpColor.h>
-#include <FUiCtrlTextBox.h>
#include <FUiCtrl_TextBoxImpl.h>
-#include <FSys_SystemResource.h>
#include "FWebCtrl_WebImpl.h"
#include "FWebCtrl_PromptPopup.h"
+
using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
-using namespace Tizen::Web::Controls;
-using namespace Tizen::Ui::Controls;
+using namespace Tizen::System;
using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
static const int LABEL_HEIGHT = 10;
+
namespace Tizen { namespace Web { namespace Controls
{
_PromptPopup::_PromptPopup(void)
- : __pPopup(null)
- , __pEditField(null)
+ : __pEditField(null)
{
}
// Prompt popup
result
-_PromptPopup::Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultVale)
+_PromptPopup::Construct(const String& message, const String& defaultVale)
{
result r = E_SUCCESS;
- String buttonStr;
- Dimension dim;
- Dimension editDim;
Rectangle rect(0, 0, 0, 0);
- int spacePad = 0;
- int buttonHeight = 0;
- int sideMargin = 0;
- int buttonWidth = 0;
- int popupWidth = 0;
int popupHeight = 0;
- int gapForControls = 0;
-
- _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
- GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, popupWidth);
- GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, popupHeight);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, buttonHeight);
- GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, spacePad);
- r = GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, editDim);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, orientation, gapForControls);
+ _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+ SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- VerticalBoxLayout layout;
- r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
+ popupHeight = LABEL_HEIGHT + (2 * pPopupData->editDim.height + pPopupData->spacePad) + pPopupData->btnDim.height + (4 * pPopupData->spacePad) ;
- Tizen::System::_SystemResource* pSysResource = Tizen::System::_SystemResource::GetInstance();
- SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
-
- std::unique_ptr<Popup> pPopup(new (std::nothrow) Popup());
- SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- popupHeight = LABEL_HEIGHT + (2 * editDim.height + gapForControls) + buttonHeight + (4 * spacePad) ;
-
- r = pPopup->Construct(layout, layout, true, Tizen::Graphics::Dimension(popupWidth, popupHeight));
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pPopup->SetTitleText("Prompt Dialog");
-
- //Temp Label for Y position adjustment using Vertical layout.
- rect.x = 0;
- rect.y = 0;
- rect.height = LABEL_HEIGHT;
- rect.width = popupWidth - 2*sideMargin;;
-
- std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
- SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pLabel->Construct(rect, L"");
+ r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupHeight));
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = pPopup->AddControl(*pLabel);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- Label* pTmpLabel = pLabel.release();
+ SetTitleText("Prompt Dialog");
//Text box
- rect = pPopup->GetClientAreaBounds();
- rect.width = popupWidth - 2*sideMargin;
+ rect = GetClientAreaBounds();
+ rect.width = pPopupData->popupDim.width - 2 * pPopupData->sideMargin;
rect.y = 0;
- rect.height = editDim.height;
+ rect.height = pPopupData->editDim.height + 10;
std::unique_ptr<TextBox> pTextBox(new (std::nothrow) TextBox());
- SysTryReturnResult(NID_WEB_CTRL, pTextBox.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pTextBox.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
r = pTextBox->Construct(rect, TEXT_BOX_BORDER_ROUNDED);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pTextBox->SetText(message);
- pTextBox->SetColor(TEXT_BOX_STATUS_NORMAL, pPopup->GetColor());
- pTextBox->SetColor(TEXT_BOX_STATUS_HIGHLIGHTED, pPopup->GetColor());
+ pTextBox->SetColor(TEXT_BOX_STATUS_NORMAL, GetColor());
+ pTextBox->SetColor(TEXT_BOX_STATUS_HIGHLIGHTED, GetColor());
- r = pPopup->AddControl(*pTextBox);
+ r = AddControl(*pTextBox);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
TextBox* pTmpTextBox = pTextBox.release();
//Edit Field
rect.y = 0;
- rect.height = editDim.height;
+ rect.height = pPopupData->editDim.height + 10;
std::unique_ptr<EditField> pEditField(new (std::nothrow) EditField());
- SysTryReturnResult(NID_WEB_CTRL, pEditField.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pEditField.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
r = pEditField->Construct(rect, EDIT_FIELD_STYLE_NORMAL);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pEditField->SetText(defaultVale);
- r = pPopup->AddControl(*pEditField);
+ r = AddControl(*pEditField);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pEditField = pEditField.release();
+ __pEditField->SetFocus();
//Panel
- buttonWidth = (popupWidth / 2) - (spacePad) - (sideMargin * 2);
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- std::unique_ptr<Panel> pPanel(new Panel());
- SysTryReturnResult(NID_WEB_CTRL, pPanel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pPanel->Construct(Rectangle(0, 0, rect.width, buttonHeight + gapForControls));
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = pPopup->AddControl(*pPanel);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- Panel* pTempPanel = pPanel.release();
-
- //Button OK
- buttonStr = pSysResource->GetString("sys_string", "IDS_COM_SK_OK");
- std::unique_ptr<Button> pBtnOk(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnOk.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnOk->Construct(Rectangle(sideMargin, gapForControls, buttonWidth, buttonHeight), buttonStr);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pBtnOk->SetActionId(ID_BUTTON_PROMPT_OK);
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
+ SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
- r = pTempPanel->AddControl(*pBtnOk);
+ ArrayList idList;
+ r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ idList.Add(*(new Integer(ID_BUTTON_PROMPT_OK)));
+ idList.Add(*(new Integer(ID_BUTTON_PROMPT_CANCEL)));
- pBtnOk->AddActionEventListener(*this);
- pBtnOk.release();
-
- // Button Cancel
- buttonStr = pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL");
- std::unique_ptr<Button> pBtnCancel(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnCancel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnCancel->Construct(Rectangle(buttonWidth + spacePad + sideMargin, gapForControls, buttonWidth, buttonHeight), buttonStr);
+ ArrayList titleList;
+ r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_SK_OK"))));
+ titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL"))));
- pBtnCancel->SetActionId(ID_BUTTON_PROMPT_CANCEL);
-
- r = pTempPanel->AddControl(*pBtnCancel);
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pBtnCancel->AddActionEventListener(*this);
- pBtnCancel.release();
-
- __pEditField->SetFocus();
-
- std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(pPopup->GetLayoutN()));
+ std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pLayout->SetHorizontalFitPolicy(*pTmpLabel, FIT_POLICY_PARENT);
- pLayout->SetHorizontalFitPolicy(*pTempPanel, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*pButtonPanel, FIT_POLICY_PARENT);
pLayout->SetHorizontalFitPolicy(*__pEditField, FIT_POLICY_PARENT);
pLayout->SetHorizontalAlignment(*pTmpTextBox, LAYOUT_HORIZONTAL_ALIGN_LEFT);
pLayout->SetHorizontalAlignment(*__pEditField, LAYOUT_HORIZONTAL_ALIGN_LEFT);
- pLayout->SetHorizontalAlignment(*pTempPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetSpacing(*pTmpTextBox, gapForControls);
- pLayout->SetSpacing(*__pEditField, gapForControls);
- pLayout->SetSpacing(*pTempPanel, gapForControls);
-
- __pPopup = std::move(pPopup);
+ pLayout->SetSpacing(*pTmpTextBox, pPopupData->spacePad);
+ pLayout->SetSpacing(*__pEditField, pPopupData->spacePad);
+ pLayout->SetSpacing(*pButtonPanel, pPopupData->spacePad);
return r;
}
void
-_PromptPopup::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+_PromptPopup::OnActionPerformed(const Control& source, int actionId)
{
switch (actionId)
{
case ID_BUTTON_PROMPT_OK:
- {
- __pPopup->SetShowState(false);
- EndModal(ID_BUTTON_PROMPT_OK);
- }
- break;
+ SetShowState(false);
+ HidePopup(ID_BUTTON_PROMPT_OK);
+ break;
case ID_BUTTON_PROMPT_CANCEL:
- __pPopup->SetShowState(false);
- EndModal(ID_BUTTON_PROMPT_CANCEL);
+ SetShowState(false);
+ HidePopup(ID_BUTTON_PROMPT_CANCEL);
break;
default:
}
}
-result
-_PromptPopup::ShowAndWait(int& modalResult)
-{
- return __pPopup->DoModal(modalResult);
-}
-
-
-result
-_PromptPopup::EndModal(int modalResult)
-{
- return __pPopup->EndModal(modalResult);
-}
}}} // Tizen::Web::Controls
#define _FWEB_CTRL_PROMPT_POPUP_H_
#include <unique_ptr.h>
-#include <FBase.h>
#include <FBaseString.h>
-#include <FUiIActionEventListener.h>
+#include "FWebCtrl_WebPopup.h"
namespace Tizen { namespace Ui { namespace Controls
{
class _PromptPopup
- : public Tizen::Base::Object
- , virtual public Tizen::Ui::IActionEventListener
+ : public _WebPopup
{
public:
const Tizen::Base::String GetPromptText(void);
- result ShowAndWait(int& modalResult);
-
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
private:
- result EndModal(int modalResult);
_PromptPopup(const _PromptPopup&);
_PromptPopup& operator =(const _PromptPopup&);
private:
- std::unique_ptr<Tizen::Ui::Controls::Popup> __pPopup;
Tizen::Ui::Controls::EditField* __pEditField;
}; // _PromptPopup
#include <FUiCtrlPanel.h>
#include <FUiIActionEventListener.h>
#include <FUiVerticalBoxLayout.h>
+#include <FSys_SystemResource.h>
#include <FUi_ResourceManager.h>
-#include "FSys_SystemResource.h"
#include "FWebCtrl_SelectBox.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
+using namespace Tizen::System;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Controls;
-using namespace Tizen::Web;
namespace Tizen { namespace Web { namespace Controls
//Internal class for maintaining states of list elements
class _ListElement
- : public Tizen::Base::Object
+ : public Object
{
public:
_ListElement(const String& itemText);
_SelectBox::_SelectBox(void)
: __pListView(null)
, __multiSelection(false)
- , __modal(0)
, __SelectedIndex(-1)
, __prevIndex(-1)
, __orientation(_CONTROL_ORIENTATION_PORTRAIT)
result
_SelectBox::Construct(bool isMultiSelect, const String& title, int listItemCnt, Evas_Object* pWebView)
{
- Rectangle popupRect(0, 0, 0, 0);
result r = E_SUCCESS;
Rectangle rect;
- Dimension dim(0, 0);
- Dimension btnDim(0,0);
- int listCount = 4;
- int totalListHeight = 0;
+ int listCount = 4;
+ int listItemHeight = 0;
int listMaxHeihgt = 0;
int popupWinTopMargin = 0;
int popupWinBottomMargin = 0;
- int popupBetweenListNBtnGap = 0;
-
- int listViewheight = 0;
- int sideBorder = 0;
+ int listViewHeight = 0;
__pWebView = pWebView;
- GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, __orientation, dim.width);
- GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, __orientation, dim.height);
- GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, __orientation, totalListHeight);
+ GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, __orientation, listItemHeight);
GET_SHAPE_CONFIG(POPUP::TOP_BORDER, __orientation, popupWinTopMargin);
GET_SHAPE_CONFIG(POPUP::BOTTOM_BORDER, __orientation, popupWinBottomMargin);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_TOP_MARGIN, __orientation, popupBetweenListNBtnGap);
- GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, __orientation, sideBorder);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, __orientation, btnDim.height);
__multiSelection = isMultiSelect;
- totalListHeight = listCount * totalListHeight;
+ _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+ SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- listMaxHeihgt = totalListHeight + btnDim.height + 2 * (popupBetweenListNBtnGap + popupWinTopMargin + popupWinBottomMargin);
+ listMaxHeihgt = listCount * listItemHeight + pPopupData->btnDim.height + 2 * ( pPopupData->spacePad + popupWinTopMargin + popupWinBottomMargin);
- dim.height = Max< int >(listMaxHeihgt, dim.height);
- rect.height = dim.height;
- rect.width = dim.width;
+ rect.height = Max< int >(listMaxHeihgt, pPopupData->popupDim.height);
+ rect.width = pPopupData->popupDim.width;
rect.x = 0;
rect.y = 0;
- VerticalBoxLayout layout;
- r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
+ r = _WebPopup::Construct(!title.IsEmpty(), Dimension(rect.width, rect.height));
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (title.IsEmpty())
+ if (!title.IsEmpty())
{
- SysLog(NID_WEB_CTRL, "title empty Popup::Construct rect.width=%d rect.height=%d\n", rect.width, rect.height);
- r = Popup::Construct(layout, layout, false, Dimension(rect.width, rect.height));
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- }
- else
- {
- SysLog(NID_WEB_CTRL, "with title Popup::Construct rect.width=%d rect.height=%d\n", rect.width, rect.height);
- r = Popup::Construct(layout, layout, true, Dimension(rect.width, rect.height));
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
Popup::SetTitleText(title);
}
- listViewheight = GetClientAreaBounds().height - popupWinTopMargin - popupWinBottomMargin - btnDim.height;
+ listViewHeight = GetClientAreaBounds().height - popupWinTopMargin - popupWinBottomMargin - pPopupData->btnDim.height;
std::unique_ptr<ListView> pListView(new (std::nothrow) ListView());
- SysTryReturnResult(NID_WEB_CTRL, pListView.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pListView.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
- r = pListView->Construct(Rectangle(0, popupWinTopMargin, GetClientAreaBounds().width, listViewheight), false);
+ r = pListView->Construct(Rectangle(0, popupWinTopMargin, GetClientAreaBounds().width, listViewHeight), false);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __listElementArray.Construct();
__pListView = pListView.release();
- r = CreateButtons(btnDim.height, popupBetweenListNBtnGap);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
-}
-
-
-result
-_SelectBox::CreateButtons(int buttonHeight, int buttonGap)
-{
- result r = E_SUCCESS;
-
- int buttonLeftRightMargin = 0;
- int popupWinBottomMargin = 0;
-
- Rectangle rect = this->GetClientAreaBounds();
- Rectangle buttonRect;
-
- Tizen::System::_SystemResource* pSysResource = Tizen::System::_SystemResource::GetInstance();
+ _SystemResource* pSysResource = _SystemResource::GetInstance();
SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
- String buttonStr = pSysResource->GetString("sys_string", "IDS_COM_BODY_DONE");
-
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, __orientation, buttonLeftRightMargin);
- GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_BOTTOM_MARGIN, __orientation, popupWinBottomMargin);
-
- std::unique_ptr<Panel> pPanel(new (std::nothrow) Panel());
- SysTryReturnResult(NID_WEB_CTRL, pPanel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pPanel->Construct(Rectangle(0, 0, GetClientAreaBounds().width, buttonHeight));
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = AddControl(*pPanel);
+ ArrayList idList;
+ r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- Panel* pAttachedPanel = pPanel.release();
-
- buttonRect.x = 0;
- buttonRect.y = 0;
- buttonRect.width = GetClientAreaBounds().width;
- buttonRect.height = buttonHeight;
-
- // Create Softkey Buttons
if (__multiSelection)
{
- buttonRect.x = buttonLeftRightMargin;
- buttonRect.width = GetClientAreaBounds().width/2 - buttonLeftRightMargin;
- std::unique_ptr<Button> pBtnSelection(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnSelection.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
-
- r = pBtnSelection->Construct(buttonRect, buttonStr);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pBtnSelection->SetActionId(ID_BUTTON_SELECTION);
- pBtnSelection->AddActionEventListener(*this);
-
- r = pAttachedPanel->AddControl(*pBtnSelection);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- pBtnSelection.release();
-
- buttonRect.x = buttonRect.width + buttonLeftRightMargin;
+ idList.Add(*(new Integer(ID_BUTTON_SELECTION)));
}
+ idList.Add(*(new Integer(ID_BUTTON_CANCEL)));
- std::unique_ptr<Button> pBtnCancel(new (std::nothrow) Button());
- SysTryReturnResult(NID_WEB_CTRL, pBtnCancel.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
-
- buttonStr = pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL");
-
- r = pBtnCancel->Construct(buttonRect, buttonStr);
+ ArrayList titleList;
+ r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ if (__multiSelection)
+ {
+ titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_BODY_DONE"))));
+ }
+ titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL"))));
- pBtnCancel->SetActionId(ID_BUTTON_CANCEL);
- pBtnCancel->AddActionEventListener(*this);
-
- r = pAttachedPanel->AddControl(*pBtnCancel);
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- pBtnCancel.release();
-
std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- pLayout->SetSpacing(*__pListView, buttonGap);
- pLayout->SetSpacing(*pAttachedPanel, buttonGap);
+ pLayout->SetSpacing(*pButtonPanel, pPopupData->sideMargin);
return r;
}
{
result r = E_SUCCESS;
std::unique_ptr<_ListElement> pListElement(new (std::nothrow) _ListElement(itemText));
- SysTryReturnResult(NID_WEB_CTRL, pListElement.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.",GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pListElement.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
pListElement->ListElementSetItemType(itemType);
pListElement->ListElementSetItemSelected(slected);
}
-Tizen::Base::Collection::IList*
+IList*
_SelectBox::GetSelectedListN(void) const
{
result r = E_SUCCESS;
//IListViewItemProvider
-Tizen::Ui::Controls::ListItemBase*
+ListItemBase*
_SelectBox::CreateItem(int index, int itemWidth)
{
result r = E_SUCCESS;
bool
-_SelectBox::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
+_SelectBox::DeleteItem(int index, ListItemBase* pItem, int itemWidth)
{
delete pItem;
pItem = null;
void
-_SelectBox::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId,
- Tizen::Ui::Controls::ListContextItemStatus state)
+_SelectBox::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus state)
{
}
void
-_SelectBox::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId,
- Tizen::Ui::Controls::ListItemStatus status)
+_SelectBox::OnListViewItemStateChanged(ListView& listView, int index, int elementId, ListItemStatus status)
{
if (__multiSelection)
{
ewk_view_popup_menu_select(__pWebView, __SelectedIndex);
}
- EndModal();
- SetShowState(false);
- return;
+ result r = HidePopup(__SelectedIndex);
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
void
-_SelectBox::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
+_SelectBox::OnListViewItemSwept(ListView& listView, int index, SweepDirection direction)
{
}
void
-_SelectBox::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
+_SelectBox::OnActionPerformed(const Control& source, int actionId)
{
switch (actionId)
{
{
ewk_view_popup_menu_select(__pWebView, __prevIndex);
}
- EndModal();
- SetShowState(false);
+
+ result r = HidePopup(__SelectedIndex);
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
break;
}
}
result
_SelectBox::UpdateList(Eina_List* pItems, int prevIndex, bool clearPrevList, bool isGroupdList)
{
- SysTryReturnResult(NID_WEB_CTRL, __pListView, E_INVALID_STATE, "[%s] List View is in an invalid state", GetErrorMessage(E_INVALID_STATE));
+ SysTryReturnResult(NID_WEB_CTRL, __pListView, E_INVALID_STATE, "List View is in an invalid state");
if (clearPrevList)
{
}
-result
-_SelectBox::ShowAndWait(int &selectedIndex)
-{
- result res = E_SUCCESS;
-
- __modal++;
-
- res = Popup::DoModal(__modal);
- __modal = 0;
- selectedIndex = __SelectedIndex;
-
- return res;
-}
-
-
-result
-_SelectBox::EndModal(void)
-{
- result res = E_SUCCESS;
-
- if (__modal)
- {
- res = Popup::EndModal(__modal);
- }
-
- return res;
-}
-
}}} // Tizen::Web::Controls
#include <Evas.h>
#include <FBaseColIList.h>
#include <FBaseString.h>
-#include <FUiCtrlPopup.h>
#include <FUiCtrlIListViewItemEventListener.h>
#include <FUiCtrlIListViewItemProvider.h>
#include <FUi_ControlManager.h>
+#include "FWebCtrl_WebPopup.h"
namespace Tizen { namespace Graphics
{
class _SelectBox
- : public Tizen::Ui::Controls::Popup
+ : public _WebPopup
, public Tizen::Ui::Controls::IListViewItemEventListener
, public Tizen::Ui::Controls::IListViewItemProvider
- , public Tizen::Ui::IActionEventListener
{
public:
/**
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
result AddListItem(const Tizen::Base::String& itemText, int itemType,bool slected);
- result ShowAndWait(int &selectedIndex);
result UpdateList(Eina_List* pItems, int prevIndex, bool clearPrevList, bool isGroupdList);
private:
bool IsMultiSelectable(void) const { return __multiSelection; }
void UpdateSelectionIndex(int index);
result CreateButtons(int btnHeight, int buttonGap);
- result EndModal(void);
public:
static const int ID_FORMAT_STRING = 300;
Tizen::Base::Collection::ArrayList __listElementArray;
Tizen::Ui::Controls::ListView* __pListView;
bool __multiSelection;
- int __modal;
int __SelectedIndex;
int __prevIndex;
Tizen::Ui::_ControlOrientation __orientation;
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_UserConfirmPopup.cpp
+ * @brief The file contains the definition of _UserConfirmPopup class.
+ */
+#include <FBaseColArrayList.h>
+#include <FBaseSysLog.h>
+#include <FBaseUtilUri.h>
+#include <FGrpDimension.h>
+#include <FGrpRectangle.h>
+#include <FSecCertX509Certificate.h>
+#include <FUiCtrlButton.h>
+#include <FUiCtrlLabel.h>
+#include <FUiCtrlPanel.h>
+#include <FUiLayout.h>
+#include <FUiVerticalBoxLayout.h>
+#include <FUi_ControlManager.h>
+#include <FUi_ResourceManager.h>
+#include "FWebCtrl_CertificatePopup.h"
+#include "FWebCtrl_UserConfirmPopup.h"
+#include "FWebCtrl_Utility.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::Security::Cert;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+
+_UserConfirmPopup::_UserConfirmPopup(void)
+ : __pUserPolicyData(null)
+ , __userConfirmMode(USER_CONFIRM_CERTIFICATE)
+{
+}
+
+
+_UserConfirmPopup::~_UserConfirmPopup(void)
+{
+}
+
+
+result
+_UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo)
+{
+ result r = E_SUCCESS;
+ SysTryReturnResult(NID_WEB_CTRL, pEventInfo, E_INVALID_ARG, "Invalid argument(s) is used. pPolicy is null.");
+ SysTryReturnResult(NID_WEB_CTRL, (userConfirmMode <= USER_CONFIRM_USERMEDIA) && (userConfirmMode >= USER_CONFIRM_CERTIFICATE), E_INVALID_ARG,
+ "Invalid userConfirmMode is used. [%d]", userConfirmMode);
+
+ _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+ SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pUserPolicyData = pEventInfo;
+ __userConfirmMode = userConfirmMode;
+
+ int popupMaxHeight = 0;
+ popupMaxHeight = 2*pPopupData->labelDim.height + 2*pPopupData->btnDim.height + 6*pPopupData->sideMargin;
+
+ r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupMaxHeight));
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ SetTitleText("Security Warning");
+
+ Rectangle rect(0, 0, 0, 0);
+
+ //label
+ rect.height = 2*pPopupData->labelDim.height;
+ rect.width = pPopupData->labelDim.width;
+
+ std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
+ SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+ String message = GetMessageFromPolicy();
+ r = pLabel->Construct(rect, message);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
+
+ r = AddControl(*pLabel);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ Label* pInfoLabel = pLabel.release();
+
+ Panel* pButtonPanel = CreateAndAddPanel();
+ SysTryReturn(NID_WEB_CTRL, pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ ArrayList idList;
+ r = idList.Construct();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
+ if (__userConfirmMode == USER_CONFIRM_CERTIFICATE)
+ {
+ idList.Add(*(new Integer(ID_BUTTON_USER_CERT_VIEW)));
+ }
+ idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
+
+ ArrayList titleList;
+ r = titleList.Construct();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ titleList.Add(*(new String(L"Allow")));
+ if (__userConfirmMode == USER_CONFIRM_CERTIFICATE)
+ {
+ titleList.Add(*(new String(L"View")));
+ }
+ titleList.Add(*(new String(L"Cancel")));
+
+ r = CreateAndAddButtons(idList, titleList, pButtonPanel);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
+ SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pLayout->SetHorizontalFitPolicy(*pInfoLabel, FIT_POLICY_PARENT);
+ pLayout->SetHorizontalFitPolicy(*pButtonPanel, FIT_POLICY_PARENT);
+
+ pLayout->SetHorizontalAlignment(*pInfoLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+ pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
+
+ pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
+
+ return E_SUCCESS;
+}
+
+
+void
+_UserConfirmPopup::OnActionPerformed(const Control& source, int actionId)
+{
+ result r = E_SUCCESS;
+
+ switch (actionId)
+ {
+ case ID_BUTTON_USER_ALLOW:
+ HandleUserAction(EINA_TRUE);
+ break;
+
+ case ID_BUTTON_USER_CERT_VIEW:
+ r = ShowCertificatePopup();
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ return;
+
+ case ID_BUTTON_USER_CANCEL:
+ HandleUserAction(EINA_FALSE);
+ break;
+
+ default:
+ break;
+ }
+
+ r = HidePopup();
+ if (IsFailed(r))
+ {
+ SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ delete this;
+}
+
+
+String
+_UserConfirmPopup::GetMessageFromPolicy(void)
+{
+ String message;
+
+ switch(__userConfirmMode)
+ {
+ case USER_CONFIRM_CERTIFICATE:
+ {
+ Ewk_Certificate_Policy_Decision* pPolicy = reinterpret_cast< Ewk_Certificate_Policy_Decision* >(__pUserPolicyData);
+ message = L"There are problems with the security certificate of this site.\n";
+ message.Append(ewk_certificate_policy_decision_url_get(pPolicy));
+ break;
+ }
+ case USER_CONFIRM_USERMEDIA:
+ {
+ message = L"Do you want to allow acccess to media?\n";
+ break;
+ }
+ default:
+ SysAssert(false);
+ }
+
+ return message;
+}
+
+
+void
+_UserConfirmPopup::HandleUserAction(Eina_Bool allow)
+{
+ switch (__userConfirmMode)
+ {
+ case USER_CONFIRM_CERTIFICATE:
+ {
+ Ewk_Certificate_Policy_Decision* pPolicy = reinterpret_cast< Ewk_Certificate_Policy_Decision* >(__pUserPolicyData);
+ ewk_certificate_policy_decision_allowed_set(pPolicy, allow);
+ break;
+ }
+ case USER_CONFIRM_USERMEDIA:
+ {
+ Ewk_User_Media_Permission_Request* pPolicy = reinterpret_cast< Ewk_User_Media_Permission_Request* >(__pUserPolicyData);
+ ewk_user_media_permission_request_set(pPolicy, allow);
+ break;
+ }
+ default:
+ SysAssert(false);
+ }
+}
+
+
+result
+_UserConfirmPopup::ShowCertificatePopup(void)
+{
+ //get Certificate information
+ Ewk_Certificate_Policy_Decision* pPolicy = reinterpret_cast< Ewk_Certificate_Policy_Decision* >(__pUserPolicyData);
+ SysTryReturnResult(NID_WEB_CTRL, pPolicy, E_SYSTEM, "Certificate policy is not set.");
+
+ std::unique_ptr<_CertificatePopup> pCertificatePopup(new (std::nothrow) _CertificatePopup());
+ SysTryReturnResult(NID_WEB_CTRL, pCertificatePopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+ result r = pCertificatePopup->Construct(pPolicy);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pCertificatePopup->ShowPopup();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pCertificatePopup.release();
+ return E_SUCCESS;
+}
+
+
+}}} // Tizen::Web::Controls
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_UserConfirmPopup.h
+ * @brief The file contains the definition of _UserConfirmPopup class.
+ */
+
+#ifndef _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
+#define _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
+
+#include <unique_ptr.h>
+#include <EWebKit2.h>
+#include <FBaseString.h>
+#include "FWebCtrl_WebPopup.h"
+
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+enum _UserConfirmPopupButtonId
+{
+ ID_BUTTON_USER_ALLOW,
+ ID_BUTTON_USER_CERT_VIEW,
+ ID_BUTTON_USER_CANCEL
+};
+
+enum _UserConfirmMode
+{
+ USER_CONFIRM_CERTIFICATE,
+ USER_CONFIRM_USERMEDIA
+};
+
+class _UserConfirmPopup
+ : public _WebPopup
+{
+
+public:
+ /**
+ * Constructor
+ */
+ _UserConfirmPopup(void);
+
+ /**
+ * Destructor
+ */
+ virtual ~_UserConfirmPopup(void);
+
+ result Construct(_UserConfirmMode userConfirmMode, void* pEventInfo);
+
+ virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+private:
+ _UserConfirmPopup(const _UserConfirmPopup&);
+
+ _UserConfirmPopup& operator =(const _UserConfirmPopup&);
+
+ Tizen::Base::String GetMessageFromPolicy(void);
+
+ void HandleUserAction(Eina_Bool allow);
+
+ result ShowCertificatePopup(void);
+
+private:
+ void* __pUserPolicyData;
+ _UserConfirmMode __userConfirmMode;
+}; // _UserConfirmPopup
+
+}}} // Tizen::Web::Controls
+#endif // _FWEB_CTRL_INTERNAL_USER_CONFIRM_POPUP_H_
*/\r
\r
#include <Ecore.h>\r
+#include <FAppUiApp.h>
+#include <FAppIAppFrame.h>
#include <FBaseSysLog.h>\r
+#include <FUiAnim_EflNode.h>\r
+#include <FUiAnim_VisualElementImpl.h>
+#include <FUiCtrlFrame.h>
+#include <FUi_ControlImpl.h>\r
#include "FWebCtrl_Utility.h"\r
\r
+using namespace Tizen::App;\r
using namespace Tizen::Base;\r
using namespace Tizen::Graphics;\r
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;\r
+using namespace Tizen::Ui::Animations;\r
\r
namespace Tizen { namespace Web { namespace Controls\r
{\r
\r
\r
-const char CERTIFICATE_FILE_PATH[] = "/opt/osp/system/internal/security/certmgr/certificates.crt";\r
-const char PLUGIN_DIRECTORY_PATH[] = "/usr/lib/osp/browser-plugin/";\r
-\r
-\r
-const wchar_t GEOLOCATION_DIRECTORY_PATH[] = L"data/.webkit/locationDatabase/";\r
-const wchar_t GEOLOCATION_DB_NAME[] = L".location.db";\r
-const wchar_t GEOLOCATION_TABLE_NAME[] = L"geolocationPermission";\r
-\r
-\r
_Utility::_Utility(void)\r
{\r
}\r
{\r
}\r
\r
+Evas*\r
+_Utility::GetEvasFromUiApp()\r
+{\r
+ IAppFrame* pAppFrame = Application::GetInstance()->GetAppFrame();
+ SysTryReturn(NID_WEB_CTRL, pAppFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ Frame* pFrame = pAppFrame->GetFrame();
+ SysTryReturn(NID_WEB_CTRL, pFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ _ControlImpl* pControlimpl = _ControlImpl::GetInstance(*pFrame);
+ SysTryReturn(NID_WEB_CTRL, pControlimpl, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ VisualElement* pVisual = pControlimpl->GetCore().GetVisualElement();
+ SysTryReturn(NID_WEB_CTRL, pVisual, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ _VisualElementImpl* pWebVisualElementImpl = _VisualElementImpl::GetInstance(*pVisual);
+ SysTryReturn(NID_WEB_CTRL,pWebVisualElementImpl, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ _EflNode* pEflNode = dynamic_cast< _EflNode* >(pWebVisualElementImpl->GetNativeNode());
+ SysTryReturn(NID_WEB_CTRL, pEflNode, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ Evas* pEvas = pEflNode->GetEvas();
+ SysTryReturn(NID_WEB_CTRL, pEvas, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));\r
+}\r
+\r
+\r
result\r
_Utility::GetPixelBufferFromEvasObject(const Evas_Object* source, Tizen::Graphics::BufferInfo& bufferInfo)\r
{\r
\r
SysLog(NID_WEB_CTRL, "color space : %d, pitch (%d), w-h (%d, %d)", colorSpace, bufferInfo.pitch, bufferInfo.width, bufferInfo.height);\r
\r
-// evas_object_image_data_set(const_cast<Evas_Object*>(source), null);\r
-\r
return E_SUCCESS;\r
-\r
}\r
+\r
+\r
+String
+_Utility::CreateOrigin(const Ewk_Security_Origin* pSecurityOrigin)\r
+{
+ String protocol(ewk_security_origin_protocol_get(pSecurityOrigin));\r
+ String host(ewk_security_origin_host_get(pSecurityOrigin));\r
+ int port = ewk_security_origin_port_get(pSecurityOrigin);\r
+
+ String origin = protocol + L"://" + host;
+
+ if (port)
+ {
+ origin.Append(L":");
+ origin.Append(port);
+ }
+
+ SysLog(NID_WEB_CTRL, "The current value of origin is %ls", origin.GetPointer());
+
+ return origin;
+}
+\r
+\r
}}}\r
#ifndef _FWEB_CTRL_INTERNAL_UTILITY_H_\r
#define _FWEB_CTRL_INTERNAL_UTILITY_H_\r
\r
+#include <EWebKit2.h>\r
#include <Evas.h>\r
#include <FGrpBufferInfo.h>\r
\r
namespace Tizen { namespace Web { namespace Controls\r
{\r
\r
-extern const char CERTIFICATE_FILE_PATH[];\r
-extern const char PLUGIN_DIRECTORY_PATH[];\r
-\r
-extern const wchar_t GEOLOCATION_DIRECTORY_PATH[];\r
-extern const wchar_t GEOLOCATION_DB_NAME[];\r
-extern const wchar_t GEOLOCATION_TABLE_NAME[];\r
-\r
class _Utility\r
{\r
public:\r
+ static Evas* GetEvasFromUiApp(void);\r
+\r
static result GetPixelBufferFromEvasObject(const Evas_Object* source, Tizen::Graphics::BufferInfo& bufferInfo);\r
\r
+ static Tizen::Base::String CreateOrigin(const Ewk_Security_Origin* pSecurityOrigin);\r
+\r
private:\r
_Utility(void);\r
\r
#include <FBaseColLinkedListT.h>
#include <FBaseSysLog.h>
#include <FBaseColIListT.h>
+#include <FGrpFloatPoint.h>
#include <FGrpPoint.h>
#include <FGrpBitmap.h>
#include <FGrpCanvas.h>
#include <FGrp_CoordinateSystem.h>
#include <FUiAnim_EflNode.h>
#include <FUiAnim_VisualElement.h>
+#include <FUi_CoordinateSystemUtils.h>
+#include <FUi_AccessibilityContainer.h>
+#include <FUi_AccessibilityElement.h>
+#include <FUi_IAccessibilityFocusHandler.h>
#include <FUi_TouchManager.h>
#include "FWebCtrl_EflWebkit.h"
#include "FWebCtrl_GestureState.h"
using namespace Tizen::Ui::Animations;
+namespace
+{
+static int __animationAccessibilityCount = 0;
+class _WebAccessibilityFocusHandler
+ :public Tizen::Ui::_IAccessibilityFocusHandler
+{
+public:
+ _WebAccessibilityFocusHandler(void)
+ {
+ }
+ virtual ~_WebAccessibilityFocusHandler(void)
+ {
+ }
+ virtual bool OnMoveFocus(Tizen::Ui::_AccessibilityFocusDirection direction)
+ {
+ __animationAccessibilityCount++;
+ if (direction == Tizen::Ui::_ACCESSIBILITY_FOCUS_DIRECTION_PREVIOUS)
+ {
+ if(__animationAccessibilityCount %3 == 0)
+ {
+ SysLog(NID_WEB_CTRL, "_WebAccessibilityFocusHandler can move focus , :direction : PREVIOUS");
+ return false;
+ }
+ SysLog(NID_WEB_CTRL, "!!!_WebAccessibilityFocusHandler can NOT move focus , :direction : PREVIOUS");
+ return true;
+ }
+ else if (direction == Tizen::Ui::_ACCESSIBILITY_FOCUS_DIRECTION_NEXT)
+ {
+ if(__animationAccessibilityCount %3 == 0)
+ {
+ SysLog(NID_WEB_CTRL, "_WebAccessibilityFocusHandler can move focus , :direction : NEXT");
+ return false;
+ }
+ SysLog(NID_WEB_CTRL, "!!!_WebAccessibilityFocusHandler can NOT move focus , :direction : NEXT");
+ return true;
+ }
+ return true;
+ }
+ virtual bool OnMoveFocus(const Tizen::Graphics::Point& point)
+ {
+ if(__animationAccessibilityCount %2 == 0)
+ {
+ SysLog(NID_WEB_CTRL, "_WebAccessibilityFocusHandler can read element at the point (%d,%d)", point.x, point.y);
+ return true;
+ }
+ else
+ {
+ SysLog(NID_WEB_CTRL, "_WebAccessibilityFocusHandler can NOT read element at the point (%d,%d)", point.x, point.y);
+ return false;
+ }
+
+ }
+};
+}
+
+
namespace Tizen { namespace Web { namespace Controls
{
pWeb->AcquireHandle();
pWeb->SetMultiTouchEnabled(true);
- pWeb->SetTouchMoveAllowance(TOUCH_MOVE_ALLOWANCE_NORMAL);
+ pWeb->SetTouchPressThreshold(0.08);
r = pWeb->AddGestureListeners();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
SetNativeObjectFocusable(false);
+ _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+ if (pContainer)
+ {
+ pContainer->Activate(true);
+ }
+
+ _WebAccessibilityFocusHandler* pFocusHandler = new (std::nothrow) _WebAccessibilityFocusHandler();
+
+ pContainer->SetFocusHandler(dynamic_cast<_IAccessibilityFocusHandler*>(pFocusHandler));
+
return E_SUCCESS;
}
}
+FloatPoint
+_Web::GetAbsoluteCoordinate(FloatPoint relativePoint)
+{
+ _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetTransformer();
+ SysAssertf(pXformer, "Failed to get coordinate transformer.");
+
+ float absX = pXformer->TransformHorizontal(relativePoint.x + GetAbsoluteBoundsF().x);
+ float absY = pXformer->TransformVertical(relativePoint.y + GetAbsoluteBoundsF().y);
+
+ return FloatPoint(absX, absY);
+}
+
+
Point
_Web::GetRelativeCoordinate(Point absolutePoint)
{
}
+FloatPoint
+_Web::GetRelativeCoordinate(FloatPoint absolutePoint)
+{
+ _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
+ SysAssertf(pXformer, "Failed to get coordinate transformer.");
+
+ FloatPoint bound(GetAbsoluteCoordinate(FloatPoint(0.0, 0.0)));
+
+ float absX = pXformer->TransformHorizontal(absolutePoint.x - bound.x);
+ float absY = pXformer->TransformVertical(absolutePoint.y - bound.y);
+
+ return FloatPoint(absX, absY);
+}
+
+
Evas_Object*
_Web::GetWebNativeNode(void)
{
std::unique_ptr<IBidirectionalEnumeratorT<_FingerInfo*> > pTouchListEnum(pTouchList->GetBidirectionalEnumeratorN());
SysAssertf(pTouchListEnum.get() != null, "Failed to get enumerator of touch list.");
- Point currentPoint;
+ FloatPoint currentPoint;
_FingerInfo* pFingerInfo = null;
while(pTouchListEnum->MoveNext() == E_SUCCESS)
{
if(state == _TOUCH_PRESSED || state == _TOUCH_MOVED || state == _TOUCH_RELEASED || state == _TOUCH_CANCELED)
{
currentPoint = GetAbsoluteCoordinate(pFingerInfo->GetPoint());
+ Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(currentPoint));
pPoint = static_cast<Ewk_Touch_Point*>(calloc(1, sizeof(Ewk_Touch_Point)));
pPoint->id = pFingerInfo->GetPointId();
- pPoint->x = currentPoint.x;
- pPoint->y = currentPoint.y;
+ pPoint->x = integerPoint.x;
+ pPoint->y = integerPoint.y;
pPoint->state = GetEvasTouchState((TouchStatus)pFingerInfo->GetStatus());
pPointList = eina_list_append(pPointList, pPoint);
Tizen::Graphics::Point GetAbsoluteCoordinate(Tizen::Graphics::Point relativePoint);
+ Tizen::Graphics::FloatPoint GetAbsoluteCoordinate(Tizen::Graphics::FloatPoint relativePoint);
+
Tizen::Graphics::Point GetRelativeCoordinate(Tizen::Graphics::Point absolutePoint);
+ Tizen::Graphics::FloatPoint GetRelativeCoordinate(Tizen::Graphics::FloatPoint absolutePoint);
+
void SetWebSettingImpl(Tizen::Web::Controls::_WebSettingImpl* pWebSettingImpl);
_WebSettingImpl* GetWebSettingImpl(void) const;
enum EventInfoKey
{
BLOCK_START,
- BLOCK_END
+ BLOCK_END,
+ BLOCK_START_FLOAT,
+ BLOCK_END_FLOAT
};
result SetEventInfo(EventInfoKey key, const Tizen::Base::Object& value);
*
* The file contains the definition of _WebImpl class.
*/
+#include <Ecore_IMF_Evas.h>
#include <Ecore_Evas.h>
#include <elm_config.h>
#include <elm_win.h>
#include <FWebCtrlITextSearchListener.h>
#include <FWebCtrlIWebDownloadListener.h>
#include <FWebCtrlIWebUiEventListener.h>
+#include <FWebCtrlIWebUiEventListenerF.h>
#include <FWebCtrlIWebKeypadEventListener.h>
#include <FWebCtrlIJavaScriptBridge.h>
#include <FWebCtrlPageNavigationList.h>
#include <FIo_DatabaseImpl.h>
#include <FIo_NormalFile.h>
#include <FUi_Control.h>
+#include <FUi_CoordinateSystemUtils.h>
#include <FUi_EcoreEvasMgr.h>
#include <FUi_EcoreEvas.h>
#include <FUi_ResourceSizeInfo.h>
#include "FWebCtrl_AppControlListener.h"
#include "FWebCtrl_AuthConfirmPopup.h"
#include "FWebCtrl_AuthenticationChallengeImpl.h"
+#include "FWebCtrl_EflWebkit.h"
#include "FWebCtrl_GeolocationConfirmPopup.h"
#include "FWebCtrl_GeolocationPermissionManagerImpl.h"
#include "FWebCtrl_HitElementResultImpl.h"
SysLog(NID_WEB_CTRL, "The current value of key is %ls, value is %ls", pAttrKey->GetPointer(), pAttrValue->GetPointer());
r = reinterpret_cast< HashMap* >(pUserData)->Add(*pAttrKey, *pAttrValue);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
pAttrKey.release();
pAttrValue.release();
}
-void FreeCharArray(void* pData)
+void
+FreeCharArray(void* pData)
{
delete[] reinterpret_cast<char*>(pData);
}
+LoadingErrorType
+ConvertErrorCode(int error)
+{
+ LoadingErrorType errorCode = WEB_ERROR_UNKNOWN;
+
+ switch (error)
+ {
+ case EWK_ERROR_NETWORK_STATUS_CANCELLED:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_CANT_RESOLVE:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_CANT_RESOLVE_PROXY:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_CANT_CONNECT:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_CANT_CONNECT_PROXY:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_IO_ERROR:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_MALFORMED:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_TRY_AGAIN:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_TOO_MANY_REDIRECTS:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_TLS_FAILED:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_INTERNAL_SERVER_ERROR:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_BAD_GATEWAY:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_SERVICE_UNAVAILABLE:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_GATEWAY_TIMEOUT:
+ errorCode = WEB_NO_CONNECTION;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_BAD_REQUEST:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_REQUEST_URI_TOO_LONG:
+ errorCode = WEB_BAD_URL;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_FORBIDDEN:
+ errorCode = WEB_FILE_ACCESS_FAILED;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_REQUEST_TIMEOUT:
+ errorCode = WEB_REQUEST_TIMEOUT;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_UNSUPPORTED_MEDIA_TYPE:
+ errorCode = WEB_MIME_NOT_SUPPORTED;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_INSUFFICIENT_STORAGE:
+ errorCode = WEB_OUT_OF_MEMORY;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_REQUEST_ENTITY_TOO_LARGE:
+ errorCode = WEB_REQUEST_MAX_EXCEEDED;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_CONTINUE:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_SWITCHING_PROTOCOLS:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_PROCESSING:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_OK:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_CREATED:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_ACCEPTED:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_NON_AUTHORITATIVE:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_NO_CONTENT:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_RESET_CONTENT:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_PARTIAL_CONTENT:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_MULTI_STATUS:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_MULTIPLE_CHOICES:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_MOVED_PERMANENTLY:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_FOUND:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_SEE_OTHER:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_NOT_MODIFIED:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_USE_PROXY:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_NOT_APPEARING_IN_THIS_PROTOCOL:
+ //fall through
+ case EWK_ERROR_NETWORK_STATUS_TEMPORARY_REDIRECT:
+ errorCode = WEB_HTTP_RESPONSE;
+ break;
+
+ case EWK_ERROR_NETWORK_STATUS_SSL_FAILED:
+ errorCode = WEB_INVALID_CERTIFICATE;
+ break;
+
+ default:
+ errorCode = WEB_ERROR_UNKNOWN;
+ break;
+ }
+
+ return errorCode;
+}
+
+
result
FireLoadingErrorOccurredEvent(_WebImpl* pImpl, int code, const char* pDescription)
{
std::unique_ptr<Integer> pErrorCode(new (std::nothrow) Integer(code));
std::unique_ptr<String> pErrorDescription(new (std::nothrow) String(pDescription));
std::unique_ptr<_LoadingEventArg> pEventArg(new (std::nothrow) _LoadingEventArg(WEB_EVENT_LOADINGLISTENER_ERROR_OCCURRED));
- SysTryReturn(NID_WEB_CTRL, pErrorCode.get() && pErrorDescription.get() && pEventArg.get(), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ SysTryReturnResult(NID_WEB_CTRL, pErrorCode.get() && pErrorDescription.get() && pEventArg.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
r = pEventArg->SetEventInfo(_LoadingEventArg::ERROR_TYPE, *pErrorCode.get());
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
String defVal(pDefaultValue);
int modalResult = -1;
+ Eina_Bool returnValue = EINA_TRUE;
_PromptPopup pPromptPopup;
r = pPromptPopup.Construct(msg, defVal);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, returnValue = EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
- pPromptPopup.ShowAndWait(modalResult);
+ r = pPromptPopup.ShowAndWait(modalResult);
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, returnValue = EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
- if (modalResult)
+ if (modalResult == ID_BUTTON_PROMPT_OK)
{
std::unique_ptr<char[]> pResult(_StringConverter::CopyToCharArrayN(pPromptPopup.GetPromptText()));
- SysTryReturn(NID_WEB_CTRL, pResult.get(), EINA_FALSE, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryCatch(NID_WEB_CTRL, pResult.get(), returnValue = EINA_FALSE, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
ewk_view_javascript_prompt_reply(pView, pResult.get());
- }
- else
- {
- ewk_view_javascript_prompt_reply(pView, null);
+ return EINA_TRUE;
}
- return EINA_TRUE;
+CATCH:
+ ewk_view_javascript_prompt_reply(pView, null);
+ return returnValue;
}
Ewk_Certificate_Policy_Decision* pPolicy = reinterpret_cast< Ewk_Certificate_Policy_Decision* >(pEventInfo);
SysAssertf(pImpl && pPolicy, "Failed to request");
- SysLog(NID_WEB_CTRL, "url : %s, pem : %s, error : %d", ewk_certificate_policy_decision_url_get(pPolicy), ewk_certificate_policy_decision_certificate_pem_get(pPolicy), ewk_certificate_policy_decision_error_get(pPolicy));
+ ewk_certificate_policy_decision_suspend(pPolicy);
- ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_TRUE);
-
- if (pImpl->GetLoadingListener())
+ switch (pImpl->GetSetting().GetCertificateErrorHandlingMode())
{
-// ToDo : If certificate check works properly, remove annotation.
-// r = FireLoadingErrorOccurredEvent(pImpl, 999, "Invalid certificate.");
-// SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ case WEB_CERTIFICATE_ERROR_HANDLING_MODE_USER_CONFIRM:
+ {
+ result r = E_SUCCESS;
+
+ r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_CERTIFICATE, pEventInfo);
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ break;
+ }
+ case WEB_CERTIFICATE_ERROR_HANDLING_MODE_CANCEL:
+CATCH:
+ ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_FALSE);
+ break;
+ case WEB_CERTIFICATE_ERROR_HANDLING_MODE_CONTINUE :
+ ewk_certificate_policy_decision_allowed_set(pPolicy, EINA_TRUE);
+ break;
+ default:
+ SysAssert(false);
}
}
r = pImpl->HttpAuthenticationRequested(pChallenge);
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
return;
CATCH:
OnGeolocationPermissionRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
{
_WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
- Ewk_Geolocation_Permission_Data* pPermissionData = reinterpret_cast< Ewk_Geolocation_Permission_Data* >(pEventInfo);
- SysAssertf(pImpl && pPermissionData, "Failed to request");
-
- Ewk_Geolocation_Permission_Request permissionRequest = ewk_geolocation_permission_request_get(pPermissionData);
+ Ewk_Geolocation_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Geolocation_Permission_Request* >(pEventInfo);
+ SysAssertf(pImpl && pPermissionRequest, "Failed to request");
if (pImpl->GetSetting().IsGeolocationEnabled())
{
std::unique_ptr<DbEnumerator> pEnum;
- String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + GEOLOCATION_DIRECTORY_PATH + GEOLOCATION_DB_NAME);
+ String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
String table(GEOLOCATION_TABLE_NAME);
_DatabaseImpl db;
- const Ewk_Security_Origin* pOrigin = ewk_geolocation_permission_request_origin_get(pPermissionData);
- String origin = _GeolocationPermissionManagerImpl::CreateOrigin(pOrigin);
+ const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pPermissionRequest);
+ String origin = _Utility::CreateOrigin(pSecurityOrigin);
r = db.Construct(geolocationPath, "r", null);
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
SysLog(NID_WEB_CTRL, "The current value of permission is %d", permission);
- ewk_geolocation_permission_request_allow_set(permissionRequest, static_cast < Eina_Bool >(permission));
+ ewk_geolocation_permission_request_set(pPermissionRequest, static_cast < Eina_Bool >(permission));
}
else
{
- r = pImpl->ShowGeolocationPopup(pPermissionData);
+ ewk_geolocation_permission_request_suspend(pPermissionRequest);
+
+ r = pImpl->ShowGeolocationPopup(pPermissionRequest);
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
}
CATCH:
- ewk_geolocation_permission_request_allow_set(permissionRequest, EINA_FALSE);
+ ewk_geolocation_permission_request_set(pPermissionRequest, EINA_FALSE);
+}
+
+
+void
+OnGetUserMediaPermissionRequsted(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_User_Media_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_User_Media_Permission_Request* >(pEventInfo);
+ SysAssertf(pImpl && pPermissionRequest, "Failed to request");
+
+ result r = pImpl->ShowUserConfirmPopup(USER_CONFIRM_USERMEDIA, pEventInfo);
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ return;
+
+CATCH:
+ ewk_user_media_permission_request_set(pPermissionRequest, EINA_FALSE);
+}
+
+
+void
+OnNotificationPermissionRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(pEventInfo);
+ SysAssertf(pImpl && pPermissionRequest, "Failed to request");
+
+ SysLog(NID_WEB_CTRL, "The permission popup has not Implemented yet. allow is the default value now.");
+
+ //ToDo : Show NotificationPermissionPopup
+
+ Ewk_Context* pContext = ewk_view_context_get(pView);
+ SysAssertf(pContext, "Failed to get webkit instance.");
+
+ //ewk_notification_permission_request_origin_get(pPermissionRequest);
+
+ ewk_notification_permission_request_set(pPermissionRequest, EINA_TRUE);
+}
+
+
+void
+OnNotificationShow(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Notification* pNotification = reinterpret_cast< Ewk_Notification* >(pEventInfo);
+ SysAssertf(pImpl && pNotification, "Failed to request");
+
+ Ewk_Context* pContext = ewk_view_context_get(pView);
+ SysAssertf(pContext, "Failed to get webkit instance.");
+
+ //ToDo : Show Notification
+ //Perform ewk_notification_clicked
+ //ewk_notification_security_origin_get(pNotification)
+ SysLog(NID_WEB_CTRL, "The current value of title is %s", ewk_notification_title_get(pNotification));
+ SysLog(NID_WEB_CTRL, "The current value of body is %s", ewk_notification_body_get(pNotification));
+ SysLog(NID_WEB_CTRL, "The current value of icon path is %s",ewk_notification_icon_url_get(pNotification));
+
+ uint64_t notificationId = ewk_notification_id_get(pNotification);
+ ewk_notification_showed(pContext, notificationId);
+}
+
+
+void
+OnNotificationCancel(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ uint64_t* pNotificationID = reinterpret_cast< uint64_t* >(pEventInfo);
+ SysAssertf(pImpl && pNotificationID, "Failed to request");
+
+ //ToDo : Where is ewk API for cancel operation?
+}
+
+
+void
+OnProtocolHandlerRegistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
+ SysAssertf(pImpl && pHandlerData, "Failed to request");
+
+ ewk_custom_handlers_data_target_get(pHandlerData);
+ ewk_custom_handlers_data_base_url_get(pHandlerData);
+ ewk_custom_handlers_data_url_get(pHandlerData);
+ ewk_custom_handlers_data_title_get(pHandlerData);
+}
+
+
+void
+OnIsProtocolHandlerRegistered(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
+ SysAssertf(pImpl && pHandlerData, "Failed to request");
+
+ ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_REGISTERED);
+}
+
+
+void
+OnProtocolHandlerUnregistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
+ SysAssertf(pImpl && pHandlerData, "Failed to request");
+}
+
+
+void
+OnContentHandlerRegistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
+ SysAssertf(pImpl && pHandlerData, "Failed to request");
+}
+
+
+void
+OnIsContentHandlerRegistered(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
+ SysAssertf(pImpl && pHandlerData, "Failed to request");
+
+ ewk_custom_handlers_data_result_set(pHandlerData, EWK_CUSTOM_HANDLERS_REGISTERED);
+}
+
+
+void
+OnContentHandlerUnregistrationRequested(void* pUserData, Evas_Object* pView, void* pEventInfo)
+{
+ _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData);
+ Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(pEventInfo);
+ SysAssertf(pImpl && pHandlerData, "Failed to request");
}
}
}
- String uriScheme(ewk_policy_decision_scheme_get(pPolicy));
+ Uri uri;
+ uri.SetUri(url);
+
+ String uriScheme(uri.GetScheme());
SysLog(NID_WEB_CTRL, "The current value of scheme is %ls", uriScheme.GetPointer());
if ((uriScheme != L"http") && (uriScheme != L"https") && (uriScheme != L"file"))
{
ewk_policy_decision_ignore(pPolicy);
+ if (uriScheme == L"")
+ {
+ return;
+ }
+
result r = E_SUCCESS;
_WebEventType eventType = WEB_EVENT_REQUEST_UNKNOWN;
selectBox.AddListItem(text, _SelectBox::LIST_ITEM_TYPE_NORMAL, false);
}
- selectBox.ShowAndWait(selectedIndex);
+ r = selectBox.ShowAndWait(selectedIndex);
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
if (selectedIndex == 0) //download
{
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
pEventArg.release();
}
+ if (pImpl->GetUiEventListenerF())
+ {
+ result r = E_SUCCESS;
+
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED));
+ SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ r = pImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+ }
}
SysAssertf(pParentImpl && pChildView, "Failed to request");
IWebUiEventListener* pUserUiListener = pParentImpl->GetUiEventListener();
+ IWebUiEventListenerF* pUserUiListenerF = pParentImpl->GetUiEventListenerF();
if (pUserUiListener)
{
Web* pWeb = pUserUiListener->OnWebWindowCreateRequested();
evas_object_data_set(*pChildView, PARENT_WEB_CTRL, pParentImpl);
}
}
+ if (pUserUiListenerF)
+ {
+ Web* pWeb = pUserUiListenerF->OnWebWindowCreateRequested();
+ if (pWeb)
+ {
+ _WebImpl* pChildImpl = _WebImpl::GetInstance(pWeb);
+ SysTryReturnVoidResult(NID_WEB_CTRL, pChildImpl, E_SYSTEM, "[%s] A system error has been occurred. Failed to get ChildImpl object.", GetErrorMessage(E_SYSTEM));
+
+ *pChildView = dynamic_cast< _Web* >(&pChildImpl->GetCore())->GetWebNativeNode();
+ evas_object_data_set(*pChildView, PARENT_WEB_CTRL, pParentImpl);
+ }
+ }
}
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
pEventArg.release();
}
-}
+ if (pParentImpl->GetUiEventListenerF())
+ {
+ result r = E_SUCCESS;
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED));
+ SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-Eina_Bool
-OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
-{
- Eina_Bool ret = EINA_FALSE;
+ r = pChildImpl->GetWebEvent()->FireAsync(*pEventArg.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+ }
+}
+
+
+Eina_Bool
+OnSelectUploadFile(Evas_Object* pView, Eina_Bool multipleFile, Eina_List* pAcceptTypes, const char* pCapture, void* pUserData)
+{
+ Eina_Bool ret = EINA_FALSE;
Eina_List* pSelectedFileNames = null;
String isMultipleSelection(L"single");
{
if (pImpl->IsKeypadVisible() == true)
{
- if ((pImpl->GetPreviousOrientation() == pFormCore->GetOrientation()) && (pImpl->GetKeypadHeight() != rect.height))
+ if ((pImpl->GetPreviousKeypadBounds().width == rect.width) && (pImpl->GetPreviousKeypadBounds().height != rect.height))
{
- pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(rect.height));
pImpl->GetWebKeypadEventListener()->OnWebKeypadBoundsChanged(*dynamic_cast< Web* >(&pImpl->GetPublic()));
}
}
}
}
pImpl->SetKeypadVisibleState(true);
- pImpl->SetPreviousOrientation(pFormCore->GetOrientation());
- pImpl->SetKeypadHeight(rect.height);
+ pImpl->SetPreviousKeypadBounds(rect);
}
else
{
_WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
SysAssertf(pWebImpl, "Failed to get Impl");
- result r = E_SUCCESS;
-
- std::unique_ptr<_SelectBox> pSelectBox(new (std::nothrow) _SelectBox());
- SysTryReturn(NID_WEB_CTRL, pSelectBox.get(), EINA_FALSE, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- //Create list required for selectBox
- int itemCount = eina_list_count(pItems);
- SysTryReturn(NID_WEB_CTRL, itemCount > 0, EINA_FALSE , E_SYSTEM, "[%s] ItemCount is invalid.", GetErrorMessage(E_SYSTEM));
-
- r = pSelectBox->Construct(false, L"", itemCount, pSmartData->self);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = pSelectBox->UpdateList(pItems, selectedIndex, false, false);
+ result r = pWebImpl->ShowSelectBoxPopup(false, L"", pItems, pSmartData->self, selectedIndex);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
- pWebImpl->SetSelectBox(pSelectBox.release());
-
- pWebImpl->GetSelectBox()->Show();
-
return EINA_TRUE;
}
_WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
SysAssertf(pWebImpl, "Failed to get Impl");
- Eina_Bool ret = EINA_TRUE;
-
- _SelectBox* pSelectBox = pWebImpl->GetSelectBox();
-
- if (pSelectBox)
- {
- pWebImpl->DeleteSelectBox();
- }
- else
- {
- ret = EINA_FALSE;
- }
+ result r = pWebImpl->ClearSelectBoxPopup();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
- return ret;
+ return EINA_TRUE;
}
_WebImpl* pWebImpl = reinterpret_cast<_WebImpl*>(evas_object_data_get(pSmartData->self, WEB_CTRL));
SysAssertf(pWebImpl, "Failed to get Impl");
- _SelectBox* pSelectBox = pWebImpl->GetSelectBox();
-
- Eina_Bool ret = EINA_FALSE;
-
- if (pSelectBox)
- {
- result r = pSelectBox->UpdateList(pItems, selectedIndex, true, false);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
-
- ret = EINA_TRUE;
- }
+ result r = pWebImpl->UpdateSelectBoxPopup(pItems, selectedIndex, false);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r));
- return ret;
+ return EINA_TRUE;
}
, __isKeypadOpened(false)
, __isLoadingErrorOccurred(false)
, __isRedirectRequested(false)
- , __keypadHeight(0)
+ , __keypadBounds(0, 0, 0, 0)
, __pWebCore(null)
, __pUserLoadingListener(null)
, __pUserUiListener(null)
+ , __pUserUiListenerF(null)
, __pUserKeypadEventListener(null)
, __pTextSearchListener(null)
, __pKeypad(null)
, __pWebEvent(null)
, __pAuthChallenge(null)
, __pAuthPopup(null)
+ , __pUserConfirmPopup(null)
, __pGeolocationPopup(null)
- , __orientation(_CONTROL_ORIENTATION_PORTRAIT)
, __pSelectBox(null)
, __pDatePicker(null)
, __pColorPicker(null)
}
+_WebImpl*
+_WebImpl::CreateWebImplN(Web* pControl, const FloatRectangle& bounds)
+{
+ result r = E_SUCCESS;
+
+ r = GET_SIZE_INFO(Web).CheckInitialSizeValidF(FloatDimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ _Web* pCore = _Web::CreateWebN();
+ SysTryReturn(NID_WEB_CTRL, pCore, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ _WebImpl* pImpl = new (std::nothrow) _WebImpl(pControl, pCore);
+
+ r = CheckConstruction(pCore, pImpl);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(Web), bounds, pCore->GetOrientation());
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pImpl->Construct();
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pImpl;
+
+CATCH:
+ delete pImpl;
+
+ return null;
+}
+
+
result
_WebImpl::Construct(void)
{
_Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
SysAssertf(pFormCore != null, "Failed to get FormCore");
- SetPreviousOrientation(pFormCore->GetOrientation());
-
return E_SUCCESS;
}
}
-void
-_WebImpl::SetSelectBox(_SelectBox* pSelectBox)
+result
+_WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List* pItems, Evas_Object* pWebView, int selectedIndex)
{
- __pSelectBox = std::unique_ptr<_SelectBox>(pSelectBox);
+ __pSelectBox.reset();
+
+ int itemCount = eina_list_count(pItems);
+ SysTryReturnResult(NID_WEB_CTRL, itemCount > 0, E_SYSTEM, "ItemCount is invalid.");
+
+ result r = E_SUCCESS;
+
+ std::unique_ptr<_SelectBox> pSelectBox(new (std::nothrow) _SelectBox());
+ SysTryReturnResult(NID_WEB_CTRL, pSelectBox.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ r = pSelectBox->Construct(isMultiSelect, title, itemCount, pWebView);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pSelectBox->UpdateList(pItems, selectedIndex, false, false);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pSelectBox = std::move(pSelectBox);
+
+ return __pSelectBox->ShowPopup();
}
-_SelectBox*
-_WebImpl::GetSelectBox(void)
+result
+_WebImpl::UpdateSelectBoxPopup(Eina_List* pItems, int selectedIndex, bool isGroupedList)
{
- return __pSelectBox.get();
+ SysTryReturnResult(NID_WEB_CTRL, __pSelectBox.get(), E_SYSTEM, "SlectBox instance does not exist.");
+
+ return __pSelectBox->UpdateList(pItems, selectedIndex, true, isGroupedList);
}
-void
-_WebImpl::DeleteSelectBox(void)
+result
+_WebImpl::ClearSelectBoxPopup(void)
{
- _SelectBox* pSelectBox = __pSelectBox.release();
- delete pSelectBox;
+ SysTryReturnResult(NID_WEB_CTRL, __pSelectBox.get(), E_SYSTEM, "SlectBox instance does not exist.");
+
+ __pSelectBox.reset();
+
+ return E_SUCCESS;
}
}
-result
-_WebImpl::AddCustomHeader(const HttpHeader& header)
-{
- std::unique_ptr<IList> pFieldNameList(header.GetFieldNamesN());
- if (pFieldNameList.get())
- {
- int count = pFieldNameList->GetCount();
- for (int i = 0; i < count; i++)
- {
- String* pFieldName = dynamic_cast< String* >(pFieldNameList->GetAt(i));
- SysTryReturn(NID_WEB_CTRL, pFieldName, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- std::unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(*pFieldName));
- SysTryReturn(NID_WEB_CTRL, pKey.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- std::unique_ptr<IEnumerator> pFieldValueEnum(header.GetFieldValuesN(*pFieldName));
- SysTryReturn(NID_WEB_CTRL, pFieldValueEnum.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- while (pFieldValueEnum->MoveNext() == E_SUCCESS)
- {
- String* pFieldValue = dynamic_cast< String* >(pFieldValueEnum->GetCurrent());
- SysTryReturn(NID_WEB_CTRL, pFieldValue, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- std::unique_ptr<char[]> pValue(_StringConverter::CopyToCharArrayN(*pFieldValue));
- SysTryReturn(NID_WEB_CTRL, pValue.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
-
- ewk_view_custom_header_add(__pWebCore->GetWebNativeNode(), pKey.get(), pValue.get());
- }
- }
- }
- return E_SUCCESS;
-}
-
-
-void
-_WebImpl::RemoveAllCustomHeaders(void)
-{
-}
-
-
bool
_WebImpl::SearchText(const String& text, bool searchForward)
{
ewk_settings_scripts_window_open_set(pSettings, static_cast< Eina_Bool >(setting.IsJavaScriptPopupEnabled()));
- ewk_settings_show_ime_on_autofocus_set(pSettings, EINA_FALSE);
+ ewk_settings_form_candidate_data_enabled_set(pSettings, static_cast< Eina_Bool >(setting.IsAutoFormDataShowEnabled()));
+
+ ewk_settings_autofill_password_form_enabled_set(pSettings, static_cast< Eina_Bool >(setting.IsAutoLoginFormFillEnabled()));
}
+ __pWebSetting->SetCertificateErrorHandlingMode(setting.GetCertificateErrorHandlingMode());
__pWebSetting->SetDefaultTextEncoding(setting.GetDefaultTextEncoding());
__pWebSetting->SetCacheControl(setting.GetCacheControl());
__pWebSetting->SetFontSize(setting.GetFontSize());
__pWebSetting->SetAutoFittingEnabled(setting.IsAutoFittingEnabled());
__pWebSetting->SetJavaScriptPopupEnabled(setting.IsJavaScriptPopupEnabled());
__pWebSetting->SetGeolocationEnabled(setting.IsGeolocationEnabled());
+ __pWebSetting->SetAutoFormDataShowEnabled(setting.IsAutoFormDataShowEnabled());
+ __pWebSetting->SetAutoLoginFormFillEnabled(setting.IsAutoLoginFormFillEnabled());
return E_SUCCESS;
}
}
+const HitElementResult*
+_WebImpl::GetElementByPointN(const FloatPoint& point) const
+{
+ const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(point));
+
+ return GetElementByPointN(integerPoint);
+}
+
+
bool
_WebImpl::IsLoading(void) const
{
void
+_WebImpl::ClearHistory(void)
+{
+ ewk_view_back_forward_list_clear(__pWebCore->GetWebNativeNode());
+}
+
+
+void
_WebImpl::ClearCache(void)
{
Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
}
+void
+_WebImpl::ClearFormData(void)
+{
+ Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
+ SysAssertf(pContext, "Failed to get webkit instance.");
+
+ ewk_context_form_candidate_data_clear(pContext);
+}
+
+
+void
+_WebImpl::ClearLoginFormData(void)
+{
+ Ewk_Context* pContext = ewk_view_context_get(__pWebCore->GetWebNativeNode());
+ SysAssertf(pContext, "Failed to get webkit instance.");
+
+ ewk_context_form_password_data_clear(pContext);
+}
+
+
bool
_WebImpl::IsCookieEnabled(void) const
{
void
+_WebImpl::SetWebUiEventListenerF(IWebUiEventListenerF* pUiEventListener)
+{
+ __pUserUiListenerF = pUiEventListener;
+}
+
+
+void
_WebImpl::SetWebKeypadEventListener(IWebKeypadEventListener* pKeypadEventListener)
{
__pUserKeypadEventListener = pKeypadEventListener;
}
+IWebUiEventListenerF*
+_WebImpl::GetUiEventListenerF(void) const
+{
+ return __pUserUiListenerF;
+}
+
+
IWebKeypadEventListener*
_WebImpl::GetWebKeypadEventListener(void) const
{
evas_object_smart_callback_add(pWebNativeNode, "authentication,challenge", OnHttpAuthenticationRequested, this);
evas_object_smart_callback_add(pWebNativeNode, "authentication,canceled", OnHttpAuthenticationCanceled, this);
- evas_object_smart_callback_add(pWebNativeNode, "request,geolocation,permission", OnGeolocationPermissionRequested, this);
+ evas_object_smart_callback_add(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested, this);
ewk_view_javascript_alert_callback_set(pWebNativeNode, OnScriptAlertRequested, const_cast< _WebImpl* >(this));
ewk_view_javascript_prompt_callback_set(pWebNativeNode, OnScriptPromptRequested, const_cast< _WebImpl* >(this));
evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this);
evas_object_smart_callback_add(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested, this);
+ evas_object_smart_callback_add(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted, this);
+
+ evas_object_smart_callback_add(pWebNativeNode, "notification,permission,request", OnNotificationPermissionRequested, this);
+ evas_object_smart_callback_add(pWebNativeNode, "notification,show", OnNotificationShow, this);
+ evas_object_smart_callback_add(pWebNativeNode, "notification,cancel", OnNotificationCancel, this);
+ evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,registration,requested", OnProtocolHandlerRegistrationRequested, this);
+ evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,isregistered", OnIsProtocolHandlerRegistered, this);
+ evas_object_smart_callback_add(pWebNativeNode, "protocolhandler,unregistration,requested", OnProtocolHandlerUnregistrationRequested, this);
+
+ evas_object_smart_callback_add(pWebNativeNode, "contenthandler,registration,requested", OnContentHandlerRegistrationRequested, this);
+ evas_object_smart_callback_add(pWebNativeNode, "contenthandler,isregistered", OnIsContentHandlerRegistered, this);
+ evas_object_smart_callback_add(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested, this);
evas_object_smart_callback_add(pWebNativeNode, "text,found", OnTextFound, this);
Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode);
evas_object_smart_callback_del(pWebNativeNode, "authentication,challenge", OnHttpAuthenticationRequested);
evas_object_smart_callback_del(pWebNativeNode, "authentication,canceled", OnHttpAuthenticationCanceled);
- evas_object_smart_callback_del(pWebNativeNode, "request,geolocation,permission", OnGeolocationPermissionRequested);
+ evas_object_smart_callback_del(pWebNativeNode, "geolocation,permission,request", OnGeolocationPermissionRequested);
ewk_view_javascript_alert_callback_set(null, null, null);
ewk_view_javascript_prompt_callback_set(null, null, null);
evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested);
evas_object_smart_callback_del(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested);
+ evas_object_smart_callback_del(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted);
+
+ evas_object_smart_callback_del(pWebNativeNode, "notification,permission,request", OnNotificationPermissionRequested);
+ evas_object_smart_callback_del(pWebNativeNode, "notification,show", OnNotificationShow);
+ evas_object_smart_callback_del(pWebNativeNode, "notification,cancel", OnNotificationCancel);
+ evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,registration,requested", OnProtocolHandlerRegistrationRequested);
+ evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,isregistered", OnIsProtocolHandlerRegistered);
+ evas_object_smart_callback_del(pWebNativeNode, "protocolhandler,unregistration,requested", OnProtocolHandlerUnregistrationRequested);
+
+ evas_object_smart_callback_del(pWebNativeNode, "contenthandler,registration,requested", OnContentHandlerRegistrationRequested);
+ evas_object_smart_callback_del(pWebNativeNode, "contenthandler,isregistered", OnIsContentHandlerRegistered);
+ evas_object_smart_callback_del(pWebNativeNode, "contenthandler,unregistration,requested", OnContentHandlerUnregistrationRequested);
evas_object_smart_callback_del(pWebNativeNode, "text,found", OnTextFound);
result
+_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint)
+{
+ const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(startPoint));
+
+ return SetBlockSelectionPosition(integerPoint);
+}
+
+
+result
_WebImpl::ReleaseBlock(void)
{
ewk_view_command_execute(__pWebCore->GetWebNativeNode(), "Unselect", 0);
}
-void
-_WebImpl::FireWebPageBlockSelectedEvent(void) const
+result
+_WebImpl::GetBlockRange(FloatPoint& startPoint, FloatPoint& endPoint) const
+{
+ Eina_Rectangle leftHandle;
+ Eina_Rectangle rightHandle;
+
+ ewk_view_text_selection_range_get(__pWebCore->GetWebNativeNode(), &leftHandle, &rightHandle);
+
+ startPoint.x = _CoordinateSystemUtils::ConvertToFloat(leftHandle.x);
+ startPoint.y = _CoordinateSystemUtils::ConvertToFloat(leftHandle.y);
+ endPoint.x = _CoordinateSystemUtils::ConvertToFloat(rightHandle.x + rightHandle.w);
+ endPoint.y = _CoordinateSystemUtils::ConvertToFloat(rightHandle.y + rightHandle.h);
+
+ if ((endPoint.x != 0) && (endPoint.y != 0))
+ {
+ startPoint = __pWebCore->GetRelativeCoordinate(startPoint);
+ endPoint = __pWebCore->GetRelativeCoordinate(endPoint);
+ }
+
+ return E_SUCCESS;
+}
+
+
+Bitmap*
+_WebImpl::GetFaviconN(void) const
{
result r = E_SUCCESS;
- std::unique_ptr<Point> startPoint(new (std::nothrow) Point());
- std::unique_ptr<Point> endPoint(new (std::nothrow) Point());
- SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ Evas_Object* pView = __pWebCore->GetWebNativeNode();
- r = GetBlockRange(*startPoint.get(), *endPoint.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ Evas* pEvas = evas_object_evas_get(pView);
+ Ewk_Context* pContext = ewk_view_context_get(pView);
+ SysAssertf(pEvas && pContext, "Failed to request");
- std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED));
- SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+ const char* pUrl = ewk_view_url_get(pView);
- r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- startPoint.release();
+ Tizen::Graphics::BufferInfo bufferInfo;
+ Tizen::Base::ByteBuffer byteBuffer;
- r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- endPoint.release();
+ std::unique_ptr<Bitmap> pBitmapImage(new (std::nothrow) Bitmap());
+ SysTryReturn(NID_WEB_CTRL, pBitmapImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- r = __pWebEvent->FireAsync(*pEventArg.get());
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- pEventArg.release();
-}
+ Evas_Object* pfavicon = ewk_context_icon_database_icon_object_add(pContext, pUrl, pEvas);
+ SysTryReturn(NID_WEB_CTRL, pfavicon, null, E_OBJ_NOT_FOUND, "[%s] Propagating.", GetErrorMessage(E_OBJ_NOT_FOUND));
-void
-_WebImpl::SetLoadingErrorOccurred(bool arg)
-{
- __isLoadingErrorOccurred = arg;
-}
+ r = _Utility::GetPixelBufferFromEvasObject(pfavicon, bufferInfo);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+ const Dimension dimension(bufferInfo.width, bufferInfo.height);
-bool
-_WebImpl::IsLoadingErrorOccurred(void) const
-{
- return __isLoadingErrorOccurred;
-}
+ r = byteBuffer.Construct((byte*)bufferInfo.pPixels, 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 );
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = pBitmapImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pBitmapImage.release();
-void
-_WebImpl::SetRedirectRequested(bool arg)
-{
- __isRedirectRequested = arg;
}
-bool
-_WebImpl::IsRedirectRequested(void) const
+void
+_WebImpl::ScrollBy(const Tizen::Graphics::Point& diff)
{
- return __isRedirectRequested;
+ ewk_view_scroll_by(__pWebCore->GetWebNativeNode(), diff.x, diff.y);
}
void
-_WebImpl::SetPolicyDecision(DecisionPolicy policy)
+_WebImpl::ScrollTo(const Tizen::Graphics::Point& dest)
{
- __policy = policy;
+ ewk_view_scroll_set(__pWebCore->GetWebNativeNode(), dest.x, dest.y);
}
-DecisionPolicy
-_WebImpl::GetPolicyDecision(void) const
+Point
+_WebImpl::GetScrollPosition(void) const
{
- return __policy;
+ Point position;
+
+ ewk_view_scroll_pos_get(__pWebCore->GetWebNativeNode(), &position.x, &position.y);
+
+ return position;
}
-LoadingErrorType
-_ConvertToOspErrorCode(int error)
+Dimension
+_WebImpl::GetPageSize(void) const
{
- LoadingErrorType errorCode = WEB_ERROR_UNKNOWN;
+ Evas_Coord width = 0;
+ Evas_Coord height = 0;
- switch (error)
- {
- case EWK_ERROR_NETWORK_STATUS_CANCELLED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_CANT_RESOLVE:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_CANT_RESOLVE_PROXY:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_CANT_CONNECT:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_CANT_CONNECT_PROXY:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_SSL_FAILED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_IO_ERROR:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_MALFORMED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_TRY_AGAIN:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_TOO_MANY_REDIRECTS:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_TLS_FAILED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_INTERNAL_SERVER_ERROR:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_BAD_GATEWAY:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_SERVICE_UNAVAILABLE:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_GATEWAY_TIMEOUT:
- errorCode = WEB_NO_CONNECTION;
- break;
+ ewk_view_contents_size_get(__pWebCore->GetWebNativeNode(), &width, &height);
- case EWK_ERROR_NETWORK_STATUS_BAD_REQUEST:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_REQUEST_URI_TOO_LONG:
- errorCode = WEB_BAD_URL;
- break;
+ Dimension size(static_cast< int >(width), static_cast< int >(height));
- case EWK_ERROR_NETWORK_STATUS_FORBIDDEN:
- errorCode = WEB_FILE_ACCESS_FAILED;
- break;
+ return size;
+}
- case EWK_ERROR_NETWORK_STATUS_REQUEST_TIMEOUT:
- errorCode = WEB_REQUEST_TIMEOUT;
- break;
- case EWK_ERROR_NETWORK_STATUS_UNSUPPORTED_MEDIA_TYPE:
- errorCode = WEB_MIME_NOT_SUPPORTED;
- break;
+void
+_WebImpl::FireWebPageBlockSelectedEvent(void) const
+{
+ result r = E_SUCCESS;
- case EWK_ERROR_NETWORK_STATUS_INSUFFICIENT_STORAGE:
- errorCode = WEB_OUT_OF_MEMORY;
- break;
+ std::unique_ptr<Point> startPoint(new (std::nothrow) Point());
+ std::unique_ptr<Point> endPoint(new (std::nothrow) Point());
+ std::unique_ptr<FloatPoint> startPointF(new (std::nothrow) FloatPoint());
+ std::unique_ptr<FloatPoint> endPointF(new (std::nothrow) FloatPoint());
+ SysTryReturnVoidResult(NID_WEB_CTRL, startPoint.get() && endPoint.get() && startPointF.get() && endPointF.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- case EWK_ERROR_NETWORK_STATUS_REQUEST_ENTITY_TOO_LARGE:
- errorCode = WEB_REQUEST_MAX_EXCEEDED;
- break;
+ r = GetBlockRange(*startPoint.get(), *endPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- case EWK_ERROR_NETWORK_STATUS_CONTINUE:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_SWITCHING_PROTOCOLS:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_PROCESSING:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_OK:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_CREATED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_ACCEPTED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_NON_AUTHORITATIVE:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_NO_CONTENT:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_RESET_CONTENT:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_PARTIAL_CONTENT:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_MULTI_STATUS:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_MULTIPLE_CHOICES:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_MOVED_PERMANENTLY:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_FOUND:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_SEE_OTHER:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_NOT_MODIFIED:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_USE_PROXY:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_NOT_APPEARING_IN_THIS_PROTOCOL:
- //fall through
- case EWK_ERROR_NETWORK_STATUS_TEMPORARY_REDIRECT:
- errorCode = WEB_HTTP_RESPONSE;
- break;
+ r = GetBlockRange(*startPointF.get(), *endPointF.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- case 999:
- errorCode = WEB_INVALID_CERTIFICATE;
- break;
+ std::unique_ptr<_WebUiEventArg> pEventArg(new (std::nothrow) _WebUiEventArg(WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED));
+ SysTryReturnVoidResult(NID_WEB_CTRL, pEventArg.get(), E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- default:
- errorCode = WEB_ERROR_UNKNOWN;
- break;
- }
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START, *startPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ startPoint.release();
- return errorCode;
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END, *endPoint.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ endPoint.release();
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_START_FLOAT, *startPointF.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ startPointF.release();
+
+ r = pEventArg->SetEventInfo(_WebUiEventArg::BLOCK_END_FLOAT, *endPointF.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ endPointF.release();
+
+ r = __pWebEvent->FireAsync(*pEventArg.get());
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEventArg.release();
+}
+
+void
+_WebImpl::SetLoadingErrorOccurred(bool arg)
+{
+ __isLoadingErrorOccurred = arg;
+}
+
+
+bool
+_WebImpl::IsLoadingErrorOccurred(void) const
+{
+ return __isLoadingErrorOccurred;
+}
+
+
+void
+_WebImpl::SetRedirectRequested(bool arg)
+{
+ __isRedirectRequested = arg;
+}
+
+
+bool
+_WebImpl::IsRedirectRequested(void) const
+{
+ return __isRedirectRequested;
+}
+
+
+void
+_WebImpl::SetPolicyDecision(DecisionPolicy policy)
+{
+ __policy = policy;
+}
+
+
+DecisionPolicy
+_WebImpl::GetPolicyDecision(void) const
+{
+ return __policy;
}
}
-int
-_WebImpl::GetKeypadHeight(void) const
+Rectangle
+_WebImpl::GetPreviousKeypadBounds(void) const
{
- return __keypadHeight;
+ return __keypadBounds;
}
void
-_WebImpl::SetKeypadHeight(int keypadHeight)
-{
- __keypadHeight = keypadHeight;
-}
-
-
-_ControlOrientation
-_WebImpl::GetPreviousOrientation(void) const
-{
- return __orientation;
-}
-
-
-void
-_WebImpl::SetPreviousOrientation(_ControlOrientation orientation)
+_WebImpl::SetPreviousKeypadBounds(Rectangle& bounds)
{
- __orientation = orientation;
+ __keypadBounds = bounds;
}
const String* pErrorMessage = dynamic_cast< const String* >(pEventArg->GetEventInfo(_LoadingEventArg::ERROR_MESSAGE));
SysTryReturn(NID_WEB_CTRL, pErrorMessage, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- LoadingErrorType errorType = _ConvertToOspErrorCode(pErrorType->ToInt());
+ LoadingErrorType errorType = ConvertErrorCode(pErrorType->ToInt());
pLoadingListner->OnLoadingErrorOccurred(errorType, *pErrorMessage);
break;
SysLog(NID_WEB_CTRL, "The current value of event type is %d", pEventArg->GetEventType());
- IWebUiEventListener* pWebUiEventListner = GetUiEventListener();
- SysTryReturnResult(NID_WEB_CTRL, pWebUiEventListner, E_SYSTEM, "A system error has been occurred. Web UI listener was not set or null.");
+ IWebUiEventListener* pWebUiEventListener = GetUiEventListener();
+ IWebUiEventListenerF* pWebUiEventListenerF = GetUiEventListenerF();
+ SysTryReturnResult(NID_WEB_CTRL, pWebUiEventListener || pWebUiEventListenerF, E_SYSTEM, "A system error has been occurred. Web UI listener was not set or null.");
- switch (pEventArg->GetEventType())
- {
- case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED:
+ if (pWebUiEventListener)
{
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ switch (pEventArg->GetEventType())
+ {
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- Point* pStartPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START)));
- SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ Point* pStartPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START)));
+ SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- Point* pEndPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END)));
- SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ Point* pEndPoint = const_cast< Point* >(dynamic_cast< const Point* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END)));
+ SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- pWebUiEventListner->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
- break;
- }
+ pWebUiEventListener->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
+ break;
+ }
- case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- pWebUiEventListner->OnWebPageShowRequested(*pWeb);
- break;
- }
+ pWebUiEventListener->OnWebPageShowRequested(*pWeb);
+ break;
+ }
- case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED:
- {
- Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+ case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
- pWebUiEventListner->OnWebWindowCloseRequested(*pWeb);
- break;
- }
+ pWebUiEventListener->OnWebWindowCloseRequested(*pWeb);
+ break;
+ }
- default:
- {
- SysAssert(false);
+ default:
+ {
+ SysAssert(false);
+ }
+ }
}
+ if (pWebUiEventListenerF)
+ {
+ switch (pEventArg->GetEventType())
+ {
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_BLOCK_SELECTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ FloatPoint* pStartPoint = const_cast< FloatPoint* >(dynamic_cast< const FloatPoint* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_START_FLOAT)));
+ SysTryReturn(NID_WEB_CTRL, pStartPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ FloatPoint* pEndPoint = const_cast< FloatPoint* >(dynamic_cast< const FloatPoint* >(pEventArg->GetEventInfo(_WebUiEventArg::BLOCK_END_FLOAT)));
+ SysTryReturn(NID_WEB_CTRL, pEndPoint, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pWebUiEventListenerF->OnWebPageBlockSelected(*pWeb, *pStartPoint, *pEndPoint);
+ break;
+ }
+
+ case WEB_EVENT_WEBUIEVENTLISTENER_PAGE_SHOW_REQUESTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ pWebUiEventListenerF->OnWebPageShowRequested(*pWeb);
+ break;
+ }
+
+ case WEB_EVENT_WEBUIEVENTLISTENER_WINDOW_CLOSE_REQUSTED:
+ {
+ Web* pWeb = dynamic_cast< Web* >(&(this->GetPublic()));
+
+ pWebUiEventListenerF->OnWebWindowCloseRequested(*pWeb);
+ break;
+ }
+
+ default:
+ {
+ SysAssert(false);
+ }
+ }
}
return r;
__pAuthChallenge = std::move(pAuthChallenge);
+ ewk_auth_challenge_suspend(pChallenge);
if (__pUserLoadingListener && __pUserLoadingListener->OnHttpAuthenticationRequestedN(host, realm, *__pAuthChallenge.get()))
{
__pAuthChallenge.release();
__pAuthPopup = std::move(pAuthPopup);
- r = __pAuthPopup->ShowPopup();
+ int modalResult = 0;
+ r = __pAuthPopup->ShowAndWait(modalResult);
SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
CATCH:
result
-_WebImpl::ShowGeolocationPopup(Ewk_Geolocation_Permission_Data* pPermissionData)
+_WebImpl::ShowGeolocationPopup(Ewk_Geolocation_Permission_Request* pPermissionRequest)
{
result r = E_SUCCESS;
std::unique_ptr<_GeolocationConfirmPopup> pGeolocationPopup(new (std::nothrow) _GeolocationConfirmPopup());
SysTryReturnResult(NID_WEB_CTRL, pGeolocationPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
- r = pGeolocationPopup->Construct(pPermissionData);
+ r = pGeolocationPopup->Construct(pPermissionRequest);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pGeolocationPopup = std::move(pGeolocationPopup);
}
+result
+_WebImpl::ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy)
+{
+ result r = E_SUCCESS;
+
+ std::unique_ptr<_UserConfirmPopup> pUserConfirmPopup(new (std::nothrow) _UserConfirmPopup());
+ SysTryReturnResult(NID_WEB_CTRL, pUserConfirmPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
+
+ r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pUserConfirmPopup = std::move(pUserConfirmPopup);
+
+ r = __pUserConfirmPopup->ShowPopup();
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pUserConfirmPopup.release();
+
+ return E_SUCCESS;
+
+CATCH:
+ __pUserConfirmPopup.reset();
+
+ return r;
+}
+
+
_Form*
_WebImpl::GetParentFormCore(_Control* pControlCore)
{
void
_WebImpl::OnChangeLayout(_ControlOrientation orientation)
{
+ _ContainerImpl::OnChangeLayout(orientation);
+
if (IsKeypadVisible() == true)
{
- _ICoordinateSystemTransformer* pXformer = _CoordinateSystem::GetInstance()->GetInverseTransformer();
- SysAssertf(pXformer, "Failed to get CoordinateTransformer");
+ int x = 0;
+ int y = 0;
+ int w = 0;
+ int h = 0;
+ ecore_imf_context_input_panel_geometry_get(ecore_imf_context_add(ecore_imf_context_default_id_get()), &x, &y, &w, &h);
_Form* pFormCore = GetParentFormCore(dynamic_cast< _Control* >(&this->GetCore()));
SysAssertf(pFormCore != null, "Failed to get FormCore");
- if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
- {
- pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(PORTRAIT_KEYPAD_HEIGHT));
- }
- else if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
- {
- pFormCore->DeflateClientRectHeight(pXformer->TransformVertical(LANDSCAPE_KEYPAD_HEIGHT));
- }
+ pFormCore->DeflateClientRectHeight(h);
}
if (__pColorPicker.get())
{
__pColorPicker->ChangeLayout(orientation);
}
-
-}
-
-
-_WebDataHandler*
-_WebImpl::GetDownloadHandler(void) const
-{
- return __pWebDownloadHandler.get();
-}
-
-
-Bitmap*
-_WebImpl::GetFaviconN(void) const
-{
- result r = E_SUCCESS;
-
- Evas_Object* pView = __pWebCore->GetWebNativeNode();
-
- Evas* pEvas = evas_object_evas_get(pView);
- Ewk_Context* pContext = ewk_view_context_get(pView);
- SysAssertf(pEvas && pContext, "Failed to request");
-
- const char* pUrl = ewk_view_url_get(pView);
-
- Tizen::Graphics::BufferInfo bufferInfo;
- Tizen::Base::ByteBuffer byteBuffer;
-
- std::unique_ptr<Bitmap> pBitmapImage(new (std::nothrow) Bitmap());
- SysTryReturn(NID_WEB_CTRL, pBitmapImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
-
- Evas_Object* pfavicon = ewk_context_icon_database_icon_object_add(pContext, pUrl, pEvas);
- SysTryReturn(NID_WEB_CTRL, pfavicon, null, E_OBJ_NOT_FOUND, "[%s] Propagating.", GetErrorMessage(E_OBJ_NOT_FOUND));
-
- r = _Utility::GetPixelBufferFromEvasObject(pfavicon, bufferInfo);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
-
- const Dimension dimension(bufferInfo.width, bufferInfo.height);
-
- r = byteBuffer.Construct((byte*)bufferInfo.pPixels, 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 );
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = pBitmapImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
-
- return pBitmapImage.release();
-
}
-_WebImpl*
-_WebImpl::GetInstance(Web* pWeb)
+void
+_WebImpl::OnAncestorVisibleStateChanged(const _Control& control)
{
- return dynamic_cast< _WebImpl* >(_ControlImpl::GetInstance(*pWeb));
+ if (IsVisible() == true)
+ {
+ ewk_view_page_visibility_state_set(__pWebCore->GetWebNativeNode(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, false);
+ }
+ else
+ {
+ ewk_view_page_visibility_state_set(__pWebCore->GetWebNativeNode(), EWK_PAGE_VISIBILITY_STATE_HIDDEN, false);
+ }
}
-const _WebImpl*
-_WebImpl::GetInstance(const Web* pWeb)
+_WebDataHandler*
+_WebImpl::GetDownloadHandler(void) const
{
- return dynamic_cast< const _WebImpl* >(_ControlImpl::GetInstance(*pWeb));
+ return __pWebDownloadHandler.get();
}
Eina_Bool
-_WebImpl::HideColorPicker()
+_WebImpl::HideColorPicker(void)
{
__pColorPicker.reset();
}
+_WebImpl*
+_WebImpl::GetInstance(Web* pWeb)
+{
+ return dynamic_cast< _WebImpl* >(_ControlImpl::GetInstance(*pWeb));
+}
+
+
+const _WebImpl*
+_WebImpl::GetInstance(const Web* pWeb)
+{
+ return dynamic_cast< const _WebImpl* >(_ControlImpl::GetInstance(*pWeb));
+}
+
+
}}} // Tizen::Web::Controls
#include <FWebCtrlILoadingListener.h>
#include <FUi_ContainerImpl.h>
#include "FWebCtrl_IWebEventListener.h"
+#include "FWebCtrl_UserConfirmPopup.h"
namespace Tizen { namespace Base { namespace Collection
{
class IWebDownloadListener;
class IWebKeypadEventListener;
class IWebUiEventListener;
+class IWebUiEventListenerF;
class AuthenticationChallenge;
class HitElementResult;
class PageNavigationList;
result SetBlockSelectionPosition(const Tizen::Graphics::Point& startPoint);
+ result SetBlockSelectionPosition(const Tizen::Graphics::FloatPoint& startPoint);
+
result ReleaseBlock(void);
result GetBlockRange(Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint) const;
+ result GetBlockRange(Tizen::Graphics::FloatPoint& startPoint, Tizen::Graphics::FloatPoint& endPoint) const;
+
void FireWebPageBlockSelectedEvent(void) const;
Tizen::Base::String GetTextFromBlock(void) const;
result SetPrivateBrowsingEnabled(bool enable);
+ void ClearHistory(void);
+
void ClearCache(void);
void ClearCookie(void);
+ void ClearFormData(void);
+
+ void ClearLoginFormData(void);
+
bool IsCookieEnabled(void) const;
void SetCookieEnabled(bool enable);
void SetWebUiEventListener(Tizen::Web::Controls::IWebUiEventListener* pUiEventListener);
+ void SetWebUiEventListenerF(Tizen::Web::Controls::IWebUiEventListenerF* pUiEventListener);
+
void SetWebKeypadEventListener(IWebKeypadEventListener* pKeypadEventListener);
void SetDownloadListener(Tizen::Web::Controls::IWebDownloadListener* pDownLoadListener);
Tizen::Web::Controls::IWebUiEventListener* GetUiEventListener(void) const;
+ Tizen::Web::Controls::IWebUiEventListenerF* GetUiEventListenerF(void) const;
+
Tizen::Web::Controls::ITextSearchListener* GetTextSearchListener(void) const;
Tizen::Web::Controls::IWebKeypadEventListener* GetWebKeypadEventListener(void) const;
const Tizen::Web::Controls::HitElementResult* GetElementByPointN(const Tizen::Graphics::Point& point) const;
+ const Tizen::Web::Controls::HitElementResult* GetElementByPointN(const Tizen::Graphics::FloatPoint& point) const;
+
result AddJavaScriptBridge(const IJavaScriptBridge& jsBridge);
result RemoveJavaScriptBridge(const IJavaScriptBridge& jsBridge);
bool IsScrollEnabled(void) const;
+ Tizen::Graphics::Bitmap* GetFaviconN(void) const;
+
+ void Pause(void);
+
+ void Resume(void);
+
+ void ScrollBy(const Tizen::Graphics::Point& diff);
+
+ void ScrollTo(const Tizen::Graphics::Point& dest);
+
+ Tizen::Graphics::Point GetScrollPosition(void) const;
+
+ Tizen::Graphics::Dimension GetPageSize(void) const;
+
virtual bool IsLayoutable(void) const;
void SetEventListenerCallback(void) const;
void SetKeypadOpened(bool isKeypadOpened);
- int GetKeypadHeight(void) const;
-
- void SetKeypadHeight(int keypadHeight);
+ Tizen::Graphics::Rectangle GetPreviousKeypadBounds(void) const;
- Tizen::Ui::_ControlOrientation GetPreviousOrientation(void) const;
-
- void SetPreviousOrientation(Tizen::Ui::_ControlOrientation orientation);
+ void SetPreviousKeypadBounds(Tizen::Graphics::Rectangle& bounds);
result HttpAuthenticationRequested(Ewk_Auth_Challenge* pChallenge);
- result ShowGeolocationPopup(Ewk_Geolocation_Permission_Data* pPermissionData);
-
- Tizen::Ui::Controls::_Form* GetParentFormCore(Tizen::Ui::_Control* pControlCore);
-
- Tizen::Graphics::Bitmap* GetFaviconN(void) const;
-
- void Pause(void);
-
- void Resume(void);
+ result ShowGeolocationPopup(Ewk_Geolocation_Permission_Request* pPermissionRequest);
- void SetSelectBox(_SelectBox* pSelectBox);
+ result ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy);
- _SelectBox* GetSelectBox(void);
+ Tizen::Ui::Controls::_Form* GetParentFormCore(Tizen::Ui::_Control* pControlCore);
- void DeleteSelectBox(void);
+ result ShowSelectBoxPopup(bool isMultiSelect, const Tizen::Base::String& title, Eina_List* pItems, Evas_Object* pWebView, int selectedIndex);
+ result UpdateSelectBoxPopup(Eina_List* pItems, int selectedIndex, bool isGroupedList);
+ result ClearSelectBoxPopup(void);
result ShowColorPicker(int r, int g, int b, int a,Tizen::Graphics::Color& color);
- Eina_Bool HideColorPicker();
+ Eina_Bool HideColorPicker(void);
_InputPickerPopup* GetColorpicker(void);
result ShowDatePicker(Ewk_Input_Type inputType, const char* inputValue,Tizen::Base::String& dateStr);
virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
+ virtual void OnAncestorVisibleStateChanged(const Tizen::Ui::_Control& control);
+
static _WebImpl* CreateWebImplN(Web* pControl, const Tizen::Graphics::Rectangle& bounds);
+ static _WebImpl* CreateWebImplN(Web* pControl, const Tizen::Graphics::FloatRectangle& bounds);
+
static _WebImpl* GetInstance(Web* pWeb);
static const _WebImpl* GetInstance(const Web* pWeb);
bool __isKeypadOpened;
bool __isLoadingErrorOccurred;
bool __isRedirectRequested;
- int __keypadHeight;
+ Tizen::Graphics::Rectangle __keypadBounds;
_Web* __pWebCore;
ILoadingListener* __pUserLoadingListener;
IWebUiEventListener* __pUserUiListener;
+ IWebUiEventListenerF* __pUserUiListenerF;
IWebKeypadEventListener* __pUserKeypadEventListener;
ITextSearchListener* __pTextSearchListener;
std::unique_ptr<AuthenticationChallenge> __pAuthChallenge;
std::unique_ptr<_AuthConfirmPopup> __pAuthPopup;
+ std::unique_ptr<_UserConfirmPopup> __pUserConfirmPopup;
+
std::unique_ptr<_GeolocationConfirmPopup> __pGeolocationPopup;
std::unique_ptr<_SelectBox> __pSelectBox;
std::unique_ptr<_InputPickerPopup> __pDatePicker;
std::unique_ptr<_InputPickerPopup> __pColorPicker;
- Tizen::Ui::_ControlOrientation __orientation;
-
Tizen::Base::Runtime::Mutex __mutex;
_TextSearch __textSearch;
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_WebPopup.cpp
+ * @brief The file contains the definition of _WebPopup class.
+ */
+#include <FBaseColIList.h>
+#include <FBaseSysLog.h>
+#include <FUiCtrlButton.h>
+#include <FUiCtrlPanel.h>
+#include <FUiVerticalBoxLayout.h>
+#include <FUi_ResourceManager.h>
+#include "FWebCtrl_WebPopup.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Graphics;
+using namespace Tizen::Io;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+std::unique_ptr<_WebPopupData> _WebPopup::__pWebPopupData(null);
+
+_WebPopup::_WebPopup(void)
+ : __isModal(false)
+ , __modal(0)
+{
+}
+
+
+_WebPopup::~_WebPopup(void)
+{
+ __pWebPopupData.reset();
+}
+
+
+result
+_WebPopup::Construct(bool hasTitle, const Dimension& popupDim)
+{
+ VerticalBoxLayout layout;
+
+ result r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = Popup::Construct(layout, layout, hasTitle, popupDim);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+}
+
+
+void
+_WebPopup::OnActionPerformed(const Control& source, int actionId)
+{
+ switch (actionId)
+ {
+ case ID_BUTTON_COMMON_CLOSE:
+ HidePopup();
+ break;
+ default:
+ SysAssertf(false, "unknown action ID used");
+ break;
+ }
+
+ delete this;
+}
+
+
+result
+_WebPopup::ShowPopup(void)
+{
+ result r = E_SUCCESS;
+
+ r = SetShowState(true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = Show();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebPopup::HidePopup(int modalResult)
+{
+ result r = E_SUCCESS;
+
+ r = SetShowState(false);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (__isModal)
+ {
+ __modal = modalResult;
+ __isModal = false;
+
+ return EndModal(__modal);
+ }
+
+ return E_SUCCESS;
+}
+
+
+result
+_WebPopup::ShowAndWait(int& modalResult)
+{
+ __isModal = true;
+
+ return DoModal(modalResult);
+}
+
+
+Panel*
+_WebPopup::CreateAndAddPanel(void)
+{
+ std::unique_ptr<Panel> pPanel(new (std::nothrow) Panel());
+ SysTryReturn(NID_WEB_CTRL, pPanel.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ Rectangle panelRect(0, 0, __pWebPopupData->popupDim.width, __pWebPopupData->btnDim.height);
+
+ result r = pPanel->Construct(panelRect);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = AddControl(*pPanel);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return pPanel.release();
+}
+
+
+result
+_WebPopup::CreateAndAddButtons(const IList& buttonIds, const IList& buttonTitles, Panel* pPanel)
+{
+ SysTryReturnResult(NID_WEB_CTRL, pPanel, E_INVALID_ARG, "[%s] Panel Pointer is null.", GetErrorMessage(E_INVALID_ARG));
+
+ _WebPopup* pParent = dynamic_cast<_WebPopup*>(pPanel->GetParent());
+ SysTryReturnResult(NID_WEB_CTRL, pParent == this, E_INVALID_ARG, "[E_INVALID_ARG] Panel not attached to popup.");
+
+ int idCount = buttonIds.GetCount();
+ int titleCount = buttonTitles.GetCount();
+ SysTryReturnResult(NID_WEB_CTRL, idCount > 0 && titleCount > 0 && idCount == titleCount, E_INVALID_DATA, "[E_INVALID_DATA] mismatch in count of Ids and Ttitles.");
+
+ int buttonMargin = __pWebPopupData->spacePad;
+ int buttonWidth = (__pWebPopupData->popupDim.width - buttonMargin*(idCount)) / idCount;
+
+ result r = E_SUCCESS;
+ for (int i = 0; i < idCount; i++)
+ {
+ const Integer* pButtonId = static_cast<const Integer*>(buttonIds.GetAt(i));
+ const String* pButtonTitle = static_cast<const String*>(buttonTitles.GetAt(i));
+ SysTryReturn(NID_WEB_CTRL, pButtonId && pButtonTitle, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+
+ //Create button
+ std::unique_ptr<Button> pButton(new (std::nothrow) Button());
+ SysTryReturnResult(NID_WEB_CTRL, pButton.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory Allocation failed.");
+
+ r = pButton->Construct(Rectangle((buttonMargin+buttonWidth)*i, 0, buttonWidth, __pWebPopupData->btnDim.height), *pButtonTitle);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pButton->SetActionId(pButtonId->ToInt());
+
+ //Add button to panel
+ r = pPanel->AddControl(*pButton);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pButton->AddActionEventListener(*this);
+ pButton.release();
+ }
+
+ return r;
+}
+
+
+_WebPopupData*
+_WebPopup::GetPopupData(bool refresh)
+{
+ if (!refresh && __pWebPopupData.get())
+ {
+ return __pWebPopupData.get();
+ }
+
+ __pWebPopupData.reset();
+
+ __pWebPopupData = std::unique_ptr<_WebPopupData> (new (std::nothrow) _WebPopupData());
+ SysTryReturn(NID_WEB_CTRL, __pWebPopupData.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+
+ GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, __pWebPopupData->popupDim.width);
+ GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, __pWebPopupData->popupDim.height);
+ GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, __pWebPopupData->sideMargin);
+
+ GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, __pWebPopupData->btnDim.height);
+ GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, __pWebPopupData->spacePad);
+
+ GET_SHAPE_CONFIG(LABEL::TEXT_FONT_SIZE, orientation, __pWebPopupData->labelFontSize);
+ GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_HEIGHT, orientation, __pWebPopupData->checkDim.height);
+ GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, orientation, __pWebPopupData->checkDim.width);
+
+ GET_DIMENSION_CONFIG(EDIT::MIN_SIZE, orientation, __pWebPopupData->editDim);
+
+ __pWebPopupData->popupDim.width -= 2*__pWebPopupData->sideMargin;
+ __pWebPopupData->labelDim.width = __pWebPopupData->popupDim.width - 2*__pWebPopupData->sideMargin;
+ __pWebPopupData->labelDim.height = 3*__pWebPopupData->labelFontSize;
+
+ return __pWebPopupData.get();
+}
+
+
+}}} // Tizen::Web::Controls
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file FWebCtrl_WebPopup.h
+ * @brief The file contains the declaration of _WebPopup class.
+ *
+ * The file contains the declaration of _WebPopup class.
+ */
+#ifndef _FWEB_CTRL_INTERNAL_WEB_POPUP_H_
+#define _FWEB_CTRL_INTERNAL_WEB_POPUP_H_
+
+#include <unique_ptr.h>
+#include <FUiCtrlPopup.h>
+
+
+namespace Tizen { namespace Base { namespace Collection
+{
+class IList;
+}}} // Tizen::Base::Collection
+
+namespace Tizen { namespace Graphics
+{
+class Dimension;
+}} // Tizen::Graphics
+
+namespace Tizen { namespace Ui
+{
+class IActionEventListener;
+}} // Tizen::Ui
+
+namespace Tizen { namespace Ui { namespace Controls
+{
+class Button;
+class Panel;
+class Popup;
+}}} // Tizen::Ui::Controls
+
+namespace Tizen { namespace Web { namespace Controls
+{
+
+enum _WebPopupButtonId
+{
+ ID_BUTTON_COMMON_CLOSE
+};
+
+struct _WebPopupData
+{
+ Tizen::Graphics::Dimension btnDim;
+ Tizen::Graphics::Dimension editDim;
+ Tizen::Graphics::Dimension popupDim;
+ Tizen::Graphics::Dimension dateDim;
+ Tizen::Graphics::Dimension colorDim;
+ Tizen::Graphics::Dimension checkDim;
+ Tizen::Graphics::Dimension labelDim;
+
+ int labelFontSize;
+ int spacePad;
+ int sideMargin;
+};
+
+class _WebPopup
+ : public Tizen::Ui::Controls::Popup
+ , virtual public Tizen::Ui::IActionEventListener
+{
+public:
+ /**
+ * Constructor
+ */
+ _WebPopup(void);
+
+ /**
+ * Destructor
+ */
+ virtual ~_WebPopup(void);
+
+ result Construct(bool hasTitle, const Tizen::Graphics::Dimension& popupDim);
+
+ virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
+
+ result ShowPopup(void);
+
+ result HidePopup(int modalResult = 0);
+
+ result ShowAndWait(int& modalResult);
+
+ Tizen::Ui::Controls::Panel* CreateAndAddPanel(void);
+
+ result CreateAndAddButtons(const Tizen::Base::Collection::IList& buttonIds,
+ const Tizen::Base::Collection::IList& buttonTitles,
+ Tizen::Ui::Controls::Panel* pPanel);
+
+protected:
+ static _WebPopupData* GetPopupData(bool refresh = false);
+
+private:
+ _WebPopup(const _WebPopup& source);
+
+ _WebPopup& operator =(const _WebPopup& source);
+
+private:
+ static std::unique_ptr<_WebPopupData> __pWebPopupData;
+ bool __isModal;
+ int __modal;
+
+}; // _WebPopup
+
+}}} //Tizen::Web::Controls
+#endif // _FWEB_CTRL_INTERNAL_WEB_POPUP_H_
, __autoFittingEnabled(true)
, __javaScriptPopupEnabled(true)
, __geolocationEnabled(true)
+ , __autoFormDataEnabled(true)
+ , __autoLoginFormEnabled(true)
{
char* pUserAgent = vconf_get_str(VCONFKEY_BROWSER_USER_AGENT);
}
+void
+_WebSettingImpl::SetAutoFormDataShowEnabled(bool enable)
+{
+ __autoFormDataEnabled = enable;
+}
+
+
+bool
+_WebSettingImpl::IsAutoFormDataShowEnabled(void) const
+{
+ return __autoFormDataEnabled;
+}
+
+
+void
+_WebSettingImpl::SetAutoLoginFormFillEnabled(bool enable)
+{
+ __autoLoginFormEnabled = enable;
+}
+
+
+bool
+_WebSettingImpl::IsAutoLoginFormFillEnabled(void) const
+{
+ return __autoLoginFormEnabled;
+}
+
+
bool
_WebSettingImpl::Equals(const Object& obj) const
{
&& __isScrollEnabled == pRhs->__isScrollEnabled && __inputStyle == pRhs->__inputStyle
&& __certificateErrorHandlingMode == pRhs->__certificateErrorHandlingMode && __userAgent == pRhs->__userAgent
&& __autoFittingEnabled == pRhs->__autoFittingEnabled && __javaScriptPopupEnabled == pRhs->__javaScriptPopupEnabled
- && __geolocationEnabled == pRhs->__geolocationEnabled;
+ && __geolocationEnabled == pRhs->__geolocationEnabled && __autoFormDataEnabled == pRhs->__autoFormDataEnabled
+ && __autoLoginFormEnabled == pRhs->__autoLoginFormEnabled;
}
+ Boolean(__isScrollEnabled).GetHashCode() + Integer(__inputStyle).GetHashCode()
+ Integer(__certificateErrorHandlingMode).GetHashCode() + __userAgent.GetHashCode()
+ Boolean(__autoFittingEnabled).GetHashCode() + Boolean(__javaScriptPopupEnabled).GetHashCode()
- + Boolean(__geolocationEnabled).GetHashCode();
+ + Boolean(__geolocationEnabled).GetHashCode() + Boolean(__autoFormDataEnabled).GetHashCode()
+ + Boolean(__autoLoginFormEnabled).GetHashCode();
}
bool IsGeolocationEnabled(void) const;
+ void SetAutoFormDataShowEnabled(bool enable);
+
+ bool IsAutoFormDataShowEnabled(void) const;
+
+ void SetAutoLoginFormFillEnabled(bool enable);
+
+ bool IsAutoLoginFormFillEnabled(void) const;
+
virtual bool Equals(const Object& obj) const;
virtual int GetHashCode(void) const;
bool __javaScriptPopupEnabled;
bool __geolocationEnabled;
+
+ bool __autoFormDataEnabled;
+
+ bool __autoLoginFormEnabled;
}; // _WebSettingImpl
}}} // Tizen::Web::Controls