File indexing completed on 2024-04-28 05:51:09
0001 /* 0002 * SPDX-FileCopyrightText: 2002-2003 Jesper K. Pedersen <blackie@kde.org> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-only 0005 **/ 0006 #ifndef __ccp 0007 #define __ccp 0008 0009 #include <QObject> 0010 0011 class KMultiFormListBoxMultiVisible; 0012 class KMultiFormListBoxEntry; 0013 0014 /** 0015 Helper class for @ref KMultiFormListBoxMultiVisible which is used to install EventFilters. 0016 0017 When the user presses CTRL + right mouse button then a menu should 0018 appear which offers him cut and paste capabilities for the entries in 0019 the KMultiFormListBoxMultiVisible. 0020 0021 To obtain this an event filter must be install for each subwidget of the 0022 KMultiFormListBoxMultiVisible. This event filter must catch the right mouse press event and 0023 post the menu. This requires a widget which has the method @ref 0024 eventFilter defined. We have this helper class exactly for this purpose. 0025 0026 For each @ref KMultiFormListBoxEntry in the @ref KMultiFormListBoxMultiVisible widget an instance of 0027 this class is associated. 0028 0029 CCP stand for Cut Copy and Paste 0030 0031 @internal 0032 **/ 0033 class CCP : public QObject 0034 { 0035 Q_OBJECT 0036 private: 0037 friend class KMultiFormListBoxMultiVisible; 0038 /** 0039 * Constructor is private so only the class @ref KMultiFormListBoxMultiVisible may create an 0040 * instance of this widget. 0041 **/ 0042 CCP(KMultiFormListBoxMultiVisible *, KMultiFormListBoxEntry *); 0043 0044 void install(QObject *); 0045 bool eventFilter(QObject *, QEvent *) override; 0046 0047 // Instance variables. 0048 0049 KMultiFormListBoxMultiVisible *ee = nullptr; 0050 KMultiFormListBoxEntry *eee = nullptr; 0051 }; 0052 0053 #endif /* ccp */