• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kopete/kopete

kopetechatwindow.h

Go to the documentation of this file.
00001 /*
00002     kopetechatwindow.h - Chat Window
00003 
00004     Copyright (c) 2002      by Olivier Goffart        <ogoffart@kde.org>
00005     Copyright (c) 2004      by Martijn Klingens       <klingens@kde.org>
00006 
00007     Kopete    (c) 2002-2004 by the Kopete developers  <kopete-devel@kde.org>
00008 
00009     *************************************************************************
00010     *                                                                       *
00011     * This program is free software; you can redistribute it and/or modify  *
00012     * it under the terms of the GNU General Public License as published by  *
00013     * the Free Software Foundation; either version 2 of the License, or     *
00014     * (at your option) any later version.                                   *
00015     *                                                                       *
00016     *************************************************************************
00017 */
00018 
00019 #ifndef KOPETECHATWINDOW_H
00020 #define KOPETECHATWINDOW_H
00021 
00022 #include <kparts/mainwindow.h>
00023 #include <qmovie.h>
00024 //Added by qt3to4:
00025 #include <QPixmap>
00026 #include <QLabel>
00027 #include <QVBoxLayout>
00028 #include <QFrame>
00029 #include <QCloseEvent>
00030 #include <QList>
00031 #include "kopetecontact.h"
00032 #include "kdeversion.h"
00033 #include <kopetechatsession.h>
00034 
00035 #include <kopete_export.h>
00036 
00037 class KAction;
00038 class KToggleAction;
00039 class KActionMenu;
00040 class KTemporaryFile;
00041 class QPixmap;
00042 class QTabWidget;
00043 class KSqueezedTextLabel;
00044 class KPushButton;
00045 class QVBoxLayout;
00046 class QFrame;
00047 class KTabWidget;
00048 class QLabel;
00049 class KopeteEmoticonAction;
00050 class ChatView;
00051 class SidebarWidget;
00052 class QDockWidget;
00053 
00054 namespace Kopete
00055 {
00056 class Message;
00057 class Contact;
00058 typedef QList<Contact*>  ContactPtrList;
00059 }
00060 
00061 typedef QList<ChatView*> ChatViewList;
00062 
00063 class KopeteChatWindow : public KXmlGuiWindow
00064 {
00065     Q_OBJECT
00066 
00067     enum {NEW_WINDOW, GROUP_BY_ACCOUNT, GROUP_ALL, GROUP_BY_GROUP, GROUP_BY_METACONTACT};
00068 
00069 public:
00077     static KopeteChatWindow *window( Kopete::ChatSession *manager );
00078     ~KopeteChatWindow();
00079 
00084     void attachChatView( ChatView *chat );
00085 
00090     void detachChatView( ChatView *chat );
00091 
00095     const int chatViewCount() { return chatViewList.count(); }
00096 
00101     ChatView *activeView();
00102 
00103     void setStatus( const QString & );
00104 
00109     virtual bool queryClose();
00110     virtual bool queryExit();
00111 
00112     KTemporaryFile *backgroundFile;
00113     ChatViewList chatViewList;
00114 
00115 private:
00116     // All KopeteChatWindows are created by the window function
00117     KopeteChatWindow( Kopete::ChatSession::Form form, QWidget *parent = 0 );
00118 
00123     static void windowListChanged();
00124 
00125     void initActions(void);
00126     void saveOptions(void);
00127     void readOptions(void);
00128     void checkDetachEnable();
00129     void createTabBar();
00130     void deleteTabBar();
00131     void addTab( ChatView* );
00132     void setPrimaryChatView( ChatView* );
00133 
00134     //why did we ever need this method??
00135     //const QString fileContents( const QString &file ) const;
00136 
00137     QDockWidget *m_participantsWidget;
00138 
00139     //
00140     QPointer<ChatView> m_activeView;
00141     ChatView *m_popupView;
00142     bool m_alwaysShowTabs;
00143     bool updateBg;
00144     KTabWidget *m_tabBar;
00145     KPushButton *m_button_send;
00146     KSqueezedTextLabel *m_status_text;
00147     QVBoxLayout *mainLayout;
00148     QFrame *mainArea;
00149     QLabel *anim;
00150     QMovie animIcon;
00151     QPixmap normalIcon;
00152 
00153     KAction *chatSend;
00154     KAction *historyUp;
00155     KAction *historyDown;
00156     KAction *nickComplete;
00157 
00158     KToggleAction *mStatusbarAction;
00159 
00160     KAction *tabLeft;
00161     KAction *tabRight;
00162     KAction *tabDetach;
00163     KAction* tabClose;
00164 
00165     KToggleAction* toggleAutoSpellCheck;
00166 
00167     KopeteEmoticonAction *actionSmileyMenu;
00168     KActionMenu *actionActionMenu;
00169     KActionMenu *actionContactMenu;
00170     KActionMenu *actionDetachMenu;
00171     KActionMenu *actionTabPlacementMenu;
00172     QString statusMsg;
00173     Kopete::ChatSession::Form initialForm;
00174 
00175 signals:
00176     void closing( KopeteChatWindow* );
00177     void chatSessionChanged( Kopete::ChatSession *newSession);
00178 
00179 public slots:
00180     void slotSmileyActivated( const QString & );
00181     void setActiveView( QWidget *active );
00182     void updateBackground( const QPixmap &pm );
00183 
00184 private slots:
00185 //  void slotPrepareSmileyMenu();
00186     void slotPrepareContactMenu();
00187     void slotPrepareDetachMenu();
00188     void slotPreparePlacementMenu();
00189     void slotUpdateSendEnabled();
00190 
00191     void slotCut();
00192     void slotCopy();
00193     void slotPaste();
00194 
00195     void slotSetBgColor();
00196     void slotSetFgColor();
00197     void slotSetFont();
00198 
00199     void slotHistoryUp();
00200     void slotHistoryDown();
00201     void slotPageUp();
00202     void slotPageDown();
00203 
00204     void slotSendMessage();
00205     void slotChatSave();
00206     void slotChatPrint();
00207 
00208     void slotPreviousTab();
00209     void slotNextTab();
00210     void slotDetachChat(QAction* = 0);
00211     void slotPlaceTabs( QAction* );
00212 
00213     void slotEnableUpdateBg() { updateBg = true; }
00214 
00215     void toggleAutoSpellChecking();
00216     void slotRTFEnabled( ChatView*, bool );
00217     void slotAutoSpellCheckEnabled( ChatView*, bool );
00218 
00219     void slotSetCaption( bool );
00220     void slotUpdateCaptionIcons( ChatView * );
00221     void slotChatClosed();
00222     void slotTabContextMenu( QWidget*, const QPoint & );
00223     void slotStopAnimation( ChatView* );
00224     void slotNickComplete();
00225     void slotCloseChat( QWidget* );
00226 
00227     //slots for tabs from the chatview widget
00228     void updateChatState( ChatView* cv, int state );
00229     void updateChatTooltip( ChatView* cv );
00230     void updateChatLabel();
00231 
00232 private:
00233     void updateSpellCheckAction();
00234 
00235 protected:
00236     virtual void closeEvent( QCloseEvent *e );
00237     virtual void changeEvent( QEvent *e );
00238 };
00239 
00240 #endif
00241 
00242 // vim: set noet ts=4 sts=4 sw=4:
00243 

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal