#pragma once #include "lc_math.h" struct lcInstructionsPageSetup { float Width; float Height; float MarginLeft; float MarginRight; float MarginTop; float MarginBottom; }; enum class lcInstructionsDirection { Horizontal, Vertical }; struct lcInstructionsPageSettings { int Rows; int Columns; lcInstructionsDirection Direction; }; enum class lcInstructionsPropertyMode { NotSet, Default, Model, StepForward, StepOnly }; enum class lcInstructionsPropertyType { StepNumberFont, StepNumberColor, StepBackgroundColor, Count }; struct lcInstructionsProperty { lcInstructionsPropertyMode Mode = lcInstructionsPropertyMode::NotSet; QVariant Value; }; using lcInstructionsProperties = std::array(lcInstructionsPropertyType::Count)>; struct lcInstructionsStep { QRectF Rect; lcModel* Model; lcStep Step; lcInstructionsProperties Properties; }; struct lcInstructionsPage { // lcInstructionsPageSettings Settings; std::vector Steps; }; struct lcInstructionsModel { std::vector StepProperties; }; class lcInstructions : public QObject { Q_OBJECT public: lcInstructions(Project* Project = nullptr); void SetDefaultPageSettings(const lcInstructionsPageSettings& PageSettings); QColor GetColorProperty(lcInstructionsPropertyType Type, lcModel* Model, lcStep Step) const; QFont GetFontProperty(lcInstructionsPropertyType Type, lcModel* Model, lcStep Step) const; void SetDefaultColor(lcInstructionsPropertyType Type, const QColor& Color); void SetDefaultFont(lcInstructionsPropertyType Type, const QFont& Font); std::vector mPages; lcInstructionsPageSettings mPageSettings; lcInstructionsPageSetup mPageSetup; lcInstructionsProperties mStepProperties; std::map mModels; signals: void PageInvalid(int PageIndex); protected: void CreatePages(); void AddDefaultPages(lcModel* Model, std::vector& AddedModels); QVariant GetProperty(lcInstructionsPropertyType Type, lcModel* Model, lcStep Step) const; void SetDefaultProperty(lcInstructionsPropertyType Type, const QVariant& Value); Project* mProject = nullptr; static const float mDisplayDPI; };