2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FNetManagedNetConnection.cpp
20 * @brief This is the implementation for the %ManagedNetConnection class.
23 #include <FNetManagedNetConnection.h>
24 #include <FNetNetConnectionManager.h>
25 #include <FBaseSysLog.h>
26 #include "FNet_ManagedNetConnectionImpl.h"
28 using namespace Tizen::Base;
29 using namespace Tizen::Base::Runtime;
31 namespace Tizen { namespace Net
34 ManagedNetConnection::ManagedNetConnection()
35 : __pManagedNetConnectionImpl(null)
37 __pManagedNetConnectionImpl = new (std::nothrow) _ManagedNetConnectionImpl(this);
38 SysTryReturnVoidResult(NID_NET, __pManagedNetConnectionImpl != null, E_OUT_OF_MEMORY,
39 "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
42 ManagedNetConnection::~ManagedNetConnection(void)
44 delete __pManagedNetConnectionImpl;
45 __pManagedNetConnectionImpl = null;
49 ManagedNetConnection::SetManagedNetConnectionEventListener(IManagedNetConnectionEventListener* pListener)
53 r = __pManagedNetConnectionImpl->SetManagedNetConnectionEventListener(pListener);
54 SysTryReturnResult(NID_NET, r == E_SUCCESS, r, "Propagating.");
60 ManagedNetConnection::GetConnectionState(void) const
62 return __pManagedNetConnectionImpl->GetConnectionState();
66 ManagedNetConnection::GetNetAccountId(void) const
68 return __pManagedNetConnectionImpl->GetNetAccountId();
71 const NetConnectionInfo*
72 ManagedNetConnection::GetNetConnectionInfo(void) const
74 return __pManagedNetConnectionImpl->GetNetConnectionInfo();