[Doxygen] Update example.
authorJaemin Ahn <j.m.ahn@samsung.com>
Tue, 9 Apr 2013 11:55:10 +0000 (20:55 +0900)
committerJaemin Ahn <j.m.ahn@samsung.com>
Tue, 9 Apr 2013 11:55:10 +0000 (20:55 +0900)
Change-Id: Iec80d13c87569ed7fbc681ca3d6ab8fe2b3db311
Signed-off-by: Jaemin Ahn <j.m.ahn@samsung.com>
inc/FNetDns.h
inc/FNetIDnsEventListener.h
inc/FNetILocalDhcpServerEventListener.h
inc/FNetINetConnectionEventListener.h
inc/FNetIpHostEntry.h
inc/FNetNetAccountInfo.h
inc/FNetNetConnection.h
inc/FNetNetStatistics.h

index f01d7a8..45576d8 100644 (file)
@@ -45,6 +45,86 @@ class _DnsImpl;
  *                     method represents a request for the DNS host information for an IP address. Both requests can be made in an asynchronous mode.
  *
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
+ *
+ * The following example demonstrates how to use the %Dns class.
+ *
+ * @code
+ *
+ *     #include <FBase.h>
+ *     #include <FNet.h>
+ *
+ *     using namespace Tizen::Base;
+ *     using namespace Tizen::Base::Collection;
+ *     using namespace Tizen::Net;
+ *
+ *     class MyClass
+ *       : public Object
+ *       , public IDnsEventListener
+ *     {
+ *        public:
+ *               MyClass(void) {}
+ *               ~MyClass(void) {}
+ *
+ *               // IDnsEventListener
+ *               void OnDnsResolutionCompletedN(IpHostEntry* pIpHostEntry, result r);
+ *
+ *               void GetHostByName(void);
+ *     };
+ *
+ *     void
+ *     MyClass::OnDnsResolutionCompletedN(IpHostEntry* pIpHostEntry, result r)
+ *     {
+ *             if (pIpHostEntry == null)
+ *             {
+ *                     return;
+ *             }
+ *
+ *             IList* pAddressList = pIpHostEntry->GetAddressList();
+ *             if (pAddressList != null)
+ *             {
+ *                     int count = pAddressList->GetCount();
+ *
+ *                     for (int i = 0; i<count; i++)
+ *                     {
+ *                             IpAddress* pIpAddress = (IpAddress*)(pAddressList->GetAt(i));
+ *                             AppLog("IpAddress no.%d = [%ls]\n", i, pIpAddress->ToString().GetPointer());
+ *                     }
+ *             }
+ *
+ *             IList* pAliasList = pIpHostEntry->GetAliasList();
+ *             if (pAliasList != null)
+ *             {
+ *                     int count = pAliasList->GetCount();
+ *
+ *                     for (int i = 0; i<count; i++)
+ *                     {
+ *                             String* pAlias = (String*)(pAliasList->GetAt(i));
+ *                             AppLog("Alias no.%d = [%ls]\n", i, pAlias->GetPointer());
+ *                     }
+ *             }
+ *
+ *             delete pIpHostEntry;
+ *     }
+ *
+ *     void
+ *     MyClass::GetHostByName(void)
+ *     {
+ *             Dns* pDns = new Dns();
+ *             result r = pDns->Construct(*this);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pDns;
+ *                     return;
+ *             }
+ *
+ *             r = pDns->GetHostByName(L"www.tizen.org");
+ *
+ *             // Wait OnDnsResolutionCompletedN() event
+ *
+ *             delete pDns;
+ *     }
+ *
+ * @endcode
  */
 class _OSP_EXPORT_ Dns
        : public Tizen::Base::Object
index 6118d8b..69e1438 100644 (file)
@@ -42,67 +42,7 @@ class IpHostEntry;
  *
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
  *
- * @see        Tizen::Net::IpHostEntry
- *
- * The following example demonstrates how to use the %IDnsEventListener interface.
- *
- * @code
- *
- *     using namespace Tizen::Net;
- *
- *     class MyDnsListener
- *             : public IDnsEventListener
- *     {
- *     public:
- *             void OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r);
- *     };
- *
- *     void
- *     MyDnsListener::OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r)
- *     {
- *             if (ipHostEntry == null)
- *             {
- *                     AppLog("error case no.%d \n", r);
- *             }
- *             else
- *             {
- *                     Tizen::Base::Collection::IList* addressList = ipHostEntry->GetAddressList();
- *
- *                     if (addressList != null)
- *                     {
- *                             int count = addressList->GetCount();
- *
- *                             for (int i = 0; i < count; i++)
- *                             {
- *                                     IpAddress* pIpAddress = (IpAddress*)(addressList->GetAt(i));
- *                                     Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(pIpAddress->ToString());
- *
- *                                     AppLog("IpAddress no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
- *                                     delete _pbb;
- *                             }
- *                     }
- *
- *                     Tizen::Base::Collection::IList* aliasList = ipHostEntry->GetAliasList();
- *
- *                     if (aliasList != null)
- *                     {
- *                             int count = aliasList->GetCount();
- *
- *                             for (int i = 0; i < count; i++)
- *                             {
- *                                     String* alias = (String*)(aliasList->GetAt(i));
- *                                     Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(*alias);
- *
- *                                     AppLog("alias no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
- *                                     delete _pbb;
- *                             }
- *                     }
- *                     delete ipHostEntry;
- *             }
- *     }
- *
- * @endcode
- *
+ * @see        IpHostEntry
  */
 class _OSP_EXPORT_ IDnsEventListener
        : virtual public Tizen::Base::Runtime::IEventListener
index 1c4d16e..27e0564 100644 (file)
@@ -44,7 +44,7 @@ class DhcpClientInfo;
  *
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/local_DHCP_server_access.htm">Local DHCP Server Access</a>.
  *
- * @see        Tizen::Net::DhcpClientInfo
+ * @see        DhcpClientInfo
  */
 class _OSP_EXPORT_ ILocalDhcpServerEventListener
        : virtual public Tizen::Base::Runtime::IEventListener
index a8b4fe4..ed9e504 100644 (file)
@@ -42,43 +42,6 @@ class NetConnection;
  *     NetConnection::AddNetConnectionListener() method. When a network connection event is generated, a method of this class is called.
  *
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/managing_network_connections.htm">Managing Network Connections</a>.
- *
- * The following example demonstrates how to use the %INetConnectionEventListener interface.
- *
- * @code
-using namespace Tizen::Net;
-using namespace Tizen::Base;
-
-class TestListener
-       : public Object
-       , public virtual INetConnectionEventListener
-{
-public:
-       TestListener() {}
-
-       ~TestListener() {}
-
-       void OnNetConnectionStarted(NetConnection& netConnection, result r)
-       {
-               AppLog("OnStarted\n");
-       }
-
-       void OnNetConnectionStopped(NetConnection& netConnection, result r)
-       {
-               AppLog("OnStopped\n");
-       }
-
-       void OnNetConnectionSuspended(NetConnection& netConnection)
-       {
-               AppLog("OnSuspended\n");
-       }
-
-       void OnNetConnectionResumed(NetConnection& netConnection)
-       {
-               AppLog("OnResumed\n");
-       }
-};
- * @endcode
  */
 class _OSP_EXPORT_ INetConnectionEventListener
        : virtual public Tizen::Base::Runtime::IEventListener
index b131155..9984f5e 100644 (file)
@@ -45,62 +45,6 @@ class _IpHostEntryImpl;
  *     with the Dns class.
  *
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/domain_name_system_access.htm">Domain Name System Access</a>.
- *
- * The following example demonstrates how to use the %IpHostEntry class.
- *
- * @code
-class MyDnsListener
-    : public IDnsEventListener
-{
-public:
-    void OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r);
-};
-
-
-void
-MyDnsListener::OnDnsResolutionCompletedN(IpHostEntry* ipHostEntry, result r)
-{
-       if (ipHostEntry == null)
-       {
-               AppLog("error case no.%d \n", r);
-       }
-       else
-       {
-               Tizen::Base::Collection::IList* addressList = ipHostEntry->GetAddressList();
-
-               if (addressList != null)
-               {
-                       int count = addressList->GetCount();
-
-                       for (int i = 0; i < count; i++)
-                       {
-                               IpAddress* pIpAddress = (IpAddress*)(addressList->GetAt(i));
-                               Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(pIpAddress->ToString());
-
-                               AppLog("IpAddress no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
-                               delete _pbb;
-                       }
-               }
-
-               Tizen::Base::Collection::IList* aliasList = ipHostEntry->GetAliasList();
-
-               if (aliasList != null)
-               {
-                       int count = aliasList->GetCount();
-
-                       for (int i = 0; i < count; i++)
-                       {
-                               String* alias = (String*)(aliasList->GetAt(i));
-                               Tizen::Base::ByteBuffer*_pbb = Tizen::Base::Utility::StringUtil::StringToUtf8N(*alias);
-
-                               AppLog("alias no.%d : %s\n", i, (char*)(_pbb->GetPointer()));
-                               delete _pbb;
-                       }
-               }
-               delete ipHostEntry;
-       }
-}
- * @endcode
  */
 class _OSP_EXPORT_ IpHostEntry
        : public Tizen::Base::Object
index 3be46d9..a4e5f74 100644 (file)
@@ -43,7 +43,7 @@ class _NetAccountInfoImpl;
  *
  * @since      2.0
  *
- * The %NetAccountInfo class provides all the configuration parameters for setting up network connections.
+ * The %NetAccountInfo class provides configuration parameters for setting up network connections.
  * %NetAccountInfo contains the base information required to connect to various bearers and it is designed to be
  * used in Programmed Data Processor (PDP) context activation. The Wi-Fi accounts are derived from this class
  * and contain additional information specific to Wi-Fi (such as SSID).
index c5d4787..acca5fb 100755 (executable)
@@ -46,37 +46,72 @@ class _NetConnectionImpl;
  * The following example demonstrates how to use the %NetConnection class.
  *
  * @code
-
-// Start the network connection.
-using namespace Tizen::Net;
-
-void
-Test(void)
-{
-       // Account ID
-       NetAccountId accountId = INVALID_HANDLE;
-       result r = E_SUCCESS;
-
-       // Account manager
-       NetAccountManager netAccountManager;
-       r = netAccountManager.Construct();
-       accountId = netAccountManager.GetNetAccountId();
-
-       // Construct a listener.
-       TestListener* pMyListener = new TestListener();
-
-       // NetConnection instance allocation.
-       NetConnection* pNetConnection = new NetConnection;
-
-       // Construct NetConnection.
-       r = pNetConnection->Construct(accountId);
-
-       // __NetConnectionEvent AddListener.
-       r = pNetConnection->AddNetConnectionListener(pMyListener);
-
-       // NetConnection connect.
-       r = pNetConnection->Start();
-}
+ *
+ *     #include <FBase.h>
+ *     #include <FNet.h>
+ *
+ *     using namespace Tizen::Base;
+ *     using namespace Tizen::Net;
+ *
+ *     class MyClass
+ *       : public Object
+ *       , public INetConnectionEventListener
+ *     {
+ *        public:
+ *               MyClass(void) {}
+ *               ~MyClass(void) {}
+ *
+ *             void OnNetConnectionStarted(NetConnection& netConnection, result r)
+ *             {
+ *                     AppLog("OnStarted result=[%s]\n", GetErrorMessage(r));
+ *             }
+ *
+ *             void OnNetConnectionStopped(NetConnection& netConnection, result r)
+ *             {
+ *                     AppLog("OnStopped\n");
+ *             }
+ *
+ *             void OnNetConnectionSuspended(NetConnection& netConnection)
+ *             {
+ *                     AppLog("OnSuspended\n");
+ *             }
+ *
+ *             void OnNetConnectionResumed(NetConnection& netConnection)
+ *             {
+ *                     AppLog("OnResumed\n");
+ *             }
+ *
+ *             void StartNetConnection(void);
+ *     };
+ *
+ *     void
+ *     MyClass::StartNetConnection(void)
+ *     {
+ *             NetAccountManager netAccountManager;
+ *             result r = netAccountManager.Construct();
+ *             if (IsFailed(r))
+ *             {
+ *                     return;
+ *             }
+ *
+ *             NetAccountId accountId = netAccountManager.GetNetAccountId(NET_BEARER_PS);
+ *
+ *             NetConnection* pNetConnection = new NetConnection();
+ *             r = pNetConnection->Construct(accountId);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetConnection;
+ *                     return;
+ *             }
+ *
+ *             r = pNetConnection->AddNetConnectionListener(*this);
+ *             r = pNetConnection->Start();
+ *
+ *             // Wait OnNetConnectionStarted() event
+ *
+ *             delete pNetConnection;
+ *     }
+ *
  * @endcode
  */
 class _OSP_EXPORT_ NetConnection
index c067300..153dce0 100755 (executable)
@@ -35,13 +35,13 @@ class _NetStatisticsImpl;
 
 /**
  * @class      NetStatistics
- * @brief      This class represents the statistical information on the Packet-Switched (PS) data call.
+ * @brief      This class represents the statistical information of the data network.
  *
  * @since      2.0
  *
  * @remarks    The %NetStatistics class cannot be tested on the emulator.
  *
- * The %NetStatistics class provides methods for getting the statistical information on the Packet-Switched (PS) data call.
+ * The %NetStatistics class provides methods for getting the statistical information of the data network.
  *
  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/network_statistics.htm">Network Statistics</a>.
  */