1 /* 2 SPDX-License-Identifier: GPL-2.0-or-later 3 4 SPDX-FileCopyrightText: 2003 Dario Abatianni <eisfuchs@tigress.com> 5 SPDX-FileCopyrightText: 2006-2008 Eike Hein <hein@kde.org> 6 */ 7 8 #ifndef STATUSPANEL_H 9 #define STATUSPANEL_H 10 11 #include "chatwindow.h" 12 13 class AwayLabel; 14 class IRCInput; 15 16 17 class KComboBox; 18 19 class StatusPanel : public ChatWindow 20 { 21 Q_OBJECT 22 friend class Server; 23 24 public: 25 explicit StatusPanel(QWidget* parent); 26 ~StatusPanel() override; 27 28 void cycle() override; 29 30 void setName(const QString& newName) override; 31 32 bool closeYourself(bool askForConfirmation=true) override; 33 bool canBeFrontView() const override; 34 bool searchView() const override; 35 36 void setChannelEncoding(const QString& encoding) override; 37 QString getChannelEncoding() const override; 38 QString getChannelEncodingDefaultDesc() const override; 39 void emitUpdateInfo() override; 40 41 void setServer(Server* newServer) override; 42 43 void setNotificationsEnabled(bool enable) override; 44 45 Q_SIGNALS: 46 void sendFile(); 47 48 public Q_SLOTS: 49 void setNickname(const QString& newNickname); 50 void indicateAway(bool show) override; 51 void updateAppearance() override; 52 void updateName(); 53 54 protected Q_SLOTS: 55 void sendText(const QString& line) override; 56 //Used to disable functions when not connected 57 void serverOnline(bool online) override; 58 59 protected: 60 /** Called from ChatWindow adjustFocus */ 61 void childAdjustFocus() override; 62 void showEvent(QShowEvent* event) override; 63 64 private Q_SLOTS: 65 void sendFileMenu(); 66 void statusTextEntered(); 67 // connected to IRCInput::textPasted() - used for large/multiline pastes 68 void textPasted(const QString& text); 69 void changeNickname(const QString& newNickname); 70 void nicknameComboboxChanged(); 71 72 private: 73 bool awayChanged; 74 bool awayState; 75 76 KComboBox* nicknameCombobox; 77 AwayLabel* awayLabel; 78 QString oldNick; 79 80 Q_DISABLE_COPY(StatusPanel) 81 }; 82 83 #endif 84