1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 21:53:52 +00:00
openmw/apps/opencs/view/world/tablebottombox.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

120 lines
3 KiB
C++
Raw Normal View History

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
#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;
namespace CSMDoc
{
class Document;
}
2013-07-25 12:29:56 +00:00
namespace CSVWorld
{
class CreatorFactoryBase;
class Creator;
2013-07-25 12:29:56 +00:00
class TableBottomBox : public QWidget
{
Q_OBJECT
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];
EditMode mEditMode;
Creator* mCreator;
ExtendedCommandConfigurator* mExtendedConfigurator;
2013-07-26 19:09:23 +00:00
QStackedLayout* mLayout;
bool mHasPosition;
int mRow;
int mColumn;
QString mStatusMessage;
2013-07-25 12:29:56 +00:00
private:
// not implemented
TableBottomBox(const TableBottomBox&);
TableBottomBox& operator=(const TableBottomBox&);
2013-07-25 12:29:56 +00:00
void updateSize();
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:
TableBottomBox(const CreatorFactoryBase& creatorFactory, CSMDoc::Document& document,
const CSMWorld::UniversalId& id, QWidget* parent = nullptr);
2013-07-25 12:29:56 +00:00
~TableBottomBox() override;
bool eventFilter(QObject* object, QEvent* event) override;
void setEditLock(bool locked);
2013-07-25 12:29:56 +00:00
void setStatusBar(bool show);
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);
signals:
void requestFocus(const std::string& id);
///< Request owner of this box to focus the just created \a id. The owner may
/// ignore this request.
private slots:
void requestDone();
///< \note This slot being called does not imply success.
void currentWidgetChanged(int index);
2013-07-26 19:09:23 +00:00
public slots:
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();
void createRequest();
void createRecordsDirectlyRequest(const std::string& id);
void cloneRequest(const std::string& id, const CSMWorld::UniversalId::Type type);
void touchRequest(const std::vector<CSMWorld::UniversalId>&);
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