mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 23:17:35 -04:00
- Connect QuotesMainWindow to work with agent, - Use DatabaseModel in Quotes and Categories models, - Connect add/edit/remove quotes with agent
46 lines
914 B
C++
46 lines
914 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include "application-settings-new/models/QuotesModel.hpp"
|
|
|
|
#include <SwitchData.hpp>
|
|
#include <json/json11.hpp>
|
|
#include <utility>
|
|
|
|
namespace Quotes
|
|
{
|
|
class QuotesModel;
|
|
};
|
|
|
|
namespace gui
|
|
{
|
|
enum class QuoteAction
|
|
{
|
|
None,
|
|
Add,
|
|
Edit
|
|
};
|
|
|
|
class QuoteSwitchData : public gui::SwitchData
|
|
{
|
|
public:
|
|
QuoteSwitchData(QuoteAction action, Quotes::QuoteRecord quote = {}) : action(action), quote(std::move(quote))
|
|
{}
|
|
|
|
[[nodiscard]] auto getQuote() const
|
|
{
|
|
return quote;
|
|
}
|
|
[[nodiscard]] auto getAction() const
|
|
{
|
|
return action;
|
|
}
|
|
|
|
private:
|
|
QuoteAction action;
|
|
Quotes::QuoteRecord quote;
|
|
};
|
|
} // namespace gui
|