1 | /* $Id: RecordingSettingsImpl.h 96407 2022-08-22 17:43:14Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM class implementation - Machine recording screen settings.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2018-2022 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
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
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef MAIN_INCLUDED_RecordingSettingsImpl_h
|
---|
29 | #define MAIN_INCLUDED_RecordingSettingsImpl_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "RecordingSettingsWrap.h"
|
---|
35 |
|
---|
36 | namespace settings
|
---|
37 | {
|
---|
38 | struct RecordingSettings;
|
---|
39 | struct RecordingScreenSettings;
|
---|
40 | }
|
---|
41 |
|
---|
42 | class RecordingScreenSettings;
|
---|
43 |
|
---|
44 | class ATL_NO_VTABLE RecordingSettings
|
---|
45 | : public RecordingSettingsWrap
|
---|
46 | {
|
---|
47 | public:
|
---|
48 |
|
---|
49 | DECLARE_COMMON_CLASS_METHODS(RecordingSettings)
|
---|
50 |
|
---|
51 | HRESULT FinalConstruct();
|
---|
52 | void FinalRelease();
|
---|
53 |
|
---|
54 | // public initializer/uninitializer for internal purposes only
|
---|
55 | HRESULT init(Machine *parent);
|
---|
56 | HRESULT init(Machine *parent, RecordingSettings *aThat);
|
---|
57 | HRESULT initCopy(Machine *parent, RecordingSettings *aThat);
|
---|
58 | void uninit();
|
---|
59 |
|
---|
60 | // public methods only for internal purposes
|
---|
61 | HRESULT i_loadSettings(const settings::RecordingSettings &data);
|
---|
62 | HRESULT i_saveSettings(settings::RecordingSettings &data);
|
---|
63 |
|
---|
64 | void i_rollback(void);
|
---|
65 | void i_commit(void);
|
---|
66 | HRESULT i_copyFrom(RecordingSettings *aThat);
|
---|
67 | void i_applyDefaults(void);
|
---|
68 |
|
---|
69 | int i_getDefaultFilename(Utf8Str &strFile, uint32_t idScreen, bool fWithFileExtension);
|
---|
70 | bool i_canChangeSettings(void);
|
---|
71 | void i_onSettingsChanged(void);
|
---|
72 |
|
---|
73 | private:
|
---|
74 |
|
---|
75 | /** Map of screen settings objects. The key specifies the screen ID. */
|
---|
76 | typedef std::map <uint32_t, ComObjPtr<RecordingScreenSettings> > RecordingScreenSettingsObjMap;
|
---|
77 |
|
---|
78 | void i_reset(void);
|
---|
79 | int i_syncToMachineDisplays(uint32_t cDisplays);
|
---|
80 | int i_createScreenObj(RecordingScreenSettingsObjMap &screenSettingsMap, uint32_t idScreen, const settings::RecordingScreenSettings &data);
|
---|
81 | int i_destroyScreenObj(RecordingScreenSettingsObjMap &screenSettingsMap, uint32_t idScreen);
|
---|
82 | int i_destroyAllScreenObj(RecordingScreenSettingsObjMap &screenSettingsMap);
|
---|
83 |
|
---|
84 | private:
|
---|
85 |
|
---|
86 | // wrapped IRecordingSettings properties
|
---|
87 | HRESULT getEnabled(BOOL *enabled);
|
---|
88 | HRESULT setEnabled(BOOL enable);
|
---|
89 | HRESULT getScreens(std::vector<ComPtr<IRecordingScreenSettings> > &aRecordScreenSettings);
|
---|
90 |
|
---|
91 | // wrapped IRecordingSettings methods
|
---|
92 | HRESULT getScreenSettings(ULONG uScreenId, ComPtr<IRecordingScreenSettings> &aRecordScreenSettings);
|
---|
93 |
|
---|
94 | private:
|
---|
95 |
|
---|
96 | struct Data;
|
---|
97 | Data *m;
|
---|
98 | };
|
---|
99 |
|
---|
100 | #endif /* !MAIN_INCLUDED_RecordingSettingsImpl_h */
|
---|
101 |
|
---|