VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.cpp

Last change on this file was 106061, checked in by vboxsync, 3 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/* $Id: UIVirtualMachineItem.cpp 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIVirtualMachineItem class implementation.
4 */
5
6/*
7 * Copyright (C) 2006-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/* GUI includes: */
29#include "UIVirtualMachineItemCloud.h"
30#include "UIVirtualMachineItemLocal.h"
31
32
33/*********************************************************************************************************************************
34* Class UIVirtualMachineItem implementation. *
35*********************************************************************************************************************************/
36
37UIVirtualMachineItem::UIVirtualMachineItem(UIVirtualMachineItemType enmType)
38 : m_enmType(enmType)
39 , m_fAccessible(false)
40 , m_enmConfigurationAccessLevel(ConfigurationAccessLevel_Null)
41 , m_fHasDetails(false)
42{
43}
44
45UIVirtualMachineItem::~UIVirtualMachineItem()
46{
47}
48
49UIVirtualMachineItemLocal *UIVirtualMachineItem::toLocal()
50{
51 return itemType() == UIVirtualMachineItemType_Local
52 ? static_cast<UIVirtualMachineItemLocal*>(this)
53 : 0;
54}
55
56UIVirtualMachineItemCloud *UIVirtualMachineItem::toCloud()
57{
58 return ( itemType() == UIVirtualMachineItemType_CloudFake
59 || itemType() == UIVirtualMachineItemType_CloudReal)
60 ? static_cast<UIVirtualMachineItemCloud*>(this)
61 : 0;
62}
63
64QPixmap UIVirtualMachineItem::osPixmap(QSize *pLogicalSize /* = 0 */) const
65{
66 if (pLogicalSize)
67 *pLogicalSize = m_logicalPixmapSize;
68 return m_pixmap;
69}
70
71
72/*********************************************************************************************************************************
73* Class UIVirtualMachineItemMimeData implementation. *
74*********************************************************************************************************************************/
75
76QString UIVirtualMachineItemMimeData::m_type = "application/org.virtualbox.gui.vmselector.UIVirtualMachineItem";
77
78UIVirtualMachineItemMimeData::UIVirtualMachineItemMimeData(UIVirtualMachineItem *pItem)
79 : m_pItem(pItem)
80{
81}
82
83QStringList UIVirtualMachineItemMimeData::formats() const
84{
85 QStringList types;
86 types << type();
87 return types;
88}
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