File indexing completed on 2024-03-24 15:28:00

0001 /*  This file is part of kdepim.
0002 
0003     Copyright (C) 2005,2007 Will Stephenson <wstephenson@kde.org>
0004 
0005     This program is free software; you can redistribute it and/or modify
0006     it under the terms of the GNU General Public License as published by
0007     the Free Software Foundation; either version 2 of the License, or
0008     (at your option) any later version.
0009 
0010     This program is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0013     GNU General Public License for more details.
0014 
0015     You should have received a copy of the GNU General Public License
0016     along with this program; if not, write to the Free Software
0017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018 
0019     As a special exception, permission is given to link this program
0020     with any edition of Qt, and distribute the resulting executable,
0021     without including the source code for Qt in the source distribution.
0022 */
0023 
0024 #ifndef _TEST_NETWORKSTATUS_SERVICE_H
0025 #define _TEST_NETWORKSTATUS_SERVICE_H
0026 
0027 #include <KMainWindow>
0028 #include <solid/networking.h>
0029 #include "ui_networkingserviceview.h"
0030 
0031 class OrgKdeSolidNetworkingServiceInterface;
0032 
0033 class TestService : public KMainWindow {
0034 Q_OBJECT
0035 public:
0036     TestService();
0037     ~TestService() override;
0038     int status( const QString & network );
0039     bool isValid();
0040 protected Q_SLOTS:
0041     void changeComboActivated( int index );
0042     void serviceOwnerChanged( const QString& service,const QString& oldOwner, const QString& newOwner );
0043 
0044     void changeButtonClicked();
0045 
0046     void slotStatusChange();
0047 private:
0048     void registerService();
0049     static QColor toQColor( Solid::Networking::Status );
0050     OrgKdeSolidNetworkingServiceInterface * m_service;
0051     Solid::Networking::Status m_status;
0052     Solid::Networking::Status m_nextStatus;
0053     Ui_TestServiceView ui;
0054     QWidget * m_view;
0055 };
0056 
0057 #endif