VirtualBox

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

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

Main/SystemProperties: new stubs for properties defining minimum free disk space for safe operation

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