The complete source code of IdealIRC http://www.idealirc.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
idealirc/IWin/IWin.h

59 lines
1.3 KiB

/*
* 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 <QWidget>
#include <unordered_map>
#include <QCloseEvent>
#include <QShowEvent>
class IWin : public QWidget
{
Q_OBJECT
public:
enum class Type
{
Undefined,
Status,
Channel,
Private,
Custom
};
static const QString InvalidWindowTypeString;
static std::unordered_map<Type,QString> 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