• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • kopete
  • chatwindow
chattexteditpart.cpp
Go to the documentation of this file.
1 /*
2  chattexteditpart.cpp - Chat Text Edit Part
3 
4  Copyright (c) 2008 by Benson Tsai <btsai@vrwarp.com>
5  Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
6 
7  Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
8 
9  *************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  *************************************************************************
17 */
18 
19 #include "chattexteditpart.h"
20 
21 #include "kopetecontact.h"
22 #include "kopetechatsession.h"
23 #include "kopeteonlinestatus.h"
24 #include "kopeteprotocol.h"
25 #include "kopeteglobal.h"
26 #include "kopeteappearancesettings.h"
27 #include "kopetechatwindowsettings.h"
28 
29 #include <kaction.h>
30 #include <kactioncollection.h>
31 #include <kcolordialog.h>
32 #include <kconfig.h>
33 #include <kcompletion.h>
34 #include <kdebug.h>
35 #include <kfontaction.h>
36 #include <kfontdialog.h>
37 #include <kfontsizeaction.h>
38 #include <kglobalsettings.h>
39 #include <kcolorscheme.h>
40 #include <kicon.h>
41 #include <kparts/genericfactory.h>
42 #include <kstandardaction.h>
43 #include <ktoggleaction.h>
44 #include <kxmlguifactory.h>
45 
46 
47 // Qt includes
48 #include <QtCore/QTimer>
49 #include <QtCore/QRegExp>
50 #include <QtCore/QEvent>
51 #include <QKeyEvent>
52 #include <QtGui/QTextCursor>
53 #include <QtGui/QTextCharFormat>
54 
55 
56 typedef KParts::GenericFactory<ChatTextEditPart> ChatTextEditPartFactory;
57 K_EXPORT_COMPONENT_FACTORY( librichtexteditpart, ChatTextEditPartFactory )
58 
59 ChatTextEditPart::ChatTextEditPart( Kopete::ChatSession *session, QWidget *parent)
60  : KParts::ReadOnlyPart( parent ), m_session(session)
61 {
62  init(session, parent);
63 }
64 
65 ChatTextEditPart::ChatTextEditPart(QWidget *parent, QObject*, const QStringList&)
66  : KParts::ReadOnlyPart( parent ), m_session()
67 {
68  init(m_session, parent);
69 }
70 
71 void ChatTextEditPart::init( Kopete::ChatSession *session, QWidget *parent)
72 {
73  // we need an instance
74  setComponentData( ChatTextEditPartFactory::componentData() );
75 
76  editor = new KopeteRichTextWidget(parent, m_session->protocol()->capabilities(), actionCollection());
77  setWidget( editor );
78 
79  // TODO: Rename rc file
80  setXMLFile( "kopeterichtexteditpart/kopeterichtexteditpartfull.rc" );
81 
82  historyPos = -1;
83 
84  mComplete = new KCompletion();
85  mComplete->setIgnoreCase( true );
86  mComplete->setOrder( KCompletion::Weighted );
87 
88  // set params on the edit widget
89  textEdit()->setMinimumSize( QSize( 75, 20 ) );
90 
91  // some signals and slots connections
92  connect( textEdit(), SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
93 
94  // timers for typing notifications
95  m_typingRepeatTimer = new QTimer(this);
96  m_typingRepeatTimer->setObjectName("m_typingRepeatTimer");
97  m_typingStopTimer = new QTimer(this);
98  m_typingStopTimer->setObjectName("m_typingStopTimer");
99 
100  connect( m_typingRepeatTimer, SIGNAL(timeout()), this, SLOT(slotRepeatTypingTimer()) );
101  connect( m_typingStopTimer, SIGNAL(timeout()), this, SLOT(slotStoppedTypingTimer()) );
102 
103  connect( session, SIGNAL(contactAdded(const Kopete::Contact*,bool)),
104  this, SLOT(slotContactAdded(const Kopete::Contact*)) );
105  connect( session, SIGNAL(contactRemoved(const Kopete::Contact*,QString,Qt::TextFormat,bool)),
106  this, SLOT(slotContactRemoved(const Kopete::Contact*)) );
107  connect( session, SIGNAL(onlineStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)),
108  this, SLOT(slotContactStatusChanged(Kopete::Contact*,Kopete::OnlineStatus,Kopete::OnlineStatus)) );
109 
110  connect( Kopete::AppearanceSettings::self(), SIGNAL(appearanceChanged()),
111  this, SLOT(slotAppearanceChanged()) );
112 
113  connect( KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()),
114  this, SLOT(slotAppearanceChanged()) );
115 
116  connect( editor, SIGNAL(richTextSupportChanged()), this, SLOT (slotRichTextSupportChanged()) );
117 
118  slotAppearanceChanged();
119 
120  slotContactAdded( session->myself() );
121 
122  foreach( Kopete::Contact *contact, session->members() )
123  slotContactAdded( contact );
124 }
125 
126 ChatTextEditPart::~ChatTextEditPart()
127 {
128  delete mComplete;
129 }
130 
131 void ChatTextEditPart::complete()
132 {
133  QTextCursor textCursor = textEdit()->textCursor();
134  QTextBlock block = textCursor.block();
135 
136  QString txt = block.text();
137  const int blockLength = block.length() - 1; // block.length includes the '\n'
138  const int blockPosition = block.position();
139  int cursorPos = textCursor.position() - blockPosition;
140 
141  // TODO replace with textCursor.movePosition(QTextCursor::PreviousWord)?
142  const int startPos = txt.lastIndexOf( QRegExp( QLatin1String("\\s\\S+") ), cursorPos - 1 ) + 1;
143  int endPos = txt.indexOf( QRegExp( QLatin1String("[\\s\\:]") ), startPos );
144  if( endPos == -1 )
145  {
146  endPos = blockLength;
147  }
148  const QString word = txt.mid( startPos, endPos - startPos );
149 
150  if ( endPos < txt.length() && txt[endPos] == ':') {
151  // Eat ':' and ' ' too, if they are there, so that after pressing Tab
152  // we are on the right side of them again.
153  ++endPos;
154  if ( endPos < txt.length() && txt[endPos] == ' ') {
155  ++endPos;
156  }
157  }
158 
159  //kDebug(14000) << word << "from" << txt
160  // << "cursor pos=" << cursorPos
161  // << "start pos=" << startPos << "end pos=" << endPos;
162 
163  QString match;
164  if ( word != m_lastMatch )
165  {
166  match = mComplete->makeCompletion( word );
167  m_lastMatch.clear();
168  }
169  else
170  {
171  match = mComplete->nextMatch();
172  }
173 
174  if ( !match.isEmpty() )
175  {
176  m_lastMatch = match;
177 
178  if ( textCursor.blockNumber() == 0 && startPos == 0 )
179  {
180  match += QLatin1String(": ");
181  }
182 
183  //kDebug(14000) << "Selecting from position" << cursorPos << "to position" << endPos;
184  // Select the text to remove
185  textCursor.setPosition( startPos + blockPosition );
186  textCursor.setPosition( endPos + blockPosition, QTextCursor::KeepAnchor );
187  //kDebug(14000) << "replacing selection:" << textCursor.selectedText() << "with match:" << match;
188  // Type the text to replace it
189  textCursor.insertText( match );
190  textEdit()->setTextCursor( textCursor );
191  }
192  else
193  {
194  //kDebug(14000) << "No completions! Tried" << mComplete->items();
195  }
196 }
197 
198 void ChatTextEditPart::slotPropertyChanged( Kopete::PropertyContainer*, const QString &key,
199  const QVariant& oldValue, const QVariant &newValue )
200 {
201  if ( key == Kopete::Global::Properties::self()->nickName().key() )
202  {
203  mComplete->removeItem( oldValue.toString() );
204  mComplete->addItem( newValue.toString() );
205  }
206 }
207 
208 void ChatTextEditPart::slotContactAdded( const Kopete::Contact *contact )
209 {
210  connect( contact, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)),
211  this, SLOT(slotPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) ) ;
212 
213  QString contactName = contact->property(Kopete::Global::Properties::self()->nickName()).value().toString();
214  mComplete->addItem( contactName );
215 }
216 
217 void ChatTextEditPart::slotContactRemoved( const Kopete::Contact *contact )
218 {
219  disconnect( contact, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)),
220  this, SLOT(slotPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) ) ;
221 
222  QString contactName = contact->property(Kopete::Global::Properties::self()->nickName()).value().toString();
223  mComplete->removeItem( contactName );
224 }
225 
226 bool ChatTextEditPart::canSend()
227 {
228  if ( !m_session ) return false;
229 
230  // can't send if there's nothing *to* send...
231  if ( text(Qt::PlainText).isEmpty() )
232  return false;
233 
234  Kopete::ContactPtrList members = m_session->members();
235 
236  // if we can't send offline, make sure we have a reachable contact...
237  if ( !( m_session->protocol()->capabilities() & Kopete::Protocol::CanSendOffline ) )
238  {
239  bool reachableContactFound = false;
240 
241  //TODO: does this perform badly in large / busy IRC channels? - no, doesn't seem to
242  for( int i = 0; i != members.size(); ++i )
243  {
244  if ( members[i]->isReachable() )
245  {
246  reachableContactFound = true;
247  break;
248  }
249  }
250 
251  // no online contact found and can't send offline? can't send.
252  if ( !reachableContactFound )
253  return false;
254  }
255 
256  return true;
257 }
258 
259 void ChatTextEditPart::slotContactStatusChanged( Kopete::Contact *, const Kopete::OnlineStatus &newStatus, const Kopete::OnlineStatus &oldStatus )
260 {
261  //FIXME: should use signal contact->isReachableChanged, but it doesn't exist ;(
262  if ( ( oldStatus.status() == Kopete::OnlineStatus::Offline )
263  != ( newStatus.status() == Kopete::OnlineStatus::Offline ) )
264  {
265  emit canSendChanged( canSend() );
266  }
267 }
268 
269 void ChatTextEditPart::sendMessage()
270 {
271  QString txt = this->text( Qt::PlainText );
272  // avoid sending emtpy messages or enter keys (see bug 100334)
273  if ( txt.isEmpty() || txt == "\n" )
274  return;
275 
276  if ( m_lastMatch.isNull() && ( txt.indexOf( QRegExp( QLatin1String("^\\w+:\\s") ) ) > -1 ) )
277  { //no last match and it finds something of the form of "word:" at the start of a line
278  QString search = txt.left( txt.indexOf(':') );
279  if( !search.isEmpty() )
280  {
281  QString match = mComplete->makeCompletion( search );
282  if( !match.isNull() )
283  textEdit()->setText( txt.replace(0,search.length(),match) );
284  }
285  }
286 
287  if ( !m_lastMatch.isNull() )
288  {
289  //FIXME: what is the next line for?
290  mComplete->addItem( m_lastMatch );
291  m_lastMatch.clear();
292  }
293 
294  slotStoppedTypingTimer();
295  Kopete::Message sentMessage = contents();
296  emit messageSent( sentMessage );
297  historyList.prepend( this->text( Qt::AutoText) );
298  historyPos = -1;
299  textEdit()->moveCursor(QTextCursor::End);
300  textEdit()->clear();
301  emit canSendChanged( false );
302 }
303 
304 bool ChatTextEditPart::isTyping()
305 {
306  QString txt = text( Qt::PlainText );
307 
308  //Make sure the message is empty. QString::isEmpty()
309  //returns false if a message contains just whitespace
310  //which is the reason why we strip the whitespace
311  return !txt.trimmed().isEmpty();
312 }
313 
314 void ChatTextEditPart::slotTextChanged()
315 {
316  if ( isTyping() )
317  {
318  // And they were previously typing
319  if( !m_typingRepeatTimer->isActive() )
320  {
321  m_typingRepeatTimer->setSingleShot( false );
322  m_typingRepeatTimer->start( 4000 );
323  slotRepeatTypingTimer();
324  }
325 
326  // Reset the stop timer again, regardless of status
327  m_typingStopTimer->setSingleShot( true );
328  m_typingStopTimer->start( 4500 );
329  }
330 
331  emit canSendChanged( canSend() );
332 }
333 
334 void ChatTextEditPart::historyUp()
335 {
336  if ( historyList.empty() || historyPos == historyList.count() - 1 )
337  return;
338 
339  QString text = this->text(Qt::PlainText);
340  bool empty = text.trimmed().isEmpty();
341 
342  // got text? save it
343  if ( !empty )
344  {
345  text = this->text(Qt::AutoText);
346  if ( historyPos == -1 )
347  {
348  historyList.prepend( text );
349  historyPos = 0;
350  }
351  else
352  {
353  historyList[historyPos] = text;
354  }
355  }
356 
357  historyPos++;
358 
359  QString newText = historyList[historyPos];
360  textEdit()->setTextOrHtml( newText );
361  textEdit()->moveCursor( QTextCursor::End );
362 }
363 
364 void ChatTextEditPart::historyDown()
365 {
366  if ( historyList.empty() || historyPos == -1 )
367  return;
368 
369  QString text = this->text(Qt::PlainText);
370  bool empty = text.trimmed().isEmpty();
371 
372  // got text? save it
373  if ( !empty )
374  {
375  text = this->text(Qt::AutoText);
376  historyList[historyPos] = text;
377  }
378 
379  historyPos--;
380 
381  QString newText = ( historyPos >= 0 ? historyList[historyPos] : QString() );
382 
383 
384  textEdit()->setTextOrHtml( newText );
385  textEdit()->moveCursor( QTextCursor::End );
386 }
387 
388 void ChatTextEditPart::addText( const QString &text )
389 {
390  if( Qt::mightBeRichText(text) )
391  {
392  if ( textEdit()->isRichTextEnabled() )
393  {
394  textEdit()->insertHtml( text );
395  }
396  else
397  {
398  QTextDocument doc;
399  doc.setHtml( text );
400  textEdit()->insertPlainText( doc.toPlainText() );
401  }
402  }
403  else
404  {
405  textEdit()->insertPlainText( text );
406  }
407 }
408 
409 void ChatTextEditPart::setContents( const Kopete::Message &message )
410 {
411  if ( isRichTextEnabled() )
412  textEdit()->setHtml ( message.escapedBody() );
413  else
414  textEdit()->setPlainText ( message.plainBody() );
415  textEdit()->moveCursor ( QTextCursor::End );
416 }
417 
418 Kopete::Message ChatTextEditPart::contents()
419 {
420  Kopete::Message currentMsg( m_session->myself(), m_session->members() );
421  currentMsg.setDirection( Kopete::Message::Outbound );
422 
423  if (isRichTextEnabled())
424  {
425  currentMsg.setHtmlBody(text());
426 
427  Kopete::Protocol::Capabilities protocolCaps = m_session->protocol()->capabilities();
428 
429  // I hate base *only* support, *waves fist at MSN*
430  if (protocolCaps & Kopete::Protocol::BaseFormatting)
431  {
432  currentMsg.setFont(textEdit()->currentRichFormat().font());
433  }
434 
435  if (protocolCaps & Kopete::Protocol::BaseFgColor)
436  {
437  currentMsg.setForegroundColor(textEdit()->currentRichFormat().foreground().color());
438  }
439 
440  if (protocolCaps & Kopete::Protocol::BaseBgColor)
441  {
442  currentMsg.setBackgroundColor(textEdit()->currentRichFormat().background().color());
443  }
444  }
445  else
446  {
447  currentMsg.setPlainBody(text());
448  }
449 
450  return currentMsg;
451 }
452 
453 void ChatTextEditPart::slotRepeatTypingTimer()
454 {
455  emit typing( true );
456 }
457 
458 void ChatTextEditPart::slotStoppedTypingTimer()
459 {
460  m_typingRepeatTimer->stop();
461  m_typingStopTimer->stop();
462  emit typing( false );
463 }
464 
465 void ChatTextEditPart::slotAppearanceChanged()
466 {
467  Kopete::AppearanceSettings *settings = Kopete::AppearanceSettings::self();
468 
469  QFont font = ( settings->chatFontSelection() == 1 ) ? settings->chatFont() : KGlobalSettings::generalFont();
470  QTextCharFormat format;
471  format.setFont(font);
472  format.setBackground(settings->chatBackgroundColor());
473  format.setForeground(settings->chatTextColor());
474 
475  editor->setDefaultPlainCharFormat(format);
476  editor->setDefaultRichCharFormat(format);
477 }
478 
479 void ChatTextEditPart::slotRichTextSupportChanged()
480 {
481  KXMLGUIFactory * f = factory();
482  if (f)
483  {
484  f->removeClient(this);
485  f->addClient(this);
486  }
487 }
488 
489 KopeteRichTextWidget *ChatTextEditPart::textEdit()
490 {
491  return editor;
492 }
493 
494 void ChatTextEditPart::setCheckSpellingEnabled( bool enabled )
495 {
496  editor->setCheckSpellingEnabled( enabled );
497 }
498 
499 bool ChatTextEditPart::checkSpellingEnabled() const
500 {
501  return editor->checkSpellingEnabled();
502 }
503 
504 void ChatTextEditPart::checkToolbarEnabled()
505 {
506  emit toolbarToggled( isRichTextEnabled() );
507 }
508 
509 KAboutData *ChatTextEditPart::createAboutData()
510 {
511  KAboutData *aboutData = new KAboutData("krichtexteditpart", 0, ki18n("Chat Text Edit Part"), "0.1",
512  ki18n("A simple rich text editor part"),
513  KAboutData::License_LGPL );
514  aboutData->addAuthor(ki18n("Richard J. Moore"), KLocalizedString(), "rich@kde.org", "http://xmelegance.org/" );
515  aboutData->addAuthor(ki18n("Jason Keirstead"), KLocalizedString(), "jason@keirstead.org", "http://www.keirstead.org/" );
516  aboutData->addAuthor(ki18n("MichaĆ«l Larouche"), KLocalizedString(), "larouche@kde.org" "http://www.tehbisnatch.org/" );
517  aboutData->addAuthor(ki18n("Benson Tsai"), KLocalizedString(), "btsai@vrwarp.com" "http://www.vrwarp.com/" );
518 
519  return aboutData;
520 }
521 
522 void ChatTextEditPart::readConfig( KConfigGroup& config )
523 {
524  kDebug() << "Loading config";
525 
526  QTextCharFormat format = editor->defaultRichFormat();
527 
528  QFont font = config.readEntry( "TextFont", format.font() );
529  QColor fg = config.readEntry( "TextFgColor", format.foreground().color() );
530  QColor bg = config.readEntry( "TextBgColor", format.background().color() );
531 
532  QTextCharFormat desiredFormat = editor->currentRichFormat();
533  desiredFormat.setFont(font);
534  desiredFormat.setForeground(fg);
535  desiredFormat.setBackground(bg);
536  editor->setCurrentRichCharFormat(desiredFormat);
537 
538  textEdit()->setAlignment(static_cast<Qt::AlignmentFlag>(config.readEntry( "EditAlignment", int(Qt::AlignLeft) )));
539 }
540 
541 void ChatTextEditPart::writeConfig( KConfigGroup& config )
542 {
543  kDebug() << "Saving config";
544 
545  config.writeEntry( "TextFont", editor->currentRichFormat().font() );
546  config.writeEntry( "TextFgColor", editor->currentRichFormat().foreground().color() );
547  config.writeEntry( "TextBgColor", editor->currentRichFormat().background().color() );
548  config.writeEntry( "EditAlignment", int(editor->alignment()) );
549 }
550 
551 void ChatTextEditPart::resetConfig( KConfigGroup& config )
552 {
553  kDebug() << "Setting default font style";
554 
555  editor->slotResetFontAndColor();
556 
557  //action_align_left->trigger();
558 
559  config.deleteEntry( "TextFont" );
560  config.deleteEntry( "TextFg" );
561  config.deleteEntry( "TextBg" );
562  config.deleteEntry( "EditAlignment" );
563 }
564 
565 QString ChatTextEditPart::text( Qt::TextFormat format ) const
566 {
567  if( (format == Qt::RichText || format == Qt::AutoText) && isRichTextEnabled() )
568  return editor->toHtml();
569  else
570  return editor->toPlainText();
571 }
572 
573 bool ChatTextEditPart::isRichTextEnabled() const
574 {
575  return editor->isRichTextEnabled();
576 }
577 
578 #include "chattexteditpart.moc"
579 
580 // vim: set noet ts=4 sts=4 sw=4:
ChatTextEditPart::complete
void complete()
Try to complete the word under the cursor.
Definition: chattexteditpart.cpp:131
KopeteRichTextWidget::setDefaultRichCharFormat
void setDefaultRichCharFormat(const QTextCharFormat &format)
Definition: kopeterichtextwidget.cpp:520
ChatTextEditPart::historyUp
void historyUp()
Go up an entry in the message history.
Definition: chattexteditpart.cpp:334
ChatTextEditPart::isRichTextEnabled
bool isRichTextEnabled() const
Is rich text is currently enabled.
Definition: chattexteditpart.cpp:573
ChatTextEditPart::ChatTextEditPart
ChatTextEditPart(Kopete::ChatSession *session, QWidget *parent)
Definition: chattexteditpart.cpp:59
ChatTextEditPart::canSend
bool canSend()
Can we send messages now?
Definition: chattexteditpart.cpp:226
ChatTextEditPart::resetConfig
void resetConfig(KConfigGroup &config)
Definition: chattexteditpart.cpp:551
ChatTextEditPart::messageSent
void messageSent(Kopete::Message &message)
Emitted when a message is sent.
QWidget
QObject
ChatTextEditPart::checkToolbarEnabled
void checkToolbarEnabled()
Definition: chattexteditpart.cpp:504
ChatTextEditPart::readConfig
void readConfig(KConfigGroup &config)
Definition: chattexteditpart.cpp:522
ChatTextEditPart::typing
void typing(bool typing)
Emitted every 4 seconds while the user is typing.
chattexteditpart.h
kopetechatwindowsettings.h
ChatTextEditPart::~ChatTextEditPart
~ChatTextEditPart()
Definition: chattexteditpart.cpp:126
ChatTextEditPart::addText
void addText(const QString &text)
Adds text into the edit area.
Definition: chattexteditpart.cpp:388
ChatTextEditPart::historyDown
void historyDown()
Go down an entry in the message history.
Definition: chattexteditpart.cpp:364
KopeteRichTextWidget
A KopeteRichTextWidget with overridden behaviors.
Definition: kopeterichtextwidget.h:44
ChatTextEditPart::isTyping
bool isTyping()
Is the user typing right now?
Definition: chattexteditpart.cpp:304
KopeteRichTextWidget::currentRichFormat
QTextCharFormat currentRichFormat() const
Definition: kopeterichtextwidget.cpp:564
ChatTextEditPart
An instant message composition part.
Definition: chattexteditpart.h:61
KopeteRichTextWidget::setCurrentRichCharFormat
void setCurrentRichCharFormat(const QTextCharFormat &format)
Definition: kopeterichtextwidget.cpp:529
ChatTextEditPart::canSendChanged
void canSendChanged(bool canSend)
Our send-button-enabled flag might have changed.
ChatTextEditPart::toolbarToggled
void toolbarToggled(bool enabled)
ChatTextEditPart::setCheckSpellingEnabled
void setCheckSpellingEnabled(bool enabled)
Enable or Disable the automatic spell checking.
Definition: chattexteditpart.cpp:494
ChatTextEditPart::sendMessage
void sendMessage()
Sends the text currently entered into the edit area.
Definition: chattexteditpart.cpp:269
ChatTextEditPart::createAboutData
static KAboutData * createAboutData()
Definition: chattexteditpart.cpp:509
ChatTextEditPartFactory
KParts::GenericFactory< ChatTextEditPart > ChatTextEditPartFactory
Definition: chattexteditpart.cpp:56
KopeteRichTextWidget::setTextOrHtml
void setTextOrHtml(const QString &text)
Definition: kopeterichtextwidget.cpp:118
ChatTextEditPart::contents
Kopete::Message contents()
Returns the message currently in the edit area.
Definition: chattexteditpart.cpp:418
ChatTextEditPart::writeConfig
void writeConfig(KConfigGroup &config)
Definition: chattexteditpart.cpp:541
KopeteRichTextWidget::isRichTextEnabled
bool isRichTextEnabled() const
Definition: kopeterichtextwidget.cpp:569
KopeteRichTextWidget::slotResetFontAndColor
void slotResetFontAndColor()
Definition: kopeterichtextwidget.cpp:249
ChatTextEditPart::checkSpellingEnabled
bool checkSpellingEnabled() const
Get the state of auto spell checking.
Definition: chattexteditpart.cpp:499
ChatTextEditPart::setContents
void setContents(const Kopete::Message &message)
Sets the message in the edit field.
Definition: chattexteditpart.cpp:409
KopeteRichTextWidget::setDefaultPlainCharFormat
void setDefaultPlainCharFormat(const QTextCharFormat &format)
Definition: kopeterichtextwidget.cpp:499
ChatTextEditPart::text
QString text(Qt::TextFormat format=Qt::AutoText) const
Get the text in the editor in the given format.
Definition: chattexteditpart.cpp:565
KopeteRichTextWidget::defaultRichFormat
QTextCharFormat defaultRichFormat() const
Definition: kopeterichtextwidget.cpp:559
ChatTextEditPart::textEdit
KopeteRichTextWidget * textEdit()
Get the inside KTextEdit.
Definition: chattexteditpart.cpp:489
Kopete::ContactPtrList
QList< Contact * > ContactPtrList
Definition: kopetechatwindow.h:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal