File: kmanagerselectiontest.h

package info (click to toggle)
kwindowsystem 5.116.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,624 kB
  • sloc: cpp: 21,787; makefile: 7; sh: 1
file content (63 lines) | stat: -rw-r--r-- 1,282 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
    This file is part of the KDE Libraries

    SPDX-FileCopyrightText: 2009 Lubos Lunak <l.lunak@kde.org>

    SPDX-License-Identifier: LGPL-2.1-or-later
*/

#ifndef KMANAGERSELECTIONTESTTEST_H
#define KMANAGERSELECTIONTESTTEST_H

#include <QObject>
#include <QTest>

class KSelectionOwner;

class KManagerSelectionTest : public QObject
{
    Q_OBJECT
public:
private Q_SLOTS:
    void testAcquireRelease();
    void testInitiallyOwned();
    void testLostOwnership();
    void testWatching();

private:
    void claim(KSelectionOwner *owner, bool force = false, bool forceKill = true);
    void xSync();
};

class KSelectionWatcher;

// For checking whether several signal have or have not been emitted,
// QSignalSpy::wait() is not powerful enough for that (it is still
// needed to do the event processing though). TODO: check if this is still true.
class SigCheckOwner : public QObject
{
    Q_OBJECT
public:
    SigCheckOwner(const KSelectionOwner &owner);
private Q_SLOTS:
    void lostOwnership();

public:
    bool lostownership;
};

class SigCheckWatcher : public QObject
{
    Q_OBJECT
public:
    SigCheckWatcher(const KSelectionWatcher &watcher);
private Q_SLOTS:
    void newOwner();
    void lostOwner();

public:
    bool newowner;
    bool lostowner;
};

#endif