tizendevice.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2013 Jarek Pelczar <jpelczar@gmail.com>
  4. **
  5. ** This file is part of Qt Creator.
  6. **
  7. ** Commercial License Usage
  8. ** Licensees holding valid commercial Qt licenses may use this file in
  9. ** accordance with the commercial license agreement provided with the
  10. ** Software or, alternatively, in accordance with the terms contained in
  11. ** a written agreement between you and Digia. For licensing terms and
  12. ** conditions see http://qt.digia.com/licensing. For further information
  13. ** use the contact form at http://qt.digia.com/contact-us.
  14. **
  15. ** GNU Lesser General Public License Usage
  16. ** Alternatively, this file may be used under the terms of the GNU Lesser
  17. ** General Public License version 2.1 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.LGPL included in the
  19. ** packaging of this file. Please review the following information to
  20. ** ensure the GNU Lesser General Public License version 2.1 requirements
  21. ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  22. **
  23. ** In addition, as a special exception, Digia gives you certain additional
  24. ** rights. These rights are described in the Digia Qt LGPL Exception
  25. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  26. **
  27. ****************************************************************************/
  28. #ifndef TIZEN_TIZENDEVICE_H
  29. #define TIZEN_TIZENDEVICE_H
  30. #include "tizen_global.h"
  31. #include "sdbconnector.h"
  32. #include <projectexplorer/devicesupport/idevice.h>
  33. #include <QCoreApplication>
  34. #include <QPointer>
  35. namespace Tizen {
  36. class TizenDeviceFactory;
  37. class TIZEN_EXPORT TizenDeviceProcessSupport : public ProjectExplorer::DeviceProcessSupport
  38. {
  39. public:
  40. virtual QString killProcessByPidCommandLine(int pid) const;
  41. virtual QString killProcessByNameCommandLine(const QString &filePath) const;
  42. virtual QString interruptProcessByNameCommandLine(const QString &filePath) const;
  43. };
  44. class TIZEN_EXPORT TizenPortsGatheringMethod : public ProjectExplorer::PortsGatheringMethod
  45. {
  46. public:
  47. virtual ~TizenPortsGatheringMethod();
  48. virtual QByteArray commandLine(QAbstractSocket::NetworkLayerProtocol protocol) const;
  49. virtual QList<int> usedPorts(const QByteArray &commandOutput) const;
  50. };
  51. class TIZEN_EXPORT TizenDevice : public ProjectExplorer::IDevice
  52. {
  53. Q_DECLARE_TR_FUNCTIONS(Tizen::TizenDevice)
  54. public:
  55. typedef QSharedPointer<TizenDevice> DevPtr;
  56. static DevPtr create(Core::Id id, DeviceState state, const QString& name);
  57. ~TizenDevice();
  58. virtual QString displayType() const;
  59. virtual ProjectExplorer::IDeviceWidget *createWidget();
  60. virtual QList<Core::Id> actionIds() const;
  61. virtual QString displayNameForActionId(Core::Id actionId) const;
  62. virtual void executeAction(Core::Id actionId, QWidget *parent = 0) const;
  63. virtual Ptr clone() const;
  64. virtual ProjectExplorer::DeviceProcessSupport::Ptr processSupport() const;
  65. virtual bool canAutoDetectPorts() const { return true; }
  66. virtual ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const;
  67. virtual bool canCreateProcessModel() const { return true; }
  68. virtual ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent = 0) const;
  69. virtual bool hasDeviceTester() const { return false; }
  70. //virtual ProjectExplorer::DeviceTester *createDeviceTester() const;
  71. protected:
  72. friend class TizenDeviceFactory;
  73. TizenDevice();
  74. TizenDevice(Core::Id id, DeviceState state, const QString& name);
  75. public:
  76. QPointer<Tizen::SdbConnector> m_connector;
  77. };
  78. } // namespace Tizen
  79. #endif // TIZEN_TIZENDEVICE_H