2013-07-25 12:29:56 +00:00
|
|
|
#ifndef CSV_WORLD_BOTTOMBOX_H
|
|
|
|
#define CSV_WORLD_BOTTOMBOX_H
|
|
|
|
|
2022-10-19 17:02:00 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
#include <QWidget>
|
2022-10-19 17:02:00 +00:00
|
|
|
|
2014-01-19 10:44:47 +00:00
|
|
|
#include <apps/opencs/model/world/universalid.hpp>
|
2013-07-25 12:29:56 +00:00
|
|
|
|
2015-07-02 14:21:47 +00:00
|
|
|
#include "extendedcommandconfigurator.hpp"
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
class QLabel;
|
2013-07-26 19:09:23 +00:00
|
|
|
class QStackedLayout;
|
|
|
|
class QStatusBar;
|
2013-07-27 11:28:12 +00:00
|
|
|
|
2015-06-18 19:59:40 +00:00
|
|
|
namespace CSMDoc
|
2013-07-27 11:28:12 +00:00
|
|
|
{
|
2015-06-18 19:59:40 +00:00
|
|
|
class Document;
|
2013-07-27 11:28:12 +00:00
|
|
|
}
|
2013-07-25 12:29:56 +00:00
|
|
|
|
|
|
|
namespace CSVWorld
|
|
|
|
{
|
2013-07-26 10:51:45 +00:00
|
|
|
class CreatorFactoryBase;
|
|
|
|
class Creator;
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
class TableBottomBox : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2015-07-02 14:21:47 +00:00
|
|
|
enum EditMode
|
|
|
|
{
|
|
|
|
EditMode_None,
|
|
|
|
EditMode_Creation,
|
|
|
|
EditMode_ExtendedConfig
|
|
|
|
};
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
bool mShowStatusBar;
|
|
|
|
QLabel* mStatus;
|
2013-07-26 19:09:23 +00:00
|
|
|
QStatusBar* mStatusBar;
|
2013-07-25 12:29:56 +00:00
|
|
|
int mStatusCount[4];
|
2015-07-02 14:21:47 +00:00
|
|
|
|
|
|
|
EditMode mEditMode;
|
2013-07-26 10:51:45 +00:00
|
|
|
Creator* mCreator;
|
2015-07-02 14:21:47 +00:00
|
|
|
ExtendedCommandConfigurator* mExtendedConfigurator;
|
|
|
|
|
2013-07-26 19:09:23 +00:00
|
|
|
QStackedLayout* mLayout;
|
2015-07-14 08:05:45 +00:00
|
|
|
bool mHasPosition;
|
|
|
|
int mRow;
|
|
|
|
int mColumn;
|
2018-06-13 13:48:24 +00:00
|
|
|
QString mStatusMessage;
|
2013-07-25 12:29:56 +00:00
|
|
|
|
|
|
|
private:
|
2013-07-26 10:51:45 +00:00
|
|
|
// not implemented
|
|
|
|
TableBottomBox(const TableBottomBox&);
|
|
|
|
TableBottomBox& operator=(const TableBottomBox&);
|
2013-07-25 12:29:56 +00:00
|
|
|
|
2013-07-26 10:51:45 +00:00
|
|
|
void updateSize();
|
|
|
|
|
2015-07-03 19:07:37 +00:00
|
|
|
void updateStatus();
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
void extendedConfigRequest(ExtendedCommandConfigurator::Mode mode, const std::vector<std::string>& selectedIds);
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
public:
|
2015-07-02 17:44:59 +00:00
|
|
|
TableBottomBox(const CreatorFactoryBase& creatorFactory, CSMDoc::Document& document,
|
|
|
|
const CSMWorld::UniversalId& id, QWidget* parent = nullptr);
|
2015-07-02 14:21:47 +00:00
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
~TableBottomBox() override;
|
|
|
|
|
2015-07-14 08:05:45 +00:00
|
|
|
bool eventFilter(QObject* object, QEvent* event) override;
|
2013-07-26 10:51:45 +00:00
|
|
|
|
2021-05-19 00:53:55 +00:00
|
|
|
void setEditLock(bool locked);
|
2013-07-25 12:29:56 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void setStatusBar(bool show);
|
2015-07-04 17:30:02 +00:00
|
|
|
|
2013-07-28 12:51:47 +00:00
|
|
|
bool canCreateAndDelete() const;
|
|
|
|
///< Is record creation and deletion supported?
|
2022-09-22 18:26:05 +00:00
|
|
|
///
|
2013-07-28 12:51:47 +00:00
|
|
|
/// \note The BotomBox does not partake in the deletion of records.
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
void setStatusMessage(const QString& message);
|
|
|
|
|
2013-07-26 10:51:45 +00:00
|
|
|
signals:
|
|
|
|
|
2018-06-13 13:48:24 +00:00
|
|
|
void requestFocus(const std::string& id);
|
|
|
|
///< Request owner of this box to focus the just created \a id. The owner may
|
2013-07-29 13:00:41 +00:00
|
|
|
/// ignore this request.
|
2018-06-13 13:48:24 +00:00
|
|
|
|
2013-07-29 13:00:41 +00:00
|
|
|
private slots:
|
|
|
|
|
|
|
|
void requestDone();
|
|
|
|
///< \note This slot being called does not imply success.
|
|
|
|
|
2015-07-03 19:07:37 +00:00
|
|
|
void currentWidgetChanged(int index);
|
2013-07-26 19:09:23 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
2015-07-03 19:07:37 +00:00
|
|
|
void selectionSizeChanged(int size);
|
|
|
|
|
2013-07-25 12:29:56 +00:00
|
|
|
void tableSizeChanged(int size, int deleted, int modified);
|
|
|
|
///< \param size Number of not deleted records
|
|
|
|
/// \param deleted Number of deleted records
|
|
|
|
/// \param modified Number of added and modified records
|
|
|
|
|
|
|
|
void positionChanged(int row, int column);
|
|
|
|
|
|
|
|
void noMorePosition();
|
2013-07-26 16:22:31 +00:00
|
|
|
|
2015-07-14 08:05:45 +00:00
|
|
|
void createRequest();
|
2023-01-14 18:36:49 +00:00
|
|
|
void createRecordsDirectlyRequest(const std::string& id);
|
2015-07-14 08:05:45 +00:00
|
|
|
void cloneRequest(const std::string& id, const CSMWorld::UniversalId::Type type);
|
|
|
|
void touchRequest(const std::vector<CSMWorld::UniversalId>&);
|
|
|
|
|
2015-07-02 17:44:59 +00:00
|
|
|
void extendedDeleteConfigRequest(const std::vector<std::string>& selectedIds);
|
|
|
|
void extendedRevertConfigRequest(const std::vector<std::string>& selectedIds);
|
2013-07-25 12:29:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|