Chatterino
Public Member Functions | Static Public Attributes | List of all members
chatterino::HighlightPhrase Class Reference

#include <HighlightPhrase.hpp>

Public Member Functions

bool operator== (const HighlightPhrase &other) const
 
 HighlightPhrase (const QString &pattern, bool showInMentions, bool hasAlert, bool hasSound, bool isRegex, bool isCaseSensitive, const QString &soundUrl, QColor color)
 Create a new HighlightPhrase. More...
 
 HighlightPhrase (const QString &pattern, bool showInMentions, bool hasAlert, bool hasSound, bool isRegex, bool isCaseSensitive, const QString &soundUrl, std::shared_ptr< QColor > color)
 Create a new HighlightPhrase. More...
 
const QString & getPattern () const
 
bool showInMentions () const
 
bool hasAlert () const
 
bool hasSound () const
 Check if this highlight phrase should play a sound when triggered. More...
 
bool hasCustomSound () const
 Check if this highlight phrase has a custom sound set. More...
 
bool isRegex () const
 
bool isValid () const
 
bool isMatch (const QString &subject) const
 
bool isCaseSensitive () const
 
const QUrl & getSoundUrl () const
 
const std::shared_ptr< QColor > getColor () const
 

Static Public Attributes

static QColor FALLBACK_HIGHLIGHT_COLOR = QColor(127, 63, 73, 127)
 
static QColor FALLBACK_REDEEMED_HIGHLIGHT_COLOR
 
static QColor FALLBACK_SUB_COLOR = QColor(196, 102, 255, 100)
 
static QColor FALLBACK_FIRST_MESSAGE_HIGHLIGHT_COLOR
 
static QColor FALLBACK_ELEVATED_MESSAGE_HIGHLIGHT_COLOR
 
static QColor FALLBACK_THREAD_HIGHLIGHT_COLOR
 

Constructor & Destructor Documentation

◆ HighlightPhrase() [1/2]

chatterino::HighlightPhrase::HighlightPhrase ( const QString &  pattern,
bool  showInMentions,
bool  hasAlert,
bool  hasSound,
bool  isRegex,
bool  isCaseSensitive,
const QString &  soundUrl,
QColor  color 
)

Create a new HighlightPhrase.

Use this constructor when creating a new HighlightPhrase.

◆ HighlightPhrase() [2/2]

chatterino::HighlightPhrase::HighlightPhrase ( const QString &  pattern,
bool  showInMentions,
bool  hasAlert,
bool  hasSound,
bool  isRegex,
bool  isCaseSensitive,
const QString &  soundUrl,
std::shared_ptr< QColor >  color 
)

Create a new HighlightPhrase.

Use this constructor when updating an existing HighlightPhrase's color.

Member Function Documentation

◆ getColor()

const std::shared_ptr< QColor > chatterino::HighlightPhrase::getColor ( ) const
Here is the caller graph for this function:

◆ getPattern()

const QString & chatterino::HighlightPhrase::getPattern ( ) const
Here is the caller graph for this function:

◆ getSoundUrl()

const QUrl & chatterino::HighlightPhrase::getSoundUrl ( ) const
Here is the caller graph for this function:

◆ hasAlert()

bool chatterino::HighlightPhrase::hasAlert ( ) const
Here is the caller graph for this function:

◆ hasCustomSound()

bool chatterino::HighlightPhrase::hasCustomSound ( ) const

Check if this highlight phrase has a custom sound set.

Note that this method only checks whether the path to the custom sound is not empty. It does not check whether the file still exists, is a sound file, or anything else.

Returns
true, if the custom sound file path is not empty, false otherwise

◆ hasSound()

bool chatterino::HighlightPhrase::hasSound ( ) const

Check if this highlight phrase should play a sound when triggered.

In distinction from HighlightPhrase::hasCustomSound, this method only checks whether or not ANY sound should be played when the phrase is triggered.

To check whether a custom sound is set, use HighlightPhrase::hasCustomSound instead.

Returns
true, if this highlight phrase should play a sound when triggered, false otherwise
Here is the caller graph for this function:

◆ isCaseSensitive()

bool chatterino::HighlightPhrase::isCaseSensitive ( ) const
Here is the caller graph for this function:

◆ isMatch()

bool chatterino::HighlightPhrase::isMatch ( const QString &  subject) const
Here is the call graph for this function:

◆ isRegex()

bool chatterino::HighlightPhrase::isRegex ( ) const
Here is the caller graph for this function:

◆ isValid()

bool chatterino::HighlightPhrase::isValid ( ) const
Here is the caller graph for this function:

◆ operator==()

bool chatterino::HighlightPhrase::operator== ( const HighlightPhrase other) const

◆ showInMentions()

bool chatterino::HighlightPhrase::showInMentions ( ) const
Here is the caller graph for this function:

Member Data Documentation

◆ FALLBACK_ELEVATED_MESSAGE_HIGHLIGHT_COLOR

QColor chatterino::HighlightPhrase::FALLBACK_ELEVATED_MESSAGE_HIGHLIGHT_COLOR
static
Initial value:
=
QColor(255, 174, 66, 60)

◆ FALLBACK_FIRST_MESSAGE_HIGHLIGHT_COLOR

QColor chatterino::HighlightPhrase::FALLBACK_FIRST_MESSAGE_HIGHLIGHT_COLOR
static
Initial value:
=
QColor(72, 127, 63, 60)

◆ FALLBACK_HIGHLIGHT_COLOR

QColor chatterino::HighlightPhrase::FALLBACK_HIGHLIGHT_COLOR = QColor(127, 63, 73, 127)
static

◆ FALLBACK_REDEEMED_HIGHLIGHT_COLOR

QColor chatterino::HighlightPhrase::FALLBACK_REDEEMED_HIGHLIGHT_COLOR
static
Initial value:
=
QColor(28, 126, 141, 60)

◆ FALLBACK_SUB_COLOR

QColor chatterino::HighlightPhrase::FALLBACK_SUB_COLOR = QColor(196, 102, 255, 100)
static

◆ FALLBACK_THREAD_HIGHLIGHT_COLOR

QColor chatterino::HighlightPhrase::FALLBACK_THREAD_HIGHLIGHT_COLOR
static
Initial value:
=
QColor(143, 48, 24, 60)

The documentation for this class was generated from the following files: