2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FNet_PsSystemNetConnection.h
19 * @brief This is the header file for the %_PsSystemNetConnection class.
21 * This header file contains the declarations of the %_PsSystemNetConnection class.
24 #ifndef _FNET_INTERNAL_PS_SYSTEM_NET_CONNECTION_H_
25 #define _FNET_INTERNAL_PS_SYSTEM_NET_CONNECTION_H_
27 #include "FNet_SystemNetConnection.h"
28 #include "FNet_NetUtility.h"
30 namespace Tizen { namespace Net {
32 * @class _PsSystemNetConnection
33 * @brief This class provides methods for a PS system network connection.
37 * This class provides methods for a system network connection.
40 class _PsSystemNetConnection
41 : public _SystemNetConnection
45 * This is the default constructor for this class.
47 _PsSystemNetConnection(void);
50 * This is the destructor for this class.
52 virtual ~_PsSystemNetConnection(void);
55 * Initializes this instance with the specified account.
59 * @return An error code
60 * @param[in] profileName The network profile's name
61 * @exception E_SUCCESS The method was successful.
62 * @exception E_INVALID_STATE This instance is in an invalid state.
63 * @exception E_INVALID_ACCOUNT The specified network profile is invalid.
64 * @exception E_SYSTEM An internal error occurred.
66 result Construct(const Tizen::Base::String& profileName);
69 * Starts the network connection.
73 * @return An error code
74 * @exception E_SUCCESS The method was successful.
75 * @exception E_INVALID_STATE This instance is in an invalid state.
76 * @exception E_SYSTEM An internal error occurred.
79 virtual result Start(_NetConnectionEvent& event);
82 * Stops the network connection.
86 * @return An error code
87 * @exception E_SUCCESS The method was successful.
88 * @exception E_INVALID_STATE This instance is in an invalid state.
89 * @exception E_SYSTEM An internal error occurred.
92 virtual result Stop(_NetConnectionEvent& event, bool waitingEvent = true);
94 virtual void HandleStartResponse(result error, void* pData);
95 virtual void HandleStopResponse(void);
96 virtual void HandleStartEvent(void);
97 virtual void HandleStopEvent(result error);
99 virtual NetConnectionState QueryConnectionState(Tizen::Base::String& devName) const;
101 void* GetProfileHandle(void);
105 * This is the copy constructor for this class.
107 * @param[in] rhs An instance of _PsSystemNetConnection
109 _PsSystemNetConnection(const _PsSystemNetConnection& rhs);
112 * This is the assignment operator. Do @b not use directly.
114 * @param[in] rhs An instance of _PsSystemNetConnection
116 _PsSystemNetConnection& operator =(const _PsSystemNetConnection& rhs);
119 Tizen::Base::String __profileName;
120 std::unique_ptr<void, _ConnectionDeleter> __pConnectionHandle;
121 std::unique_ptr<void, _ProfileDeleter> __pProfileHandle;
123 friend class _SystemNetConnection;
125 }; // _PsSystemNetConnection
128 #endif // _FNET_INTERNAL_PS_SYSTEM_NET_CONNECTION_H_