VirtualBox

source: vbox/trunk/src/VBox/Main/include/BIOSSettingsImpl.h@ 7829

Last change on this file since 7829 was 7207, checked in by vboxsync, 17 years ago

Main: Reworked enums to avoid 1) weird duplication of enum name when referring to enum values in cross-platform code; 2) possible clashes on Win32 due to putting identifiers like Paused or Disabled to the global namespace (via C enums). In the new style, enums are used like this: a) USBDeviceState_T v = USBDeviceState_Busy from cross-platform non-Qt code; b) KUSBDeviceState v = KUSBDeviceState_Busy from Qt code; c) USBDeviceState v = USBDeviceState_Busy from plain Win32 and d) PRUInt32 USBDeviceState v = USBDeviceState::Busy from plain XPCOM.

  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1/* $Id$ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2007 innotek GmbH
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19
20#ifndef ____H_BIOSSETTINGS
21#define ____H_BIOSSETTINGS
22
23#include "VirtualBoxBase.h"
24
25class Machine;
26
27class ATL_NO_VTABLE BIOSSettings :
28 public VirtualBoxSupportErrorInfoImpl <BIOSSettings, IBIOSSettings>,
29 public VirtualBoxSupportTranslation <BIOSSettings>,
30 public VirtualBoxBaseNEXT,
31 public IBIOSSettings
32{
33public:
34
35 struct Data
36 {
37 Data()
38 {
39 mLogoFadeIn = true;
40 mLogoFadeOut = true;
41 mLogoDisplayTime = 0;
42 mBootMenuMode = BIOSBootMenuMode_MessageAndMenu;
43 mACPIEnabled = true;
44 mIOAPICEnabled = false;
45 mPXEDebugEnabled = false;
46 mTimeOffset = 0;
47 mIDEControllerType = IDEControllerType_PIIX4;
48 }
49
50 bool operator== (const Data &that) const
51 {
52 return this == &that ||
53 (mLogoFadeIn == that.mLogoFadeIn &&
54 mLogoFadeOut == that.mLogoFadeOut &&
55 mLogoDisplayTime == that.mLogoDisplayTime &&
56 mLogoImagePath == that.mLogoImagePath &&
57 mBootMenuMode == that.mBootMenuMode &&
58 mACPIEnabled == that.mACPIEnabled &&
59 mIOAPICEnabled == that.mIOAPICEnabled &&
60 mPXEDebugEnabled == that.mPXEDebugEnabled &&
61 mIDEControllerType == that.mIDEControllerType &&
62 mTimeOffset == that.mTimeOffset);
63 }
64
65 BOOL mLogoFadeIn;
66 BOOL mLogoFadeOut;
67 ULONG mLogoDisplayTime;
68 Bstr mLogoImagePath;
69 BIOSBootMenuMode_T mBootMenuMode;
70 BOOL mACPIEnabled;
71 BOOL mIOAPICEnabled;
72 BOOL mPXEDebugEnabled;
73 LONG64 mTimeOffset;
74 IDEControllerType_T mIDEControllerType;
75 };
76
77 DECLARE_NOT_AGGREGATABLE(BIOSSettings)
78
79 DECLARE_PROTECT_FINAL_CONSTRUCT()
80
81 BEGIN_COM_MAP(BIOSSettings)
82 COM_INTERFACE_ENTRY(ISupportErrorInfo)
83 COM_INTERFACE_ENTRY(IBIOSSettings)
84 END_COM_MAP()
85
86 NS_DECL_ISUPPORTS
87
88 HRESULT FinalConstruct();
89 void FinalRelease();
90
91 // public initializer/uninitializer for internal purposes only
92 HRESULT init (Machine *parent);
93 HRESULT init (Machine *parent, BIOSSettings *that);
94 HRESULT initCopy (Machine *parent, BIOSSettings *that);
95 void uninit();
96
97 STDMETHOD(COMGETTER(LogoFadeIn))(BOOL *enabled);
98 STDMETHOD(COMSETTER(LogoFadeIn))(BOOL enable);
99 STDMETHOD(COMGETTER(LogoFadeOut))(BOOL *enabled);
100 STDMETHOD(COMSETTER(LogoFadeOut))(BOOL enable);
101 STDMETHOD(COMGETTER(LogoDisplayTime))(ULONG *displayTime);
102 STDMETHOD(COMSETTER(LogoDisplayTime))(ULONG displayTime);
103 STDMETHOD(COMGETTER(LogoImagePath))(BSTR *imagePath);
104 STDMETHOD(COMSETTER(LogoImagePath))(INPTR BSTR imagePath);
105 STDMETHOD(COMGETTER(BootMenuMode))(BIOSBootMenuMode_T *bootMenuMode);
106 STDMETHOD(COMSETTER(BootMenuMode))(BIOSBootMenuMode_T bootMenuMode);
107 STDMETHOD(COMGETTER(ACPIEnabled))(BOOL *enabled);
108 STDMETHOD(COMSETTER(ACPIEnabled))(BOOL enable);
109 STDMETHOD(COMGETTER(IOAPICEnabled))(BOOL *enabled);
110 STDMETHOD(COMSETTER(IOAPICEnabled))(BOOL enable);
111 STDMETHOD(COMGETTER(PXEDebugEnabled))(BOOL *enabled);
112 STDMETHOD(COMSETTER(PXEDebugEnabled))(BOOL enable);
113 STDMETHOD(COMGETTER(IDEControllerType))(IDEControllerType_T *controllerType);
114 STDMETHOD(COMSETTER(IDEControllerType))(IDEControllerType_T controllerType);
115 STDMETHOD(COMGETTER)(TimeOffset)(LONG64 *offset);
116 STDMETHOD(COMSETTER)(TimeOffset)(LONG64 offset);
117
118 // public methods only for internal purposes
119
120 HRESULT loadSettings (const settings::Key &aMachineNode);
121 HRESULT saveSettings (settings::Key &aMachineNode);
122
123 const Backupable <Data> &data() const { return mData; }
124
125 bool isModified() { AutoLock alock (this); return mData.isBackedUp(); }
126 bool isReallyModified() { AutoLock alock (this); return mData.hasActualChanges(); }
127 void rollback() { AutoLock alock (this); mData.rollback(); }
128 void commit();
129 void copyFrom (BIOSSettings *aThat);
130
131 // for VirtualBoxSupportErrorInfoImpl
132 static const wchar_t *getComponentName() { return L"BIOSSettings"; }
133
134private:
135
136 ComObjPtr <Machine, ComWeakRef> mParent;
137 ComObjPtr <BIOSSettings> mPeer;
138 Backupable <Data> mData;
139};
140
141#endif // ____H_BIOSSETTINGS
142
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