VirtualBox

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

Last change on this file since 30714 was 30714, checked in by vboxsync, 14 years ago

Main: remove SupportErrorInfo template magic

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