Antares Simulator
Power System Simulator
renewable-cluster-order.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 "cluster-order.h"
25 #include <map>
26 #include <list>
27 // #include "../item/renewable-cluster-item.h"
28 
29 namespace Antares::Component::HTMLListbox::Datasource
30 {
31 using RenewableClusterList = std::list<Data::RenewableCluster*>;
32 using RenewableClusterMap = std::map<wxString, RenewableClusterList>;
33 
35 {
36 public:
38 
42  virtual ~RenewableClustersByOrder();
44 
45 private:
46  virtual void sortClustersInGroup(RenewableClusterList& clusterList) = 0;
47 
48  void reorderItemsList(const wxString& search) override;
49  void rebuildItemsList(const wxString& search) override;
50 
51 }; // RenewableClustersByOrder
52 
54 {
55 public:
57 
62 
64 
65  virtual wxString name() const override
66  {
67  return wxT("Renewable clusters in alphabetical order");
68  }
69 
70  virtual const char* icon() const override
71  {
72  return "images/16x16/sort_alphabet.png";
73  }
74 
75 private:
76  void sortClustersInGroup(RenewableClusterList& clusterList) override;
77 
78 }; // class RenewableClustersByAlphaOrder
79 
81 {
82 public:
84 
89 
91 
92  virtual wxString name() const
93  {
94  return wxT("Renewable clusters in reverse alphabetical order");
95  }
96 
97  virtual const char* icon() const
98  {
99  return "images/16x16/sort_alphabet_descending.png";
100  }
101 
102 private:
103  void sortClustersInGroup(RenewableClusterList& clusterList) override;
104 
105 }; // class RenewableClustersByAlphaReverseOrder
106 
107 } // namespace Antares::Component::HTMLListbox::Datasource
Listbox with HTML content.
Definition: component.h:46
virtual const char * icon() const override
Get the relative path to the icon file.
Definition: renewable-cluster-order.h:70
virtual ~RenewableClustersByAlphaOrder()
Destructor.
Definition: renewable-cluster-order.cpp:164
virtual wxString name() const override
Get the name of the datasource.
Definition: renewable-cluster-order.h:65
RenewableClustersByAlphaOrder(HTMLListbox::Component &parent)
Default Constructor.
Definition: renewable-cluster-order.cpp:159
virtual const char * icon() const
Get the relative path to the icon file.
Definition: renewable-cluster-order.h:97
virtual wxString name() const
Get the name of the datasource.
Definition: renewable-cluster-order.h:92
virtual ~RenewableClustersByAlphaReverseOrder()
Destructor.
Definition: renewable-cluster-order.cpp:182
RenewableClustersByAlphaReverseOrder(HTMLListbox::Component &parent)
Default Constructor.
Definition: renewable-cluster-order.cpp:176
virtual ~RenewableClustersByOrder()
Destructor.
Definition: renewable-cluster-order.cpp:36
RenewableClustersByOrder(HTMLListbox::Component &parent)
Default Constructor.
Definition: renewable-cluster-order.cpp:31