/* * IdealIRC - Internet Relay Chat client * Copyright (C) 2021 Tom-Andre Barstad. * This software is licensed under the Software Attribution License. * See LICENSE for more information. */ #ifndef IWIN_H #define IWIN_H #include "Widgets/IIRCView.h" #include #include #include #include class IWin : public QWidget { Q_OBJECT public: enum class Type { Undefined, Status, Channel, Private, Custom }; static const QString InvalidWindowTypeString; static std::unordered_map TypeString; Type getType() const; IWin* getParent() const { return m_parent; } IWin* getStatusParent(); virtual bool print(PrintType ptype, const QString& text) = 0; virtual void refreshWindowTitle() = 0; virtual void clear() = 0; const QString& getButtonText() const; void setButtonText(const QString& text); bool operator==(const IWin& other); // TODO implementation protected: explicit IWin(Type type, IWin* parentWindow = nullptr); void closeEvent(QCloseEvent*) override; private: Type m_type; QString m_buttonText; IWin* m_parent{ nullptr }; bool m_firstShow{ true }; signals: void aboutToClose(IWin* who); }; #endif // IWIN_H