UIMediumManager.h revision 65ba0abe3ecfd47b318d49a3c37a9b48d1f6904e
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * VBox frontends: Qt4 GUI ("VirtualBox"):
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * UIMediumManager class declaration
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2012 Oracle Corporation
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * available from http://www.virtualbox.org. This file is free software;
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * you can redistribute it and/or modify it under the terms of the GNU
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * General Public License (GPL) as published by the Free Software
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync/* GUI includes: */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync/* COM includes: */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync/* Forward declarations: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync/* Medium Manager Dialog: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsyncclass UIMediumManager : public QIWithRetranslateUI2<QIMainDialog>, public Ui::UIMediumManager
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Enumerators: */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync enum ItemAction { ItemAction_Added, ItemAction_Updated, ItemAction_Removed };
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync enum Action { Action_Edit, Action_Copy, Action_Modify, Action_Remove, Action_Release };
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync UIMediumManager(QWidget *pCenterWidget, bool fRefresh = true);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Static API: Singleton stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync static void showModeless(QWidget *pCenterWidget, bool fRefresh = true);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handler: Refresh stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handlers: Medium-processing stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleMediumUpdated(const UIMedium &medium);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleMediumRemoved(UIMediumType type, const QString &strId);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handlers: Medium-enumeration stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleMediumEnumerated(const UIMedium &medium);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handlers: Medium-modification stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handlers: Navigation stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleCurrentItemChanged(QTreeWidgetItem *pItem, QTreeWidgetItem *pPrevItem = 0);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleContextMenuCall(const QPoint &position);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handler: Machine stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void sltHandleMachineStateChanged(QString strId, KMachineState state);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handlers: Geometry stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Helpers: Prepare stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#endif /* Q_WS_MAC */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Helper: Populate stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Helpers: Cleanup stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync#endif /* Q_WS_MAC */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Handler: Translation stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Helper: Medium-modification stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool releaseMediumFrom(const UIMedium &medium, const QString &strMachineId);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool releaseHardDiskFrom(const UIMedium &medium, CMachine &machine);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool releaseOpticalDiskFrom(const UIMedium &medium, CMachine &machine);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool releaseFloppyDiskFrom(const UIMedium &medium, CMachine &machine);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Internal API: Tree-widget access stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync UIMediumItem* toMediumItem(QTreeWidgetItem *aItem) const;
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void setCurrentItem(QTreeWidget *pTree, QTreeWidgetItem *pItem);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync UIMediumItem* createHardDiskItem (QTreeWidget *aTree, const UIMedium &aMedium) const;
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync void updateTabIcons (UIMediumItem *aItem, ItemAction aAction);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync UIMediumItem* searchItem (QTreeWidget *aTree, const QString &aId) const;
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync bool checkMediumFor (UIMediumItem *aItem, Action aAction);
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync QString formatPaneText (const QString &aText, bool aCompact = true, const QString &aElipsis = "middle");
cf575292da27c79a7de59f7ced500686a0838b38vboxsync /* Helper: Enumeration stuff: */
cf575292da27c79a7de59f7ced500686a0838b38vboxsync static bool isMediumAttachedToHiddenMachinesOnly(const UIMedium &medium);
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Variable: Singleton instance: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Variables: General stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Variables: Tab-widget stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Variables: Menu & Toolbar stuff: */
26ab5559e05ae622734a4047cee975670da3b0e8vboxsync /* Variable: Progress-bar stuff: */
8230e6f6671b538d39c7ef6d8484cf516a983ef4vboxsync#endif /* __UIMediumManager_h__ */