full rework of the output order
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include "../net/net.h"
|
||||
#include "../settings/settings.h"
|
||||
|
||||
enum class ColumnType {
|
||||
enum ColumnType {
|
||||
date,
|
||||
goods_name,
|
||||
goods_price_per_unit,
|
||||
@@ -23,32 +23,26 @@ enum class ColumnType {
|
||||
goods_total
|
||||
};
|
||||
|
||||
struct Column { // Example:
|
||||
ColumnType type; // goods_name
|
||||
std::string name; // "Товар"
|
||||
unsigned int position; // "0" <-- 0 = "A", 1 = "B", etc.. column letter in
|
||||
// table processor (i.e. excel or libreoffice)
|
||||
} typedef Column;
|
||||
// Q_DECLARE_METATYPE(ColumnType);
|
||||
|
||||
// struct Column { // Example:
|
||||
// ColumnType type; // goods_name
|
||||
// std::string name; // "Товар"
|
||||
// unsigned int position; // "0" <-- 0 = "A", 1 = "B", etc.. column letter in
|
||||
// // table processor (i.e. excel or libreoffice)
|
||||
// } typedef Column;
|
||||
|
||||
class OutputOptions {
|
||||
|
||||
std::vector<Column> order;
|
||||
bool print_header;
|
||||
bool print_total;
|
||||
std::string path;
|
||||
|
||||
public:
|
||||
OutputOptions();
|
||||
|
||||
void add_or_update_column(Column &);
|
||||
void update_column(Column&, unsigned short);
|
||||
void remove_column(unsigned short);
|
||||
void remove_column(ColumnType);
|
||||
unsigned short find_column(ColumnType);
|
||||
bool column_exist(ColumnType);
|
||||
Column& get_column(ColumnType);
|
||||
std::vector<Column>& get_columns();
|
||||
|
||||
void set_print_header(bool);
|
||||
bool get_print_header();
|
||||
|
||||
@@ -60,3 +54,5 @@ public:
|
||||
};
|
||||
|
||||
#endif // OUTPUT_OPTIONS_H
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user