Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef INSERTFXPOPUP_H
Toshihiro Shimizu 890ddd
#define INSERTFXPOPUP_H
Toshihiro Shimizu 890ddd
pojienie 1cc671
#include <qtreewidget></qtreewidget>
Toshihiro Shimizu 890ddd
#include "toonzqt/dvdialog.h"
Campbell Barton d0e335
#include "tfilepath.h"
Toshihiro Shimizu 890ddd
#include "tstream.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// forward declaration
Toshihiro Shimizu 890ddd
class QTreeWidget;
Toshihiro Shimizu 890ddd
class QTreeWidgetItem;
Toshihiro Shimizu 890ddd
class TFx;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qicon></qicon>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
pojienie 1cc671
// FxTree
pojienie 1cc671
//-----------------------------------------------------------------------------
pojienie 1cc671
pojienie 1cc671
class FxTree final : public QTreeWidget {
pojienie 1cc671
  Q_OBJECT
pojienie 1cc671
pojienie 1cc671
public:
pojienie 1cc671
  void searchItems(const QString &searchWord = QString());
pojienie d6e8b1
pojienie d6e8b1
private:
pojienie d6e8b1
  void displayAll(QTreeWidgetItem *item);
pojienie d6e8b1
  void hideAll(QTreeWidgetItem *item);
pojienie 1cc671
};
pojienie 1cc671
pojienie 1cc671
//=============================================================================
Toshihiro Shimizu 890ddd
// InsertFxPopup
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class InsertFxPopup final : public DVGui::Dialog {
Shinya Kitaoka 120a6e
  Q_OBJECT
Toshihiro Shimizu 890ddd
pojienie 1cc671
  FxTree *m_fxTree;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TIStream *m_is;
Shinya Kitaoka 120a6e
  TFilePath m_presetFolder;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  QIcon m_folderIcon;
Shinya Kitaoka 120a6e
  QIcon m_presetIcon;
Shinya Kitaoka 120a6e
  QIcon m_fxIcon;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  InsertFxPopup();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  TFx *createFx();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void makeItem(QTreeWidgetItem *parent, std::string fxid);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void loadFolder(QTreeWidgetItem *parent);
Shinya Kitaoka 120a6e
  /*!Return true if preset is loaded.*/
Shinya Kitaoka 120a6e
  bool loadPreset(QTreeWidgetItem *item);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool loadFx(TFilePath fp);
Shinya Kitaoka 120a6e
  void loadMacro();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public slots:
Shinya Kitaoka 120a6e
  void onItemDoubleClicked(QTreeWidgetItem *w, int c);
Shinya Kitaoka 120a6e
  void onInsert();
Shinya Kitaoka 120a6e
  void onReplace();
Shinya Kitaoka 120a6e
  void onAdd();
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 contextMenuEvent(QContextMenuEvent *) override;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected slots:
Shinya Kitaoka 120a6e
  void updatePresets();
Shinya Kitaoka 120a6e
  void removePreset();
pojienie 1cc671
  void onSearchTextChanged(const QString &text);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // INSERTFXPOPUP_H