• 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
kopetechatwindow.h
Go to the documentation of this file.
1 /*
2  kopetechatwindow.h - Chat Window
3 
4  Copyright (c) 2008 by Benson Tsai <btsai@vrwarp.com>
5  Copyright (c) 2002 by Olivier Goffart <ogoffart@kde.org>
6  Copyright (c) 2004 by Martijn Klingens <klingens@kde.org>
7 
8  Kopete (c) 2002-2004 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 KOPETECHATWINDOW_H
21 #define KOPETECHATWINDOW_H
22 
23 #include <kparts/mainwindow.h>
24 #include <qmovie.h>
25 #include <QPixmap>
26 #include <QLabel>
27 #include <QVBoxLayout>
28 #include <QFrame>
29 #include <QCloseEvent>
30 #include <QList>
31 #include "kopetecontact.h"
32 #include "kdeversion.h"
33 #include <kopetechatsession.h>
34 
35 #include <kopete_export.h>
36 
37 class KAction;
38 class KToggleAction;
39 class KActionMenu;
40 class KTemporaryFile;
41 class QPixmap;
42 class KSqueezedTextLabel;
43 class KPushButton;
44 class QVBoxLayout;
45 class QFrame;
46 class KTabWidget;
47 class QLabel;
48 class KopeteEmoticonAction;
49 class ChatView;
50 class QDockWidget;
51 
52 namespace Kopete
53 {
54 class Message;
55 class Contact;
56 typedef QList<Contact*> ContactPtrList;
57 }
58 
59 typedef QList<ChatView*> ChatViewList;
60 
61 class KopeteChatWindow : public KXmlGuiWindow
62 {
63  Q_OBJECT
64 
65  enum {NEW_WINDOW, GROUP_BY_ACCOUNT, GROUP_ALL, GROUP_BY_GROUP, GROUP_BY_METACONTACT};
66 
67 public:
75  static KopeteChatWindow *window( Kopete::ChatSession *manager );
76  ~KopeteChatWindow();
77 
82  void attachChatView( ChatView *chat );
83 
88  void detachChatView( ChatView *chat );
89 
93  int chatViewCount() { return chatViewList.count(); }
94 
99  ChatView *activeView();
100 
101  void setStatus( const QString & );
102 
107  virtual bool queryClose();
108  virtual bool queryExit();
109 
110  KTemporaryFile *backgroundFile;
111  ChatViewList chatViewList;
112 
113 private:
114  // All KopeteChatWindows are created by the window function
115  KopeteChatWindow( Kopete::ChatSession::Form form, QWidget *parent = 0 );
116 
121  static void windowListChanged();
122 
123  void initActions(void);
124  void saveOptions(void);
125  void readOptions(void);
126  void checkDetachEnable();
127  void createTabBar();
128  void deleteTabBar();
129  void addTab( ChatView* );
130  void setPrimaryChatView( ChatView* );
131 
132  //why did we ever need this method??
133  //const QString fileContents( const QString &file ) const;
134 
135  QDockWidget *m_participantsWidget;
136 
137  //
138  QPointer<ChatView> m_activeView;
139  ChatView *m_popupView;
140  bool m_alwaysShowTabs;
141  bool updateBg;
142  KTabWidget *m_tabBar;
143  KPushButton *m_button_send;
144  KSqueezedTextLabel *m_status_text;
145  QVBoxLayout *mainLayout;
146  QFrame *mainArea;
147  QLabel *anim;
148  QMovie* animIcon;
149  QPixmap normalIcon;
150 
151  KAction *chatSend;
152  KAction *chatSendFile;
153  KAction *historyUp;
154  KAction *historyDown;
155  KAction *nickComplete;
156 
157  KToggleAction *mStatusbarAction;
158 
159  KAction *tabActive;
160  KAction *tabLeft;
161  KAction *tabRight;
162  KAction *tabDetach;
163  KAction *tabClose;
164  KAction *tabCloseAllOthers;
165 
166  QAction *sendMessage;
167 
168  KToggleAction* toggleAutoSpellCheck;
169 
170  KopeteEmoticonAction *actionSmileyMenu;
171  KActionMenu *actionActionMenu;
172  KActionMenu *actionContactMenu;
173  KActionMenu *actionDetachMenu;
174  KActionMenu *actionTabPlacementMenu;
175  QString statusMsg;
176  Kopete::ChatSession::Form initialForm;
177 
178  bool m_UpdateChatLabel;
179 
180 signals:
181  void closing( KopeteChatWindow* );
182  void chatSessionChanged( Kopete::ChatSession *newSession);
183 
184 public slots:
185  void slotSmileyActivated( const QString & );
186  void setActiveView( QWidget *active );
187  void updateBackground( const QPixmap &pm );
188 
189 private slots:
190 // void slotPrepareSmileyMenu();
191  void testCanDecode(const QDragMoveEvent *, bool &);
192  void receivedDropEvent( QWidget *, QDropEvent * );
193  void slotPrepareContactMenu();
194  void slotPrepareDetachMenu();
195  void slotPreparePlacementMenu();
196  void slotUpdateSendEnabled();
197 
198  void slotCut();
199  void slotCopy();
200  void slotPaste();
201 
202  void slotResetFontAndColor();
203 
204  void slotHistoryUp();
205  void slotHistoryDown();
206  void slotPageUp();
207  void slotPageDown();
208 
209  void slotSendMessage();
210  void slotSendFile();
211  void slotChatSave();
212  void slotChatPrint();
213 
214  void slotPreviousTab();
215  void slotNextTab();
216  void slotNextActiveTab();
217  void slotDetachChat(QAction* = 0);
218  void slotPlaceTabs( QAction* );
219  void slotCloseAllOtherTabs();
220 
221  void slotEnableUpdateBg() { updateBg = true; }
222 
223  void updateChatSendFileAction();
224  void updateSendKeySequence();
225 
226  void toggleAutoSpellChecking();
227  void slotAutoSpellCheckEnabled( ChatView*, bool );
228 
229  void slotSetCaption( bool );
230  void slotUpdateCaptionIcons( ChatView * );
231  void slotChatClosed();
232  void slotTabContextMenu( QWidget*, const QPoint & );
233  void slotStopAnimation( ChatView* );
234  void slotCloseChat( QWidget* );
235 
236  //slots for tabs from the chatview widget
237  void updateChatState( ChatView* cv, int state );
238  void updateChatTooltip( ChatView* cv );
239  void updateChatLabel();
240 
241  void enableSpellCheckAction(bool enable);
242 
243  void updateActions();
244 
245 private:
246  void updateSpellCheckAction();
247 
248 protected:
249  virtual void closeEvent( QCloseEvent *e );
250  virtual void changeEvent( QEvent *e );
251  virtual void resizeEvent( QResizeEvent *e);
252  virtual bool eventFilter( QObject *obj, QEvent *event );
253 };
254 
255 #endif
256 
257 // vim: set noet ts=4 sts=4 sw=4:
258 
KopeteChatWindow::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition: kopetechatwindow.cpp:1356
ChatView
Definition: chatview.h:62
KPushButton
KopeteChatWindow::chatSessionChanged
void chatSessionChanged(Kopete::ChatSession *newSession)
QEvent
QResizeEvent
QWidget
KopeteChatWindow::chatViewList
ChatViewList chatViewList
Definition: kopetechatwindow.h:111
ChatViewList
QList< ChatView * > ChatViewList
Definition: kopetechatwindow.h:59
KopeteChatWindow::closing
void closing(KopeteChatWindow *)
KopeteChatWindow::chatViewCount
int chatViewCount()
Returns the number of chat views attached to this window.
Definition: kopetechatwindow.h:93
QDockWidget
KopeteChatWindow::backgroundFile
KTemporaryFile * backgroundFile
Definition: kopetechatwindow.h:110
KopeteChatWindow::resizeEvent
virtual void resizeEvent(QResizeEvent *e)
Definition: kopetechatwindow.cpp:1349
QDragMoveEvent
KopeteChatWindow::detachChatView
void detachChatView(ChatView *chat)
Detach a chat view from this window.
Definition: kopetechatwindow.cpp:804
manager
virtual Kopete::ChatSession * manager(Kopete::Contact::CanCreateFlags)
Definition: chatwindowconfig.cpp:94
KopeteChatWindow::queryExit
virtual bool queryExit()
Definition: kopetechatwindow.cpp:1259
QPointer< ChatView >
QMovie
KopeteEmoticonAction
Definition: kopeteemoticonaction.h:28
KopeteChatWindow::slotSmileyActivated
void slotSmileyActivated(const QString &)
Definition: kopetechatwindow.cpp:1209
KopeteChatWindow::updateBackground
void updateBackground(const QPixmap &pm)
Definition: kopetechatwindow.cpp:931
QPoint
KopeteChatWindow::queryClose
virtual bool queryClose()
Reimplemented from KXmlGuiWindow - asks each ChatView in the window if it is ok to close the window...
Definition: kopetechatwindow.cpp:1225
KopeteChatWindow::changeEvent
virtual void changeEvent(QEvent *e)
Definition: kopetechatwindow.cpp:1197
QCloseEvent
QList::count
int count(const T &value) const
KXmlGuiWindow
QObject
QDropEvent
KopeteChatWindow::window
static KopeteChatWindow * window(Kopete::ChatSession *manager)
Find the appropriate window for a ChatView of the given protocol to dock into.
Definition: kopetechatwindow.cpp:105
QVBoxLayout
KopeteChatWindow::~KopeteChatWindow
~KopeteChatWindow()
Definition: kopetechatwindow.cpp:281
KopeteChatWindow::closeEvent
virtual void closeEvent(QCloseEvent *e)
Definition: kopetechatwindow.cpp:1275
QString
QList
QPixmap
QFrame
KActionMenu
KopeteChatWindow::activeView
ChatView * activeView()
Returns the chatview in the currently active tab, or the only chat view if chatViewCount() == 1...
Definition: kopetechatwindow.cpp:348
QAction
KAction
KopeteChatWindow::attachChatView
void attachChatView(ChatView *chat)
Attach an unattached chatview to this window.
Definition: kopetechatwindow.cpp:757
KopeteChatWindow::setActiveView
void setActiveView(QWidget *active)
Definition: kopetechatwindow.cpp:946
KopeteChatWindow::setStatus
void setStatus(const QString &)
Definition: kopetechatwindow.cpp:629
KopeteChatWindow
Definition: kopetechatwindow.h:61
QLabel
Kopete::ContactPtrList
QList< Contact * > ContactPtrList
Definition: kopetechatwindow.h:55
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