File indexing completed on 2024-04-21 03:51:46

0001 /*
0002     This file is part of the KDE Project
0003     SPDX-FileCopyrightText: 2008 Sebastian Trueg <trueg@kde.org>
0004     SPDX-FileCopyrightText: 2012-2015 Vishesh Handa <vhanda@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #ifndef BALOO_FILEINDEXER_POWER_STATE_MONITOR_H_
0010 #define BALOO_FILEINDEXER_POWER_STATE_MONITOR_H_
0011 
0012 #include <QObject>
0013 
0014 namespace Baloo
0015 {
0016 
0017 class PowerStateMonitor : public QObject
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit PowerStateMonitor(QObject* parent = nullptr);
0023 
0024     bool isOnBattery()    const {
0025         return m_isOnBattery;
0026     }
0027 
0028 Q_SIGNALS:
0029     /**
0030      * Emitted when the power management status changes.
0031      *
0032      * \param conserveResources true if you should conserve resources
0033      */
0034     void powerManagementStatusChanged(bool conserveResources);
0035 
0036 private Q_SLOTS:
0037     void slotPowerManagementStatusChanged(bool conserveResources);
0038 
0039 private:
0040     bool m_enabled;
0041     bool m_isOnBattery;
0042 };
0043 }
0044 
0045 #endif