ORE Studio 0.0.4
Loading...
Searching...
No Matches
InstrumentFormUtils.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
16 * Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 */
19#ifndef ORES_QT_INSTRUMENT_FORM_UTILS_HPP
20#define ORES_QT_INSTRUMENT_FORM_UTILS_HPP
21
22#include <string>
23
24class QComboBox;
25
26namespace ores::qt {
27
37public:
38 InstrumentFormUtils() = delete;
39
40 // ── Field-specific populators ──────────────────────────────────────────────
41
43 static void populateSettlement(QComboBox* cb);
44
46 static void populateOptionType(QComboBox* cb);
47
49 static void populateExerciseStyle(QComboBox* cb);
50
52 static void populateExerciseType(QComboBox* cb);
53
56 static void populateDayCount(QComboBox* cb);
57
60 static void populateFrequency(QComboBox* cb);
61
63 static void populateBarrierType(QComboBox* cb);
64
66 static void populateAverageType(QComboBox* cb);
67
69 static void populateSeniority(QComboBox* cb);
70
72 static void populateRestructuring(QComboBox* cb);
73
75 static void populateTrsReturnType(QComboBox* cb);
76
78 static void populateAscotOptionType(QComboBox* cb);
79
81 static void populateReturnType(QComboBox* cb);
82
84 static void populateLongShort(QComboBox* cb);
85
87 static void populateMomentType(QComboBox* cb);
88
89 // ── Value accessors ────────────────────────────────────────────────────────
90
95 static void setComboValue(QComboBox* cb, const std::string& value);
96
100 static std::string getComboValue(const QComboBox* cb);
101};
102
103} // namespace ores::qt
104
105#endif
Qt-based graphical user interface for ORE Studio.
Definition AccountController.hpp:32
Static helpers for populating and reading instrument-form combo boxes.
Definition InstrumentFormUtils.hpp:36
static void populateAverageType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:95
static void populateTrsReturnType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:110
static void populateSettlement(QComboBox *cb)
Definition InstrumentFormUtils.cpp:25
static void populateDayCount(QComboBox *cb)
Definition InstrumentFormUtils.cpp:45
static void populateExerciseType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:40
static void populateFrequency(QComboBox *cb)
Definition InstrumentFormUtils.cpp:64
static void populateBarrierType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:82
static void populateExerciseStyle(QComboBox *cb)
Definition InstrumentFormUtils.cpp:35
static void populateAscotOptionType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:115
static void populateLongShort(QComboBox *cb)
Definition InstrumentFormUtils.cpp:125
static void populateReturnType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:120
static std::string getComboValue(const QComboBox *cb)
Return the currently selected item text as a std::string.
Definition InstrumentFormUtils.cpp:141
static void setComboValue(QComboBox *cb, const std::string &value)
Select the combo item whose text equals value. Falls back to index 0 (the empty entry) if not found.
Definition InstrumentFormUtils.cpp:135
static void populateMomentType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:130
static void populateOptionType(QComboBox *cb)
Definition InstrumentFormUtils.cpp:30
static void populateSeniority(QComboBox *cb)
Definition InstrumentFormUtils.cpp:100
static void populateRestructuring(QComboBox *cb)
Definition InstrumentFormUtils.cpp:105