1 | /* $Id: UIChooserHandlerMouse.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIChooserHandlerMouse class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_manager_chooser_UIChooserHandlerMouse_h
|
---|
29 | #define FEQT_INCLUDED_SRC_manager_chooser_UIChooserHandlerMouse_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QObject>
|
---|
36 |
|
---|
37 | /* Forward declarations: */
|
---|
38 | class UIChooserModel;
|
---|
39 | class QGraphicsSceneMouseEvent;
|
---|
40 | class UIChooserItem;
|
---|
41 |
|
---|
42 | /* Mouse event type: */
|
---|
43 | enum UIMouseEventType
|
---|
44 | {
|
---|
45 | UIMouseEventType_Press,
|
---|
46 | UIMouseEventType_Release,
|
---|
47 | UIMouseEventType_DoubleClick
|
---|
48 | };
|
---|
49 |
|
---|
50 | /* Mouse handler for graphics selector: */
|
---|
51 | class UIChooserHandlerMouse : public QObject
|
---|
52 | {
|
---|
53 | Q_OBJECT;
|
---|
54 |
|
---|
55 | public:
|
---|
56 |
|
---|
57 | /* Constructor: */
|
---|
58 | UIChooserHandlerMouse(UIChooserModel *pParent);
|
---|
59 |
|
---|
60 | /* API: Model mouse-event handler delegate: */
|
---|
61 | bool handle(QGraphicsSceneMouseEvent *pEvent, UIMouseEventType type) const;
|
---|
62 |
|
---|
63 | private:
|
---|
64 |
|
---|
65 | /* API: Model wrapper: */
|
---|
66 | UIChooserModel* model() const;
|
---|
67 |
|
---|
68 | /* Helpers: Model mouse-event handler delegates: */
|
---|
69 | bool handleMousePress(QGraphicsSceneMouseEvent *pEvent) const;
|
---|
70 | bool handleMouseRelease(QGraphicsSceneMouseEvent *pEvent) const;
|
---|
71 | bool handleMouseDoubleClick(QGraphicsSceneMouseEvent *pEvent) const;
|
---|
72 |
|
---|
73 | /* Variables: */
|
---|
74 | UIChooserModel *m_pModel;
|
---|
75 | };
|
---|
76 |
|
---|
77 | #endif /* !FEQT_INCLUDED_SRC_manager_chooser_UIChooserHandlerMouse_h */
|
---|
78 |
|
---|