add patch
[framework/osp/web.git] / inc / FWebCtrlWeb.h
index fa22d82..e2ff11e 100755 (executable)
@@ -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 <FUi.h>
 #include <FWeb.h>
 
@@ -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 <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