2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
27 #include "ewk_intent_service.h"
29 #include "IntentServiceInfo.h"
30 #include "WKAPICast.h"
31 #include "WKRetainPtr.h"
33 #include "ewk_intent_service_private.h"
34 #include <wtf/text/CString.h>
36 using namespace WebKit;
38 #if ENABLE(WEB_INTENTS_TAG)
39 Ewk_Intent_Service::Ewk_Intent_Service(WKIntentServiceInfoRef serviceRef)
40 : m_action(AdoptWK, WKIntentServiceInfoCopyAction(serviceRef))
41 , m_type(AdoptWK, WKIntentServiceInfoCopyType(serviceRef))
42 , m_href(AdoptWK, WKIntentServiceInfoCopyHref(serviceRef))
43 , m_title(AdoptWK, WKIntentServiceInfoCopyTitle(serviceRef))
44 , m_disposition(AdoptWK, WKIntentServiceInfoCopyDisposition(serviceRef))
47 const char* Ewk_Intent_Service::action() const
52 const char* Ewk_Intent_Service::type() const
57 const char* Ewk_Intent_Service::href() const
62 const char* Ewk_Intent_Service::title() const
67 const char* Ewk_Intent_Service::disposition() const
73 Ewk_Intent_Service* ewk_intent_service_ref(Ewk_Intent_Service* service)
75 #if ENABLE(WEB_INTENTS_TAG)
76 EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
83 void ewk_intent_service_unref(Ewk_Intent_Service* service)
85 #if ENABLE(WEB_INTENTS_TAG)
86 EINA_SAFETY_ON_NULL_RETURN(service);
92 const char* ewk_intent_service_action_get(const Ewk_Intent_Service* service)
94 EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
96 #if ENABLE(WEB_INTENTS_TAG)
97 return service->action();
103 const char* ewk_intent_service_type_get(const Ewk_Intent_Service* service)
105 EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
107 #if ENABLE(WEB_INTENTS_TAG)
108 return service->type();
114 const char* ewk_intent_service_href_get(const Ewk_Intent_Service* service)
116 EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
118 #if ENABLE(WEB_INTENTS_TAG)
119 return service->href();
125 const char* ewk_intent_service_title_get(const Ewk_Intent_Service* service)
127 EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
129 #if ENABLE(WEB_INTENTS_TAG)
130 return service->title();
136 const char* ewk_intent_service_disposition_get(const Ewk_Intent_Service* service)
138 EINA_SAFETY_ON_NULL_RETURN_VAL(service, 0);
140 #if ENABLE(WEB_INTENTS_TAG)
141 return service->disposition();