Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CPanelChannelsFilterChannels.hpp
Go to the documentation of this file.
1#ifndef LIBS_PANELS_CPANELCHANNELSFILTERCHANNELS_HPP_
2#define LIBS_PANELS_CPANELCHANNELSFILTERCHANNELS_HPP_
3
4#include "core/defines.hpp"
7
8#include <memory>
9#include <string>
10
12{
13public:
14 static constexpr int32_t kMaxFilters = 5;
15 static constexpr int32_t kNumGridLayoutColumns = 4;
16 static constexpr int32_t kNumGridLayoutRows = kMaxFilters + 1;
17 static inline const std::string kStringErrorNoFilters = _("No filters added");
18 static inline const std::string kStringErrorOverExistingFilters =
19 _("filter is over the number of existing filters");
20
21 // default methods disabled
27
28 explicit CPanelChannelsFilterChannels(const std::shared_ptr<AbstractSheetModel> &sheetModel);
30
31 // main public methods
33 void applyFilters();
34 [[nodiscard]] bool hasActiveFilters() const;
36
37private:
38 // methods to help methods that apply the filters
39 static bool filterNumber(const CFilterChannel &filter, int32_t value);
40 [[nodiscard]] bool filterText(const CFilterChannel &filter, const std::string &strValue) const;
41 [[nodiscard]] bool filterChannel(const CFilterChannel &filter,
42 const std::shared_ptr<iv::channels::AbstractChannel> &channel,
43 const std::shared_ptr<iv::units::Unit> &unit) const;
44 void resetFilters();
45
46 // methods to apply the filters
48 void applyAllFilters();
49
50 // private members
51 std::shared_ptr<AbstractSheetModel> m_sheetModelRef;
52 std::array<CFilterChannel, kMaxFilters> m_filtersModel;
55};
56
57#endif /* LIBS_PANELS_CPANELCHANNELSFILTERCHANNELS_HPP_ */
Definition AbstractComponentGUI.hpp:30
Definition CFilterChannel.hpp:12
EFilterOperator
Definition CFilterChannel.hpp:15
Definition CPanelChannelsFilterChannels.hpp:12
CPanelChannelsFilterChannels & operator=(CPanelChannelsFilterChannels &&other)=delete
static constexpr int32_t kMaxFilters
Definition CPanelChannelsFilterChannels.hpp:14
std::array< CFilterChannel, kMaxFilters > m_filtersModel
Definition CPanelChannelsFilterChannels.hpp:52
bool m_caseSensitive
Definition CPanelChannelsFilterChannels.hpp:53
CPanelChannelsFilterChannels(const CPanelChannelsFilterChannels &other)=delete
bool filterChannel(const CFilterChannel &filter, const std::shared_ptr< iv::channels::AbstractChannel > &channel, const std::shared_ptr< iv::units::Unit > &unit) const
Definition CPanelChannelsFilterChannels.cpp:197
static bool filterNumber(const CFilterChannel &filter, int32_t value)
Definition CPanelChannelsFilterChannels.cpp:56
CPanelChannelsFilterChannels & operator=(const CPanelChannelsFilterChannels &other)=delete
bool hasActiveFilters() const
Definition CPanelChannelsFilterChannels.cpp:335
static constexpr int32_t kNumGridLayoutRows
Definition CPanelChannelsFilterChannels.hpp:16
AbstractComponentGUI * buildPanel()
Definition CPanelChannelsFilterChannels.cpp:18
bool filterText(const CFilterChannel &filter, const std::string &strValue) const
Definition CPanelChannelsFilterChannels.cpp:119
static const std::string kStringErrorOverExistingFilters
Definition CPanelChannelsFilterChannels.hpp:18
static constexpr int32_t kNumGridLayoutColumns
Definition CPanelChannelsFilterChannels.hpp:15
void applyFilters()
Definition CPanelChannelsFilterChannels.cpp:42
const iv::gui::sheets::RowsDefinitions & getRowDefinitionsModified() const
Definition CPanelChannelsFilterChannels.cpp:51
static const std::string kStringErrorNoFilters
Definition CPanelChannelsFilterChannels.hpp:17
void applyAllFilters()
Definition CPanelChannelsFilterChannels.cpp:316
std::shared_ptr< AbstractSheetModel > m_sheetModelRef
Definition CPanelChannelsFilterChannels.hpp:51
CPanelChannelsFilterChannels(CPanelChannelsFilterChannels &&other)=delete
void resetFilters()
Definition CPanelChannelsFilterChannels.cpp:242
void applySingleFilterWithOperator(const CFilterChannel &filter, CFilterChannel::EFilterOperator filterOperator)
Definition CPanelChannelsFilterChannels.cpp:250
iv::gui::sheets::RowsDefinitions m_rowDefinitionsModified
Definition CPanelChannelsFilterChannels.hpp:54
#define _(string)
Definition defines.hpp:169
std::map< RowId, RowDefinition > RowsDefinitions
Definition structs.hpp:85