VirtualBox

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

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

Main: Rework storage controller handling to allow an arbitrary number of different storage controllers and remove code duplication:

  • XML format changed
  • New StorageController class
  • Removed SATAController (obsolete)
  • Removed the IDE controller code from BIOSSettings, handled in StorageController now
  • 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 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 }
53
54 bool operator== (const Data &that) const
55 {
56 return this == &that ||
57 (mLogoFadeIn == that.mLogoFadeIn &&
58 mLogoFadeOut == that.mLogoFadeOut &&
59 mLogoDisplayTime == that.mLogoDisplayTime &&
60 mLogoImagePath == that.mLogoImagePath &&
61 mBootMenuMode == that.mBootMenuMode &&
62 mACPIEnabled == that.mACPIEnabled &&
63 mIOAPICEnabled == that.mIOAPICEnabled &&
64 mPXEDebugEnabled == that.mPXEDebugEnabled &&
65 mTimeOffset == that.mTimeOffset);
66 }
67
68 BOOL mLogoFadeIn;
69 BOOL mLogoFadeOut;
70 ULONG mLogoDisplayTime;
71 Bstr mLogoImagePath;
72 BIOSBootMenuMode_T mBootMenuMode;
73 BOOL mACPIEnabled;
74 BOOL mIOAPICEnabled;
75 BOOL mPXEDebugEnabled;
76 LONG64 mTimeOffset;
77 };
78
79 DECLARE_NOT_AGGREGATABLE(BIOSSettings)
80
81 DECLARE_PROTECT_FINAL_CONSTRUCT()
82
83 BEGIN_COM_MAP(BIOSSettings)
84 COM_INTERFACE_ENTRY(ISupportErrorInfo)
85 COM_INTERFACE_ENTRY(IBIOSSettings)
86 END_COM_MAP()
87
88 NS_DECL_ISUPPORTS
89
90 HRESULT FinalConstruct();
91 void FinalRelease();
92
93 // public initializer/uninitializer for internal purposes only
94 HRESULT init (Machine *parent);
95 HRESULT init (Machine *parent, BIOSSettings *that);
96 HRESULT initCopy (Machine *parent, BIOSSettings *that);
97 void uninit();
98
99 STDMETHOD(COMGETTER(LogoFadeIn))(BOOL *enabled);
100 STDMETHOD(COMSETTER(LogoFadeIn))(BOOL enable);
101 STDMETHOD(COMGETTER(LogoFadeOut))(BOOL *enabled);
102 STDMETHOD(COMSETTER(LogoFadeOut))(BOOL enable);
103 STDMETHOD(COMGETTER(LogoDisplayTime))(ULONG *displayTime);
104 STDMETHOD(COMSETTER(LogoDisplayTime))(ULONG displayTime);
105 STDMETHOD(COMGETTER(LogoImagePath))(BSTR *imagePath);
106 STDMETHOD(COMSETTER(LogoImagePath))(IN_BSTR imagePath);
107 STDMETHOD(COMGETTER(BootMenuMode))(BIOSBootMenuMode_T *bootMenuMode);
108 STDMETHOD(COMSETTER(BootMenuMode))(BIOSBootMenuMode_T bootMenuMode);
109 STDMETHOD(COMGETTER(ACPIEnabled))(BOOL *enabled);
110 STDMETHOD(COMSETTER(ACPIEnabled))(BOOL enable);
111 STDMETHOD(COMGETTER(IOAPICEnabled))(BOOL *enabled);
112 STDMETHOD(COMSETTER(IOAPICEnabled))(BOOL enable);
113 STDMETHOD(COMGETTER(PXEDebugEnabled))(BOOL *enabled);
114 STDMETHOD(COMSETTER(PXEDebugEnabled))(BOOL enable);
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() { AutoWriteLock alock (this); return mData.isBackedUp(); }
126 bool isReallyModified() { AutoWriteLock alock (this); return mData.hasActualChanges(); }
127 void rollback() { AutoWriteLock alock (this); mData.rollback(); }
128 void commit();
129 void copyFrom (BIOSSettings *aThat);
130 void applyDefaults (GuestOSType *aOsType);
131
132 // for VirtualBoxSupportErrorInfoImpl
133 static const wchar_t *getComponentName() { return L"BIOSSettings"; }
134
135private:
136
137 ComObjPtr <Machine, ComWeakRef> mParent;
138 ComObjPtr <BIOSSettings> mPeer;
139 Backupable <Data> mData;
140};
141
142#endif // ____H_BIOSSETTINGS
143
144/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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