File indexing completed on 2024-05-12 05:20:46

0001 /*
0002     secondarywindow.h
0003 
0004     This file is part of KMail, the KDE mail client.
0005     SPDX-FileCopyrightText: 2003 Ingo Kloecker <kloecker@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-only
0008 */
0009 
0010 #pragma once
0011 
0012 #include "kmail_private_export.h"
0013 #include <kxmlguiwindow.h>
0014 class QCloseEvent;
0015 
0016 namespace KMail
0017 {
0018 /**
0019  *  Window class for secondary KMail window like the composer window and
0020  *  the separate message window.
0021  */
0022 class KMAILTESTS_TESTS_EXPORT SecondaryWindow : public KXmlGuiWindow
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit SecondaryWindow(const QString &name = QString());
0028     ~SecondaryWindow() override;
0029     using KMainWindow::setCaption;
0030 public Q_SLOTS:
0031     /**
0032      * Reimplement because we have <a href="https://bugs.kde.org/show_bug.cgi?id=163978">this bug</a>
0033      * @brief setCaption
0034      * @param caption
0035      */
0036     void setCaption(const QString &caption) override;
0037 
0038 protected:
0039     /**
0040      *  Reimplemented because we don't want the application to quit when the
0041      *  last _visible_ secondary window is closed in case a system tray applet
0042      *  exists.
0043      */
0044     void closeEvent(QCloseEvent *) override;
0045 };
0046 } // namespace KMail