UIMediumManager.h revision 58668e366c315f45ea3be7b3a43f79224858173a
/** @file
*
* VBox frontends: Qt4 GUI ("VirtualBox"):
* UIMediumManager class declaration
*/
/*
* Copyright (C) 2006-2013 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 __UIMediumManager_h__
#define __UIMediumManager_h__
/* GUI includes: */
#include "UIMediumManager.gen.h"
#include "QIWithRetranslateUI.h"
#include "QIMainDialog.h"
#include "UIMediumDefs.h"
/* COM includes: */
#include "COMEnums.h"
#include "CMachine.h"
#include "CVirtualBox.h"
/* Forward declarations: */
/** Functor interface allowing to check if passed UIMediumItem is suitable. */
{
/** Determines whether passed UIMediumItem is suitable. */
};
/** Medium Manager dialog. */
{
/** Tab index enumerator. */
/** Item action enumerator. */
/** Constructor for Medium Manager dialog. */
/** Destructor for Medium Manager dialog. */
~UIMediumManager();
/** Returns Medium Manager singleton instance. */
static UIMediumManager* instance();
/** Shows Medium Manager singleton instance, creates new if necessary. */
/** Fully refreshes medium manager contents. */
void sltRefreshAll();
/** Handles VBoxGlobal::sigMediumCreated signal. */
/** Handles VBoxGlobal::sigMediumDeleted signal. */
/** Handles VBoxGlobal::sigMediumEnumerationStarted signal. */
void sltHandleMediumEnumerationStart();
/** Handles VBoxGlobal::sigMediumEnumerated signal. */
/** Handles VBoxGlobal::sigMediumEnumerationFinished signal. */
void sltHandleMediumEnumerationFinish();
/** Calls for clone VD wizard to copy chosen medium. */
void sltCopyMedium();
/** Calls for medium-type change dialog for chosen medium. */
void sltModifyMedium();
/** Calls for remove medium dialog for chosen medium. */
void sltRemoveMedium();
/** Calls for medium release dialog for chosen medium. */
void sltReleaseMedium();
/* Handlers: Navigation stuff: */
void sltHandleCurrentTabChanged();
void sltHandleCurrentItemChanged();
void sltHandleDoubleClick();
/* Handlers: Geometry stuff: */
void sltMakeRequestForTableAdjustment();
void sltPerformTablesAdjustment();
/* Helpers: Prepare stuff: */
void prepare();
void prepareThis();
void prepareActions();
void prepareMenuBar();
void prepareToolBar();
void prepareContextMenu();
void prepareTabWidget();
void prepareTreeWidgets();
void prepareTreeWidgetHD();
void prepareTreeWidgetCD();
void prepareTreeWidgetFD();
void prepareInformationPanes();
void prepareButtonBox();
void prepareProgressBar();
#ifdef Q_WS_MAC
void prepareMacWindowMenu();
#endif /* Q_WS_MAC */
/** Repopulates tree-widgets content. */
void repopulateTreeWidgets();
/** Updates details according latest changes in current medium-item of predefined @a type. */
/** Updates details according latest changes in current medium-item of chosen type. */
void refetchCurrentChosenMediumItem();
/** Updates details according latest changes in all current medium-items. */
void refetchCurrentMediumItems();
/** Update actions according currently chosen medium-item. */
void updateActions();
/** Update tab icons according last @a action happened with @a pItem. */
/** Update information pane of passed medium @a type. */
/** Update information pane for hard-drive tab. */
void updateInformationPanesHD();
/** Update information pane for optical-disk tab. */
void updateInformationPanesCD();
/** Update information pane for floppy-disk tab. */
void updateInformationPanesFD();
/* Helpers: Cleanup stuff: */
#ifdef Q_WS_MAC
void cleanupMacWindowMenu();
#endif /* Q_WS_MAC */
void cleanup();
/* Handler: Translation stuff: */
void retranslateUi();
/** Creates UIMediumItem for corresponding @a medium. */
/** Updates UIMediumItem for corresponding @a medium. */
/** Deletes UIMediumItem for corresponding @a strMediumID. */
/* Helpers: Medium-modification stuff: */
/** Determines medium type for passed @a pTreeWidget. */
/** Returns current medium type. */
UIMediumType currentMediumType() const;
/** Returns tree-widget for passed medium @a type. */
/** Returns current tree-widget. */
QTreeWidget* currentTreeWidget() const;
/** Returns medium-item for passed medium @a type. */
/** Returns current medium-item. */
UIMediumItem* currentMediumItem() const;
/** Defines <i>current-item</i> for passed @a pTreeWidget as @a pItem. */
/* Helper: Other stuff: */
/** Casts passed QTreeWidgetItem @a pItem to UIMediumItem if possible. */
/* Static helper: Formatting stuff: */
static QString formatPaneText(const QString &strText, bool fCompact = true, const QString &strElipsis = "middle");
/* Static helper: Enumeration stuff: */
/* Variable: Singleton instance: */
static UIMediumManager *m_spInstance;
/* Variables: General stuff: */
bool m_fRefresh;
/* Variables: Tab-widget stuff: */
bool m_fInaccessibleHD;
bool m_fInaccessibleCD;
bool m_fInaccessibleFD;
/* Variables: Menu & Toolbar stuff: */
/* Variable: Progress-bar stuff: */
};
#endif /* __UIMediumManager_h__ */