bool OnLoadUrl();
bool OnEvaluteJavaScript();
bool OnClearHistory();
+bool OnPlainTextReceived();
static void ConnectToGlobalSignal( bool (*func)() )
{
return mScrollEdgeReachedSignal;
}
+ void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
+ {
+ if (callback)
+ {
+ ConnectToGlobalSignal(&OnPlainTextReceived);
+ mPlainTextReceivedCallback = callback;
+ }
+ }
+
std::string mUrl;
std::vector< std::string > mHistory;
size_t mCurrentPlusOnePos;
WebEngineContext* mockWebEngineContext;
WebEngineCookieManager* mockWebEngineCookieManager;
WebEngineSettings* mockWebEngineSettings;
+ Dali::WebEnginePlugin::PlainTextReceivedCallback mPlainTextReceivedCallback;
};
inline WebEngine& GetImplementation( Dali::WebEngine& webEngine )
}
return false;
}
+
+bool OnPlainTextReceived()
+{
+ DisconnectFromGlobalSignal(&OnPlainTextReceived);
+ if (gInstance)
+ {
+ std::string dummyResultText;
+ gInstance->mPlainTextReceivedCallback(dummyResultText);
+ }
+ return false;
+}
+
} // namespace
} // namespace Adaptor
return Internal::Adaptor::GetImplementation( *this ).ScrollEdgeReachedSignal();
}
+void WebEngine::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
+{
+ Internal::Adaptor::GetImplementation(*this).GetPlainTextAsynchronously(callback);
+}
+
} // namespace Dali;
static int gScrollEdgeReachedCallbackCalled = 0;
static int gEvaluateJavaScriptCallbackCalled = 0;
static bool gTouched = false;
+static int gPlainTextReceivedCallbackCalled = 0;
struct CallbackFunctor
{
gScrollEdgeReachedCallbackCalled++;
}
+static bool OnPlainTextReceived(const std::string& plainText)
+{
+ gPlainTextReceivedCallbackCalled++;
+ return true;
+}
+
static void OnPageLoadError( WebView view, const std::string& url, WebView::LoadErrorCode errorCode )
{
}
END_TEST;
}
+int UtcDaliWebViewGetPlainText(void)
+{
+ ToolkitTestApplication application;
+
+ WebView view = WebView::New();
+ DALI_TEST_CHECK(view);
+
+ view.LoadUrl(TEST_URL1);
+
+ view.GetPlainTextAsynchronously(&OnPlainTextReceived);
+ Test::EmitGlobalTimerSignal();
+ DALI_TEST_EQUALS(gPlainTextReceivedCallbackCalled, 1, TEST_LOCATION);
+
+ END_TEST;
+}
return Dali::Toolkit::GetImpl( *this ).ScrollEdgeReachedSignal();
}
+void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
+{
+ Dali::Toolkit::GetImpl(*this).GetPlainTextAsynchronously(callback);
+}
+
WebView::WebView(Internal::WebView& implementation)
: Control(implementation)
{
*/
WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+ /**
+ * @brief Get a plain text of current web page asynchronously.
+ *
+ * @param[in] callback The callback function called asynchronously.
+ */
+ void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback);
+
public: // Not intended for application developers
/// @cond internal
/**
}
}
+void WebView::GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback)
+{
+ if(mWebEngine)
+ {
+ mWebEngine.GetPlainTextAsynchronously(callback);
+ }
+}
+
bool WebView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
Dali::BaseHandle handle( object );
*/
Dali::Toolkit::WebView::WebViewScrollEdgeReachedSignalType& ScrollEdgeReachedSignal();
+ /**
+ * @copydoc Dali::Toolkit::WebView::GetPlainTextAsynchronously()
+ */
+ void GetPlainTextAsynchronously(Dali::WebEnginePlugin::PlainTextReceivedCallback callback);
+
public: // Properties
/**