1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
/*
Copyright (C) 2012 Samsung Electronics
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "ewk_custom_handler_private.h"
#if ENABLE(NAVIGATOR_CONTENT_UTILS)
/**
* @internal
* Register a scheme handler.
*
* @param data Data of the handler including the protocol and the handler url.
*
* Emits signal: "protocolhandler,registration,requested" on View with a pointer to Ewk_Custom_Handler_Data.
*/
bool ewk_custom_handler_register_protocol_handler(Ewk_Custom_Handler_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data->ewkView, false);
evas_object_smart_callback_call(data->ewkView, "protocolhandler,registration,requested", data);
return true;
}
#if ENABLE(CUSTOM_SCHEME_HANDLER)
/**
* @internal
* Query whether the handler is registered or not.
*
* @param data Data of the handler including the protocol and the handler url.
*
* Emits signal: "protocolhandler,isregistered" on View with a pointer to Ewk_Custom_Handler_Data.
*/
Ewk_Custom_Handlers_State ewk_custom_handler_is_protocol_handler_registered(Ewk_Custom_Handler_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data->ewkView, EWK_CUSTOM_HANDLERS_DECLINED);
evas_object_smart_callback_call(data->ewkView, "protocolhandler,isregistered", data);
Ewk_Custom_Handlers_State result = data->result;
return result;
}
/**
* @internal
* Remove the registered scheme handler.
*
* @param data Data of the handler including the protocol and the handler url.
*
* Emits signal: "protocolhandler,unregistration,requested" on View with a pointer to Ewk_Custom_Handler_Data.
*/
bool ewk_custom_handler_unregister_protocol_handler(Ewk_Custom_Handler_Data* data)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(data->ewkView, false);
evas_object_smart_callback_call(data->ewkView, "protocolhandler,unregistration,requested", data);
return true;
}
#endif // ENABLE(CUSTOM_SCHEME_HANDLER)
#endif // ENABLE(NAVIGATOR_CONTENT_UTILS)
|