2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
20 #ifndef WRTDEVICEAPIS_NETWORKING_IADAPTER_H_
21 #define WRTDEVICEAPIS_NETWORKING_IADAPTER_H_
24 #include <dpl/noncopyable.h>
25 #include "IConnection.h"
26 #include "EventConnected.h"
27 #include "EventDisconnected.h"
29 namespace WrtDeviceApis {
30 namespace Networking {
32 class IAdapter : public DPL::Noncopyable
40 T_ETHERNET, //!< T_ETHERNET
45 virtual ~IAdapter() = 0;
48 * Checks whether network adapter has active connection.
49 * @return True when connected, false otherwsie.
51 virtual bool isConnected() const = 0;
54 * Gets active connection.
55 * @return Active connection or NULL if not connected.
57 virtual IConnectionPtr getConnection() const = 0;
60 * Sets on connected event emitter.
61 * @param event Event emitter.
63 virtual void addOnConnected(const EventConnectedEmitterPtr& emitter) = 0;
66 * Removes on connected event emitter.
67 * @param id Emitters id.
69 virtual void removeOnConnected(EventConnectedEmitter::IdType id) = 0;
72 * Sets on disconnected event emitter.
73 * @param emitter Event emitter.
75 virtual void addOnDisconnected(const EventDisconnectedEmitterPtr& emitter)
79 * Removes on disconnected event emitter.
80 * @param id Emitters id.
82 virtual void removeOnDisconnected(EventDisconnectedEmitter::IdType id) = 0;
85 * Gets type of an adapter
86 * @return type Type of an adapter
88 virtual Type getAdapterType() const = 0;
91 typedef std::list<IAdapter*> AdaptersSet;
92 typedef std::list<IAdapter*>::iterator AdaptersSetIterator;
97 #endif // WRTDEVICEAPIS_NETWORKING_IADAPTER_H_