31 using namespace std::placeholders;
36 return !aSelection.
Empty();
42 return aSelection.
Empty();
96 for(
const auto& item : aSelection )
98 if( item->Type() == aType )
108 if( aSelection.
Empty() )
113 for(
const auto& item : aSelection )
115 if( !item->IsType( types ) )
125 if( aSelection.
Empty() )
128 for(
const auto& item : aSelection )
130 if( !item->IsType( aTypes ) )
140 return aSelection.
Size() == aNumber;
146 return aSelection.
Size() > aNumber;
152 return aSelection.
Size() < aNumber;
185 return aConditionB || aConditionA;
198 return aConditionB && aConditionA;
SELECTION_CONDITION operator!(const SELECTION_CONDITION &aCondition)
static bool onlyTypeFunc(const SELECTION &aSelection, KICAD_T aType)
Helper function used by OnlyTypes()
SELECTION_CONDITION operator &&(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB)
static bool countFunc(const SELECTION &aSelection, int aNumber)
Helper function used by MoreThan()
bool(&) SELECTION_BOOL(const SELECTION &)
Signature for a reference to a function that takes a SELECTION and returns a boolean.
static bool andBoolFunc(const SELECTION_CONDITION &aConditionA, SELECTION_BOOL &aConditionB, const SELECTION &aSelection)
static bool notFunc(const SELECTION_CONDITION &aCondition, const SELECTION &aSelection)
Helper function used by operator||.
static bool orBoolFunc(const SELECTION_CONDITION &aConditionA, SELECTION_BOOL &aConditionB, const SELECTION &aSelection)
Helper function used by operator&&.
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
static bool lessThanFunc(const SELECTION &aSelection, int aNumber)
Helper function used by operator||.
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
static SELECTION_CONDITION OnlyTypes(const KICAD_T aTypes[])
Create a functor that tests if the selected items are only of given types.
static SELECTION_CONDITION HasType(KICAD_T aType)
Create a functor that tests if among the selected items there is at least one of a given type.
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static bool IdleSelection(const SELECTION &aSelection)
Test if all selected items are not being edited.
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
static bool onlyTypesFunc(const SELECTION &aSelection, const KICAD_T aTypes[])
Helper function used by Count()
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
static bool orFunc(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB, const SELECTION &aSelection)
Helper function used by operator&&.
static SELECTION_CONDITION LessThan(int aNumber)
Create a functor that tests if the number of selected items is smaller than the value given as parame...
STATUS_FLAGS GetEditFlags() const
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
SELECTION_CONDITION operator||(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB)
bool Empty() const
Checks if there is anything selected.
static bool hasTypeFunc(const SELECTION &aSelection, KICAD_T aType)
< Helper function used by HasType()
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Create a functor that tests if the selected items are only of given type.
int Size() const
Returns the number of selected parts.
static bool Empty(const SELECTION &aSelection)
Test if there are no items selected.
static bool andFunc(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB, const SELECTION &aSelection)
Helper function used by operator!
static bool moreThanFunc(const SELECTION &aSelection, int aNumber)
Helper function used by LessThan()