// gKeyMapper - GUI glue between the mappings file and the row widgets. #ifndef GKEYMAPPER_MAPPINGS_H #define GKEYMAPPER_MAPPINGS_H #include #include #include "keyrow.h" #include "mapping.h" namespace gkeymapper { // The rows' current state, or a file's content put into the rows. Both are also // what write/read use, so the widget <-> file mapping lives in one place; and a // window that is rebuilt (language switch) carries the rows over this way // without writing a file, so unsaved edits survive. MappingSet collect_mappings(const std::vector& rows); void apply_mappings(const MappingSet& set, const std::vector& rows); // Collects the current widget state and writes it to path. bool write_mappings(const std::string& path, const std::vector& rows); // Loads path into the rows' widgets (type dropdown + target entry). void read_mappings(const std::string& path, const std::vector& rows); } // namespace gkeymapper #endif // GKEYMAPPER_MAPPINGS_H