1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

Spreadsheet: Move sheet management to a Workbook class

This commit is contained in:
AnotherTest 2020-08-26 06:00:23 +04:30 committed by Andreas Kling
parent 6ea7e67b62
commit e1f5f709ee
5 changed files with 228 additions and 110 deletions

View file

@ -27,6 +27,7 @@
#pragma once
#include "SpreadsheetView.h"
#include "Workbook.h"
#include <AK/NonnullRefPtrVector.h>
#include <LibGUI/Widget.h>
@ -41,7 +42,7 @@ public:
void save(const StringView& filename);
void load(const StringView& filename);
const String& current_filename() const { return m_current_filename; }
const String& current_filename() const { return m_workbook->current_filename(); }
void set_filename(const String& filename);
private:
@ -49,13 +50,12 @@ private:
void setup_tabs();
NonnullRefPtrVector<Sheet> m_sheets;
SpreadsheetView* m_selected_view { nullptr };
RefPtr<GUI::TabWidget> m_tab_widget;
RefPtr<GUI::Label> m_current_cell_label;
RefPtr<GUI::TextEditor> m_cell_value_editor;
RefPtr<GUI::TabWidget> m_tab_widget;
String m_current_filename;
OwnPtr<Workbook> m_workbook;
};
}