20#ifndef ORES_QT_PAGINATION_WIDGET_HPP
21#define ORES_QT_PAGINATION_WIDGET_HPP
29#include "ores.logging/make_logger.hpp"
43 inline static std::string_view logger_name =
44 "ores.qt.pagination_widget";
46 [[nodiscard]]
static auto& lg() {
48 static auto instance = make_logger(logger_name);
61 void update_state(std::uint32_t loaded_count, std::uint32_t total_count);
80 [[nodiscard]] std::uint32_t
current_page()
const {
return current_page_; }
114 void on_page_size_changed(
int index);
115 void on_load_all_clicked();
116 void on_first_clicked();
117 void on_prev_clicked();
118 void on_next_clicked();
119 void on_last_clicked();
123 QComboBox* page_size_combo_;
124 QAction* first_action_;
125 QAction* prev_action_;
126 QAction* next_action_;
127 QAction* last_action_;
128 QAction* load_all_action_;
129 QToolBar* nav_toolbar_;
130 QHBoxLayout* layout_;
132 std::uint32_t loaded_count_{0};
133 std::uint32_t total_count_{0};
134 std::uint32_t current_page_{0};
136 void update_button_states();
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Widget providing pagination controls for data tables.
Definition PaginationWidget.hpp:39
void update_state(std::uint32_t loaded_count, std::uint32_t total_count)
Update the pagination display with current state.
Definition PaginationWidget.cpp:116
void page_size_changed(std::uint32_t page_size)
Emitted when user changes the page size selection.
std::uint32_t total_pages() const
Get the total number of pages.
Definition PaginationWidget.cpp:171
void set_load_all_enabled(bool enabled)
Enable or disable the Load All button.
Definition PaginationWidget.cpp:163
void load_all_requested()
Emitted when user requests to load all remaining data.
std::uint32_t current_offset() const
Calculate the offset for the current page.
Definition PaginationWidget.cpp:179
std::uint32_t current_page() const
Get the current page number (0-based).
Definition PaginationWidget.hpp:80
void page_requested(std::uint32_t offset, std::uint32_t limit)
Emitted when user requests to navigate to a specific page.
std::uint32_t page_size() const
Get the selected page size.
Definition PaginationWidget.cpp:145