VBoxVMSettingsHD.h revision ad27e1d5e48ca41245120c331cc88b50464813ce
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* VBoxVMSettingsHD class declaration
*/
/*
* Copyright (C) 2006-2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __VBoxVMSettingsHD_h__
#define __VBoxVMSettingsHD_h__
/* Global includes */
#include <QtGlobal> /* for Q_WS_MAC */
#ifdef Q_WS_MAC
/* Somewhere Carbon.h includes AssertMacros.h which defines the macro "check".
* In QItemDelegate a class method is called "check" also. As we not used the
* macro undefine it here. */
#endif /* Q_WS_MAC */
#include <QItemDelegate>
#include <QPointer>
/* Local includes */
#include "UISettingsPage.h"
#include "VBoxVMSettingsHD.gen.h"
#include "COMDefs.h"
/* Local forwards */
/* Internal Types */
enum ItemState
{
State_DefaultItem = 0,
State_CollapsedItem = 1,
State_ExpandedItem = 2,
};
/* Pixmap Storage Pool */
{
enum PixmapType
{
InvalidPixmap = -1,
ControllerAddEn = 0,
ControllerAddDis = 1,
ControllerDelEn = 2,
ControllerDelDis = 3,
AttachmentAddEn = 4,
AttachmentAddDis = 5,
AttachmentDelEn = 6,
AttachmentDelDis = 7,
IDEControllerNormal = 8,
IDEControllerExpand = 9,
IDEControllerCollapse = 10,
SATAControllerNormal = 11,
SATAControllerExpand = 12,
SATAControllerCollapse = 13,
SCSIControllerNormal = 14,
SCSIControllerExpand = 15,
SCSIControllerCollapse = 16,
FloppyControllerNormal = 17,
FloppyControllerExpand = 18,
FloppyControllerCollapse = 19,
IDEControllerAddEn = 20,
IDEControllerAddDis = 21,
SATAControllerAddEn = 22,
SATAControllerAddDis = 23,
SCSIControllerAddEn = 24,
SCSIControllerAddDis = 25,
FloppyControllerAddEn = 26,
FloppyControllerAddDis = 27,
HDAttachmentNormal = 28,
CDAttachmentNormal = 29,
FDAttachmentNormal = 30,
HDAttachmentAddEn = 31,
HDAttachmentAddDis = 32,
CDAttachmentAddEn = 33,
CDAttachmentAddDis = 34,
FDAttachmentAddEn = 35,
FDAttachmentAddDis = 36,
VMMEn = 37,
VMMDis = 38,
};
};
/* Abstract Controller Type */
{
KStorageBus busType() const;
KStorageControllerType ctrType() const;
ControllerTypeList ctrTypes() const;
DeviceTypeList deviceTypeList() const;
};
/* IDE Controller Type */
{
KStorageControllerType first() const;
};
/* SATA Controller Type */
{
KStorageControllerType first() const;
};
/* SCSI Controller Type */
{
KStorageControllerType first() const;
};
/* Floppy Controller Type */
{
KStorageControllerType first() const;
};
/* SAS Controller Type */
{
KStorageControllerType first() const;
};
/* Abstract Item */
{
enum ItemType
{
Type_InvalidItem = 0,
Type_RootItem = 1,
Type_ControllerItem = 2,
};
virtual ~AbstractItem();
AbstractItem* parent() const;
virtual int childCount() const = 0;
};
/* Root Item */
{
RootItem();
~RootItem();
int childCount() const;
};
/* Controller Item */
{
~ControllerItem();
KStorageBus ctrBusType() const;
KStorageControllerType ctrType() const;
ControllerTypeList ctrTypes() const;
bool ctrUseIoCache() const;
void setCtrUseIoCache (bool aUseIoCache);
SlotsList ctrAllSlots() const;
SlotsList ctrUsedSlots() const;
DeviceTypeList ctrDeviceTypeList() const;
QStringList ctrUsedMediumIds() const;
int childCount() const;
bool mUseIoCache;
};
/* Attachment Item */
{
StorageSlot attSlot() const;
KDeviceType attDeviceType() const;
DeviceTypeList attDeviceTypes() const;
QString attMediumId() const;
bool attIsShowDiffs() const;
bool attIsHostDrive() const;
bool attIsPassthrough() const;
void setAttIsShowDiffs (bool aAttIsShowDiffs);
void setAttIsPassthrough (bool aPassthrough);
QString attLogicalSize() const;
QString attLocation() const;
void cache();
int childCount() const;
bool mAttIsShowDiffs;
bool mAttIsHostDrive;
bool mAttIsPassthrough;
};
/* Storage Model */
{
enum DataRole
{
};
enum ToolTipType
{
DefaultToolTip = 0,
ExpanderToolTip = 1,
HDAdderToolTip = 2,
CDAdderToolTip = 3,
FDAdderToolTip = 4
};
~StorageModel();
QModelIndex root() const;
QModelIndex addController (const QString &aCtrName, KStorageBus aBusType, KStorageControllerType aCtrType);
};
/* Storage Delegate */
{
void paint (QPainter *aPainter, const QStyleOptionViewItem &aOption, const QModelIndex &aIndex) const;
bool mDisableStaticControls;
};
/**
* QWidget class reimplementation.
* Used as HD Settings widget.
*/
{
void storageChanged();
void putBackTo();
void retranslateUi();
void addController();
void addIDEController();
void addSATAController();
void addSCSIController();
void addFloppyController();
void addSASController();
void delController();
void addAttachment();
void addHDAttachment();
void addCDAttachment();
void addFDAttachment();
void delAttachment();
void getInformation();
void setInformation();
void onVmmInvoked();
void updateActionsState();
void onRowRemoved();
void onCurrentItemChanged();
bool mIsLoadingInProgress;
bool mIsPolished;
bool mDisableStaticControls;
};
#endif // __VBoxVMSettingsHD_h__