SolidModules
solid-network.h
Go to the documentation of this file.00001 /* This file is part of the KDE project 00002 Copyright (C) 2006 Kevin Ottens <ervin@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 00018 */ 00019 00020 #ifndef MAIN_H 00021 #define MAIN_H 00022 00023 #include <QCoreApplication> 00024 #include <QEventLoop> 00025 00026 #include <solid/storageaccess.h> 00027 #include <solid/opticaldrive.h> 00028 00029 class KJob; 00030 00031 namespace Solid { 00032 namespace Control { 00033 class Authentication; 00034 } 00035 } 00036 00037 class SolidNetwork : public QCoreApplication 00038 { 00039 Q_OBJECT 00040 public: 00041 SolidNetwork(int &argc, char **argv) : QCoreApplication(argc, argv), m_error(0) {} 00042 00043 static bool doIt(); 00044 00045 bool netmgrList(); 00046 bool netmgrNetworkingEnabled(); 00047 bool netmgrWirelessEnabled(); 00048 bool netmgrWirelessHardwareEnabled(); 00049 bool netmgrChangeNetworkingEnabled(bool enabled); 00050 bool netmgrChangeWirelessEnabled(bool enabled); 00051 bool netmgrListNetworks(const QString &device); 00052 bool netmgrQueryNetworkInterface(const QString &); 00053 bool netmgrQueryNetwork(const QString & device, const QString &); 00054 //bool netmgrActivateNetwork(const QString & device, const QString & uni, Solid::Control::Authentication * auth = 0); 00055 //bool netmgrCapabilities(const QString &udi); 00056 00057 private: 00058 void connectJob(KJob *job); 00059 00060 QEventLoop m_loop; 00061 int m_error; 00062 QString m_errorString; 00063 private slots: 00064 void slotStorageResult(Solid::ErrorType error, const QVariant &errorData); 00065 void slotResult(KJob *job); 00066 void slotPercent(KJob *job, unsigned long percent); 00067 void slotInfoMessage(KJob *job, const QString &message); 00068 }; 00069 00070 00071 #endif