*
* The following example demonstrates how to use the %Web class.
* @code
-// Sample code for WebSample.h
+// Sample code using Form for WebSample.h
#include <FUi.h>
#include <FWeb.h>
virtual result OnInitializing(void);
};
-// Sample code for WebSample.cpp
+// Sample code using Form for WebSample.cpp
#include "WebSample.h"
using namespace Tizen::Ui;
{
result r = E_SUCCESS;
+ // Constucts a Form
+ ...
+
__pWeb = new Web();
__pWeb->Construct(GetClientAreaBounds());
AddControl(__pWeb);
+
LoadUrl();
return r;
}
* @endcode
*
+ * @code
+// Sample code using Window for WebSample.h
+#include <FApp.h>
+#include <FUi.h>
+#include <FWeb.h>
+
+class WebSample :
+ public Tizen::Ui::Window
+{
+public:
+ WebSample(void) {};
+ virtual ~WebSample(void) {};
+
+protected:
+ void LoadUrl(void);
+
+private:
+ Tizen::Web::Controls::Web *__pWeb;
+
+public:
+ virtual result OnInitializing(void);
+};
+
+// Sample code using Window for WebSample.cpp
+#include "WebSample.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Web::Controls;
+
+result
+WebSample::OnInitializing(void)
+{
+ result r = E_SUCCESS;
+
+ // Constucts a Window
+ ...
+
+ Frame *pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame();
+ SetOwner(pFrame->GetCurrentForm());
+
+ __pWeb = new Web();
+ __pWeb->Construct(GetClientAreaBounds());
+ AddControl(__pWeb);
+
+ Show();
+ LoadUrl();
+
+ return r;
+}
+
+// Calls LoadUrl() with the URL of the Web content to display it on the Web control
+void
+WebSample::LoadUrl(void)
+{
+ Tizen::Base::String url(L"http://www.tizen.org");
+
+ __pWeb->LoadUrl(url);
+}
+ * @endcode
*/
class _OSP_EXPORT_ Web
: public Tizen::Ui::Container
* @privilege %http://tizen.org/privilege/web.service
*
* @return The result of the evaluated JavaScript, @n
- * else null if an error occurs
+ * else @c null 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.