VirtualBox

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

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

© 2023 Oracle
ContactPrivacy policyTerms of Use