• 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.14
  • kdenetwork
  • kopete
  • kopete
  • chatwindow
chatmessagepart.h
Go to the documentation of this file.
1 /*
2  chatmessagepart.h - Chat Message KPart
3 
4  Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
5  Copyright (c) 2005 by MichaĆ«l Larouche <larouche@kde.org>
6  Copyright (c) 2009 by Fabian Rami <fabian.rami@wowcompany.com>
7 
8  Kopete (c) 2002-2008 by the Kopete developers <kopete-devel@kde.org>
9 
10  *************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  *************************************************************************
18 */
19 
20 #ifndef CHATMESSAGEPART_H
21 #define CHATMESSAGEPART_H
22 
23 #include <khtml_part.h>
24 #include <dom/html_element.h>
25 #include <dom/dom2_events.h>
26 
27 #include <kmenu.h>
28 #include <kopetemessage.h>
29 
30 #include <kopete_export.h>
31 
32 namespace Kopete
33 {
34  class Message;
35  class ChatSession;
36  class Contact;
37 }
38 class KMenu;
39 class ChatWindowStyle;
40 
44 class KOPETECHATWINDOW_SHARED_EXPORT ChatMessagePart : public KHTMLPart
45 {
46  Q_OBJECT
47 public:
51  ChatMessagePart( Kopete::ChatSession *manager, QWidget *parent);
52  ~ChatMessagePart();
53 
57  void clear();
58 
63  void keepScrolledDown();
64 
72  QString formatName( const Kopete::Contact* contact, Qt::TextFormat format ) const;
73 
81  QString formatName( const QString &sourceName, Qt::TextFormat format ) const;
82 
83 public slots:
92  void copy(bool justselection = false);
93 
97  void print();
98 
102  void save();
103 
107  void pageUp();
108 
112  void pageDown();
113 
119  void appendMessage( Kopete::Message &message, bool restoring = false);
120 
130  void setStyle( const QString &styleName );
131 
141  void setStyle( ChatWindowStyle *style );
142 
147  void setStyleVariant( const QString &variantPath );
148 
149  void messageStateChanged( uint messageId, Kopete::Message::MessageState state );
150 
155  KDE_DEPRECATED void slotToggleGraphicOverride(bool enable);
156 
157 signals:
161  void contextMenuEvent( const QString &textUnderMouse, KMenu *popupMenu );
162 
166  void tooltipEvent( const QString &textUnderMouse, QString &toolTip );
167 
168 private slots:
169  void slotOpenURLRequest( const KUrl &url, const KParts::OpenUrlArguments &, const KParts::BrowserArguments & );
170  void slotFileTransferIncomingDone( unsigned int id );
171  void slotScrollView();
172  void slotRenderingFinished();
173  void slotAppearanceChanged();
174 
175  void slotScrollingTo( int y );
176 
177  void slotRefreshView();
178 
179  void slotRightClick( const QString &, const QPoint &point );
180 
181  void slotCopyURL();
182 
183  void slotCloseView( bool force = false );
184 
188  void changeStyle();
189 
193  void clearStyle();
194 
198  void slotUpdateHeaderDisplayName();
202  void slotUpdateHeaderPhoto();
203 
204  void resendMessage( uint messageId );
205 
206  void playVoiceClip( uint messageId );
207 
208  void saveVoiceClip( uint messageId );
209 
210 protected:
211  virtual void khtmlDrawContentsEvent( khtml::DrawContentsEvent * );
212 
213 private:
214  void readOverrides();
215 
216  const QString styleHTML() const;
217 
218  Kopete::Contact *contactFromNode( const DOM::Node &n ) const;
219 
223  void emitTooltipEvent( const QString &textUnderMouse, QString &toolTipString );
224 
228  QString textUnderMouse();
229 
230 // class ToolTip;
231 // friend class ToolTip;
232 
242  QString formatStyleKeywords( const QString &sourceHTML, const Kopete::Message &message );
251  QString formatStyleKeywords( const QString &sourceHTML );
252 
261  QString formatTime(const QString &timeFormat, const QDateTime &dateTime);
262 
270  QString formatMessageBody( const Kopete::Message &message );
271 
275  void writeTemplate();
276 
283  QString adjustStyleVariantForChatSession( const QString & styleVariant ) const;
284 
289  QString photoForContact( const Kopete::Contact *contact ) const;
290 
291  void addFileTransferButtonsEventListener( unsigned int id );
292 
293  void disableFileTransferButtons( unsigned int id );
294 
295  void addVoiceClipsButtonsEventListener( unsigned int id );
296 
297  void changeMessageStateElement( uint id, Kopete::Message::MessageState state );
298 
299  void registerClickEventListener( DOM::HTMLElement element );
300 
301  void readChatFont();
302 
303  class Private;
304  Private * const d;
305 };
306 
307 class HTMLEventListener: public QObject, public DOM::EventListener
308 {
309  Q_OBJECT
310 public:
311  virtual void handleEvent( DOM::Event &event );
312 Q_SIGNALS:
313  void resendMessage( uint messageId );
314  void playVoiceClip( uint messageId );
315  void saveVoiceClip( uint messageId );
316 };
317 
318 #endif
319 
320 // vim: set noet ts=4 sts=4 sw=4:
321 
QWidget
ChatWindowStyle
This class represent a single chat window style.
Definition: kopetechatwindowstyle.h:30
manager
virtual Kopete::ChatSession * manager(Kopete::Contact::CanCreateFlags)
Definition: chatwindowconfig.cpp:94
ChatMessagePart
Definition: chatmessagepart.h:44
KHTMLPart
QPoint
HTMLEventListener::playVoiceClip
void playVoiceClip(uint messageId)
QObject::event
virtual bool event(QEvent *e)
HTMLEventListener::resendMessage
void resendMessage(uint messageId)
HTMLEventListener
Definition: chatmessagepart.h:307
QObject
QString
HTMLEventListener::saveVoiceClip
void saveVoiceClip(uint messageId)
HTMLEventListener::handleEvent
virtual void handleEvent(DOM::Event &event)
Definition: chatmessagepart.cpp:1593
QDateTime
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 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