1 | /** @file
|
---|
2 | *
|
---|
3 | * VirtualBox COM class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006 InnoTek Systemberatung 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 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef ____H_BIOSSETTINGS
|
---|
23 | #define ____H_BIOSSETTINGS
|
---|
24 |
|
---|
25 | #include "VirtualBoxBase.h"
|
---|
26 |
|
---|
27 | class Machine;
|
---|
28 |
|
---|
29 | class ATL_NO_VTABLE BIOSSettings :
|
---|
30 | public VirtualBoxSupportErrorInfoImpl <BIOSSettings, IBIOSSettings>,
|
---|
31 | public VirtualBoxSupportTranslation <BIOSSettings>,
|
---|
32 | public VirtualBoxBaseNEXT,
|
---|
33 | public IBIOSSettings
|
---|
34 | {
|
---|
35 | public:
|
---|
36 |
|
---|
37 | struct Data
|
---|
38 | {
|
---|
39 | Data()
|
---|
40 | {
|
---|
41 | mLogoFadeIn = true;
|
---|
42 | mLogoFadeOut = true;
|
---|
43 | mLogoDisplayTime = 0;
|
---|
44 | mBootMenuMode = BIOSBootMenuMode_MessageAndMenu;
|
---|
45 | mACPIEnabled = true;
|
---|
46 | mIOAPICEnabled = false;
|
---|
47 | mTimeOffset = 0;
|
---|
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 | 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 | LONG64 mTimeOffset;
|
---|
71 | };
|
---|
72 |
|
---|
73 | DECLARE_NOT_AGGREGATABLE(BIOSSettings)
|
---|
74 |
|
---|
75 | DECLARE_PROTECT_FINAL_CONSTRUCT()
|
---|
76 |
|
---|
77 | BEGIN_COM_MAP(BIOSSettings)
|
---|
78 | COM_INTERFACE_ENTRY(ISupportErrorInfo)
|
---|
79 | COM_INTERFACE_ENTRY(IBIOSSettings)
|
---|
80 | END_COM_MAP()
|
---|
81 |
|
---|
82 | NS_DECL_ISUPPORTS
|
---|
83 |
|
---|
84 | HRESULT FinalConstruct();
|
---|
85 | void FinalRelease();
|
---|
86 |
|
---|
87 | // public initializer/uninitializer for internal purposes only
|
---|
88 | HRESULT init (Machine *parent);
|
---|
89 | HRESULT init (Machine *parent, BIOSSettings *that);
|
---|
90 | HRESULT initCopy (Machine *parent, BIOSSettings *that);
|
---|
91 | void uninit();
|
---|
92 |
|
---|
93 | STDMETHOD(COMGETTER(LogoFadeIn))(BOOL *enabled);
|
---|
94 | STDMETHOD(COMSETTER(LogoFadeIn))(BOOL enable);
|
---|
95 | STDMETHOD(COMGETTER(LogoFadeOut))(BOOL *enabled);
|
---|
96 | STDMETHOD(COMSETTER(LogoFadeOut))(BOOL enable);
|
---|
97 | STDMETHOD(COMGETTER(LogoDisplayTime))(ULONG *displayTime);
|
---|
98 | STDMETHOD(COMSETTER(LogoDisplayTime))(ULONG displayTime);
|
---|
99 | STDMETHOD(COMGETTER(LogoImagePath))(BSTR *imagePath);
|
---|
100 | STDMETHOD(COMSETTER(LogoImagePath))(INPTR BSTR imagePath);
|
---|
101 | STDMETHOD(COMGETTER(BootMenuMode))(BIOSBootMenuMode_T *bootMenuMode);
|
---|
102 | STDMETHOD(COMSETTER(BootMenuMode))(BIOSBootMenuMode_T bootMenuMode);
|
---|
103 | STDMETHOD(COMGETTER(ACPIEnabled))(BOOL *enabled);
|
---|
104 | STDMETHOD(COMSETTER(ACPIEnabled))(BOOL enable);
|
---|
105 | STDMETHOD(COMGETTER(IOAPICEnabled))(BOOL *enabled);
|
---|
106 | STDMETHOD(COMSETTER(IOAPICEnabled))(BOOL enable);
|
---|
107 | STDMETHOD(COMGETTER)(TimeOffset)(LONG64 *offset);
|
---|
108 | STDMETHOD(COMSETTER)(TimeOffset)(LONG64 offset);
|
---|
109 |
|
---|
110 | // public methods only for internal purposes
|
---|
111 |
|
---|
112 | const Backupable <Data> &data() const { return mData; }
|
---|
113 |
|
---|
114 | bool isModified() { AutoLock alock (this); return mData.isBackedUp(); }
|
---|
115 | bool isReallyModified() { AutoLock alock (this); return mData.hasActualChanges(); }
|
---|
116 | void rollback() { AutoLock alock (this); mData.rollback(); }
|
---|
117 | void commit();
|
---|
118 | void copyFrom (BIOSSettings *aThat);
|
---|
119 |
|
---|
120 | // for VirtualBoxSupportErrorInfoImpl
|
---|
121 | static const wchar_t *getComponentName() { return L"BIOSSettings"; }
|
---|
122 |
|
---|
123 | private:
|
---|
124 |
|
---|
125 | ComObjPtr <Machine, ComWeakRef> mParent;
|
---|
126 | ComObjPtr <BIOSSettings> mPeer;
|
---|
127 | Backupable <Data> mData;
|
---|
128 | };
|
---|
129 |
|
---|
130 | #endif // ____H_BIOSSETTINGS
|
---|
131 |
|
---|