valentina/src/app/puzzle/vpcarrousel.h

110 lines
3 KiB
C
Raw Normal View History

2020-04-13 12:43:27 +02:00
/************************************************************************
**
2020-05-23 14:29:18 +02:00
** @file vpcarrousel.h
2020-04-13 12:43:27 +02:00
** @author Ronan Le Tiec
** @date 13 04, 2020
**
** @brief
** @copyright
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2020 Valentina project
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
2020-05-23 14:29:18 +02:00
#ifndef VPCARROUSEL_H
#define VPCARROUSEL_H
2020-04-13 12:24:26 +02:00
#include <QWidget>
#include <QComboBox>
#include <QScrollArea>
2020-05-23 15:34:11 +02:00
#include "vplayout.h"
2020-05-23 15:42:51 +02:00
#include "vppiece.h"
namespace Ui
{
2020-05-23 14:29:18 +02:00
class VPCarrousel;
}
2020-04-13 12:24:26 +02:00
2020-05-23 14:29:18 +02:00
class VPCarrousel : public QWidget
2020-04-13 12:24:26 +02:00
{
Q_OBJECT
public:
2020-05-23 15:34:11 +02:00
explicit VPCarrousel(VPLayout *layout, QWidget *parent = nullptr);
2020-05-23 14:29:18 +02:00
virtual ~VPCarrousel() = default;
2020-04-13 12:24:26 +02:00
2020-05-02 12:17:06 +02:00
/**
* @brief SetOrientation Sets the orientation to the given value and refreshes
* the orientation of the carrousel.
* @param orientation the orientation to set the carrousel to.
*/
2020-04-26 12:09:28 +02:00
void SetOrientation(Qt::Orientation orientation);
2020-05-02 12:17:06 +02:00
/**
* @brief RefreshOrientation Refreshes the orientation of the carrousel with the
* m_orientation value;
*/
void RefreshOrientation();
2020-04-26 12:09:28 +02:00
/**
* @brief Refresh Refreshes the content of the carrousel
*/
void Refresh();
2020-11-21 13:45:26 +01:00
/**
* @brief RefreshFocusedSheetName refreshes the name of the focused sheet
*/
void RefreshFocusedSheetName();
2020-04-26 12:09:28 +02:00
/**
* @brief Clear Clears the carrousel (removes everything)
*/
void Clear();
/**
* @brief ClearSelection Clears the selection of the carrousel.
*/
void ClearSelection();
2020-05-24 19:53:51 +02:00
/**
* @brief ClearSelectionExceptForCurrentPieceList Clears the selection of all pieces of
* the layout except for the one in the current piece list
*/
void ClearSelectionExceptForCurrentPieceList();
2020-04-13 12:24:26 +02:00
private:
2020-05-23 14:29:18 +02:00
Q_DISABLE_COPY(VPCarrousel)
Ui::VPCarrousel *ui;
2020-04-26 12:09:28 +02:00
2020-05-24 19:53:51 +02:00
VPLayout *m_layout{nullptr};
2020-05-23 15:29:57 +02:00
QList<VPPieceList*> m_pieceLists{};
2020-04-26 12:09:28 +02:00
2020-05-02 12:17:06 +02:00
Qt::Orientation m_orientation{Qt::Vertical};
2020-04-13 12:24:26 +02:00
private slots:
/**
2020-05-23 15:29:57 +02:00
* @brief on_ActivePieceListChanged Called when the active piece list is changed
* @param index
*/
2020-05-23 15:29:57 +02:00
void on_ActivePieceListChanged(int index);
2020-04-13 12:24:26 +02:00
};
2020-05-23 14:29:18 +02:00
#endif // VPCARROUSEL_H