File indexing completed on 2024-05-19 03:59:07

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 1999 Simon Hausmann <hausmann@kde.org>
0004     SPDX-FileCopyrightText: 1999 David Faure <faure@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #include "guiactivateevent.h"
0010 
0011 using namespace KParts;
0012 
0013 class KParts::GUIActivateEventPrivate
0014 {
0015 public:
0016     GUIActivateEventPrivate(bool activated)
0017         : m_bActivated(activated)
0018     {
0019     }
0020     const bool m_bActivated;
0021 };
0022 
0023 const QEvent::Type GUIActivateEventType = (QEvent::Type)1970;
0024 
0025 GUIActivateEvent::GUIActivateEvent(bool activated)
0026     : QEvent(GUIActivateEventType)
0027     , d(new GUIActivateEventPrivate(activated))
0028 {
0029 }
0030 
0031 GUIActivateEvent::~GUIActivateEvent() = default;
0032 
0033 bool GUIActivateEvent::activated() const
0034 {
0035     return d->m_bActivated;
0036 }
0037 
0038 bool GUIActivateEvent::test(const QEvent *event)
0039 {
0040     return event->type() == GUIActivateEventType;
0041 }