root/trunk/qt4-gui/src/dialogs/historydlg.h

Revision 6448, 3.4 kB (checked in by flynd, 4 months ago)

Searching in history dialog will now mark all dates with matching entries in green.

Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of Licq, an instant messaging client for UNIX.
4 * Copyright (C) 2007 Licq developers
5 *
6 * Licq is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Licq is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Licq; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 */
20
21#ifndef HISTORYDLG_H
22#define HISTORYDLG_H
23
24#include "config.h"
25
26#include <QDialog>
27
28#include <licq_history.h>
29
30class QCalendarWidget;
31class QCheckBox;
32class QLabel;
33class QLineEdit;
34class QPushButton;
35class QRegExp;
36class QTextCodec;
37
38class CICQSignal;
39class ICQEvent;
40
41namespace LicqQtGui
42{
43class Calendar;
44class HistoryView;
45
46/**
47 * Dialog that displays history for a contact with search functionallity
48 */
49class HistoryDlg : public QDialog
50{
51  Q_OBJECT
52
53public:
54  /**
55   * Constructor
56   *
57   * @param id Contact id
58   * @param ppid Contact protocol id
59   * @param parent Parent widget
60   */
61  HistoryDlg(QString id, unsigned long ppid, QWidget* parent = 0);
62
63  /**
64   * Desstructor
65   */
66  ~HistoryDlg();
67
68private slots:
69  /**
70   * Update history view to show the date marked in the calendar
71   */
72  void calenderClicked();
73
74  /**
75   * Search forwards
76   */
77  void findNext();
78
79  /**
80   * Search backwards
81   */
82  void findPrevious();
83
84  /**
85   * Find the next occurence of the word in the search box
86   *
87   * @param backwards Search backwards in history
88   */
89  void find(bool backwards);
90
91  /**
92   * Search field has changed
93   *
94   * @param text Contents of text field
95   */
96  void searchTextChanged(const QString& text);
97
98  /**
99   * Popup user menu from menu button
100   */
101  void showUserMenu();
102
103  /**
104   * Go to next date with activity
105   */
106  void nextDate();
107
108  /**
109   * Go to previous date with activity
110   */
111  void previousDate();
112
113private slots:
114  /**
115   * A user was updated. Add to history if it was a message recieved for this user
116   *
117   * @param signal Signal from daemon
118   */
119  void updatedUser(CICQSignal* signal);
120
121  /**
122   * A message was sent. Add to history if it was for the current user
123   *
124   * @param event Event object for message
125   */
126  void eventSent(const ICQEvent* event);
127
128private:
129  /**
130   * Add an event to the current history
131   *
132   * @param event Event to add
133   */
134  void addMsg(const CUserEvent* event);
135
136  /**
137   * Build a regular expression from the input fields
138   *
139   * @return A regular expression
140   */
141  QRegExp getRegExp() const;
142
143  /**
144   * Populate history view with entries
145   */
146  void showHistory();
147
148  QString myId;
149  unsigned long myPpid;
150  bool myIsOwner;
151  QString myContactName;
152  QString myOwnerName;
153  QTextCodec* myContactCodec;
154  bool myUseHtml;
155  bool myPatternChanged;
156
157  HistoryList myHistoryList;
158  HistoryListIter mySearchPos;
159
160  Calendar* myCalendar;
161  HistoryView* myHistoryView;
162  QLabel* myStatusLabel;
163  QLineEdit* myPatternEdit;
164  QCheckBox* myMatchCaseCheck;
165  QCheckBox* myRegExpSearchCheck;
166  QPushButton* myFindPrevButton;
167  QPushButton* myFindNextButton;
168};
169
170} // namespace LicqQtGui
171
172#endif
Note: See TracBrowser for help on using the browser.