26 #include "kopetechatsession.h"
27 #include "kopetemetacontact.h"
28 #include "kopetepluginmanager.h"
29 #include "kopeteprotocol.h"
30 #include "kopeteaccount.h"
31 #include "kopeteglobal.h"
32 #include "kopetecontactlist.h"
33 #include "kopeteviewmanager.h"
34 #include "kopetebehaviorsettings.h"
38 #include <ktabwidget.h>
41 #include <kmessagebox.h>
43 #include <kstringhandler.h>
44 #include <kwindowsystem.h>
45 #include <kglobalsettings.h>
46 #include <kgenericfactory.h>
47 #include <khtmlview.h>
48 #include <kxmlguifactory.h>
55 K_PLUGIN_FACTORY( ChatWindowPluginFactory, registerPlugin<ChatWindowPlugin>(); )
56 K_EXPORT_PLUGIN( ChatWindowPluginFactory(
"kopete_chatwindow" ) )
59 Kopete::ViewPlugin( ChatWindowPluginFactory::componentData(), parent )
70 class KopeteChatViewPrivate
84 , d(new KopeteChatViewPrivate)
87 d->visibleMembers =
false;
88 d->sendInProgress =
false;
95 d->warnGroupChat = mgr->warnGroupChat();
100 d->splitter =
new QSplitter( Qt::Vertical, vbox );
108 d->splitter->addWidget(m_messagePart->view());
109 d->splitter->addWidget(m_editPart->widget());
110 d->splitter->setChildrenCollapsible(
false );
113 d->splitter->setSizes( sizes );
116 connect(
editPart(), SIGNAL(toolbarToggled(
bool)),
this, SLOT(slotToggleRtfToolbar(
bool)) );
122 connect(
editPart(), SIGNAL(typing(
bool)),
123 mgr, SLOT(typing(
bool)) );
124 connect(
editPart()->textEdit(), SIGNAL(documentSizeUpdated(
int)),
132 setAcceptDrops(
true);
136 connect( mgr, SIGNAL(displayNameChanged()),
137 this, SLOT(slotChatDisplayNameChanged()) );
138 connect( mgr, SIGNAL(statusMessageChanged(Kopete::Contact*)),
139 this, SLOT(slotStatusMessageChanged( Kopete::Contact*)));
140 connect( mgr, SIGNAL(contactAdded(
const Kopete::Contact*,
bool)),
141 this, SLOT(slotContactAdded(
const Kopete::Contact*,
bool)) );
142 connect( mgr, SIGNAL(contactRemoved(
const Kopete::Contact*,QString,Qt::TextFormat,
bool)),
143 this, SLOT(slotContactRemoved(
const Kopete::Contact*,QString,Qt::TextFormat,
bool)) );
144 connect( mgr, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
145 this, SLOT(slotContactStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) );
146 connect( mgr, SIGNAL(
remoteTyping(
const Kopete::Contact*,
bool)),
147 this, SLOT(
remoteTyping(
const Kopete::Contact*,
bool)) );
148 connect( mgr, SIGNAL(eventNotification(QString)),
153 KopeteViewManager::viewManager(), SLOT(slotViewDestroyed(
KopeteView*)) );
155 KopeteViewManager::viewManager(), SLOT(slotViewActivated(
KopeteView*)) );
156 connect(
this, SIGNAL(
messageSent(Kopete::Message&)),
162 slotContactAdded( mgr->myself(), true );
163 for (
int i = 0; i != mgr->members().size(); ++i )
165 slotContactAdded( mgr->members()[i], true );
168 setFocusProxy(
editPart()->widget() );
169 m_messagePart->view()->setFocusProxy(
editPart()->widget() );
172 slotChatDisplayNameChanged();
180 emit(
closing( static_cast<KopeteView*>(
this) ) );
205 if ( contacts.count() != 1 )
208 return contacts.first()->canAcceptFiles();
251 int response = KMessageBox::Continue;
253 if ( !unreadMessageFrom.isNull() )
255 response = KMessageBox::warningContinueCancel(
this, i18n(
"<qt>You have received a message from <b>%1</b> in the last "
256 "second. Are you sure you want to clear this chat?</qt>", unreadMessageFrom ), i18n(
"Unread Message" ),
257 KGuiItem( i18nc(
"@action:button",
"Clear Chat" ) ), KStandardGuiItem::cancel(), QLatin1String(
"AskClearChatRecentMessage" ) );
260 if ( response == KMessageBox::Continue )
267 if ( contacts.count() != 1 )
274 QString contactListGroup = QString(QLatin1String(
"chatwindow_") + QString(mc->metaContactId()));
275 KConfigGroup config = KGlobal::config()->group(contactListGroup);
287 if ( !m_mainWindow || !m_mainWindow->isActiveWindow() || activate )
290 if (!KWindowSystem::windowInfo(m_mainWindow->winId(), NET::WMDesktop).onAllDesktops())
292 if (Kopete::BehaviorSettings::self()->trayflashNotifySetCurrentDesktopToChatView() && activate)
293 KWindowSystem::setCurrentDesktop(KWindowSystem::windowInfo(m_mainWindow->winId(), NET::WMDesktop).desktop());
295 KWindowSystem::setOnDesktop(m_mainWindow->winId(), KWindowSystem::currentDesktop());
298 if(m_mainWindow->isMinimized())
300 KWindowSystem::unminimizeWindow( m_mainWindow->winId());
304 m_mainWindow->raise();
308 KWindowSystem::forceActiveWindow( m_mainWindow->winId() );
317 m_mainWindow->setObjectName( QLatin1String(
"KopeteChatWindow") );
323 if ( !m_mainWindow->isVisible() )
325 m_mainWindow->show();
337 return ( m_mainWindow && m_mainWindow->isVisible() );
342 return d->sendInProgress;
347 int response = KMessageBox::Continue;
351 if ( m_manager->members().count() > 1 && ! d->warnGroupChat )
353 QString shortCaption = d->captionText;
354 shortCaption = KStringHandler::rsqueeze( shortCaption );
356 response = KMessageBox::warningContinueCancel(
this, i18n(
"<qt>You are about to leave the groupchat session <b>%1</b>.<br />"
357 "You will not receive future messages from this conversation.</qt>", shortCaption ), i18n(
"Closing Group Chat" ),
358 KGuiItem( i18nc(
"@action:button",
"Close Chat" ) ), KStandardGuiItem::cancel(), QLatin1String(
"AskCloseGroupChat" ) );
361 if ( !unreadMessageFrom.isNull() && ( response == KMessageBox::Continue ) )
363 response = KMessageBox::warningContinueCancel(
this, i18n(
"<qt>You have received a message from <b>%1</b> in the last "
364 "second. Are you sure you want to close this chat?</qt>", unreadMessageFrom ), i18n(
"Unread Message" ),
365 KGuiItem( i18nc(
"@action:button",
"Close Chat" ) ), KStandardGuiItem::cancel(), QLatin1String(
"AskCloseChatRecentMessage" ) );
368 if ( d->sendInProgress && ( response == KMessageBox::Continue ) )
370 response = KMessageBox::warningContinueCancel(
this, i18n(
"You have a message send in progress, which will be "
371 "aborted if this chat is closed. Are you sure you want to close this chat?" ), i18n(
"Message in Transit" ),
372 KGuiItem( i18nc(
"@action:button",
"Close Chat" ) ), KStandardGuiItem::cancel(), QLatin1String(
"AskCloseChatMessageInProgress" ) );
376 if( response == KMessageBox::Continue )
398 newState = m_tabState;
403 m_tabState = newState;
406 newState = m_remoteTypingMap.isEmpty() ? m_tabState :
Typing ;
413 "%1 other people in the chat", m_manager->members().count() ) );
421 m_mainWindow->guiFactory()->removeClient(
editPart());
424 m_mainWindow = parent;
428 m_mainWindow->guiFactory()->addClient(
editPart());
434 TypingMap::iterator it = m_remoteTypingMap.find(contact);
435 if (it != m_remoteTypingMap.end())
437 if (it.value()->isActive())
440 m_remoteTypingMap.erase(it);
444 m_remoteTypingMap.insert( contact,
new QTimer(
this) );
445 connect( m_remoteTypingMap[ contact ], SIGNAL(timeout()), SLOT(slotRemoteTypingTimeout()) );
447 m_remoteTypingMap[ contact ]->setSingleShot(
true );
448 m_remoteTypingMap[ contact ]->start( 6000 );
452 QStringList typingList;
454 for( it = m_remoteTypingMap.begin(); it != m_remoteTypingMap.end(); ++it )
456 const Kopete::Contact *c = it.key();
457 typingList.append( m_messagePart->
formatName(c, Qt::PlainText) );
461 if( !typingList.isEmpty() )
463 if ( typingList.count() == 1 )
464 setStatusText( i18n(
"%1 is typing a message", typingList.first() ) );
467 QString statusTyping = typingList.join( QLatin1String(
", " ) );
468 setStatusText( i18nc(
"%1 is a list of names",
"%1 are typing a message", statusTyping ) );
480 d->statusText = status;
488 QScrollBar *messageAreaScrollBar =
messagePart()->view()->verticalScrollBar();
489 bool isScrolledDown = messageAreaScrollBar->value() == messageAreaScrollBar->maximum();
492 QList<int> sizes = d->splitter->sizes();
493 sizes.first() -= difference;
494 sizes.last() += difference;
495 d->splitter->setSizes(sizes);
498 if (isScrolledDown) {
505 return d->statusText;
508 void ChatView::slotChatDisplayNameChanged()
513 QString chatName = m_manager->displayName();
515 foreach (
const Kopete::Contact *c, msgManager()->members())
517 QString contactName = m_messagePart->
formatName(c, Qt::PlainText);
518 if ( c->metaContact() )
520 chatName.replace( c->metaContact()->displayName(), contactName );
524 chatName.replace( c->nickName(), contactName );
529 if ( chatName != d->captionText )
533 void ChatView::slotPropertyChanged( Kopete::PropertyContainer*,
const QString &key,
534 const QVariant& oldValue,
const QVariant &newValue )
536 if ( key == Kopete::Global::Properties::self()->nickName().key() )
538 QString newName=newValue.toString();
539 QString oldName=oldValue.toString();
541 if(Kopete::BehaviorSettings::self()->showEvents())
542 if ( oldName != newName && !oldName.isEmpty())
543 sendInternalMessage( i18n(
"%1 is now known as %2", oldName, newName ) );
547 void ChatView::slotDisplayNameChanged(
const QString &oldValue,
const QString &newValue )
549 if( Kopete::BehaviorSettings::self()->showEvents() )
551 if( oldValue != newValue )
552 sendInternalMessage( i18n(
"%1 is now known as %2", oldValue, newValue ) );
556 void ChatView::slotStatusMessageChanged( Kopete::Contact* contact )
558 if ( contact == m_manager->myself() )
560 const QString contactName = m_messagePart->
formatName(contact, Qt::PlainText);
561 const QString statusTitle = contact->statusMessage().title();
562 const QString statusMessage = contact->statusMessage().message();
564 if ( statusTitle.isEmpty() && statusMessage.isEmpty() )
565 msg = i18nc(
"%1 is a contact's name",
"%1 deleted status message", contactName );
568 if ( statusTitle.isEmpty() )
570 else if ( statusMessage.isEmpty() )
573 msg = statusTitle +
" - " + statusMessage;
574 msg = i18nc(
"%1 is a contact's name",
"%1 changed status message: %2", contactName, msg );
577 sendInternalMessage( msg );
580 void ChatView::slotContactAdded(
const Kopete::Contact *contact,
bool suppress)
582 if( contact->metaContact() && contact->metaContact() != Kopete::ContactList::self()->myself() )
584 connect( contact->metaContact(), SIGNAL(displayNameChanged(QString,QString)),
585 this, SLOT(slotDisplayNameChanged(QString,QString)) );
589 connect( contact, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)),
590 this, SLOT(slotPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) ) ;
593 const QString contactName = m_messagePart->
formatName(contact, Qt::PlainText);
594 if( !suppress && Kopete::BehaviorSettings::self()->showEvents() && m_manager->members().count() > 1 )
595 sendInternalMessage( i18n(
"%1 has joined the chat.", contactName) );
597 if ( m_manager->members().count() == 1 )
607 const QString statusTitle = contact->statusMessage().title();
608 const QString statusMessage = contact->statusMessage().message();
609 if ( contact != m_manager->myself() && ( !statusTitle.isEmpty() || !statusMessage.isEmpty() ) )
612 if ( statusTitle.isEmpty() )
614 else if ( statusMessage.isEmpty() )
617 msg = statusTitle +
" - " + statusMessage;
618 sendInternalMessage( i18n(
"%1 status message is %2", contactName, msg ) );
622 void ChatView::slotContactRemoved(
const Kopete::Contact *contact,
const QString &reason, Qt::TextFormat format,
bool suppressNotification )
625 if ( contact != m_manager->myself() )
627 TypingMap::iterator it = m_remoteTypingMap.find( contact );
628 if ( it != m_remoteTypingMap.end() )
630 if ((*it)->isActive())
633 m_remoteTypingMap.remove( contact );
637 if ( m_manager->members().count() > 0 )
639 if( contact->metaContact() )
641 disconnect( contact->metaContact(), SIGNAL(displayNameChanged(QString,QString)),
642 this, SLOT(slotDisplayNameChanged(QString,QString)) );
646 disconnect(contact,SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)),
647 this, SLOT(slotPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) ) ;
651 if ( !suppressNotification && Kopete::BehaviorSettings::self()->showEvents() )
653 QString contactName = m_messagePart->
formatName(contact, Qt::PlainText);
654 if ( reason.isEmpty() )
655 sendInternalMessage( i18n(
"%1 has left the chat.", contactName ), format ) ;
657 sendInternalMessage( i18n(
"%1 has left the chat (%2).", contactName, reason ), format);
670 return d->captionText;
676 QString newCaption = text;
679 d->captionText = text;
682 newCaption = KStringHandler::rsqueeze( d->captionText, 20 );
685 QWidget::setWindowTitle( newCaption );
687 emit
updateChatTooltip(
this, QString::fromLatin1(
"<qt>%1</qt>").arg( d->captionText ) );
690 if( !d->isActive && modified )
707 switch ( message.importance() )
709 case Kopete::Message::Highlight:
712 case Kopete::Message::Normal:
713 if ( message.direction() == Kopete::Message::Inbound )
723 if( message.direction() == Kopete::Message::Inbound )
725 unreadMessageFrom = m_messagePart->
formatName ( message.from(), Qt::PlainText );
726 QTimer::singleShot( 1000,
this, SLOT(slotMarkMessageRead()) );
729 unreadMessageFrom.clear();
735 if ( contacts.count() != 1 )
738 Kopete::Contact* contact = contacts.first();
739 if ( contact->canAcceptFiles() )
743 void ChatView::slotMarkMessageRead()
745 unreadMessageFrom.clear();
748 void ChatView::slotToggleRtfToolbar(
bool enabled )
753 void ChatView::slotContactStatusChanged( Kopete::Contact *contact,
const Kopete::OnlineStatus &newStatus,
const Kopete::OnlineStatus &oldStatus )
755 kDebug(14000) << contact;
756 bool inhibitNotification = ( newStatus.status() == Kopete::OnlineStatus::Unknown ||
757 oldStatus.status() == Kopete::OnlineStatus::Unknown );
758 if ( contact && Kopete::BehaviorSettings::self()->showEvents() && !inhibitNotification )
760 if ( contact->account() && contact == contact->account()->myself() )
763 if ( newStatus.status() != Kopete::OnlineStatus::Connecting )
764 sendInternalMessage( i18n(
"You are now marked as %1.", newStatus.description() ) );
766 else if ( !contact->account() || !contact->account()->suppressStatusNotification() )
773 if ( newStatus.status() != oldStatus.status() )
775 QString contactName = m_messagePart->
formatName(contact, Qt::PlainText);
776 sendInternalMessage( i18n(
"%2 is now %1.",
777 newStatus.description(), contactName ) );
783 slotChatDisplayNameChanged();
787 void ChatView::sendInternalMessage(
const QString &msg, Qt::TextFormat format )
791 Kopete::Message message = Kopete::Message();
792 message.setDirection( Kopete::Message::Internal );
797 message.setPlainBody( msg );
800 message.setHtmlBody( msg );
812 d->sendInProgress =
true;
818 d->sendInProgress =
false;
824 KSharedConfig::Ptr config = KGlobal::config();
825 KConfigGroup kopeteChatWindowMainWinSettings( config, ( msgManager()->form() == Kopete::ChatSession::Chatroom ? QLatin1String(
"KopeteChatWindowGroupMode" ) : QLatin1String(
"KopeteChatWindowIndividualMode" ) ) );
826 kopeteChatWindowMainWinSettings.writeEntry( QLatin1String(
"ChatViewSplitter"), d->splitter->saveState().toBase64() );
834 if ( contacts.count() != 1 )
841 QString contactListGroup = QString(QLatin1String(
"chatwindow_") +
842 QString(mc->metaContactId()));
843 KConfigGroup config = KGlobal::config()->group(contactListGroup);
846 if (
editPart()->isRichTextEnabled() != Kopete::BehaviorSettings::self()->richTextByDefault() )
847 config.writeEntry(
"EnableRichText",
editPart()->isRichTextEnabled() );
849 config.deleteEntry(
"EnableRichText" );
851 if (
editPart()->checkSpellingEnabled() != Kopete::BehaviorSettings::self()->spellCheck() )
852 config.writeEntry(
"EnableAutoSpellCheck",
editPart()->checkSpellingEnabled() );
854 config.deleteEntry(
"EnableAutoSpellCheck" );
863 if ( contacts.count() != 1 )
867 QString contactListGroup = QString(QLatin1String(
"chatwindow_") +
868 QString(contacts.first()->metaContact()->metaContactId()));
869 KConfigGroup config(KGlobal::config(), contactListGroup );
870 bool enableRichText = config.readEntry(
"EnableRichText", Kopete::BehaviorSettings::self()->richTextByDefault() );
873 bool enableAutoSpell = config.readEntry(
"EnableAutoSpellCheck", Kopete::BehaviorSettings::self()->spellCheck() );
878 void ChatView::readOptions()
880 KConfigGroup kopeteChatWindowMainWinSettings( KGlobal::config(), ( msgManager()->form() == Kopete::ChatSession::Chatroom ? QLatin1String(
"KopeteChatWindowGroupMode" ) : QLatin1String(
"KopeteChatWindowIndividualMode" ) ) );
883 state = kopeteChatWindowMainWinSettings.readEntry( QLatin1String(
"ChatViewSplitter"), state );
884 d->splitter->restoreState( QByteArray::fromBase64( state ) );
895 KXMLGUIFactory * f = msgManager()->factory();
898 f->addClient(m_editPart);
901 emit(
activated(static_cast<KopeteView*>(
this)));
905 KXMLGUIFactory * f = m_editPart->factory();
908 f->removeClient(m_editPart);
913 void ChatView::slotRemoteTypingTimeout()
917 if ( !m_remoteTypingMap.isEmpty() )
926 event->setAccepted(
true );
929 QWidget::dragEnterEvent( event );
937 event->setAccepted(
true );
940 QWidget::dragMoveEvent( event );
945 if( event->provides(
"application/kopete.metacontacts.list" ) )
947 QByteArray encodedData =
event->encodedData (
"application/kopete.metacontacts.list" );
948 QDataStream stream( &encodedData, QIODevice::ReadOnly );
949 QString metacontactID;
950 stream >> metacontactID;
952 metacontactID.remove( 0, metacontactID.indexOf(
'/')+1 );
953 kDebug() << metacontactID;
955 if ( parent && m_manager->mayInvite() )
957 foreach ( Kopete::Contact * candidate, parent->contacts() )
959 if( candidate && candidate->account() == m_manager->account() && candidate->isOnline())
961 if( candidate != m_manager->myself() && !m_manager->members().contains( candidate ) )
968 else if ( KUrl::List::canDecode( event->mimeData() ) && m_manager->members().count() == 1 &&
969 (
event->source() != (
QWidget*)m_messagePart->view()->viewport() ) )
972 Kopete::Contact *contact = members.first();
973 if ( contact && contact->canAcceptFiles() )
983 if( event->provides(
"application/kopete.metacontacts.list" ) )
985 QByteArray encodedData =
event->encodedData (
"application/kopete.metacontacts.list" );
986 QDataStream stream( &encodedData, QIODevice::ReadOnly );
987 QString metacontactID;
988 stream >> metacontactID;
990 metacontactID.remove( 0, metacontactID.indexOf(
'/')+1 );
992 if ( parent && m_manager->mayInvite() )
994 foreach ( Kopete::Contact * candidate, parent->contacts() )
996 if( candidate && candidate->account() == m_manager->account() && candidate->isOnline())
998 if( candidate != m_manager->myself() && !m_manager->members().contains( candidate ) )
999 m_manager->inviteContact(candidate->contactId());
1004 else if ( event->provides(
"text/uri-list" ) && m_manager->members().count() == 1 )
1007 Kopete::Contact *contact = members.first();
1009 if ( !contact || !contact->canAcceptFiles() || !Q3UriDrag::canDecode( event ) )
1015 KUrl::List urlList = KUrl::List::fromMimeData( event->mimeData() );
1017 for ( KUrl::List::Iterator it = urlList.begin(); it != urlList.end(); ++it )
1019 if ( (*it).isLocalFile() )
1021 contact->sendFile( *it );
1032 QWidget::dropEvent(event);
1038 connect( m_messagePart,
1039 SIGNAL(contextMenuEvent(Kopete::Message&,QString,KMenu*)),
1047 connect( m_messagePart,
1048 SIGNAL(tooltipEvent(Kopete::Message&,QString,QString&)),
1054 #include "chatview.moc"
void loadChatSettings()
read the chat settings (rich text, auto spelling)
void complete()
Try to complete the word under the cursor.
ChatTextEditPart * editPart() const
void setCaption(const QString &text, bool modified)
Sets the text to be displayed on tab label and window caption.
QString & caption() const
void clear()
Clear the message window.
void cut()
Initiates a cut action on the edit area of the chat view.
virtual bool closeView(bool force=false)
void appendMessage(Kopete::Message &message, bool restoring=false)
Appends a message to the messave view.
static ChatWindowStyleManager * self()
Singleton access to this class.
virtual void dragMoveEvent(QDragMoveEvent *)
void windowCreated()
Emitted when we re-parent ourselves with a new window.
void setRichTextEnabled(bool enable)
enable/disable rich text support
bool canSend()
Can we send messages now?
This is the class that makes the chatwindow a plugin.
KopeteTabState tabState() const
Retrieves the tab state.
void keepScrolledDown()
Immediately scroll the chat to the bottom, as long as it has not been intentionally scrolled away fro...
void resetConfig(KConfigGroup &config)
virtual void dropEvent(QDropEvent *)
bool isDragEventAccepted(const QDragMoveEvent *) const
virtual void registerContextMenuHandler(QObject *target, const char *slot)
Reimplemented from KopeteView.
void detachChatView(ChatView *chat)
Detach a chat view from this window.
void captionChanged(bool active)
virtual Kopete::ChatSession * manager(Kopete::Contact::CanCreateFlags)
void saveOptions()
Saves window settings such as splitter positions.
void addText(const QString &text)
Adds text into the edit area.
QString formatName(const Kopete::Contact *contact, Qt::TextFormat format) const
Format contact's nickname/displayname according to preferences.
virtual void appendMessage(Kopete::Message &message)
Called when a message is received from someone.
virtual void dragEnterEvent(QDragEnterEvent *)
virtual void clear()
Clears the chat buffer.
void setActive(bool value)
Tells this view it is the active view.
void readConfig(KConfigGroup &config)
virtual bool isVisible()
Reimplemented from KopeteView.
void remoteTyping(const Kopete::Contact *contact, bool typing)
Called when a typing event is received from a contact Updates the typing map and outputs the typing m...
K_PLUGIN_FACTORY(KopeteAccountConfigFactory, registerPlugin< KopeteAccountConfig >();) KopeteAccountConfig
const QString & statusText()
virtual QWidget * mainWidget()
Reimplemented from KopeteView.
void addText(const QString &text)
Adds text into the edit area.
void messageSent(Kopete::Message &)
Emitted when a message is sent.
void updateChatState(ChatView *, int)
Emitted when the state of the chat changes.
static KopeteChatWindow * window(Kopete::ChatSession *manager)
Find the appropriate window for a ChatView of the given protocol to dock into.
void copy()
Initiates a copy action If there is text selected in the HTML view, that text is copied Otherwise...
virtual void makeVisible()
Reimplemented from KopeteView.
virtual void raise(bool activate=false)
Reimplemented from KopeteView.
void setStatusText(const QString &text)
Sets the text to be displayed on the status label.
virtual Kopete::Message currentMessage()
Returns the message currently in the edit area.
An instant message composition part.
KopeteTabState
the state of our chat
void activated(KopeteView *)
void paste()
Initiates a paste action into the edit area of the chat view.
void sendMessage()
Sends the text currently entered into the edit area.
bool sendInProgress() const
void resetFontAndColor()
Reset font and color of the edit area and outgoing messages.
void saveChatSettings()
save the chat settings (rich text, auto spelling)
void rtfEnabled(ChatView *, bool)
Emitted when the state of RTF has changed.
void slotRecalculateSize(int difference)
Triggers text edit's size recalculation.
void updateStatusIcon(ChatView *)
virtual void setCurrentMessage(const Kopete::Message &newMessage)
Sets the current message in the chat window.
Kopete::Message contents()
Returns the message currently in the edit area.
void writeConfig(KConfigGroup &config)
void setMainWindow(KopeteChatWindow *parent)
Changes the pointer to the chat window.
void closing(KopeteView *)
virtual void registerTooltipHandler(QObject *target, const char *slot)
Reimplemented from KopeteView.
KopeteView * createView(Kopete::ChatSession *manager)
void messageSuccess(ChatView *)
void setActiveView(QWidget *active)
void setStatus(const QString &)
void sendFile()
Send file (opens file dialog)
virtual void sendMessage()
Sends the text currently entered into the edit area.
void updateChatTooltip(ChatView *, const QString &)
Emitted when a possible tab tooltip needs updating.
ChatView(Kopete::ChatSession *manager, ChatWindowPlugin *parent)
void canSendChanged(bool)
Our send-button-enabled flag has changed.
void setContents(const Kopete::Message &message)
Sets the message in the edit field.
void autoSpellCheckEnabled(ChatView *, bool)
void canAcceptFilesChanged()
ChatMessagePart * messagePart() const
void copy(bool justselection=false)
Initiates a copy action If there is text selected in the HTML view, that text is copied Otherwise if ...
KopeteRichTextWidget * textEdit()
Get the inside KTextEdit.
virtual void messageSentSuccessfully()
Reimplemented from KopeteView.
QList< Contact * > ContactPtrList
void updateChatLabel(ChatView *, const QString &)
Emitted when a possible tab label needs updating.