KiCad PCB EDA Suite
Loading...
Searching...
No Matches
board_project_settings_params.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Jon Evans <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef KICAD_BOARD_PROJECT_SETTINGS_PARAMS_H
22#define KICAD_BOARD_PROJECT_SETTINGS_PARAMS_H
23
25#include <settings/parameters.h>
26
27
28class KICOMMON_API PARAM_LAYER_PRESET : public PARAM_LAMBDA<nlohmann::json>
29{
30public:
31 PARAM_LAYER_PRESET( const std::string& aPath, std::vector<LAYER_PRESET>* aPresetList );
32
33 static void MigrateToV9Layers( nlohmann::json& aJson );
34
35 static void MigrateToNamedRenderLayers( nlohmann::json& aJson );
36
37private:
38 nlohmann::json presetsToJson();
39
40 void jsonToPresets( const nlohmann::json& aJson );
41
42 std::vector<LAYER_PRESET>* m_presets;
43};
44
45
46class KICOMMON_API PARAM_VIEWPORT : public PARAM_LAMBDA<nlohmann::json>
47{
48public:
49 PARAM_VIEWPORT( const std::string& aPath, std::vector<VIEWPORT>* aViewportList );
50
51private:
52 nlohmann::json viewportsToJson();
53
54 void jsonToViewports( const nlohmann::json& aJson );
55
56 std::vector<VIEWPORT>* m_viewports;
57};
58
59
60class KICOMMON_API PARAM_VIEWPORT3D : public PARAM_LAMBDA<nlohmann::json>
61{
62public:
63 PARAM_VIEWPORT3D( const std::string& aPath, std::vector<VIEWPORT3D>* aViewportList );
64
65private:
66 nlohmann::json viewportsToJson();
67
68 void jsonToViewports( const nlohmann::json & aJson );
69
70 std::vector<VIEWPORT3D>* m_viewports;
71};
72
73
74class KICOMMON_API PARAM_LAYER_PAIRS : public PARAM_LAMBDA<nlohmann::json>
75{
76public:
77 PARAM_LAYER_PAIRS( const std::string& aPath, std::vector<LAYER_PAIR_INFO>& m_layerPairInfos );
78
79private:
80 nlohmann::json layerPairsToJson();
81
82 void jsonToLayerPairs( const nlohmann::json& aJson );
83
84 std::vector<LAYER_PAIR_INFO>& m_layerPairInfos;
85};
86
87
88#endif // KICAD_BOARD_PROJECT_SETTINGS_PARAMS_H
PARAM_LAMBDA(const std::string &aJsonPath, std::function< nlohmann::json()> aGetter, std::function< void(nlohmann::json)> aSetter, nlohmann::json aDefault, bool aReadOnly=false)
Definition parameters.h:299
nlohmann::json layerPairsToJson()
void jsonToLayerPairs(const nlohmann::json &aJson)
std::vector< LAYER_PAIR_INFO > & m_layerPairInfos
PARAM_LAYER_PAIRS(const std::string &aPath, std::vector< LAYER_PAIR_INFO > &m_layerPairInfos)
static void MigrateToV9Layers(nlohmann::json &aJson)
static void MigrateToNamedRenderLayers(nlohmann::json &aJson)
PARAM_LAYER_PRESET(const std::string &aPath, std::vector< LAYER_PRESET > *aPresetList)
std::vector< LAYER_PRESET > * m_presets
void jsonToPresets(const nlohmann::json &aJson)
void jsonToViewports(const nlohmann::json &aJson)
PARAM_VIEWPORT3D(const std::string &aPath, std::vector< VIEWPORT3D > *aViewportList)
nlohmann::json viewportsToJson()
std::vector< VIEWPORT3D > * m_viewports
std::vector< VIEWPORT > * m_viewports
PARAM_VIEWPORT(const std::string &aPath, std::vector< VIEWPORT > *aViewportList)
nlohmann::json viewportsToJson()
void jsonToViewports(const nlohmann::json &aJson)
#define KICOMMON_API
Definition kicommon.h:28