/*************************************************************************** * Copyright (C) 2006 by Michael Kaufmann * * michael@enlighter.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifdef HAVE_CONFIG_H #include "../config.h" #endif #ifndef _KOVPN_H_ #define _KOVPN_H_ #ifdef HAVE_CONFIG_H #include #endif #include #include // #include #include #include "traywindow.h" #include "kovpninterface.h" #include "kovpnconfig.h" #include "openvpnmanager.h" #include "authmanager.h" #include "kovpnconfigdialog.h" #include "kovpnwidget.h" #include "logwidget.h" // #include // #include // #include // #include // #include /** * @short Application Main Window * @author Michael Kaufmann * @version 0.1 */ class kovpn : public KMainWindow { Q_OBJECT public: /** * Default Constructor */ kovpn(); /** * Default Destructor */ virtual ~kovpn(); /** * Request authentification data from user. */ bool getAuthData( QString &username, QString &password, QString ressource ); void initSystemTray(); // void initInfoPopup(); KIconLoader *kovpnIcons; void show(); void reg( openVPNManager * manager ); void dereg( openVPNManager * manager ); public slots: void authRequestGUI( bool &cancel, bool &failure, const QString &ressource, QString &password, QString &username, const QString &message ); void passRequestGUI( bool &cancel, bool &failure, const QString &ressource, QString &username, const QString &message ); void error( const QString & ); void message( bool &, const QString &, const QString & ); void slotPreferences(); void slotConnect(); void slotDisconnect(); void slotQuitKovpn(); void slotShowLogWidget(); void loadConfig(); // void slotOvpnStatusChanged( const QString & id, openVPNManager::states ); // void slotOvpnServerChanged( const QString & id, const QString & server ); // void slotOvpnIPChanged( const QString & id, const QString & ip ); // void slotOvpnUptimeChanged( const QString & id, const int & uptime ); void slotSettingsChanged(); signals: void signalConnect( QString username, QString password ); void signalDisconnect(); protected: virtual void closeEvent( QCloseEvent *ev ); void debug( const QString & method, const QString & message = "I was called" ); // virtual bool queryClose (); // virtual bool queryExit (); private: kovpnConfig * mConfig; kovpnWidget * centralWidget; TrayWindow * mSystemTray; logWidget * mLogWidget; // openVPNManager * manager; // KPassivePopup * infoPopup; kovpnConfigDialog * mConfigDialog; authManager * mAuthManager; QMap mOvpnManagers; QStringList mConnections; bool mIsShuttingDown; /* If set to false, Kovpn just minimizes to the System Tray rather than quitting. */ bool mStartMinimized; bool mShowMoreInformation; bool mQuietMode; }; #endif // _KOVPN_H_