A chain which allows a group of filters to be processed as one. More...
#include "Filter.h"
Public Member Functions | |
virtual | ~FilterChain () |
void | addFilter (Filter *filter) |
Adds a new filter to the chain. More... | |
void | clear () |
Removes all filters from the chain. More... | |
bool | containsFilter (Filter *filter) |
Returns true if the chain contains filter . More... | |
Filter::HotSpot * | hotSpotAt (int line, int column) const |
Returns the first hotspot which occurs at line , column or 0 if no hotspot was found. More... | |
QList< Filter::HotSpot * > | hotSpots () const |
Returns a list of all the hotspots in all the chain's filters. More... | |
QList< Filter::HotSpot > | hotSpotsAtLine (int line) const |
Returns a list of all hotspots at the given line in all the chain's filters. More... | |
void | process () |
Processes each filter in the chain. More... | |
void | removeFilter (Filter *filter) |
Removes a filter from the chain. More... | |
void | reset () |
Resets each filter in the chain. More... | |
void | setBuffer (const QString *buffer, const QList< int > *linePositions) |
Sets the buffer for each filter in the chain to process. More... | |
A chain which allows a group of filters to be processed as one.
The chain owns the filters added to it and deletes them when the chain itself is destroyed.
Use addFilter() to add a new filter to the chain. When new text to be filtered arrives, use addLine() to add each additional line of text which needs to be processed and then after adding the last line, use process() to cause each filter in the chain to process the text.
After processing a block of text, the reset() method can be used to set the filter chain's internal cursor back to the first line.
The hotSpotAt() method will return the first hotspot which covers a given position.
The hotSpots() and hotSpotsAtLine() method return all of the hotspots in the text and on a given line respectively.
|
virtual |
Definition at line 42 of file Filter.cpp.
References filter().
void FilterChain::addFilter | ( | Filter * | filter | ) |
Adds a new filter to the chain.
The chain will delete this filter when it is destroyed
Definition at line 54 of file Filter.cpp.
References append, and filter().
Referenced by QUnixTerminalImpl::initialize().
void FilterChain::clear | ( | void | ) |
Removes all filters from the chain.
Definition at line 84 of file Filter.cpp.
Returns true if the chain contains filter
.
Definition at line 62 of file Filter.cpp.
References filter().
Filter::HotSpot * FilterChain::hotSpotAt | ( | int | line, |
int | column | ||
) | const |
Returns the first hotspot which occurs at line
, column
or 0 if no hotspot was found.
Definition at line 88 of file Filter.cpp.
References column, and filter().
Referenced by TerminalView::filterActions(), TerminalView::mouseMoveEvent(), and TerminalView::mousePressEvent().
QList< Filter::HotSpot * > FilterChain::hotSpots | ( | ) | const |
Returns a list of all the hotspots in all the chain's filters.
Definition at line 104 of file Filter.cpp.
References filter(), and list.
Referenced by TerminalView::hotSpotRegion(), and TerminalView::paintFilters().
QList<Filter::HotSpot> FilterChain::hotSpotsAtLine | ( | int | line | ) | const |
Returns a list of all hotspots at the given line in all the chain's filters.
void FilterChain::process | ( | ) |
Processes each filter in the chain.
Definition at line 78 of file Filter.cpp.
Referenced by TerminalView::processFilters().
void FilterChain::removeFilter | ( | Filter * | filter | ) |
Removes a filter from the chain.
The chain will no longer delete the filter when destroyed
Definition at line 58 of file Filter.cpp.
References filter().
void FilterChain::reset | ( | void | ) |
Resets each filter in the chain.
Definition at line 66 of file Filter.cpp.
Referenced by TerminalImageFilterChain::setImage().
void FilterChain::setBuffer | ( | const QString * | buffer, |
const QList< int > * | linePositions | ||
) |
Sets the buffer for each filter in the chain to process.
Definition at line 72 of file Filter.cpp.
Referenced by TerminalImageFilterChain::setImage().