OpenMW
apps/opencs/view/world/vartypedelegate.hpp
Go to the documentation of this file.
00001 #ifndef CSV_WORLD_VARTYPEDELEGATE_H
00002 #define CSV_WORLD_VARTYPEDELEGATE_H
00003 
00004 #include <components/esm/variant.hpp>
00005 
00006 #include "enumdelegate.hpp"
00007 
00008 namespace CSVWorld
00009 {
00010     class VarTypeDelegate : public EnumDelegate
00011     {
00012         private:
00013 
00014             virtual void addCommands (QAbstractItemModel *model,
00015                 const QModelIndex& index, int type) const;
00016 
00017         public:
00018 
00019             VarTypeDelegate (const std::vector<std::pair<int, QString> >& values,
00020                 QUndoStack& undoStack, QObject *parent);
00021     };
00022 
00023     class VarTypeDelegateFactory : public CommandDelegateFactory
00024     {
00025             std::vector<std::pair<int, QString> > mValues;
00026 
00027         public:
00028 
00029             VarTypeDelegateFactory (ESM::VarType type0 = ESM::VT_Unknown,
00030                 ESM::VarType type1 = ESM::VT_Unknown, ESM::VarType type2 = ESM::VT_Unknown,
00031                 ESM::VarType type3 = ESM::VT_Unknown);
00032 
00033             virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const;
00035 
00036             void add (ESM::VarType type);
00037     };
00038 }
00039 
00040 #endif