VirtualBox

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

Last change on this file was 104251, checked in by vboxsync, 6 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.4 KB
Line 
1/* $Id: UIVirtualMachineItemLocal.h 104251 2024-04-09 12:36:47Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVirtualMachineItemLocal class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-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_UIVirtualMachineItemLocal_h
29#define FEQT_INCLUDED_SRC_manager_UIVirtualMachineItemLocal_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QDateTime>
36
37/* GUI includes: */
38#include "UIVirtualMachineItem.h"
39
40/* COM includes: */
41#include "CMachine.h"
42
43/** UIVirtualMachineItem sub-class used as local Virtual Machine item interface. */
44class UIVirtualMachineItemLocal : public UIVirtualMachineItem
45{
46 Q_OBJECT;
47
48public:
49
50 /** Constructs local VM item on the basis of taken @a comMachine. */
51 UIVirtualMachineItemLocal(const CMachine &comMachine);
52 /** Destructs local VM item. */
53 virtual ~UIVirtualMachineItemLocal();
54
55 /** @name Arguments.
56 * @{ */
57 /** Returns cached virtual machine object. */
58 CMachine machine() const { return m_comMachine; }
59 /** @} */
60
61 /** @name Basic attributes.
62 * @{ */
63 /** Returns cached machine settings file name. */
64 QString settingsFile() const { return m_strSettingsFile; }
65 /** Returns cached machine group list. */
66 const QStringList &groups() { return m_groups; }
67 /** @} */
68
69 /** @name Snapshot attributes.
70 * @{ */
71 /** Returns cached snapshot name. */
72 QString snapshotName() const { return m_strSnapshotName; }
73 /** Returns cached snapshot children count. */
74 ULONG snapshotCount() const { return m_cSnaphot; }
75 /** @} */
76
77 /** @name State attributes.
78 * @{ */
79 /** Returns cached machine state. */
80 KMachineState machineState() const { return m_enmMachineState; }
81 /** Returns cached session state. */
82 KSessionState sessionState() const { return m_enmSessionState; }
83 /** Returns cached session state name. */
84 QString sessionStateName() const { return m_strSessionStateName; }
85 /** @} */
86
87 /** @name Update stuff.
88 * @{ */
89 /** Recaches machine data. */
90 virtual void recache() RT_OVERRIDE;
91 /** Recaches machine item pixmap. */
92 virtual void recachePixmap() RT_OVERRIDE;
93 /** @} */
94
95 /** @name Validation stuff.
96 * @{ */
97 /** Returns whether this item is editable. */
98 virtual bool isItemEditable() const RT_OVERRIDE;
99 /** Returns whether this item is removable. */
100 virtual bool isItemRemovable() const RT_OVERRIDE;
101 /** Returns whether this item is saved. */
102 virtual bool isItemSaved() const RT_OVERRIDE;
103 /** Returns whether this item is powered off. */
104 virtual bool isItemPoweredOff() const RT_OVERRIDE;
105 /** Returns whether this item is started. */
106 virtual bool isItemStarted() const RT_OVERRIDE;
107 /** Returns whether this item is running. */
108 virtual bool isItemRunning() const RT_OVERRIDE;
109 /** Returns whether this item is running headless. */
110 virtual bool isItemRunningHeadless() const RT_OVERRIDE;
111 /** Returns whether this item is paused. */
112 virtual bool isItemPaused() const RT_OVERRIDE;
113 /** Returns whether this item is stuck. */
114 virtual bool isItemStuck() const RT_OVERRIDE;
115 /** Returns whether this item can be switched to. */
116 virtual bool isItemCanBeSwitchedTo() const RT_OVERRIDE;
117 /** @} */
118
119private slots:
120
121 /** @name Event handling.
122 * @{ */
123 /** Handles translation event. */
124 void sltRetranslateUI();
125 /** @} */
126
127private:
128
129 /** @name Arguments.
130 * @{ */
131 /** Holds cached machine object reference. */
132 CMachine m_comMachine;
133 /** @} */
134
135 /** @name Basic attributes.
136 * @{ */
137 /** Holds cached machine settings file name. */
138 QString m_strSettingsFile;
139 /** Holds cached machine group list. */
140 QStringList m_groups;
141 /** @} */
142
143 /** @name Snapshot attributes.
144 * @{ */
145 /** Holds cached snapshot name. */
146 QString m_strSnapshotName;
147 /** Holds cached last state change date/time. */
148 QDateTime m_lastStateChange;
149 /** Holds cached snapshot children count. */
150 ULONG m_cSnaphot;
151 /** @} */
152
153 /** @name State attributes.
154 * @{ */
155 /** Holds cached machine state. */
156 KMachineState m_enmMachineState;
157 /** Holds cached session state. */
158 KSessionState m_enmSessionState;
159 /** Holds cached session state name. */
160 QString m_strSessionStateName;
161 /** @} */
162
163 /** @name Console attributes.
164 * @{ */
165 /** Holds machine PID. */
166 ULONG m_pid;
167 /** @} */
168};
169
170#endif /* !FEQT_INCLUDED_SRC_manager_UIVirtualMachineItemLocal_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use