49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <memory>
|
||
|
|
#include "workspace/FileEntry.h"
|
||
|
|
|
||
|
|
class DataPanel;
|
||
|
|
class QWidget;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @file DataPanelFactory.h
|
||
|
|
* @brief Data Panel Factory
|
||
|
|
* Creates appropriate panel instances based on file type
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Data panel factory class
|
||
|
|
* Creates appropriate panel instances based on file type using factory pattern
|
||
|
|
*/
|
||
|
|
class DataPanelFactory
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
/**
|
||
|
|
* @brief Create panel based on file type
|
||
|
|
* @param index Panel index
|
||
|
|
* @param fileType File type
|
||
|
|
* @param filePath File path
|
||
|
|
* @param parent Parent widget
|
||
|
|
* @return Created panel pointer (caller takes ownership)
|
||
|
|
*/
|
||
|
|
static DataPanel* CreatePanel(int index, FileEntryType fileType, const QString& filePath, QWidget* parent = nullptr);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Check if file type is supported
|
||
|
|
* @param fileType File type to check
|
||
|
|
* @return True if supported, false otherwise
|
||
|
|
*/
|
||
|
|
static bool IsTypeSupported(FileEntryType fileType);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Get display name for file type
|
||
|
|
* @param fileType File type
|
||
|
|
* @return Display name
|
||
|
|
*/
|
||
|
|
static QString GetTypeDisplayName(FileEntryType fileType);
|
||
|
|
|
||
|
|
private:
|
||
|
|
// Private constructor to prevent instantiation
|
||
|
|
DataPanelFactory() = default;
|
||
|
|
};
|