Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
spotlight-provider.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#ifndef __ANTARES_WINDOWS_OUTPUT_SPOTLIGHT_PROVIDER_H__
22#define __ANTARES_WINDOWS_OUTPUT_SPOTLIGHT_PROVIDER_H__
23
24#include <ui/common/component/spotlight.h>
25#include "fwd.h"
26#include "layer.h"
27#include <wx/bitmap.h>
28
29namespace Antares
30{
31namespace Window
32{
33namespace OutputViewer
34{
36{
37public:
40
41public:
43
44
47 SpotlightProvider(Component* com, Layer* layer);
49 virtual ~SpotlightProvider();
51
55 virtual void search(Spotlight::IItem::Vector& out,
56 const Spotlight::SearchToken::Vector& tokens,
57 const Yuni::String& text = "") override;
58
62 virtual bool onSelect(Spotlight::IItem::Ptr& item) override;
63
64private:
65 void appendAreaName(Spotlight::IItem::Vector& out, const Yuni::String& name);
66 void appendLinkName(Spotlight::IItem::Vector& out, const Yuni::String& name);
67
68private:
70 Component* pComponent;
72 Layer* pLayer;
73
75 wxBitmap* pBmpReattach;
77 wxBitmap* pBmpArea;
79 wxBitmap* pBmpGroup;
81 wxBitmap* pBmpLink;
82
83}; // class Layer
84
86{
87public:
90
91public:
93
94
101
102 size_t getSelectedLayerID(const Yuni::String& layerName);
103
107 virtual void search(Spotlight::IItem::Vector& out,
108 const Spotlight::SearchToken::Vector& tokens,
109 const Yuni::String& text = "");
110
111 virtual void search(Spotlight::IItem::Vector& out,
112 const Spotlight::SearchToken::Vector& tokens,
113 Spotlight::IItem::Vector& in);
114
118 virtual bool onSelect(Spotlight::IItem::Ptr& item);
119
120 void addEconomy();
121 void addAdequacy();
122 void addNoCommonItem();
123
124 void addText(const Yuni::String& name);
125 void addAreaName(const Yuni::String& name);
126 void addSetName(const Yuni::String& name);
127 void addLinkName(const Yuni::String& name);
128
129 void addUncommonAreaName(const Yuni::String& name);
130 void addUncommonLinkName(const Yuni::String& name);
131
132public:
133 Spotlight::IItem::Vector items;
134
135private:
136 void appendSetName(Spotlight::IItem::Vector& out,
137 const Yuni::String& name,
138 const char* grp = "DISTRICTS");
139 void appendAreaName(Spotlight::IItem::Vector& out,
140 const Yuni::String& name,
141 const char* grp = "AREAS");
142 void appendLinkName(Spotlight::IItem::Vector& out,
143 const Yuni::String& name,
144 const char* grp = "LINKS");
145
146private:
148 Component* pComponent;
149
151 wxBitmap* pBmpReattach;
153 wxBitmap* pBmpArea;
155 wxBitmap* pBmpGroup;
157 wxBitmap* pBmpLink;
158
159 Spotlight::IItem::Ptr pCurrentAreaOrLink;
160
161}; // class SpotlightProviderGlobalSelection
162
164{
165public:
168
169public:
171
172
177 virtual ~SpotlightProviderMCAll();
179
183 virtual void search(Spotlight::IItem::Vector& out,
184 const Spotlight::SearchToken::Vector& tokens,
185 const Yuni::String& text = "");
186
190 virtual bool onSelect(Spotlight::IItem::Ptr& item);
191
192private:
194 Component* pComponent;
195
197 wxBitmap* pBmpReattach;
199 wxBitmap* pBmpVariable;
200
201}; // class SpotlightProviderMCAll
202
203} // namespace OutputViewer
204} // namespace Window
205} // namespace Antares
206
207#endif // __ANTARES_WINDOWS_OUTPUT_SPOTLIGHT_PROVIDER_H__
Data Provider.
Definition spotlight.h:31
Definition spotlight.h:40
Component: Viewer for simulation results.
Definition output.h:49
virtual ~SpotlightProviderGlobalSelection()
Destructor.
Definition spotlight-provider.cpp:84
virtual bool onSelect(Spotlight::IItem::Ptr &item)
An item has been selected.
Definition spotlight-provider.cpp:555
virtual void search(Spotlight::IItem::Vector &out, const Spotlight::SearchToken::Vector &tokens, const Yuni::String &text="")
Perform a new search.
Definition spotlight-provider.cpp:350
SpotlightProviderGlobalSelection(Component *com)
Default constructor.
Definition spotlight-provider.cpp:73
virtual bool onSelect(Spotlight::IItem::Ptr &item)
An item has been selected.
Definition spotlight-provider.cpp:679
virtual void search(Spotlight::IItem::Vector &out, const Spotlight::SearchToken::Vector &tokens, const Yuni::String &text="")
Perform a new search.
Definition spotlight-provider.cpp:632
SpotlightProviderMCAll(Component *com)
Default constructor.
Definition spotlight-provider.cpp:93
virtual ~SpotlightProviderMCAll()
Destructor.
Definition spotlight-provider.cpp:101
Definition spotlight-provider.h:36
virtual bool onSelect(Spotlight::IItem::Ptr &item) override
An item has been selected.
Definition spotlight-provider.cpp:273
virtual void search(Spotlight::IItem::Vector &out, const Spotlight::SearchToken::Vector &tokens, const Yuni::String &text="") override
Perform a new search.
Definition spotlight-provider.cpp:126
SpotlightProvider(Component *com, Layer *layer)
Default constructor.
Definition spotlight-provider.cpp:107
virtual ~SpotlightProvider()
Destructor.
Definition spotlight-provider.cpp:118