VirtualBox

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

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

Main: fix more windows warnings + burns

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1/* $Id: SystemPropertiesImpl.h 22183 2009-08-11 17:00:33Z vboxsync $ */
2
3/** @file
4 *
5 * VirtualBox COM class implementation
6 */
7
8/*
9 * Copyright (C) 2006-2008 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 "HardDiskFormatImpl.h"
29
30#include <VBox/com/array.h>
31
32#include <list>
33
34class VirtualBox;
35namespace settings
36{
37 struct SystemProperties;
38}
39
40class ATL_NO_VTABLE SystemProperties :
41 public VirtualBoxBase,
42 public VirtualBoxSupportErrorInfoImpl<SystemProperties, ISystemProperties>,
43 public VirtualBoxSupportTranslation<SystemProperties>,
44 VBOX_SCRIPTABLE_IMPL(ISystemProperties)
45{
46public:
47
48 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (SystemProperties)
49
50 DECLARE_NOT_AGGREGATABLE(SystemProperties)
51
52 DECLARE_PROTECT_FINAL_CONSTRUCT()
53
54 BEGIN_COM_MAP(SystemProperties)
55 COM_INTERFACE_ENTRY (ISupportErrorInfo)
56 COM_INTERFACE_ENTRY (ISystemProperties)
57 COM_INTERFACE_ENTRY2 (IDispatch, ISystemProperties)
58 END_COM_MAP()
59
60 NS_DECL_ISUPPORTS
61
62 DECLARE_EMPTY_CTOR_DTOR (SystemProperties)
63
64 HRESULT FinalConstruct();
65 void FinalRelease();
66
67 // public initializer/uninitializer for internal purposes only
68 HRESULT init (VirtualBox *aParent);
69 void uninit();
70
71 // ISystemProperties properties
72 STDMETHOD(COMGETTER(MinGuestRAM) (ULONG *minRAM));
73 STDMETHOD(COMGETTER(MaxGuestRAM) (ULONG *maxRAM));
74 STDMETHOD(COMGETTER(MinGuestVRAM) (ULONG *minVRAM));
75 STDMETHOD(COMGETTER(MaxGuestVRAM) (ULONG *maxVRAM));
76 STDMETHOD(COMGETTER(MinGuestCPUCount) (ULONG *minCPUCount));
77 STDMETHOD(COMGETTER(MaxGuestCPUCount) (ULONG *maxCPUCount));
78 STDMETHOD(COMGETTER(MaxGuestMonitors) (ULONG *maxMonitors));
79 STDMETHOD(COMGETTER(MaxVDISize) (ULONG64 *maxVDISize));
80 STDMETHOD(COMGETTER(NetworkAdapterCount) (ULONG *count));
81 STDMETHOD(COMGETTER(SerialPortCount) (ULONG *count));
82 STDMETHOD(COMGETTER(ParallelPortCount) (ULONG *count));
83 STDMETHOD(COMGETTER(MaxBootPosition) (ULONG *aMaxBootPosition));
84 STDMETHOD(COMGETTER(DefaultMachineFolder)) (BSTR *aDefaultMachineFolder);
85 STDMETHOD(COMSETTER(DefaultMachineFolder)) (IN_BSTR aDefaultMachineFolder);
86 STDMETHOD(COMGETTER(DefaultHardDiskFolder)) (BSTR *aDefaultHardDiskFolder);
87 STDMETHOD(COMSETTER(DefaultHardDiskFolder)) (IN_BSTR aDefaultHardDiskFolder);
88 STDMETHOD(COMGETTER(HardDiskFormats)) (ComSafeArrayOut (IHardDiskFormat *, aHardDiskFormats));
89 STDMETHOD(COMGETTER(DefaultHardDiskFormat)) (BSTR *aDefaultHardDiskFolder);
90 STDMETHOD(COMSETTER(DefaultHardDiskFormat)) (IN_BSTR aDefaultHardDiskFolder);
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 // public methods only for internal purposes
100
101 HRESULT loadSettings(const settings::SystemProperties &data);
102 HRESULT saveSettings(settings::SystemProperties &data);
103
104 ComObjPtr<HardDiskFormat> hardDiskFormat(CBSTR aFormat);
105
106 // public methods for internal purposes only
107 // (ensure there is a caller and a read lock before calling them!)
108
109 // for VirtualBoxSupportErrorInfoImpl
110 static const wchar_t *getComponentName() { return L"SystemProperties"; }
111
112private:
113
114 typedef std::list< ComObjPtr<HardDiskFormat> > HardDiskFormatList;
115
116 HRESULT setDefaultMachineFolder(const Utf8Str &aPath);
117 HRESULT setDefaultHardDiskFolder(const Utf8Str &aPath);
118 HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat);
119
120 HRESULT setRemoteDisplayAuthLibrary(const Utf8Str &aPath);
121 HRESULT setWebServiceAuthLibrary(const Utf8Str &aPath);
122
123 const ComObjPtr<VirtualBox, ComWeakRef> mParent;
124
125 Utf8Str m_strDefaultMachineFolder;
126 Utf8Str m_strDefaultMachineFolderFull;
127 Utf8Str m_strDefaultHardDiskFolder;
128 Utf8Str m_strDefaultHardDiskFolderFull;
129 Utf8Str m_strDefaultHardDiskFormat;
130
131 HardDiskFormatList mHardDiskFormats;
132
133 Utf8Str m_strRemoteDisplayAuthLibrary;
134 Utf8Str m_strWebServiceAuthLibrary;
135 ULONG mLogHistoryCount;
136 AudioDriverType_T mDefaultAudioDriver;
137
138 friend class VirtualBox;
139};
140
141#endif // ____H_SYSTEMPROPERTIESIMPL
142/* 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