root/trunk/qt4-gui/src/userevents/usersendcommon.h

Revision 6463, 3.6 kB (checked in by flynd, 4 months ago)

Use a const pointer for user objects that are only fetched for read access. Fixed some places where we changed the user even though we just had a read lock.

Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of Licq, an instant messaging client for UNIX.
4 * Copyright (C) 2000-2006 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 USERSENDCOMMON_H
22#define USERSENDCOMMON_H
23
24#include "usereventcommon.h"
25
26#include <licq_color.h>
27
28class QGroupBox;
29class QLabel;
30class QPushButton;
31class QSplitter;
32
33class CICQSignal;
34class ICQEvent;
35class ICQUser;
36
37namespace LicqQtGui
38{
39class HistoryView;
40class MLEdit;
41class MMUserView;
42
43class UserSendCommon : public UserEventCommon
44{
45  Q_OBJECT
46public:
47
48  UserSendCommon(int type, QString id, unsigned long ppid, QWidget* parent = 0, const char* name = 0);
49  virtual ~UserSendCommon();
50  virtual bool eventFilter(QObject* watched, QEvent* e);
51
52  void setText(const QString& text);
53  void convoJoin(QString id, unsigned long convoId);
54  void convoLeave(QString id, unsigned long convoId);
55
56  virtual void windowActivationChange(bool oldActive);
57  int clearDelay;
58
59signals:
60  void autoCloseNotify();
61  void msgTypeChanged(UserSendCommon* from, UserSendCommon* to);
62
63  /**
64   * Since daemon doesn't notify us when an event is sent we'll have to handle
65   * it ourselfs. This signal is sent to notify other windows about the event
66   * that was sent.
67   *
68   * @param event Event object that was sent
69   */
70  void eventSent(const ICQEvent* event);
71
72public slots:
73  void changeEventType(int type);
74
75protected:
76  CICQColor myIcqColor;
77  HistoryView* myHistoryView;
78  MLEdit* myMessageEdit;
79  MMUserView* myMassMessageList;
80  QAction* myMassMessageCheck;
81  QAction* mySendServerCheck;
82  QAction* myUrgentCheck;
83  QAction* myEventTypeMenu;
84  QActionGroup* myEventTypeGroup;
85  QGroupBox* myMassMessageBox;
86  QLabel* myPictureLabel;
87  QPushButton* myCloseButton;
88  QPushButton* mySendButton;
89  QSplitter* myViewSplitter;
90  QSplitter* myPictureSplitter;
91  QString myTempMessage;
92  QTimer* mySendTypingTimer;
93  int myType;
94
95  void retrySend(ICQEvent* e, bool online, unsigned short level);
96  virtual void userUpdated(CICQSignal* sig, QString id = QString::null, unsigned long ppid = 0);
97  void updatePicture(const ICQUser* u = NULL);
98  bool checkSecure();
99
100  /**
101   * Get icon for a message type
102   *
103   * @param type Message type
104   * @return Message icon
105   */
106  const QPixmap& iconForType(int type) const;
107
108  virtual void resetSettings() = 0;
109  virtual bool sendDone(ICQEvent* e) = 0;
110
111protected slots:
112  /**
113   * Update iconset in menus and on buttons
114   */
115  virtual void updateIcons();
116
117  virtual void send();
118  virtual void eventDoneReceived(ICQEvent* e);
119
120  void cancelSend();
121  void changeEventType(QAction* action);
122  void clearNewEvents();
123  void closeDialog();
124  void showEmoticonsMenu();
125  void insertEmoticon(const QString& value);
126  void massMessageToggled(bool on);
127  void messageAdded();
128  void resetTitle();
129  void sendServerToggled(bool on);
130  void setBackgroundICQColor();
131  void setForegroundICQColor();
132  void showSendTypeMenu();
133  void messageTextChanged();
134  void textChangedTimeout();
135  void sendTrySecure();
136};
137
138} // namespace LicqQtGui
139#endif
Note: See TracBrowser for help on using the browser.