KNemo – network interfaces monitor for systray
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.8 KiB

/* This file is part of KNemo
Copyright (C) 2004, 2005 Percy Leonhardt <>
KNemo is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
KNemo is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
#include <tqobject.h>
#include <tqstring.h>
class Interface;
class InterfaceTray;
* This is the logical representation of the systemtray icon. It handles
* creation and deletion of the real icon, setting the tooltip, setting
* the correct icon image and displaying of the settings dialog.
* @short Logical representation of the systemtray icon
* @author Percy Leonhardt <>
class InterfaceIcon : public TQObject
* Default Constructor
InterfaceIcon( Interface* interface );
* Default Destructor
virtual ~InterfaceIcon();
* Change the tooltip according to the alias of the interface
void updateToolTip();
* Fill the context menu with entries if the user configured
* start and stop command
void updateMenu();
void statisticsSelected();
public slots:
* Changes the icon image displayed in the tray
void updateStatus( int status );
* Creates or deletes the tray icon
void updateTrayStatus( int previousState, bool notify=true );
* Resizes the tray icon
void resizeIcon();
private slots:
* Called when the user selects 'Configure KNemo' from the context menu
void showConfigDialog();
* Called when the user setup custom commands and selects one
* in the context menu
void menuActivated( int id );
// the interface this icon belongs to
Interface* mInterface;
// the real tray icon
InterfaceTray* mTray;
static const TQString ICON_DISCONNECTED;
static const TQString ICON_CONNECTED;
static const TQString ICON_INCOMING;
static const TQString ICON_OUTGOING;
static const TQString ICON_TRAFFIC;
static const TQString SUFFIX_PPP;
static const TQString SUFFIX_LAN;
static const TQString SUFFIX_WLAN;