VirtualBox

source: vbox/trunk/src/VBox/Main/include/SystemPropertiesImpl.h@ 28800

Last change on this file since 28800 was 28800, checked in by vboxsync, 15 years ago

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/* $Id: SystemPropertiesImpl.h 28800 2010-04-27 08:22:32Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2010 Oracle Corporation
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_SYSTEMPROPERTIESIMPL
21#define ____H_SYSTEMPROPERTIESIMPL
22
23#include "VirtualBoxBase.h"
24#include "MediumFormatImpl.h"
25
26#include <VBox/com/array.h>
27
28#include <list>
29
30namespace settings
31{
32 struct SystemProperties;
33}
34
35class ATL_NO_VTABLE SystemProperties :
36 public VirtualBoxBase,
37 public VirtualBoxSupportErrorInfoImpl<SystemProperties, ISystemProperties>,
38 public VirtualBoxSupportTranslation<SystemProperties>,
39 VBOX_SCRIPTABLE_IMPL(ISystemProperties)
40{
41public:
42
43 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (SystemProperties)
44
45 DECLARE_NOT_AGGREGATABLE(SystemProperties)
46
47 DECLARE_PROTECT_FINAL_CONSTRUCT()
48
49 BEGIN_COM_MAP(SystemProperties)
50 COM_INTERFACE_ENTRY (ISupportErrorInfo)
51 COM_INTERFACE_ENTRY (ISystemProperties)
52 COM_INTERFACE_ENTRY2 (IDispatch, ISystemProperties)
53 END_COM_MAP()
54
55 DECLARE_EMPTY_CTOR_DTOR (SystemProperties)
56
57 HRESULT FinalConstruct();
58 void FinalRelease();
59
60 // public initializer/uninitializer for internal purposes only
61 HRESULT init (VirtualBox *aParent);
62 void uninit();
63
64 // ISystemProperties properties
65 STDMETHOD(COMGETTER(MinGuestRAM) (ULONG *minRAM));
66 STDMETHOD(COMGETTER(MaxGuestRAM) (ULONG *maxRAM));
67 STDMETHOD(COMGETTER(MinGuestVRAM) (ULONG *minVRAM));
68 STDMETHOD(COMGETTER(MaxGuestVRAM) (ULONG *maxVRAM));
69 STDMETHOD(COMGETTER(MinGuestCPUCount) (ULONG *minCPUCount));
70 STDMETHOD(COMGETTER(MaxGuestCPUCount) (ULONG *maxCPUCount));
71 STDMETHOD(COMGETTER(MaxGuestMonitors) (ULONG *maxMonitors));
72 STDMETHOD(COMGETTER(MaxVDISize) (ULONG64 *maxVDISize));
73 STDMETHOD(COMGETTER(NetworkAdapterCount) (ULONG *count));
74 STDMETHOD(COMGETTER(SerialPortCount) (ULONG *count));
75 STDMETHOD(COMGETTER(ParallelPortCount) (ULONG *count));
76 STDMETHOD(COMGETTER(MaxBootPosition) (ULONG *aMaxBootPosition));
77 STDMETHOD(COMGETTER(DefaultMachineFolder)) (BSTR *aDefaultMachineFolder);
78 STDMETHOD(COMSETTER(DefaultMachineFolder)) (IN_BSTR aDefaultMachineFolder);
79 STDMETHOD(COMGETTER(DefaultHardDiskFolder)) (BSTR *aDefaultHardDiskFolder);
80 STDMETHOD(COMSETTER(DefaultHardDiskFolder)) (IN_BSTR aDefaultHardDiskFolder);
81 STDMETHOD(COMGETTER(MediumFormats)) (ComSafeArrayOut (IMediumFormat *, aMediumFormats));
82 STDMETHOD(COMGETTER(DefaultHardDiskFormat)) (BSTR *aDefaultHardDiskFormat);
83 STDMETHOD(COMSETTER(DefaultHardDiskFormat)) (IN_BSTR aDefaultHardDiskFormat);
84 STDMETHOD(COMGETTER(FreeDiskSpaceWarning))(ULONG64 *aFreeDiskSpace);
85 STDMETHOD(COMSETTER(FreeDiskSpaceWarning))(ULONG64 aFreeDiskSpace);
86 STDMETHOD(COMGETTER(FreeDiskSpacePercentWarning))(ULONG *aFreeDiskSpacePercent);
87 STDMETHOD(COMSETTER(FreeDiskSpacePercentWarning))(ULONG aFreeDiskSpacePercent);
88 STDMETHOD(COMGETTER(FreeDiskSpaceError))(ULONG64 *aFreeDiskSpace);
89 STDMETHOD(COMSETTER(FreeDiskSpaceError))(ULONG64 aFreeDiskSpace);
90 STDMETHOD(COMGETTER(FreeDiskSpacePercentError))(ULONG *aFreeDiskSpacePercent);
91 STDMETHOD(COMSETTER(FreeDiskSpacePercentError))(ULONG aFreeDiskSpacePercent);
92 STDMETHOD(COMGETTER(RemoteDisplayAuthLibrary)) (BSTR *aRemoteDisplayAuthLibrary);
93 STDMETHOD(COMSETTER(RemoteDisplayAuthLibrary)) (IN_BSTR aRemoteDisplayAuthLibrary);
94 STDMETHOD(COMGETTER(WebServiceAuthLibrary)) (BSTR *aWebServiceAuthLibrary);
95 STDMETHOD(COMSETTER(WebServiceAuthLibrary)) (IN_BSTR aWebServiceAuthLibrary);
96 STDMETHOD(COMGETTER(LogHistoryCount)) (ULONG *count);
97 STDMETHOD(COMSETTER(LogHistoryCount)) (ULONG count);
98 STDMETHOD(COMGETTER(DefaultAudioDriver)) (AudioDriverType_T *aAudioDriver);
99
100 STDMETHOD(GetMaxDevicesPerPortForStorageBus) (StorageBus_T aBus, ULONG *aMaxDevicesPerPort);
101 STDMETHOD(GetMinPortCountForStorageBus) (StorageBus_T aBus, ULONG *aMinPortCount);
102 STDMETHOD(GetMaxPortCountForStorageBus) (StorageBus_T aBus, ULONG *aMaxPortCount);
103 STDMETHOD(GetMaxInstancesOfStorageBus)(StorageBus_T aBus, ULONG *aMaxInstances);
104 STDMETHOD(GetDeviceTypesForStorageBus)(StorageBus_T aBus, ComSafeArrayOut(DeviceType_T, aDeviceTypes));
105
106 // public methods only for internal purposes
107
108 HRESULT loadSettings(const settings::SystemProperties &data);
109 HRESULT saveSettings(settings::SystemProperties &data);
110
111 ComObjPtr<MediumFormat> mediumFormat(CBSTR aFormat);
112
113 // public methods for internal purposes only
114 // (ensure there is a caller and a read lock before calling them!)
115
116 // for VirtualBoxSupportErrorInfoImpl
117 static const wchar_t *getComponentName() { return L"SystemProperties"; }
118
119private:
120
121 typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
122
123 HRESULT setDefaultMachineFolder(const Utf8Str &aPath);
124 HRESULT setDefaultHardDiskFolder(const Utf8Str &aPath);
125 HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat);
126
127 HRESULT setRemoteDisplayAuthLibrary(const Utf8Str &aPath);
128 HRESULT setWebServiceAuthLibrary(const Utf8Str &aPath);
129
130 VirtualBox * const mParent;
131
132 Utf8Str m_strDefaultMachineFolder;
133 Utf8Str m_strDefaultMachineFolderFull;
134 Utf8Str m_strDefaultHardDiskFolder;
135 Utf8Str m_strDefaultHardDiskFolderFull;
136 Utf8Str m_strDefaultHardDiskFormat;
137
138 MediumFormatList mMediumFormats;
139
140 Utf8Str m_strRemoteDisplayAuthLibrary;
141 Utf8Str m_strWebServiceAuthLibrary;
142 ULONG mLogHistoryCount;
143 AudioDriverType_T mDefaultAudioDriver;
144
145 friend class VirtualBox;
146};
147
148#endif // ____H_SYSTEMPROPERTIESIMPL
149/* 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