Antares Simulator
Power System Simulator
cluster-item.h
1 /*
2  * Copyright 2007-2025, 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 
29 namespace Antares::Component::HTMLListbox::Item
30 {
36 class ClusterItem: public IItem
37 {
38 public:
39  // Default constructor
41 
42  // Additional Additional HTML content ("<td>my text</td>")
43  ClusterItem(Antares::Data::Cluster* a, const wxString& additional);
44 
45  // Destructor
46  virtual ~ClusterItem();
47 
48  bool interactive() const override
49  {
50  return true;
51  }
52 
53  // Get the HTML Content for the item
54  wxString htmlContent(const wxString& searchString);
55 
56  virtual void addAdditionalIcons(wxString& out) const = 0;
57 
58 protected:
72  bool HtmlContent(wxString& out, Data::Cluster* cluster, const wxString& searchString);
73 
74  wxString getIconFilePath(const AnyString& filename);
75  void preloadImages();
76 
77 private:
78  virtual wxString htmlContentTail() = 0;
79 
80 protected:
81  // The current generic cluster
82  Antares::Data::Cluster* pCluster;
83 
84 private:
85  // Additional text
86  const wxString pText;
87  wxString pIconFileEnabled;
88  wxString pIconFileDisabled;
89 
90 }; // class ClusterItem
91 
92 } // namespace Antares::Component::HTMLListbox::Item
Single item for an abstract cluster.
Definition: cluster-item.h:37
wxString htmlContent(const wxString &searchString)
Get the HTML Content for the item.
Definition: cluster-item.cpp:90
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:58
bool interactive() const override
Get the item is interactive (can be clicked by the user)
Definition: cluster-item.h:48
Single item for an Input (abstract)
Definition: item.h:44
Definition: cluster.h:46