1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-24 09:23:53 +00:00
openmw/apps/opencs/model/world/idcompletionmanager.hpp

41 lines
996 B
C++
Raw Normal View History

2015-05-30 12:31:44 +00:00
#ifndef CSM_WORLD_IDCOMPLETIONMANAGER_HPP
#define CSM_WORLD_IDCOMPLETIONMANAGER_HPP
#include <map>
#include <memory>
2022-09-22 18:26:05 +00:00
#include <vector>
2015-05-30 12:31:44 +00:00
#include "columnbase.hpp"
2015-05-30 12:31:44 +00:00
#include "universalid.hpp"
class QCompleter;
namespace CSMWorld
{
class Data;
/// \brief Creates and stores all ID completers
class IdCompletionManager
{
2022-09-22 18:26:05 +00:00
static const std::map<ColumnBase::Display, UniversalId::Type> sCompleterModelTypes;
2015-05-30 12:31:44 +00:00
2022-09-22 18:26:05 +00:00
std::map<ColumnBase::Display, std::shared_ptr<QCompleter>> mCompleters;
2015-05-30 12:31:44 +00:00
2022-09-22 18:26:05 +00:00
// Don't allow copying
IdCompletionManager(const IdCompletionManager&);
IdCompletionManager& operator=(const IdCompletionManager&);
2015-05-30 12:31:44 +00:00
2022-09-22 18:26:05 +00:00
void generateCompleters(Data& data);
2015-05-30 12:31:44 +00:00
2022-09-22 18:26:05 +00:00
public:
static std::vector<ColumnBase::Display> getDisplayTypes();
2015-05-30 12:31:44 +00:00
2022-09-22 18:26:05 +00:00
IdCompletionManager(Data& data);
2022-09-22 18:26:05 +00:00
bool hasCompleterFor(ColumnBase::Display display) const;
std::shared_ptr<QCompleter> getCompleter(ColumnBase::Display display);
2015-05-30 12:31:44 +00:00
};
}
#endif