1 #ifndef CSM_WORLD_IDCOMPLETIONMANAGER_HPP
2 #define CSM_WORLD_IDCOMPLETIONMANAGER_HPP
3 
4 #include <vector>
5 #include <map>
6 #include <memory>
7 
8 #include "columnbase.hpp"
9 #include "universalid.hpp"
10 
11 class QCompleter;
12 
13 namespace CSMWorld
14 {
15     class Data;
16 
17     /// \brief Creates and stores all ID completers
18     class IdCompletionManager
19     {
20             static const std::map<ColumnBase::Display, UniversalId::Type> sCompleterModelTypes;
21 
22             std::map<ColumnBase::Display, std::shared_ptr<QCompleter> > mCompleters;
23 
24             // Don't allow copying
25             IdCompletionManager(const IdCompletionManager &);
26             IdCompletionManager &operator = (const IdCompletionManager &);
27 
28             void generateCompleters(Data &data);
29 
30         public:
31             static std::vector<ColumnBase::Display> getDisplayTypes();
32 
33             IdCompletionManager(Data &data);
34 
35             bool hasCompleterFor(ColumnBase::Display display) const;
36             std::shared_ptr<QCompleter> getCompleter(ColumnBase::Display display);
37     };
38 }
39 
40 #endif
41