convert enum LayoutMode into enum class