Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
#ifndef STYLENAMEEDITOR_H
Toshihiro Shimizu 890ddd
#define STYLENAMEEDITOR_H
Toshihiro Shimizu 890ddd
shun_iwasawa 03feed
#include "dvdialog.h"
shun_iwasawa 03feed
shun_iwasawa 160579
#include <qwidget></qwidget>
shun_iwasawa 160579
#include <qstringlist></qstringlist>
shun_iwasawa 160579
#include <qpushbutton></qpushbutton>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class QLineEdit;
Toshihiro Shimizu 890ddd
class QPushButton;
Toshihiro Shimizu 890ddd
class TPaletteHandle;
shun_iwasawa 160579
class QGridLayout;
shun_iwasawa 6c76ac
class QScrollArea;
shun_iwasawa 160579
shun_iwasawa 160579
const int WORD_COLUMN_AMOUNT = 3;
shun_iwasawa 160579
shun_iwasawa 160579
//------------------------------------------------------------
shun_iwasawa 160579
shun_iwasawa 160579
class NewWordDialog : public QDialog {
shun_iwasawa 160579
  Q_OBJECT
shun_iwasawa 160579
  QLineEdit *m_lineEdit;
shun_iwasawa 160579
shun_iwasawa 160579
public:
otakuto fb3573
  NewWordDialog(QWidget *parent = nullptr);
shun_iwasawa 160579
  QString getName();
shun_iwasawa 160579
};
shun_iwasawa 160579
shun_iwasawa 160579
//------------------------------------------------------------
shun_iwasawa 160579
shun_iwasawa 160579
class WordButton : public QPushButton {
shun_iwasawa 160579
  Q_OBJECT
shun_iwasawa 160579
public:
otakuto fb3573
  WordButton(const QString &text, QWidget *parent = nullptr);
shun_iwasawa 160579
shun_iwasawa 160579
protected:
shun_iwasawa 160579
  void contextMenuEvent(QContextMenuEvent *) override;
shun_iwasawa 160579
shun_iwasawa 160579
protected slots:
shun_iwasawa 160579
  virtual void onClicked();
shun_iwasawa 160579
  void onRemove();
shun_iwasawa 160579
shun_iwasawa 160579
signals:
shun_iwasawa 160579
  void clicked(const QString &);
shun_iwasawa 160579
  void removeWord(const QString &);
shun_iwasawa 160579
};
shun_iwasawa 160579
shun_iwasawa 160579
//------------------------------------------------------------
shun_iwasawa 160579
shun_iwasawa 160579
class AddWordButton final : public WordButton {
shun_iwasawa 160579
  Q_OBJECT
shun_iwasawa 160579
  int m_column;
shun_iwasawa 160579
shun_iwasawa 160579
public:
otakuto fb3573
  AddWordButton(const int col, QWidget *parent = nullptr);
shun_iwasawa 160579
shun_iwasawa 160579
protected slots:
shun_iwasawa 160579
  void onClicked() override;
shun_iwasawa 160579
  void contextMenuEvent(QContextMenuEvent *) override{};
shun_iwasawa 160579
shun_iwasawa 160579
signals:
shun_iwasawa 160579
  void clicked(const int);
shun_iwasawa 160579
};
shun_iwasawa 160579
shun_iwasawa 160579
//------------------------------------------------------------
shun_iwasawa 160579
shun_iwasawa 160579
class EasyInputArea final : public QWidget {
shun_iwasawa 160579
  Q_OBJECT
shun_iwasawa 160579
shun_iwasawa 160579
  QStringList m_wordList[WORD_COLUMN_AMOUNT];
shun_iwasawa 160579
  QGridLayout *m_wordLayout[WORD_COLUMN_AMOUNT];
shun_iwasawa 6c76ac
  QScrollArea *m_scrollArea[WORD_COLUMN_AMOUNT];
shun_iwasawa 160579
shun_iwasawa 160579
  void loadList();
shun_iwasawa 160579
  void saveList();
shun_iwasawa 160579
  void updatePanelSize(int columnId);
shun_iwasawa 160579
shun_iwasawa 160579
public:
shun_iwasawa 160579
  EasyInputArea(QWidget *parent = 0);
shun_iwasawa 03feed
shun_iwasawa 03feed
protected:
shun_iwasawa 03feed
  void enterEvent(QEvent *) override;
shun_iwasawa 6c76ac
  void resizeEvent(QResizeEvent *) override;
shun_iwasawa 160579
shun_iwasawa 160579
protected slots:
shun_iwasawa 160579
  void addWordButtonClicked(const int);
shun_iwasawa 160579
  void onRemoveWord(const QString &);
shun_iwasawa 160579
shun_iwasawa 160579
signals:
shun_iwasawa 160579
  void wordClicked(const QString &);
shun_iwasawa 03feed
  void mouseEnter();
shun_iwasawa 160579
};
shun_iwasawa 160579
shun_iwasawa 160579
//------------------------------------------------------------
Toshihiro Shimizu 890ddd
shun_iwasawa 03feed
class StyleNameEditor final : public DVGui::Dialog {
Shinya Kitaoka 120a6e
  Q_OBJECT
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TPaletteHandle *m_paletteHandle;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QLineEdit *m_styleName;
Shinya Kitaoka 120a6e
  QPushButton *m_okButton, *m_applyButton, *m_cancelButton;
Toshihiro Shimizu 890ddd
shun_iwasawa 03feed
  int m_selectionStart, m_selectionLength;
shun_iwasawa 03feed
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  StyleNameEditor(QWidget *parent = 0);
Shinya Kitaoka 120a6e
  void setPaletteHandle(TPaletteHandle *ph);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 473e70
  void showEvent(QShowEvent *) override;
Shinya Kitaoka 473e70
  void hideEvent(QHideEvent *) override;
Shinya Kitaoka 473e70
  void enterEvent(QEvent *) override;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected slots:
Shinya Kitaoka 120a6e
  void onStyleSwitched();
Shinya Kitaoka 120a6e
  void onOkPressed();
Shinya Kitaoka 120a6e
  void onApplyPressed();
Shinya Kitaoka 120a6e
  void onCancelPressed();
shun_iwasawa 160579
  void onWordClicked(const QString &);
shun_iwasawa 03feed
  void storeSelectionInfo();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif