/**
 * @file hand_menu.h
 * @ingroup GameMenusZones
 */
//! \todo Document this file.

#ifndef COCKATRICE_HAND_MENU_H
#define COCKATRICE_HAND_MENU_H

#include "../../../interface/widgets/menus/tearoff_menu.h"
#include "abstract_player_component.h"

#include <QAction>
#include <QMenu>

class PlayerGraphicsItem;
class PlayerActions;

class HandMenu : public TearOffMenu, public AbstractPlayerComponent
{
    Q_OBJECT

public:
    HandMenu(PlayerGraphicsItem *player, QWidget *parent = nullptr);

    QMenu *revealHandMenu() const
    {
        return mRevealHand;
    }
    QMenu *revealRandomHandCardMenu() const
    {
        return mRevealRandomHandCard;
    }

    void retranslateUi() override;
    void setShortcutsActive() override;
    void setShortcutsInactive() override;

private slots:
    void populateRevealHandMenuWithActivePlayers();
    void populateRevealRandomHandCardMenuWithActivePlayers();
    void onRevealHandTriggered();
    void onRevealRandomHandCardTriggered();

private:
    PlayerGraphicsItem *player;

    QAction *aViewHand = nullptr;
    QAction *aMulligan = nullptr;
    QAction *aMulliganSame = nullptr;
    QAction *aMulliganMinusOne = nullptr;

    QMenu *mSortHand = nullptr;
    QAction *aSortHandByName = nullptr;
    QAction *aSortHandByType = nullptr;
    QAction *aSortHandByManaValue = nullptr;

    QMenu *mRevealHand = nullptr;
    QAction *aRevealHandToAll = nullptr;

    QMenu *mRevealRandomHandCard = nullptr;
    QAction *aRevealRandomHandCardToAll = nullptr;

    QMenu *mMoveHandMenu = nullptr;
    QAction *aMoveHandToTopLibrary = nullptr;
    QAction *aMoveHandToBottomLibrary = nullptr;
    QAction *aMoveHandToGrave = nullptr;
    QAction *aMoveHandToRfg = nullptr;
};

#endif // COCKATRICE_HAND_MENU_H
