File indexing completed on 2024-05-12 16:57:41
0001 /* 0002 * SPDX-FileCopyrightText: 2020 Dimitris Kardarakos <dimkard@posteo.net> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #ifndef WAKEUPBACKEND_H 0008 #define WAKEUPBACKEND_H 0009 0010 #include <QObject> 0011 #include <QVariantMap> 0012 0013 /** 0014 * @brief Power management backend that offers scheduling wake up at a time specified 0015 * 0016 */ 0017 class WakeupBackend : public QObject 0018 { 0019 public: 0020 explicit WakeupBackend(QObject *parent = nullptr) : QObject(parent) {} 0021 virtual ~WakeupBackend() = default; 0022 0023 /** 0024 * @brief Schedule a wake-up at the time provided 0025 * 0026 * @param callbackInfo Information about the method to call back after awaking by the power manager module 0027 * @return The scheduled wakeup returned by the power manager module 0028 */ 0029 virtual QVariant scheduleWakeup(const QVariantMap &callbackInfo, const quint64 wakeupAt) = 0; 0030 0031 /** 0032 * @brief Clear a scheduled wake-up 0033 * 0034 * @param scheduledWakeup The scheduled wake up, as returned by the scheduleWakeup method 0035 */ 0036 virtual void clearWakeup(const QVariant &scheduledWakeup) = 0; 0037 0038 /** 0039 * 0040 * @return True if the backend is a valid one 0041 */ 0042 virtual bool isValid() = 0; 0043 0044 /** 0045 * @return True if the backend offers wakeup features 0046 */ 0047 virtual bool isWakeupBackend() = 0; 0048 0049 }; 0050 0051 #endif // WAKEUPBACKEND_H