VirtualBox

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

Last change on this file since 14949 was 14949, checked in by vboxsync, 16 years ago

Appended vim modeline to set tabstop and expand tabs (in the way
suggested by our coding guidelines).

  • Property svn:eol-style set to native
File size: 5.3 KB
Line 
1/* $Id$ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_BIOSSETTINGS
25#define ____H_BIOSSETTINGS
26
27#include "VirtualBoxBase.h"
28
29class Machine;
30class GuestOSType;
31
32class ATL_NO_VTABLE BIOSSettings :
33 public VirtualBoxSupportErrorInfoImpl <BIOSSettings, IBIOSSettings>,
34 public VirtualBoxSupportTranslation <BIOSSettings>,
35 public VirtualBoxBaseNEXT,
36 public IBIOSSettings
37{
38public:
39
40 struct Data
41 {
42 Data()
43 {
44 mLogoFadeIn = true;
45 mLogoFadeOut = true;
46 mLogoDisplayTime = 0;
47 mBootMenuMode = BIOSBootMenuMode_MessageAndMenu;
48 mACPIEnabled = true;
49 mIOAPICEnabled = false;
50 mPXEDebugEnabled = false;
51 mTimeOffset = 0;
52 mIDEControllerType = IDEControllerType_PIIX4;
53 }
54
55 bool operator== (const Data &that) const
56 {
57 return this == &that ||
58 (mLogoFadeIn == that.mLogoFadeIn &&
59 mLogoFadeOut == that.mLogoFadeOut &&
60 mLogoDisplayTime == that.mLogoDisplayTime &&
61 mLogoImagePath == that.mLogoImagePath &&
62 mBootMenuMode == that.mBootMenuMode &&
63 mACPIEnabled == that.mACPIEnabled &&
64 mIOAPICEnabled == that.mIOAPICEnabled &&
65 mPXEDebugEnabled == that.mPXEDebugEnabled &&
66 mIDEControllerType == that.mIDEControllerType &&
67 mTimeOffset == that.mTimeOffset);
68 }
69
70 BOOL mLogoFadeIn;
71 BOOL mLogoFadeOut;
72 ULONG mLogoDisplayTime;
73 Bstr mLogoImagePath;
74 BIOSBootMenuMode_T mBootMenuMode;
75 BOOL mACPIEnabled;
76 BOOL mIOAPICEnabled;
77 BOOL mPXEDebugEnabled;
78 LONG64 mTimeOffset;
79 IDEControllerType_T mIDEControllerType;
80 };
81
82 DECLARE_NOT_AGGREGATABLE(BIOSSettings)
83
84 DECLARE_PROTECT_FINAL_CONSTRUCT()
85
86 BEGIN_COM_MAP(BIOSSettings)
87 COM_INTERFACE_ENTRY(ISupportErrorInfo)
88 COM_INTERFACE_ENTRY(IBIOSSettings)
89 END_COM_MAP()
90
91 NS_DECL_ISUPPORTS
92
93 HRESULT FinalConstruct();
94 void FinalRelease();
95
96 // public initializer/uninitializer for internal purposes only
97 HRESULT init (Machine *parent);
98 HRESULT init (Machine *parent, BIOSSettings *that);
99 HRESULT initCopy (Machine *parent, BIOSSettings *that);
100 void uninit();
101
102 STDMETHOD(COMGETTER(LogoFadeIn))(BOOL *enabled);
103 STDMETHOD(COMSETTER(LogoFadeIn))(BOOL enable);
104 STDMETHOD(COMGETTER(LogoFadeOut))(BOOL *enabled);
105 STDMETHOD(COMSETTER(LogoFadeOut))(BOOL enable);
106 STDMETHOD(COMGETTER(LogoDisplayTime))(ULONG *displayTime);
107 STDMETHOD(COMSETTER(LogoDisplayTime))(ULONG displayTime);
108 STDMETHOD(COMGETTER(LogoImagePath))(BSTR *imagePath);
109 STDMETHOD(COMSETTER(LogoImagePath))(INPTR BSTR imagePath);
110 STDMETHOD(COMGETTER(BootMenuMode))(BIOSBootMenuMode_T *bootMenuMode);
111 STDMETHOD(COMSETTER(BootMenuMode))(BIOSBootMenuMode_T bootMenuMode);
112 STDMETHOD(COMGETTER(ACPIEnabled))(BOOL *enabled);
113 STDMETHOD(COMSETTER(ACPIEnabled))(BOOL enable);
114 STDMETHOD(COMGETTER(IOAPICEnabled))(BOOL *enabled);
115 STDMETHOD(COMSETTER(IOAPICEnabled))(BOOL enable);
116 STDMETHOD(COMGETTER(PXEDebugEnabled))(BOOL *enabled);
117 STDMETHOD(COMSETTER(PXEDebugEnabled))(BOOL enable);
118 STDMETHOD(COMGETTER(IDEControllerType))(IDEControllerType_T *controllerType);
119 STDMETHOD(COMSETTER(IDEControllerType))(IDEControllerType_T controllerType);
120 STDMETHOD(COMGETTER)(TimeOffset)(LONG64 *offset);
121 STDMETHOD(COMSETTER)(TimeOffset)(LONG64 offset);
122
123 // public methods only for internal purposes
124
125 HRESULT loadSettings (const settings::Key &aMachineNode);
126 HRESULT saveSettings (settings::Key &aMachineNode);
127
128 const Backupable <Data> &data() const { return mData; }
129
130 bool isModified() { AutoWriteLock alock (this); return mData.isBackedUp(); }
131 bool isReallyModified() { AutoWriteLock alock (this); return mData.hasActualChanges(); }
132 void rollback() { AutoWriteLock alock (this); mData.rollback(); }
133 void commit();
134 void copyFrom (BIOSSettings *aThat);
135 void applyDefaults (GuestOSType *aOsType);
136
137 // for VirtualBoxSupportErrorInfoImpl
138 static const wchar_t *getComponentName() { return L"BIOSSettings"; }
139
140private:
141
142 ComObjPtr <Machine, ComWeakRef> mParent;
143 ComObjPtr <BIOSSettings> mPeer;
144 Backupable <Data> mData;
145};
146
147#endif // ____H_BIOSSETTINGS
148
149/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette