From e11bca06c2913868461191a0d380eca93c22c8ba Mon Sep 17 00:00:00 2001 From: Jaemin Ahn Date: Tue, 9 Apr 2013 20:55:10 +0900 Subject: [PATCH] [Doxygen] Update example. Change-Id: Iec80d13c87569ed7fbc681ca3d6ab8fe2b3db311 Signed-off-by: Jaemin Ahn --- inc/FNetDns.h | 80 +++++++++++++++++++++++++++ inc/FNetIDnsEventListener.h | 62 +-------------------- inc/FNetILocalDhcpServerEventListener.h | 2 +- inc/FNetINetConnectionEventListener.h | 37 ------------- inc/FNetIpHostEntry.h | 56 ------------------- inc/FNetNetAccountInfo.h | 2 +- inc/FNetNetConnection.h | 97 ++++++++++++++++++++++----------- inc/FNetNetStatistics.h | 4 +- 8 files changed, 151 insertions(+), 189 deletions(-) diff --git a/inc/FNetDns.h b/inc/FNetDns.h index f01d7a8..45576d8 100644 --- a/inc/FNetDns.h +++ b/inc/FNetDns.h @@ -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 Domain Name System Access. + * + * The following example demonstrates how to use the %Dns class. + * + * @code + * + * #include + * #include + * + * 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; iGetAt(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; iGetAt(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 diff --git a/inc/FNetIDnsEventListener.h b/inc/FNetIDnsEventListener.h index 6118d8b..69e1438 100644 --- a/inc/FNetIDnsEventListener.h +++ b/inc/FNetIDnsEventListener.h @@ -42,67 +42,7 @@ class IpHostEntry; * * For more information on the class features, see Domain Name System Access. * - * @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 diff --git a/inc/FNetILocalDhcpServerEventListener.h b/inc/FNetILocalDhcpServerEventListener.h index 1c4d16e..27e0564 100644 --- a/inc/FNetILocalDhcpServerEventListener.h +++ b/inc/FNetILocalDhcpServerEventListener.h @@ -44,7 +44,7 @@ class DhcpClientInfo; * * For more information on the class features, see Local DHCP Server Access. * - * @see Tizen::Net::DhcpClientInfo + * @see DhcpClientInfo */ class _OSP_EXPORT_ ILocalDhcpServerEventListener : virtual public Tizen::Base::Runtime::IEventListener diff --git a/inc/FNetINetConnectionEventListener.h b/inc/FNetINetConnectionEventListener.h index a8b4fe4..ed9e504 100644 --- a/inc/FNetINetConnectionEventListener.h +++ b/inc/FNetINetConnectionEventListener.h @@ -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 Managing Network Connections. - * - * 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 diff --git a/inc/FNetIpHostEntry.h b/inc/FNetIpHostEntry.h index b131155..9984f5e 100644 --- a/inc/FNetIpHostEntry.h +++ b/inc/FNetIpHostEntry.h @@ -45,62 +45,6 @@ class _IpHostEntryImpl; * with the Dns class. * * For more information on the class features, see Domain Name System Access. - * - * 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 diff --git a/inc/FNetNetAccountInfo.h b/inc/FNetNetAccountInfo.h index 3be46d9..a4e5f74 100644 --- a/inc/FNetNetAccountInfo.h +++ b/inc/FNetNetAccountInfo.h @@ -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). diff --git a/inc/FNetNetConnection.h b/inc/FNetNetConnection.h index c5d4787..acca5fb 100755 --- a/inc/FNetNetConnection.h +++ b/inc/FNetNetConnection.h @@ -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 + * #include + * + * 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 diff --git a/inc/FNetNetStatistics.h b/inc/FNetNetStatistics.h index c067300..153dce0 100755 --- a/inc/FNetNetStatistics.h +++ b/inc/FNetNetStatistics.h @@ -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 Network Statistics. */ -- 2.7.4