root/trunk/qt4-gui/src/widgets/historyview.h

Revision 6185, 2.6 kB (checked in by flynd, 7 months ago)

Moved eventSent signal from mainwin to licqgui.

Line 
1/*
2 * This file is part of Licq, an instant messaging client for UNIX.
3 * Copyright (C) 2007 Licq developers
4 *
5 * Licq is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * Licq is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with Licq; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20#ifndef HISTORYVIEW_H
21#define HISTORYVIEW_H
22
23#include <licq_constants.h>
24
25#include "mlview.h"
26
27class CUserEvent;
28class ICQEvent;
29
30namespace LicqQtGui
31{
32class HistoryView : public MLView
33{
34  Q_OBJECT
35
36public:
37  static QStringList getStyleNames(bool includeHistoryStyles = false);
38
39  HistoryView(bool historyMode = false, QString id = QString(),
40      unsigned long ppid = 0, QWidget* parent = 0);
41  virtual ~HistoryView();
42
43  void setHistoryConfig(unsigned short msgStyle, QString dateFormat,
44      bool extraSpacing, bool reverse);
45  void setChatConfig(unsigned short msgStyle, QString dateFormat,
46      bool extraSpacing, bool appendLineBreak, bool showNotices);
47  void setColors(QString back, QString rcv, QString snt,
48      QString rcvHist = QString(), QString sntHist = QString(),
49      QString notice = QString());
50  void setReverse(bool reverse);
51  void setOwner(QString id, unsigned long ppid = 0);
52
53  void updateContent();
54  void clear();
55  void addMsg(direction dir, bool fromHistory, QString eventDescription, QDateTime date,
56    bool isDirect, bool isMultiRec, bool isUrgent, bool isEncrypted,
57    QString contactName, QString messageText, QString anchor = QString());
58  void addNotice(QDateTime dateTime, QString messageText);
59
60  virtual QSize sizeHint() const;
61
62public slots:
63  void addMsg(const CUserEvent* event, QString id = QString(), unsigned long ppid = 0);
64  void addMsg(const ICQEvent* event);
65  void setColors();
66
67signals:
68  void messageAdded();
69
70private:
71  void internalAddMsg(QString s);
72
73  QString myId;
74  unsigned long myPpid;
75  unsigned short myMsgStyle;
76  QString myDateFormat;
77  bool myExtraSpacing;
78  bool myReverse;
79  bool myAppendLineBreak;
80  bool myUseBuffer;
81  bool myShowNotices;
82  QString myColorRcvHistory;
83  QString myColorSntHistory;
84  QString myColorRcv;
85  QString myColorSnt;
86  QString myColorNotice;
87  QString myBuffer;
88};
89
90} // namespace LicqQtGui
91
92#endif
Note: See TracBrowser for help on using the browser.