qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
ContentDialog Class Reference

#include <contentdialog.h>

Inheritance diagram for ContentDialog:
Inheritance graph
Collaboration diagram for ContentDialog:
Collaboration graph

Public Slots

void reorderLayouts (bool newGroupOnTop)
 Update layouts order according to settings. More...
 
void previousContact ()
 
void nextContact ()
 Enable next contact. More...
 
void setUsername (const QString &newName)
 Update username to show in the title. More...
 
void reloadTheme () override
 
void activate (GenericChatroomWidget *widget)
 Show ContentDialog, activate chatroom widget. More...
 
- Public Slots inherited from ActivateDialog
virtual void reloadTheme ()
 

Signals

void friendDialogShown (const Friend *f)
 
void groupDialogShown (Group *g)
 
void addFriendDialog (Friend *frnd, ContentDialog *contentDialog)
 
void addGroupDialog (Group *group, ContentDialog *contentDialog)
 
void activated ()
 
void willClose ()
 
void connectFriendWidget (FriendWidget &friendWidget)
 
- Signals inherited from ActivateDialog
void windowStateChanged (Qt::WindowStates state)
 

Public Member Functions

 ContentDialog (const Core &core, QWidget *parent=nullptr)
 
 ~ContentDialog () override
 
FriendWidgetaddFriend (std::shared_ptr< FriendChatroom > chatroom, GenericChatForm *form)
 
GroupWidgetaddGroup (std::shared_ptr< GroupChatroom > chatroom, GenericChatForm *form)
 
void removeFriend (const ToxPk &friendPk) override
 
void removeGroup (const GroupId &groupId) override
 
int chatroomCount () const override
 
void ensureSplitterVisible ()
 
void updateTitleAndStatusIcon ()
 Update window title and icon. More...
 
void cycleContacts (bool forward, bool loop=true)
 Activate next/previous contact. More...
 
void onVideoShow (QSize size)
 
void onVideoHide ()
 
void addFriendWidget (FriendWidget *widget, Status::Status status)
 
bool isActiveWidget (GenericChatroomWidget *widget)
 
bool hasContact (const ContactId &contactId) const override
 
bool isContactActive (const ContactId &contactId) const override
 
void focusContact (const ContactId &friendPk)
 
void updateFriendStatus (const ToxPk &friendPk, Status::Status status)
 
void updateContactStatusLight (const ContactId &contactId)
 
void setStatusMessage (const ToxPk &friendPk, const QString &message)
 
- Public Member Functions inherited from ActivateDialog
 ActivateDialog (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 
bool event (QEvent *event) override
 
- Public Member Functions inherited from IDialogs
 IDialogs ()=default
 
virtual ~IDialogs ()
 
 IDialogs (const IDialogs &)=default
 
IDialogsoperator= (const IDialogs &)=default
 
 IDialogs (IDialogs &&)=default
 
IDialogsoperator= (IDialogs &&)=default
 

Protected Member Functions

bool event (QEvent *event) final
 
void dragEnterEvent (QDragEnterEvent *event) final
 
void dropEvent (QDropEvent *event) final
 
void changeEvent (QEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 
void moveEvent (QMoveEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 

Private Slots

void updateFriendWidget (const ToxPk &friendPk, QString alias)
 Update friend widget name and position. More...
 
void onGroupchatPositionChanged (bool top)
 Handler of groupchatPositionChanged action. Move group layout on the top or on the buttom. More...
 

Private Member Functions

void closeIfEmpty ()
 
void closeEvent (QCloseEvent *event) override
 
void retranslateUi ()
 Retranslate all elements in the form. More...
 
void saveDialogGeometry ()
 Save size of dialog window. More...
 
void saveSplitterState ()
 Save state of splitter between dialog and dialog list. More...
 
QLayout * nextLayout (QLayout *layout, bool forward) const
 Find the next or previous layout in layout list. More...
 
int getCurrentLayout (QLayout *&layout)
 Get current layout and index of current wiget in it. Current layout – layout contains activated widget. More...
 
void focusCommon (const ContactId &id, QHash< const ContactId &, GenericChatroomWidget * > list)
 

Private Attributes

QList< QLayout * > layouts
 
QSplitter * splitter
 
QScrollArea * friendScroll
 
FriendListLayoutfriendLayout
 
GenericChatItemLayout groupLayout
 
ContentLayoutcontentLayout
 
GenericChatroomWidgetactiveChatroomWidget
 
QSize videoSurfaceSize
 
int videoCount
 
QHash< const ContactId &, GenericChatroomWidget * > contactWidgets
 
QHash< const ContactId &, GenericChatForm * > contactChatForms
 
QString username
 

Detailed Description

Definition at line 49 of file contentdialog.h.

Constructor & Destructor Documentation

◆ ContentDialog()

ContentDialog::ContentDialog ( const Core core,
QWidget *  parent = nullptr 
)
explicit

Definition at line 54 of file contentdialog.cpp.

◆ ~ContentDialog()

ContentDialog::~ContentDialog ( )
override

Definition at line 143 of file contentdialog.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ activate

void ContentDialog::activate ( GenericChatroomWidget widget)
slot

Show ContentDialog, activate chatroom widget.

Parameters
widgetWidget which should be activated.

Definition at line 582 of file contentdialog.cpp.

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

◆ activated

void ContentDialog::activated ( )
signal
Here is the caller graph for this function:

◆ addFriend()

FriendWidget * ContentDialog::addFriend ( std::shared_ptr< FriendChatroom chatroom,
GenericChatForm form 
)

Definition at line 154 of file contentdialog.cpp.

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

◆ addFriendDialog

void ContentDialog::addFriendDialog ( Friend frnd,
ContentDialog contentDialog 
)
signal
Here is the caller graph for this function:

◆ addFriendWidget()

void ContentDialog::addFriendWidget ( FriendWidget widget,
Status::Status  status 
)

Definition at line 713 of file contentdialog.cpp.

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

◆ addGroup()

GroupWidget * ContentDialog::addGroup ( std::shared_ptr< GroupChatroom chatroom,
GenericChatForm form 
)

Definition at line 176 of file contentdialog.cpp.

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

◆ addGroupDialog

void ContentDialog::addGroupDialog ( Group group,
ContentDialog contentDialog 
)
signal
Here is the caller graph for this function:

◆ changeEvent()

void ContentDialog::changeEvent ( QEvent *  event)
overrideprotected

Definition at line 533 of file contentdialog.cpp.

Here is the call graph for this function:

◆ chatroomCount()

int ContentDialog::chatroomCount ( ) const
overridevirtual

Implements IDialogs.

Definition at line 254 of file contentdialog.cpp.

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

◆ closeEvent()

void ContentDialog::closeEvent ( QCloseEvent *  event)
overrideprivate

Definition at line 148 of file contentdialog.cpp.

◆ closeIfEmpty()

void ContentDialog::closeIfEmpty ( )
private

Definition at line 247 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ connectFriendWidget

void ContentDialog::connectFriendWidget ( FriendWidget friendWidget)
signal
Here is the caller graph for this function:

◆ cycleContacts()

void ContentDialog::cycleContacts ( bool  forward,
bool  inverse = true 
)

Activate next/previous contact.

Parameters
forwardIf true, activate next contace, previous otherwise.
inverse??? TODO: Add docs.

Definition at line 304 of file contentdialog.cpp.

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

◆ dragEnterEvent()

void ContentDialog::dragEnterEvent ( QDragEnterEvent *  event)
finalprotected

Definition at line 472 of file contentdialog.cpp.

Here is the call graph for this function:

◆ dropEvent()

void ContentDialog::dropEvent ( QDropEvent *  event)
finalprotected

Definition at line 505 of file contentdialog.cpp.

Here is the call graph for this function:

◆ ensureSplitterVisible()

void ContentDialog::ensureSplitterVisible ( )

Definition at line 259 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ event()

bool ContentDialog::event ( QEvent *  event)
finalprotected

Definition at line 444 of file contentdialog.cpp.

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

◆ focusCommon()

void ContentDialog::focusCommon ( const ContactId id,
QHash< const ContactId &, GenericChatroomWidget * >  list 
)
private

Definition at line 568 of file contentdialog.cpp.

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

◆ focusContact()

void ContentDialog::focusContact ( const ContactId friendPk)

Definition at line 563 of file contentdialog.cpp.

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

◆ friendDialogShown

void ContentDialog::friendDialogShown ( const Friend f)
signal
Here is the caller graph for this function:

◆ getCurrentLayout()

int ContentDialog::getCurrentLayout ( QLayout *&  layout)
private

Get current layout and index of current wiget in it. Current layout – layout contains activated widget.

Parameters
[out]layoutCurrent layout
Returns
Index of current widget in current layout.

Definition at line 275 of file contentdialog.cpp.

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

◆ groupDialogShown

void ContentDialog::groupDialogShown ( Group g)
signal
Here is the caller graph for this function:

◆ hasContact()

bool ContentDialog::hasContact ( const ContactId contactId) const
overridevirtual

Implements IDialogs.

Definition at line 688 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ isActiveWidget()

bool ContentDialog::isActiveWidget ( GenericChatroomWidget widget)

Definition at line 718 of file contentdialog.cpp.

◆ isContactActive()

bool ContentDialog::isContactActive ( const ContactId contactId) const
overridevirtual

Implements IDialogs.

Definition at line 619 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ keyPressEvent()

void ContentDialog::keyPressEvent ( QKeyEvent *  event)
overrideprotected

Definition at line 555 of file contentdialog.cpp.

Here is the call graph for this function:

◆ moveEvent()

void ContentDialog::moveEvent ( QMoveEvent *  event)
overrideprotected

Definition at line 549 of file contentdialog.cpp.

Here is the call graph for this function:

◆ nextContact

void ContentDialog::nextContact ( )
slot

Enable next contact.

Definition at line 423 of file contentdialog.cpp.

Here is the call graph for this function:

◆ nextLayout()

QLayout * ContentDialog::nextLayout ( QLayout *  layout,
bool  forward 
) const
private

Find the next or previous layout in layout list.

Parameters
layoutCurrent layout.
forwardIf true, move forward, backward othwerwise.
Returns
Next/previous layout.

Definition at line 699 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ onGroupchatPositionChanged

void ContentDialog::onGroupchatPositionChanged ( bool  top)
privateslot

Handler of groupchatPositionChanged action. Move group layout on the top or on the buttom.

Parameters
topIf true, move group layout on the top, false otherwise.

Definition at line 658 of file contentdialog.cpp.

Here is the call graph for this function:

◆ onVideoHide()

void ContentDialog::onVideoHide ( )

Definition at line 363 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ onVideoShow()

void ContentDialog::onVideoShow ( QSize  size)

Definition at line 351 of file contentdialog.cpp.

◆ previousContact

void ContentDialog::previousContact ( )
slot

Definition at line 415 of file contentdialog.cpp.

Here is the call graph for this function:

◆ reloadTheme

void ContentDialog::reloadTheme ( )
overrideslot

Definition at line 438 of file contentdialog.cpp.

Here is the call graph for this function:

◆ removeFriend()

void ContentDialog::removeFriend ( const ToxPk friendPk)
overridevirtual

Implements IDialogs.

Definition at line 194 of file contentdialog.cpp.

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

◆ removeGroup()

void ContentDialog::removeGroup ( const GroupId groupId)
overridevirtual

Implements IDialogs.

Definition at line 223 of file contentdialog.cpp.

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

◆ reorderLayouts

void ContentDialog::reorderLayouts ( bool  newGroupOnTop)
slot

Update layouts order according to settings.

Parameters
groupOnTopIf true move groupchat layout on the top. Move under online otherwise.

Definition at line 402 of file contentdialog.cpp.

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

◆ resizeEvent()

void ContentDialog::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 543 of file contentdialog.cpp.

Here is the call graph for this function:

◆ retranslateUi()

void ContentDialog::retranslateUi ( )
private

Retranslate all elements in the form.

Definition at line 667 of file contentdialog.cpp.

Here is the call graph for this function:

◆ saveDialogGeometry()

void ContentDialog::saveDialogGeometry ( )
private

Save size of dialog window.

Definition at line 675 of file contentdialog.cpp.

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

◆ saveSplitterState()

void ContentDialog::saveSplitterState ( )
private

Save state of splitter between dialog and dialog list.

Definition at line 683 of file contentdialog.cpp.

Here is the call graph for this function:

◆ setStatusMessage()

void ContentDialog::setStatusMessage ( const ToxPk friendPk,
const QString &  message 
)

Definition at line 630 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ setUsername

void ContentDialog::setUsername ( const QString &  newName)
slot

Update username to show in the title.

Parameters
newNameNew name to display.

Definition at line 432 of file contentdialog.cpp.

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

◆ updateContactStatusLight()

void ContentDialog::updateContactStatusLight ( const ContactId contactId)

Definition at line 611 of file contentdialog.cpp.

Here is the caller graph for this function:

◆ updateFriendStatus()

void ContentDialog::updateFriendStatus ( const ToxPk friendPk,
Status::Status  status 
)

Definition at line 605 of file contentdialog.cpp.

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

◆ updateFriendWidget

void ContentDialog::updateFriendWidget ( const ToxPk friendPk,
QString  alias 
)
privateslot

Update friend widget name and position.

Parameters
friendIdFriend Id.
aliasAlias to display on widget.

Definition at line 643 of file contentdialog.cpp.

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

◆ updateTitleAndStatusIcon()

void ContentDialog::updateTitleAndStatusIcon ( )

Update window title and icon.

Definition at line 379 of file contentdialog.cpp.

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

◆ willClose

void ContentDialog::willClose ( )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ activeChatroomWidget

GenericChatroomWidget* ContentDialog::activeChatroomWidget
private

Definition at line 130 of file contentdialog.h.

◆ contactChatForms

QHash<const ContactId&, GenericChatForm*> ContentDialog::contactChatForms
private

Definition at line 135 of file contentdialog.h.

◆ contactWidgets

QHash<const ContactId&, GenericChatroomWidget*> ContentDialog::contactWidgets
private

Definition at line 134 of file contentdialog.h.

◆ contentLayout

ContentLayout* ContentDialog::contentLayout
private

Definition at line 129 of file contentdialog.h.

◆ friendLayout

FriendListLayout* ContentDialog::friendLayout
private

Definition at line 127 of file contentdialog.h.

◆ friendScroll

QScrollArea* ContentDialog::friendScroll
private

Definition at line 126 of file contentdialog.h.

◆ groupLayout

GenericChatItemLayout ContentDialog::groupLayout
private

Definition at line 128 of file contentdialog.h.

◆ layouts

QList<QLayout*> ContentDialog::layouts
private

Definition at line 124 of file contentdialog.h.

◆ splitter

QSplitter* ContentDialog::splitter
private

Definition at line 125 of file contentdialog.h.

◆ username

QString ContentDialog::username
private

Definition at line 137 of file contentdialog.h.

◆ videoCount

int ContentDialog::videoCount
private

Definition at line 132 of file contentdialog.h.

◆ videoSurfaceSize

QSize ContentDialog::videoSurfaceSize
private

Definition at line 131 of file contentdialog.h.


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