VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h

Last change on this file was 104251, checked in by vboxsync, 5 weeks ago

FE/Qt. bugref:10622. Using new UITranslationEventListener in the manager UI classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.0 KB
Line 
1/* $Id: UIChooserView.h 104251 2024-04-09 12:36:47Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIChooserView 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_chooser_UIChooserView_h
29#define FEQT_INCLUDED_SRC_manager_chooser_UIChooserView_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "QIGraphicsView.h"
36
37/* Forward declarations: */
38class UIChooserModel;
39class UIChooserSearchWidget;
40
41/** QIGraphicsView extension used as VM chooser pane view. */
42class UIChooserView : public QIGraphicsView
43{
44 Q_OBJECT;
45
46signals:
47
48 /** Notifies listeners about resize. */
49 void sigResized();
50
51 /** Notifies listeners about search widget visibility changed to @a fVisible. */
52 void sigSearchWidgetVisibilityChanged(bool fVisible);
53
54public:
55
56 /** Constructs a Chooser-view passing @a pParent to the base-class. */
57 UIChooserView(QWidget *pParent);
58
59 /** @name General stuff.
60 * @{ */
61 /** Defines @a pChooserModel reference. */
62 void setModel(UIChooserModel *pChooserModel);
63 /** Returns Chooser-model reference. */
64 UIChooserModel *model() const;
65 /** @} */
66
67 /** @name Search stuff.
68 * @{ */
69 /** Returns whether search widget visible. */
70 bool isSearchWidgetVisible() const;
71 /** Makes search widget @a fVisible. */
72 void setSearchWidgetVisible(bool fVisible);
73
74 /** Updates search widget's results count.
75 * @param iTotalMatchCount Brings total search results count.
76 * @param iCurrentlyScrolledItemIndex Brings the item index search currently scrolled to. */
77 void setSearchResultsCount(int iTotalMatchCount, int iCurrentlyScrolledItemIndex);
78 /** Forwards @a strSearchText to the search widget which in
79 * turn appends it to the current (if any) search term. */
80 void appendToSearchString(const QString &strSearchText);
81 /** Repeats the last search again. */
82 void redoSearch();
83 /** @} */
84
85public slots:
86
87 /** @name Layout stuff.
88 * @{ */
89 /** Handles minimum width @a iHint change. */
90 void sltMinimumWidthHintChanged(int iHint);
91 /** @} */
92
93protected:
94
95 /** @name Event handling stuff.
96 * @{ */
97 /** Handles resize @a pEvent. */
98 virtual void resizeEvent(QResizeEvent *pEvent) RT_OVERRIDE;
99 /** @} */
100
101private slots:
102
103 /** @name Theme stuff stuff.
104 * @{ */
105 /** Updates palette. */
106 void sltUpdatePalette() { preparePalette(); }
107 /** @} */
108
109 /** @name Search stuff.
110 * @{ */
111 /** Handles request for a new search.
112 * @param strSearchTerm Brings the search term.
113 * @param iSearchFlags Brings the item search flags. */
114 void sltRedoSearch(const QString &strSearchTerm, int iSearchFlags);
115 /** Handles request to scroll to @a fNext search result. */
116 void sltHandleScrollToSearchResult(bool fNext);
117 /** Handles request to scroll to make search widget @a fVisible. */
118 void sltHandleSearchWidgetVisibilityToggle(bool fVisible);
119 /** @} */
120
121 /** @name Event handling stuff.
122 * @{ */
123 /** Handles translation event. */
124 void sltRetranslateUI();
125 /** @} */
126
127private:
128
129 /** @name Prepare/Cleanup cascade.
130 * @{ */
131 /** Prepares all. */
132 void prepare();
133 /** Prepares this. */
134 void prepareThis();
135 /** Prepares palette. */
136 void preparePalette();
137 /** Prepares widgets. */
138 void prepareWidget();
139 /** @} */
140
141 /** @name General stuff.
142 * @{ */
143 /** Updates scene rectangle. */
144 void updateSceneRect();
145 /** @} */
146
147 /** @name Search stuff.
148 * @{ */
149 /** Updates search widget's geometry. */
150 void updateSearchWidgetGeometry();
151 /** @} */
152
153 /** @name General stuff.
154 * @{ */
155 /** Holds the Chooser-model reference. */
156 UIChooserModel *m_pChooserModel;
157 /** @} */
158
159 /** @name Search stuff.
160 * @{ */
161 /** Holds the search widget instance. */
162 UIChooserSearchWidget *m_pSearchWidget;
163 /** @} */
164
165 /** @name Layout stuff.
166 * @{ */
167 /** Holds the minimum width hint. */
168 int m_iMinimumWidthHint;
169 /** @} */
170};
171
172#endif /* !FEQT_INCLUDED_SRC_manager_chooser_UIChooserView_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use