115 lines
2.8 KiB
C++
115 lines
2.8 KiB
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <QString>
|
|
#include "workspace/FileEntry.h"
|
|
|
|
class DockWidget;
|
|
|
|
/**
|
|
* @file DataPanel.h
|
|
* @brief Data Panel Base Class
|
|
* Provides panel framework structure for different data types, specific functionality implemented by derived classes
|
|
*/
|
|
|
|
/**
|
|
* @brief Data panel base class
|
|
* Provides panel framework structure for different data types, specific functionality implemented by derived classes
|
|
*/
|
|
class DataPanel : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/**
|
|
* @brief Constructor
|
|
* @param index Panel index
|
|
* @param fileType File type
|
|
* @param filePath Associated file path
|
|
* @param parent Parent widget
|
|
*/
|
|
explicit DataPanel(int index, FileEntryType fileType, const QString& filePath, QWidget* parent = nullptr);
|
|
|
|
/**
|
|
* @brief Destructor
|
|
*/
|
|
virtual ~DataPanel();
|
|
|
|
/**
|
|
* @brief Get panel index
|
|
* @return Panel index
|
|
*/
|
|
int GetIndex() const { return index_; }
|
|
|
|
/**
|
|
* @brief Get file type (virtual function, implemented by derived classes)
|
|
* @return File type
|
|
*/
|
|
virtual FileEntryType GetFileType() const { return fileType_; }
|
|
|
|
/**
|
|
* @brief Get file path
|
|
* @return File path
|
|
*/
|
|
QString GetFilePath() const { return filePath_; }
|
|
|
|
/**
|
|
* @brief Get panel title
|
|
* @return Panel title
|
|
*/
|
|
QString GetTitle() const { return title_; }
|
|
|
|
/**
|
|
* @brief Set dock widget reference
|
|
* @param dockWidget Dock widget pointer
|
|
*/
|
|
void SetDockWidget(DockWidget* dockWidget) { dockWidget_ = dockWidget; }
|
|
|
|
/**
|
|
* @brief Get dock widget reference
|
|
* @return Dock widget pointer
|
|
*/
|
|
DockWidget* GetDockWidget() const { return dockWidget_; }
|
|
|
|
/**
|
|
* @brief Refresh panel content (virtual function, implemented by derived classes)
|
|
*/
|
|
virtual void RefreshPanel() {}
|
|
|
|
signals:
|
|
/**
|
|
* @brief Panel close signal
|
|
*/
|
|
void PanelClosed();
|
|
|
|
protected:
|
|
/**
|
|
* @brief Close event handler
|
|
* @param event Close event
|
|
*/
|
|
void closeEvent(QCloseEvent* event) override;
|
|
|
|
/**
|
|
* @brief Initialize UI (virtual function, derived classes implement specific layout)
|
|
*/
|
|
virtual void InitUI();
|
|
|
|
/**
|
|
* @brief Generate panel title
|
|
* @return Generated title
|
|
*/
|
|
virtual QString GenerateTitle();
|
|
|
|
/**
|
|
* @brief Get type display name (virtual function, implemented by derived classes)
|
|
* @return Display name for the file type
|
|
*/
|
|
virtual QString GetTypeDisplayName() const;
|
|
|
|
private:
|
|
int index_; // Panel index
|
|
FileEntryType fileType_; // File type
|
|
QString filePath_; // Associated file path
|
|
QString title_; // Panel title
|
|
DockWidget* dockWidget_; // Dock widget reference
|
|
}; |