File indexing completed on 2024-09-22 04:50:00

0001 /*
0002  * SPDX-FileCopyrightText: 1996-1998 Stefan Taferner <taferner@kde.org>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-or-later
0005  *
0006  */
0007 
0008 #pragma once
0009 
0010 #include "filteractionwithtest.h"
0011 
0012 namespace Phonon
0013 {
0014 class MediaObject;
0015 }
0016 
0017 namespace MailCommon
0018 {
0019 //=============================================================================
0020 // FilterActionPlaySound - execute command
0021 // Execute a sound
0022 //=============================================================================
0023 class FilterActionPlaySound : public FilterActionWithTest
0024 {
0025     Q_OBJECT
0026 public:
0027     FilterActionPlaySound();
0028     ~FilterActionPlaySound() override;
0029     [[nodiscard]] ReturnCode process(ItemContext &context, bool applyOnOutbound) const override;
0030     [[nodiscard]] SearchRule::RequiredPart requiredPart() const override;
0031     static FilterAction *newAction();
0032     [[nodiscard]] bool argsFromStringInteractive(const QString &argsStr, const QString &filterName) override;
0033 
0034     [[nodiscard]] bool isEmpty() const override;
0035     [[nodiscard]] QString informationAboutNotValidAction() const override;
0036 
0037 private:
0038     mutable Phonon::MediaObject *mPlayer = nullptr;
0039 };
0040 }