UIMachineWindowNormal.h revision cae5cca5168e18e168df5541b11f462b60062a7a
b341a780162d809b187a8f35a10bba7642b69798vboxsync/** @file
b341a780162d809b187a8f35a10bba7642b69798vboxsync *
b341a780162d809b187a8f35a10bba7642b69798vboxsync * VBox frontends: Qt GUI ("VirtualBox"):
b341a780162d809b187a8f35a10bba7642b69798vboxsync * UIMachineWindowNormal class declaration
b341a780162d809b187a8f35a10bba7642b69798vboxsync */
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync/*
b341a780162d809b187a8f35a10bba7642b69798vboxsync * Copyright (C) 2010 Sun Microsystems, Inc.
b341a780162d809b187a8f35a10bba7642b69798vboxsync *
b341a780162d809b187a8f35a10bba7642b69798vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b341a780162d809b187a8f35a10bba7642b69798vboxsync * available from http://www.virtualbox.org. This file is free software;
b341a780162d809b187a8f35a10bba7642b69798vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b341a780162d809b187a8f35a10bba7642b69798vboxsync * General Public License (GPL) as published by the Free Software
b341a780162d809b187a8f35a10bba7642b69798vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b341a780162d809b187a8f35a10bba7642b69798vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b341a780162d809b187a8f35a10bba7642b69798vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b341a780162d809b187a8f35a10bba7642b69798vboxsync *
b341a780162d809b187a8f35a10bba7642b69798vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
b341a780162d809b187a8f35a10bba7642b69798vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
b341a780162d809b187a8f35a10bba7642b69798vboxsync * additional information or have any questions.
b341a780162d809b187a8f35a10bba7642b69798vboxsync */
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync#ifndef __UIMachineWindowNormal_h__
b341a780162d809b187a8f35a10bba7642b69798vboxsync#define __UIMachineWindowNormal_h__
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync/* Global includes */
b341a780162d809b187a8f35a10bba7642b69798vboxsync#include <QLabel>
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync/* Local includes */
b341a780162d809b187a8f35a10bba7642b69798vboxsync#include "VBoxDefs.h"
b341a780162d809b187a8f35a10bba7642b69798vboxsync#include "QIWithRetranslateUI.h"
b341a780162d809b187a8f35a10bba7642b69798vboxsync#include "QIMainDialog.h"
b341a780162d809b187a8f35a10bba7642b69798vboxsync#include "UIMachineWindow.h"
b341a780162d809b187a8f35a10bba7642b69798vboxsync#ifdef Q_WS_X11
b341a780162d809b187a8f35a10bba7642b69798vboxsync# include <X11/Xlib.h>
b341a780162d809b187a8f35a10bba7642b69798vboxsync#endif
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync/* Local forwards */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsyncclass CMediumAttachment;
b341a780162d809b187a8f35a10bba7642b69798vboxsyncclass UIIndicatorsPool;
b341a780162d809b187a8f35a10bba7642b69798vboxsyncclass QIStateIndicator;
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsyncclass UIMachineWindowNormal : public QIWithRetranslateUI<QIMainDialog>, public UIMachineWindow
b341a780162d809b187a8f35a10bba7642b69798vboxsync{
b341a780162d809b187a8f35a10bba7642b69798vboxsync Q_OBJECT;
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsyncprotected:
b341a780162d809b187a8f35a10bba7642b69798vboxsync
9f801b83895937ce4d726206e5859637ff9f5166vboxsync /* Normal machine window constructor/destructor: */
cae5cca5168e18e168df5541b11f462b60062a7avboxsync UIMachineWindowNormal(UIMachineLogic *pMachineLogic, ulong uScreenId);
b341a780162d809b187a8f35a10bba7642b69798vboxsync virtual ~UIMachineWindowNormal();
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsyncprivate slots:
b341a780162d809b187a8f35a10bba7642b69798vboxsync
9f801b83895937ce4d726206e5859637ff9f5166vboxsync /* Console callback handlers: */
0de1998ac52682bb5322df476e45f237265ea9b7vboxsync void sltMachineStateChanged();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sltMediumChange(const CMediumAttachment &attachment);
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sltUSBControllerChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sltUSBDeviceStateChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sltNetworkAdapterChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void sltSharedFolderChange();
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync
9f801b83895937ce4d726206e5859637ff9f5166vboxsync /* LED connections: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync void sltUpdateIndicators();
b341a780162d809b187a8f35a10bba7642b69798vboxsync void sltShowIndicatorsContextMenu(QIStateIndicator *pIndicator, QContextMenuEvent *pEvent);
b341a780162d809b187a8f35a10bba7642b69798vboxsync void sltProcessGlobalSettingChange(const char *aPublicName, const char *aName);
b341a780162d809b187a8f35a10bba7642b69798vboxsync
9f801b83895937ce4d726206e5859637ff9f5166vboxsync /* Close window reimplementation: */
9f801b83895937ce4d726206e5859637ff9f5166vboxsync void sltTryClose();
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsyncprivate:
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Translate routine: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync void retranslateUi();
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Update routines: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync void updateAppearanceOf(int aElement);
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Event handlers: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync bool event(QEvent *pEvent);
b341a780162d809b187a8f35a10bba7642b69798vboxsync#ifdef Q_WS_X11
b341a780162d809b187a8f35a10bba7642b69798vboxsync bool x11Event(XEvent *pEvent);
b341a780162d809b187a8f35a10bba7642b69798vboxsync#endif
9594b281c609c06ce1e08d06be2e74026b363062vboxsync void closeEvent(QCloseEvent *pEvent);
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Private getters: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync UIIndicatorsPool* indicatorsPool() { return m_pIndicatorsPool; }
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Prepare helpers: */
085bc29163eb87e345acaae02789e4c233d51f3bvboxsync void prepareConsoleConnections();
b341a780162d809b187a8f35a10bba7642b69798vboxsync void prepareMenu();
b341a780162d809b187a8f35a10bba7642b69798vboxsync void prepareStatusBar();
b341a780162d809b187a8f35a10bba7642b69798vboxsync void prepareConnections();
9f801b83895937ce4d726206e5859637ff9f5166vboxsync void prepareMachineView();
8b048c9203f6823d1a06b0235c7c3cb633c6e3a5vboxsync void loadWindowSettings();
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Cleanup helpers: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync void saveWindowSettings();
8b048c9203f6823d1a06b0235c7c3cb633c6e3a5vboxsync void cleanupMachineView();
499be9a0008af6b44433986c7002727ac06513a9vboxsync //void cleanupConnections() {}
b341a780162d809b187a8f35a10bba7642b69798vboxsync void cleanupStatusBar();
499be9a0008af6b44433986c7002727ac06513a9vboxsync //void cleanupMenu() {}
499be9a0008af6b44433986c7002727ac06513a9vboxsync //void cleanupConsoleConnections() {}
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Indicators pool: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync UIIndicatorsPool *m_pIndicatorsPool;
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Other QWidgets: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync QWidget *m_pCntHostkey;
b341a780162d809b187a8f35a10bba7642b69798vboxsync QLabel *m_pNameHostkey;
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Other QObjects: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync QTimer *m_pIdleTimer;
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Other members: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync QRect m_normalGeometry;
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync /* Factory support: */
b341a780162d809b187a8f35a10bba7642b69798vboxsync friend class UIMachineWindow;
b341a780162d809b187a8f35a10bba7642b69798vboxsync};
b341a780162d809b187a8f35a10bba7642b69798vboxsync
b341a780162d809b187a8f35a10bba7642b69798vboxsync#endif // __UIMachineWindowNormal_h__
3488e51e244adfc756837287fbfbcc03eca8bf7avboxsync