VirtualBox

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

Last change on this file since 5713 was 5388, checked in by vboxsync, 17 years ago

Main: BIOSSettings: Don't forget to update Data::operator== when adding new fields.

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