X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inc%2FFWebCtrlWeb.h;h=e2ff11ef0b3b580195b8da2f8862abee4157a7e6;hb=refs%2Ftags%2Fsubmit%2Ftizen_2.2%2F20130816.020230;hp=fa22d82e2cee5e2714f5e3058ee1126803b96a4e;hpb=9276a6838bc11c65d4f06bc242536c1f3b30c4e8;p=framework%2Fosp%2Fweb.git diff --git a/inc/FWebCtrlWeb.h b/inc/FWebCtrlWeb.h index fa22d82..e2ff11e 100755 --- a/inc/FWebCtrlWeb.h +++ b/inc/FWebCtrlWeb.h @@ -72,7 +72,7 @@ namespace Tizen { namespace Web { namespace Controls * * The following example demonstrates how to use the %Web class. * @code -// Sample code for WebSample.h +// Sample code using Form for WebSample.h #include #include @@ -93,7 +93,7 @@ public: virtual result OnInitializing(void); }; -// Sample code for WebSample.cpp +// Sample code using Form for WebSample.cpp #include "WebSample.h" using namespace Tizen::Ui; @@ -105,9 +105,13 @@ WebSample::OnInitializing(void) { result r = E_SUCCESS; + // Constucts a Form + ... + __pWeb = new Web(); __pWeb->Construct(GetClientAreaBounds()); AddControl(__pWeb); + LoadUrl(); return r; @@ -123,6 +127,67 @@ WebSample::LoadUrl(void) } * @endcode * + * @code +// Sample code using Window for WebSample.h +#include +#include +#include + +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