VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsContextMenu.h@ 103977

Last change on this file since 103977 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h79562-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsModel.h79645-79692
    /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h79225,​79271
File size: 3.6 KB
Line 
1/* $Id: UIDetailsContextMenu.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDetailsContextMenu class declaration.
4 */
5
6/*
7 * Copyright (C) 2012-2023 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_details_UIDetailsContextMenu_h
29#define FEQT_INCLUDED_SRC_manager_details_UIDetailsContextMenu_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "QIWithRetranslateUI.h"
36#include "UIExtraDataDefs.h"
37
38/* Forward declaration: */
39class QListWidget;
40class QListWidgetItem;
41class UIDetailsModel;
42
43/** QWidget subclass used as Details pane context menu. */
44class UIDetailsContextMenu : public QIWithRetranslateUI2<QWidget>
45{
46 Q_OBJECT;
47
48public:
49
50 /** Context menu data fields. */
51 enum DataField
52 {
53 DataField_Type = Qt::UserRole + 1,
54 DataField_Name = Qt::UserRole + 2,
55 };
56
57 /** Constructs context-menu.
58 * @param pModel Brings model object reference. */
59 UIDetailsContextMenu(UIDetailsModel *pModel);
60
61 /** Updates category check-states. */
62 void updateCategoryStates();
63 /** Updates option check-states for certain @a enmRequiredCategoryType. */
64 void updateOptionStates(DetailsElementType enmRequiredCategoryType = DetailsElementType_Invalid);
65
66protected:
67
68 /** Handles translation event. */
69 virtual void retranslateUi() RT_OVERRIDE;
70
71 /** Handles translation event for categories list. */
72 void retranslateCategories();
73 /** Handles translation event for options list. */
74 void retranslateOptions();
75
76private slots:
77
78 /** Handles signal about category list-widget @a pItem hovered. */
79 void sltCategoryItemEntered(QListWidgetItem *pItem);
80 /** Handles signal about category list-widget @a pItem clicked. */
81 void sltCategoryItemClicked(QListWidgetItem *pItem);
82 /** Handles signal about current category list-widget @a pItem hovered. */
83 void sltCategoryItemChanged(QListWidgetItem *pCurrent, QListWidgetItem *pPrevious);
84
85 /** Handles signal about option list-widget @a pItem hovered. */
86 void sltOptionItemEntered(QListWidgetItem *pItem);
87 /** Handles signal about option list-widget @a pItem clicked. */
88 void sltOptionItemClicked(QListWidgetItem *pItem);
89
90private:
91
92 /** Prepares all. */
93 void prepare();
94
95 /** (Re)populates categories. */
96 void populateCategories();
97 /** (Re)populates options. */
98 void populateOptions();
99
100 /** Adjusts both list widgets. */
101 void adjustListWidgets();
102
103 /** Creates category list item with specified @a icon. */
104 QListWidgetItem *createCategoryItem(const QIcon &icon);
105 /** Creates option list item. */
106 QListWidgetItem *createOptionItem();
107
108 /** Holds the model reference. */
109 UIDetailsModel *m_pModel;
110
111 /** Holds the categories list instance. */
112 QListWidget *m_pListWidgetCategories;
113 /** Holds the options list instance. */
114 QListWidget *m_pListWidgetOptions;
115};
116
117#endif /* !FEQT_INCLUDED_SRC_manager_details_UIDetailsContextMenu_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette