Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
cluster-item.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21
22#pragma once
23
24#include "item.h"
25#include <antares/study/study.h>
26
27#include <memory>
28
29namespace Antares
30{
31namespace Component
32{
33namespace HTMLListbox
34{
35namespace Item
36{
42class ClusterItem : public IItem
43{
44public:
45 // Default constructor
47
48 // Additional Additional HTML content ("<td>my text</td>")
49 ClusterItem(Antares::Data::Cluster* a, const wxString& additional);
50
51 // Destructor
52 virtual ~ClusterItem();
53
54 bool interactive() const override
55 {
56 return true;
57 }
58
59 // Get the HTML Content for the item
60 wxString htmlContent(const wxString& searchString);
61
62 virtual void addAdditionalIcons(wxString& out) const = 0;
63
64protected:
78 bool HtmlContent(wxString& out, Data::Cluster* cluster, const wxString& searchString);
79
80 wxString getIconFilePath(const AnyString& filename);
81 void preloadImages();
82
83private:
84 virtual wxString htmlContentTail() = 0;
85
86protected:
87 // The current generic cluster
88 Antares::Data::Cluster* pCluster;
89
90private:
91 // Additional text
92 const wxString pText;
93 wxString pIconFileEnabled;
94 wxString pIconFileDisabled;
95
96}; // class ClusterItem
97
98} // namespace Item
99} // namespace HTMLListbox
100} // namespace Component
101} // namespace Antares
Single item for an abstract cluster.
Definition cluster-item.h:43
wxString htmlContent(const wxString &searchString)
Get the HTML Content for the item.
Definition cluster-item.cpp:89
bool HtmlContent(wxString &out, Data::Cluster *cluster, const wxString &searchString)
Add a portion of Html from a cluster to a string.
Definition cluster-item.cpp:61
bool interactive() const override
Get the item is interactive (can be clicked by the user)
Definition cluster-item.h:54
Single item for an Input (abstract)
Definition item.h:48
Definition cluster.h:48