File indexing completed on 2024-04-21 05:01:49

0001 /*
0002     smb4ksystemtray  -  This is the system tray window class of Smb4K.
0003 
0004     SPDX-FileCopyrightText: 2007-2024 Alexander Reinholdt <alexander.reinholdt@kdemail.net>
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef SMB4KSYSTEMTRAY_H
0009 #define SMB4KSYSTEMTRAY_H
0010 
0011 // application specific includes
0012 #include "smb4kmountdialog.h"
0013 
0014 // Qt includes
0015 #include <QString>
0016 #include <QWidget>
0017 
0018 // KDE includes
0019 #include <KStatusNotifierItem>
0020 
0021 class Smb4KSystemTray : public KStatusNotifierItem
0022 {
0023     Q_OBJECT
0024 
0025     friend class Smb4KMainWindow;
0026 
0027 public:
0028     /**
0029      * The constructor.
0030      *
0031      * @param parent        The parent widget of the system tray window
0032      */
0033     explicit Smb4KSystemTray(QWidget *parent = nullptr);
0034 
0035     /**
0036      * The destructor.
0037      */
0038     ~Smb4KSystemTray();
0039 
0040 public Q_SLOTS:
0041     /**
0042      * This function (re-)loads the settings for this widget.
0043      */
0044     void loadSettings();
0045 
0046 protected Q_SLOTS:
0047     /**
0048      * This slot opens the manual mount dialog.
0049      *
0050      * @param checked         TRUE if the action can be and is checked and FALSE
0051      *                        otherwise.
0052      */
0053     void slotMountDialog();
0054 
0055     /**
0056      * Set the status of the system tray icon. This slot checks the global
0057      * list of mounted shares and the global list of workgroups. If neither of
0058      * them contains any item, the icon is set to passive state until one of
0059      * the lists is populated.
0060      */
0061     void slotSetStatus();
0062 };
0063 
0064 #endif