#ifndef ASH_ASSISTANT_MODEL_ASSISTANT_QUERY_H_
#define ASH_ASSISTANT_MODEL_ASSISTANT_QUERY_H_
#include <string>
#include "base/component_export.h"
#include "chromeos/ash/services/assistant/public/cpp/assistant_service.h"
namespace ash {
enum class AssistantQueryType {
kNull,
kText,
kVoice,
};
class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantQuery {
public:
using AssistantQuerySource = assistant::AssistantQuerySource;
AssistantQuery(const AssistantQuery&) = delete;
AssistantQuery& operator=(const AssistantQuery&) = delete;
virtual ~AssistantQuery() = default;
AssistantQueryType type() const { return type_; }
AssistantQuerySource source() const { return source_; }
virtual bool Empty() const = 0;
protected:
AssistantQuery(AssistantQueryType type, AssistantQuerySource source)
: type_(type), source_(source) {}
private:
const AssistantQueryType type_;
const AssistantQuerySource source_;
};
class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantNullQuery
: public AssistantQuery {
public:
AssistantNullQuery()
: AssistantQuery(AssistantQueryType::kNull,
AssistantQuerySource::kUnspecified) {}
AssistantNullQuery(const AssistantNullQuery&) = delete;
AssistantNullQuery& operator=(const AssistantNullQuery&) = delete;
~AssistantNullQuery() override = default;
bool Empty() const override;
};
class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantTextQuery
: public AssistantQuery {
public:
AssistantTextQuery(const std::string& text, AssistantQuerySource source)
: AssistantQuery(AssistantQueryType::kText, source), text_(text) {}
AssistantTextQuery(const AssistantTextQuery&) = delete;
AssistantTextQuery& operator=(const AssistantTextQuery&) = delete;
~AssistantTextQuery() override = default;
bool Empty() const override;
const std::string& text() const { return text_; }
private:
const std::string text_;
};
class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantVoiceQuery
: public AssistantQuery {
public:
AssistantVoiceQuery() : AssistantVoiceQuery(std::string(), std::string()) {}
AssistantVoiceQuery(const std::string& high_confidence_speech,
const std::string& low_confidence_speech = std::string())
: AssistantQuery(AssistantQueryType::kVoice,
AssistantQuerySource::kVoiceInput),
high_confidence_speech_(high_confidence_speech),
low_confidence_speech_(low_confidence_speech) {}
AssistantVoiceQuery(const AssistantVoiceQuery&) = delete;
AssistantVoiceQuery& operator=(const AssistantVoiceQuery&) = delete;
~AssistantVoiceQuery() override = default;
bool Empty() const override;
const std::string& high_confidence_speech() const {
return high_confidence_speech_;
}
const std::string& low_confidence_speech() const {
return low_confidence_speech_;
}
private:
const std::string high_confidence_speech_;
const std::string low_confidence_speech_;
};
}
#endif