2
* This file is part of buteo-syncfw package
4
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public License
10
* version 2.1 as published by the Free Software Foundation.
12
* This library is distributed in the hope that it will be useful, but
13
* WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
25
#ifndef TRANSPORTTRACKER_H_
26
#define TRANSPORTTRACKER_H_
28
#include "SyncCommonDefs.h"
33
class ContextProperty;
40
/*! \brief Class for tracking transport states
42
* USB state is tracked with HAL, BT and Internet states with Context Framework.
44
class TransportTracker : public QObject
50
/*! \brief Constructor
52
* @param aParent Parent object
54
TransportTracker(QObject *aParent = 0);
57
virtual ~TransportTracker();
59
/*! \brief Checks the state of the given connectivity type
61
* @param aType Connectivity type
62
* @return True if available, false if not
64
bool isConnectivityAvailable(Sync::ConnectivityType aType) const;
66
// @todo: make private
67
void updateState(Sync::ConnectivityType aType, bool aState);
71
/*! \brief Signal emitted when a connectivity state changes
73
* @param aType Connectivity type whose state has changed
74
* @param aState New state. True if available, false if not.
76
void connectivityStateChanged(Sync::ConnectivityType aType, bool aState);
80
void onUsbStateChanged(bool aConnected);
82
void onBtStateChanged();
84
void onInternetStateChanged();
88
QMap<Sync::ConnectivityType, bool> iTransportStates;
90
USBModedProxy *iUSBProxy;
94
ContextProperty *iInternet;
96
mutable QMutex iMutex;
98
friend class TransportTrackerTest;
104
#endif /* TRANSPORTTRACKER_H_ */