1 | /* $Id: TrustedPlatformModuleImpl.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM class implementation - Machine Trusted Platform Module settings.
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2021-2022 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 MAIN_INCLUDED_TrustedPlatformModuleImpl_h
|
---|
21 | #define MAIN_INCLUDED_TrustedPlatformModuleImpl_h
|
---|
22 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
23 | # pragma once
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | #include "TrustedPlatformModuleWrap.h"
|
---|
27 |
|
---|
28 | class GuestOSType;
|
---|
29 |
|
---|
30 | namespace settings
|
---|
31 | {
|
---|
32 | struct TpmSettings;
|
---|
33 | }
|
---|
34 |
|
---|
35 | class ATL_NO_VTABLE TrustedPlatformModule :
|
---|
36 | public TrustedPlatformModuleWrap
|
---|
37 | {
|
---|
38 | public:
|
---|
39 |
|
---|
40 | DECLARE_COMMON_CLASS_METHODS(TrustedPlatformModule)
|
---|
41 |
|
---|
42 | HRESULT FinalConstruct();
|
---|
43 | void FinalRelease();
|
---|
44 |
|
---|
45 | // public initializer/uninitializer for internal purposes only
|
---|
46 | HRESULT init(Machine *parent);
|
---|
47 | HRESULT init(Machine *parent, TrustedPlatformModule *that);
|
---|
48 | HRESULT initCopy(Machine *parent, TrustedPlatformModule *that);
|
---|
49 | void uninit();
|
---|
50 |
|
---|
51 | // public methods for internal purposes only
|
---|
52 | HRESULT i_loadSettings(const settings::TpmSettings &data);
|
---|
53 | HRESULT i_saveSettings(settings::TpmSettings &data);
|
---|
54 |
|
---|
55 | void i_rollback();
|
---|
56 | void i_commit();
|
---|
57 | void i_copyFrom(TrustedPlatformModule *aThat);
|
---|
58 | void i_applyDefaults(GuestOSType *aOsType);
|
---|
59 |
|
---|
60 | private:
|
---|
61 |
|
---|
62 | // wrapped ITrustedPlatformModule properties
|
---|
63 | HRESULT getType(TpmType_T *aType);
|
---|
64 | HRESULT setType(TpmType_T aType);
|
---|
65 | HRESULT getLocation(com::Utf8Str &location);
|
---|
66 | HRESULT setLocation(const com::Utf8Str &location);
|
---|
67 |
|
---|
68 | struct Data;
|
---|
69 | Data *m;
|
---|
70 | };
|
---|
71 |
|
---|
72 | #endif /* !MAIN_INCLUDED_TrustedPlatformModuleImpl_h */
|
---|
73 |
|
---|
74 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|