Chatterino
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
chatterino::ChannelView Class Referencefinal

#include <ChannelView.hpp>

Inheritance diagram for chatterino::ChannelView:
[legend]
Collaboration diagram for chatterino::ChannelView:
[legend]

Public Types

enum  Context { Context::None, Context::UserCard, Context::ReplyThread, Context::Search }
 

Public Member Functions

 ChannelView (BaseWidget *parent=nullptr, Split *split=nullptr, Context context=Context::None, size_t messagesLimit=1000)
 
void queueUpdate ()
 
ScrollbargetScrollBar ()
 
QString getSelectedText ()
 
bool hasSelection ()
 
void clearSelection ()
 
void setEnableScrollingToBottom (bool)
 
bool getEnableScrollingToBottom () const
 
void setOverrideFlags (boost::optional< MessageElementFlags > value)
 
const boost::optional< MessageElementFlags > & getOverrideFlags () const
 
void updateLastReadMessage ()
 
bool scrollToMessage (const MessagePtr &message)
 
bool scrollToMessageId (const QString &id)
 
bool pausable () const
 Pausing. More...
 
void setPausable (bool value)
 
bool paused () const
 
void pause (PauseReason reason, boost::optional< uint > msecs=boost::none)
 
void unpause (PauseReason reason)
 
MessageElementFlags getFlags () const
 
ChannelPtr channel ()
 
void setChannel (ChannelPtr channel_)
 
void setFilters (const QList< QUuid > &ids)
 
const QList< QUuid > getFilterIds () const
 
FilterSetPtr getFilterSet () const
 
ChannelPtr sourceChannel () const
 
void setSourceChannel (ChannelPtr sourceChannel)
 
bool hasSourceChannel () const
 
LimitedQueueSnapshot< MessageLayoutPtr > & getMessagesSnapshot ()
 
void queueLayout ()
 
void clearMessages ()
 
Context getContext () const
 
void showUserInfoPopup (const QString &userName, QString alternativePopoutChannel=QString())
 Creates and shows a UserInfoPopup dialog. More...
 
bool mayContainMessage (const MessagePtr &message)
 This method is meant to be used when filtering out channels. It must return true if a message belongs in this channel. It might return true if a message doesn't belong in this channel. More...
 
- Public Member Functions inherited from chatterino::BaseWidget
 BaseWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
virtual float scale () const
 
boost::optional< float > overrideScale () const
 
void setOverrideScale (boost::optional< float >)
 
QSize scaleIndependantSize () const
 
int scaleIndependantWidth () const
 
int scaleIndependantHeight () const
 
void setScaleIndependantSize (int width, int height)
 
void setScaleIndependantSize (QSize)
 
void setScaleIndependantWidth (int value)
 
void setScaleIndependantHeight (int value)
 
float qtFontScale () const
 

Public Attributes

pajlada::Signals::Signal< QMouseEvent * > mouseDown
 
pajlada::Signals::NoArgSignal selectionChanged
 
pajlada::Signals::Signal< HighlightStatetabHighlightRequested
 
pajlada::Signals::NoArgSignal liveStatusChanged
 
pajlada::Signals::Signal< const Link & > linkClicked
 
pajlada::Signals::Signal< QString, FromTwitchLinkOpenChannelInopenChannelIn
 
QCursor neutral
 
QCursor up
 
QCursor down
 
- Public Attributes inherited from chatterino::BaseWidget
pajlada::Signals::Signal< float > scaleChanged
 

Protected Member Functions

void themeChangedEvent () override
 
void scaleChangedEvent (float scale) override
 
void resizeEvent (QResizeEvent *) override
 
void paintEvent (QPaintEvent *) override
 
void wheelEvent (QWheelEvent *event) override
 
void enterEvent (QEvent *) override
 
void leaveEvent (QEvent *) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void hideEvent (QHideEvent *) override
 
void handleLinkClick (QMouseEvent *event, const Link &link, MessageLayout *layout)
 
bool tryGetMessageAt (QPoint p, std::shared_ptr< MessageLayout > &message, QPoint &relativePos, int &index)
 
- Protected Member Functions inherited from chatterino::BaseWidget
virtual void childEvent (QChildEvent *) override
 
virtual void showEvent (QShowEvent *) override
 
virtual void addShortcuts ()
 
void setScale (float value)
 
void clearShortcuts ()
 

Additional Inherited Members

- Protected Attributes inherited from chatterino::BaseWidget
Themetheme
 
std::vector< QShortcut * > shortcuts_
 
pajlada::Signals::SignalHolder signalHolder_
 

Member Enumeration Documentation

◆ Context

Enumerator
None 
UserCard 
ReplyThread 
Search 

Constructor & Destructor Documentation

◆ ChannelView()

chatterino::ChannelView::ChannelView ( BaseWidget parent = nullptr,
Split split = nullptr,
Context  context = Context::None,
size_t  messagesLimit = 1000 
)
explicit

remove elements that are finite

Here is the call graph for this function:

Member Function Documentation

◆ channel()

ChannelPtr chatterino::ChannelView::channel ( )
Here is the caller graph for this function:

◆ clearMessages()

void chatterino::ChannelView::clearMessages ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearSelection()

void chatterino::ChannelView::clearSelection ( )
Here is the call graph for this function:

◆ enterEvent()

void chatterino::ChannelView::enterEvent ( QEvent *  )
overrideprotected

◆ getContext()

ChannelView::Context chatterino::ChannelView::getContext ( ) const

◆ getEnableScrollingToBottom()

bool chatterino::ChannelView::getEnableScrollingToBottom ( ) const

◆ getFilterIds()

const QList< QUuid > chatterino::ChannelView::getFilterIds ( ) const
Here is the caller graph for this function:

◆ getFilterSet()

FilterSetPtr chatterino::ChannelView::getFilterSet ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFlags()

MessageElementFlags chatterino::ChannelView::getFlags ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMessagesSnapshot()

LimitedQueueSnapshot< MessageLayoutPtr > & chatterino::ChannelView::getMessagesSnapshot ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOverrideFlags()

const boost::optional< MessageElementFlags > & chatterino::ChannelView::getOverrideFlags ( ) const

◆ getScrollBar()

Scrollbar & chatterino::ChannelView::getScrollBar ( )
Here is the caller graph for this function:

◆ getSelectedText()

QString chatterino::ChannelView::getSelectedText ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleLinkClick()

void chatterino::ChannelView::handleLinkClick ( QMouseEvent *  event,
const Link link,
MessageLayout layout 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasSelection()

bool chatterino::ChannelView::hasSelection ( )
Here is the caller graph for this function:

◆ hasSourceChannel()

bool chatterino::ChannelView::hasSourceChannel ( ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hideEvent()

void chatterino::ChannelView::hideEvent ( QHideEvent *  )
overrideprotected

◆ leaveEvent()

void chatterino::ChannelView::leaveEvent ( QEvent *  )
overrideprotected
Here is the call graph for this function:

◆ mayContainMessage()

bool chatterino::ChannelView::mayContainMessage ( const MessagePtr message)

This method is meant to be used when filtering out channels. It must return true if a message belongs in this channel. It might return true if a message doesn't belong in this channel.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseDoubleClickEvent()

void chatterino::ChannelView::mouseDoubleClickEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mouseMoveEvent()

void chatterino::ChannelView::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Pause on hover

Here is the call graph for this function:

◆ mousePressEvent()

void chatterino::ChannelView::mousePressEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ mouseReleaseEvent()

void chatterino::ChannelView::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ paintEvent()

void chatterino::ChannelView::paintEvent ( QPaintEvent *  )
overrideprotected
Here is the call graph for this function:

◆ pausable()

bool chatterino::ChannelView::pausable ( ) const

Pausing.

Here is the caller graph for this function:

◆ pause()

void chatterino::ChannelView::pause ( PauseReason  reason,
boost::optional< uint >  msecs = boost::none 
)

Msecs has a value

No value found so we insert a new one.

If the new time point is newer then we override.

Msecs is none -> pause is infinite. We just override the value.

Here is the caller graph for this function:

◆ paused()

bool chatterino::ChannelView::paused ( ) const

No elements in the map -> not paused

Here is the call graph for this function:
Here is the caller graph for this function:

◆ queueLayout()

void chatterino::ChannelView::queueLayout ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ queueUpdate()

void chatterino::ChannelView::queueUpdate ( )
Here is the caller graph for this function:

◆ resizeEvent()

void chatterino::ChannelView::resizeEvent ( QResizeEvent *  )
overrideprotected
Here is the call graph for this function:

◆ scaleChangedEvent()

void chatterino::ChannelView::scaleChangedEvent ( float  scale)
overrideprotectedvirtual

Reimplemented from chatterino::BaseWidget.

Here is the call graph for this function:

◆ scrollToMessage()

bool chatterino::ChannelView::scrollToMessage ( const MessagePtr message)

Attempts to scroll to a message in this channel.

Returns
true if the message was found and highlighted.
Here is the call graph for this function:

◆ scrollToMessageId()

bool chatterino::ChannelView::scrollToMessageId ( const QString &  id)

Attempts to scroll to a message id in this channel.

Returns
true if the message was found and highlighted.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChannel()

void chatterino::ChannelView::setChannel ( ChannelPtr  channel_)

Clear connections from the last channel

make copy of channel and expose

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEnableScrollingToBottom()

void chatterino::ChannelView::setEnableScrollingToBottom ( bool  value)

◆ setFilters()

void chatterino::ChannelView::setFilters ( const QList< QUuid > &  ids)
Here is the caller graph for this function:

◆ setOverrideFlags()

void chatterino::ChannelView::setOverrideFlags ( boost::optional< MessageElementFlags value)
Here is the caller graph for this function:

◆ setPausable()

void chatterino::ChannelView::setPausable ( bool  value)
Here is the caller graph for this function:

◆ setSourceChannel()

void chatterino::ChannelView::setSourceChannel ( ChannelPtr  sourceChannel)
Here is the caller graph for this function:

◆ showUserInfoPopup()

void chatterino::ChannelView::showUserInfoPopup ( const QString &  userName,
QString  alternativePopoutChannel = QString() 
)

Creates and shows a UserInfoPopup dialog.

Parameters
userNameThe login name of the user
alternativePopoutChannelOptional parameter containing the channel name to use for context
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sourceChannel()

ChannelPtr chatterino::ChannelView::sourceChannel ( ) const

◆ themeChangedEvent()

void chatterino::ChannelView::themeChangedEvent ( )
overrideprotectedvirtual

Reimplemented from chatterino::BaseWidget.

Here is the call graph for this function:

◆ tryGetMessageAt()

bool chatterino::ChannelView::tryGetMessageAt ( QPoint  p,
std::shared_ptr< MessageLayout > &  message,
QPoint &  relativePos,
int &  index 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unpause()

void chatterino::ChannelView::unpause ( PauseReason  reason)

Remove the value from the map

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateLastReadMessage()

void chatterino::ChannelView::updateLastReadMessage ( )
Here is the caller graph for this function:

◆ wheelEvent()

void chatterino::ChannelView::wheelEvent ( QWheelEvent *  event)
overrideprotected
Here is the call graph for this function:

Member Data Documentation

◆ down

QCursor chatterino::ChannelView::down

◆ linkClicked

pajlada::Signals::Signal<const Link &> chatterino::ChannelView::linkClicked

◆ liveStatusChanged

pajlada::Signals::NoArgSignal chatterino::ChannelView::liveStatusChanged

◆ mouseDown

pajlada::Signals::Signal<QMouseEvent *> chatterino::ChannelView::mouseDown

◆ neutral

QCursor chatterino::ChannelView::neutral

◆ openChannelIn

pajlada::Signals::Signal<QString, FromTwitchLinkOpenChannelIn> chatterino::ChannelView::openChannelIn

◆ selectionChanged

pajlada::Signals::NoArgSignal chatterino::ChannelView::selectionChanged

◆ tabHighlightRequested

pajlada::Signals::Signal<HighlightState> chatterino::ChannelView::tabHighlightRequested

◆ up

QCursor chatterino::ChannelView::up

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