VirtualBox

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

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

Main: Cleaned up the long standing const BSTR = const (OLECHAR *) on WIn32 vs (const PRunichar) * on XPCOM clash. Cleaned up BSTR/GUID macros (IN_BSTR replaces INPTR BSTR, IN_GUID replaces INPTR GUIDPARAM, OUT_GUID replaces GUIDPARAMOUT).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/* $Id: SystemPropertiesImpl.h 15051 2008-12-05 17:20:00Z 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;
35
36class ATL_NO_VTABLE SystemProperties :
37 public VirtualBoxBaseNEXT,
38 public VirtualBoxSupportErrorInfoImpl <SystemProperties, ISystemProperties>,
39 public VirtualBoxSupportTranslation <SystemProperties>,
40 public ISystemProperties
41{
42public:
43
44 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (SystemProperties)
45
46 DECLARE_NOT_AGGREGATABLE(SystemProperties)
47
48 DECLARE_PROTECT_FINAL_CONSTRUCT()
49
50 BEGIN_COM_MAP(SystemProperties)
51 COM_INTERFACE_ENTRY(ISupportErrorInfo)
52 COM_INTERFACE_ENTRY(ISystemProperties)
53 END_COM_MAP()
54
55 NS_DECL_ISUPPORTS
56
57 DECLARE_EMPTY_CTOR_DTOR (SystemProperties)
58
59 HRESULT FinalConstruct();
60 void FinalRelease();
61
62 // public initializer/uninitializer for internal purposes only
63 HRESULT init (VirtualBox *aParent);
64 void uninit();
65
66 // ISystemProperties properties
67 STDMETHOD(COMGETTER(MinGuestRAM) (ULONG *minRAM));
68 STDMETHOD(COMGETTER(MaxGuestRAM) (ULONG *maxRAM));
69 STDMETHOD(COMGETTER(MinGuestVRAM) (ULONG *minVRAM));
70 STDMETHOD(COMGETTER(MaxGuestVRAM) (ULONG *maxVRAM));
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(HardDiskFormats)) (ComSafeArrayOut (IHardDiskFormat *, aHardDiskFormats));
82 STDMETHOD(COMGETTER(DefaultHardDiskFormat)) (BSTR *aDefaultHardDiskFolder);
83 STDMETHOD(COMSETTER(DefaultHardDiskFormat)) (IN_BSTR aDefaultHardDiskFolder);
84 STDMETHOD(COMGETTER(RemoteDisplayAuthLibrary)) (BSTR *aRemoteDisplayAuthLibrary);
85 STDMETHOD(COMSETTER(RemoteDisplayAuthLibrary)) (IN_BSTR aRemoteDisplayAuthLibrary);
86 STDMETHOD(COMGETTER(WebServiceAuthLibrary)) (BSTR *aWebServiceAuthLibrary);
87 STDMETHOD(COMSETTER(WebServiceAuthLibrary)) (IN_BSTR aWebServiceAuthLibrary);
88 STDMETHOD(COMGETTER(HWVirtExEnabled)) (BOOL *enabled);
89 STDMETHOD(COMSETTER(HWVirtExEnabled)) (BOOL enabled);
90 STDMETHOD(COMGETTER(LogHistoryCount)) (ULONG *count);
91 STDMETHOD(COMSETTER(LogHistoryCount)) (ULONG count);
92
93 // public methods only for internal purposes
94
95 HRESULT loadSettings (const settings::Key &aGlobal);
96 HRESULT saveSettings (settings::Key &aGlobal);
97
98 ComObjPtr <HardDiskFormat> hardDiskFormat (CBSTR aFormat);
99
100 // public methods for internal purposes only
101 // (ensure there is a caller and a read lock before calling them!)
102
103 /** Default Machine path (as is, not full). Not thread safe (use object lock). */
104 const Bstr &defaultMachineFolder() const { return mDefaultMachineFolder; }
105 /** Default Machine path (full). Not thread safe (use object lock). */
106 const Bstr &defaultMachineFolderFull() const { return mDefaultMachineFolderFull; }
107 /** Default hard disk path (as is, not full). Not thread safe (use object lock). */
108 const Bstr &defaultHardDiskFolder() const { return mDefaultHardDiskFolder; }
109 /** Default hard disk path (full). Not thread safe (use object lock). */
110 const Bstr &defaultHardDiskFolderFull() const { return mDefaultHardDiskFolderFull; }
111
112 /** Default hard disk format. Not thread safe (use object lock). */
113 const Bstr &defaultHardDiskFormat() const { return mDefaultHardDiskFormat; }
114
115 // for VirtualBoxSupportErrorInfoImpl
116 static const wchar_t *getComponentName() { return L"SystemProperties"; }
117
118private:
119
120 typedef std::list <ComObjPtr <HardDiskFormat> > HardDiskFormatList;
121
122 HRESULT setDefaultMachineFolder (CBSTR aPath);
123 HRESULT setDefaultHardDiskFolder (CBSTR aPath);
124 HRESULT setDefaultHardDiskFormat (CBSTR aFormat);
125
126 HRESULT setRemoteDisplayAuthLibrary (CBSTR aPath);
127 HRESULT setWebServiceAuthLibrary (CBSTR aPath);
128
129 const ComObjPtr <VirtualBox, ComWeakRef> mParent;
130
131 Bstr mDefaultMachineFolder;
132 Bstr mDefaultMachineFolderFull;
133 Bstr mDefaultHardDiskFolder;
134 Bstr mDefaultHardDiskFolderFull;
135 Bstr mDefaultHardDiskFormat;
136
137 HardDiskFormatList mHardDiskFormats;
138
139 Bstr mRemoteDisplayAuthLibrary;
140 Bstr mWebServiceAuthLibrary;
141 BOOL mHWVirtExEnabled;
142 ULONG mLogHistoryCount;
143};
144
145#endif // ____H_SYSTEMPROPERTIESIMPL
146/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use