[55401] | 1 | /* $Id: AdditionsFacilityImpl.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
[35997] | 2 | /** @file
|
---|
[79052] | 3 | * VirtualBox Main - Additions facility class.
|
---|
[35997] | 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
[98103] | 7 | * Copyright (C) 2014-2023 Oracle and/or its affiliates.
|
---|
[35997] | 8 | *
|
---|
[96407] | 9 | * This file is part of VirtualBox base platform packages, as
|
---|
| 10 | * available from https://www.virtualbox.org.
|
---|
| 11 | *
|
---|
| 12 | * This program is free software; you can redistribute it and/or
|
---|
| 13 | * modify it under the terms of the GNU General Public License
|
---|
| 14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | * License.
|
---|
| 16 | *
|
---|
| 17 | * This program is distributed in the hope that it will be useful, but
|
---|
| 18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | * General Public License for more details.
|
---|
| 21 | *
|
---|
| 22 | * You should have received a copy of the GNU General Public License
|
---|
| 23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | *
|
---|
| 25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
[35997] | 26 | */
|
---|
| 27 |
|
---|
[76562] | 28 | #ifndef MAIN_INCLUDED_AdditionsFacilityImpl_h
|
---|
| 29 | #define MAIN_INCLUDED_AdditionsFacilityImpl_h
|
---|
[76487] | 30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
| 31 | # pragma once
|
---|
| 32 | #endif
|
---|
[35997] | 33 |
|
---|
| 34 | #include <iprt/time.h>
|
---|
[50370] | 35 | #include "AdditionsFacilityWrap.h"
|
---|
[40212] | 36 |
|
---|
[35997] | 37 | class Guest;
|
---|
| 38 |
|
---|
[79052] | 39 | /**
|
---|
[84564] | 40 | * A Guest Additions facility.
|
---|
[79052] | 41 | */
|
---|
[35997] | 42 | class ATL_NO_VTABLE AdditionsFacility :
|
---|
[50370] | 43 | public AdditionsFacilityWrap
|
---|
[35997] | 44 | {
|
---|
| 45 | public:
|
---|
| 46 |
|
---|
[90828] | 47 | DECLARE_COMMON_CLASS_METHODS(AdditionsFacility)
|
---|
[35997] | 48 |
|
---|
[79052] | 49 | /** @name Initializer & uninitializer methods
|
---|
| 50 | * @{ */
|
---|
[39890] | 51 | HRESULT init(Guest *a_pParent, AdditionsFacilityType_T a_enmFacility, AdditionsFacilityStatus_T a_enmStatus,
|
---|
| 52 | uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);
|
---|
[79052] | 53 | void uninit();
|
---|
[35997] | 54 | HRESULT FinalConstruct();
|
---|
[79052] | 55 | void FinalRelease();
|
---|
| 56 | /** @} */
|
---|
[35997] | 57 |
|
---|
| 58 | public:
|
---|
[79051] | 59 | /** @name public internal methods
|
---|
| 60 | * @{ */
|
---|
| 61 | LONG64 i_getLastUpdated() const;
|
---|
[79054] | 62 | #if 0 /* unused */
|
---|
[79051] | 63 | AdditionsFacilityType_T i_getType() const;
|
---|
[50370] | 64 | AdditionsFacilityClass_T i_getClass() const;
|
---|
[79051] | 65 | const char *i_getName() const;
|
---|
| 66 | #endif
|
---|
[50370] | 67 | AdditionsFacilityStatus_T i_getStatus() const;
|
---|
[79050] | 68 | bool i_update(AdditionsFacilityStatus_T a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);
|
---|
[79051] | 69 | /** @} */
|
---|
[35997] | 70 |
|
---|
| 71 | private:
|
---|
[50370] | 72 |
|
---|
[79051] | 73 | /** @name Wrapped IAdditionsFacility properties
|
---|
| 74 | * @{ */
|
---|
[50370] | 75 | HRESULT getClassType(AdditionsFacilityClass_T *aClassType);
|
---|
| 76 | HRESULT getLastUpdated(LONG64 *aLastUpdated);
|
---|
| 77 | HRESULT getName(com::Utf8Str &aName);
|
---|
| 78 | HRESULT getStatus(AdditionsFacilityStatus_T *aStatus);
|
---|
| 79 | HRESULT getType(AdditionsFacilityType_T *aType);
|
---|
[79051] | 80 | /** @} */
|
---|
[50370] | 81 |
|
---|
[79052] | 82 | struct Data
|
---|
[35997] | 83 | {
|
---|
[79052] | 84 | /** Last update timestamp. */
|
---|
| 85 | RTTIMESPEC mTimestamp;
|
---|
[35997] | 86 | /** The facilitie's current status. */
|
---|
[79052] | 87 | AdditionsFacilityStatus_T mStatus;
|
---|
| 88 | /** Flags. */
|
---|
| 89 | uint32_t mfFlags;
|
---|
| 90 | /** The facilitie's ID/type (static). */
|
---|
| 91 | AdditionsFacilityType_T mType;
|
---|
| 92 | /** Index into s_aFacilityInfo. */
|
---|
| 93 | size_t midxInfo;
|
---|
| 94 | } mData;
|
---|
[40212] | 95 |
|
---|
[79052] | 96 | /** Facility <-> string mappings. */
|
---|
| 97 | struct FacilityInfo
|
---|
[40212] | 98 | {
|
---|
[79052] | 99 | /** The facilitie's name. */
|
---|
| 100 | const char *mName; /* utf-8 */
|
---|
| 101 | /** The facilitie's type. */
|
---|
| 102 | AdditionsFacilityType_T mType;
|
---|
| 103 | /** The facilitie's class. */
|
---|
| 104 | AdditionsFacilityClass_T mClass;
|
---|
| 105 | };
|
---|
| 106 | static const FacilityInfo s_aFacilityInfo[8];
|
---|
[35997] | 107 | };
|
---|
| 108 |
|
---|
[76562] | 109 | #endif /* !MAIN_INCLUDED_AdditionsFacilityImpl_h */
|
---|
[35997] | 110 |
|
---|