/******************************************************************************
** Copyright (c) 2008 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/

//! \file DtKeyMapRecord.h
//! \brief Contains makArchives::DtKeyMapRecord class.
//! \ingroup makArchives

#ifndef DtKeyMapRecord_H_
#define DtKeyMapRecord_H_

#include <makArchives/makArchives.h>

namespace makArchives
{
   //! A record saving the keyboard mapping.
   //! \ingroup makArchives
   class DT_DLL_MAKARCHIVES DtKeyMapRecord
   {
   public:

      typedef std::list<std::string> FunctionList;
      typedef std::pair<FunctionList,FunctionList> UpDownFunctionLists;
      typedef std::map<int, UpDownFunctionLists > KeyFunctionListMap;
      

      //! CTOR
      DtKeyMapRecord();

      //! Copy CTOR
      DtKeyMapRecord(const DtKeyMapRecord& copy);

      //! Dtor
      ~DtKeyMapRecord();

      //! Assignment Op
      DtKeyMapRecord& operator=(const DtKeyMapRecord& copy);

      const std::string& name() const;
      void setName(const std::string& name);

      const KeyFunctionListMap& unmodifiedKeyMap() const;
      KeyFunctionListMap& unmodifiedKeyMap();

      const KeyFunctionListMap& shiftKeyMap() const;
      KeyFunctionListMap& shiftKeyMap();

      const KeyFunctionListMap& ctrlKeyMap() const;
      KeyFunctionListMap& ctrlKeyMap();

      const KeyFunctionListMap& altKeyMap() const;
      KeyFunctionListMap& altKeyMap();

      const KeyFunctionListMap& shiftCtrlKeyMap() const;
      KeyFunctionListMap& shiftCtrlKeyMap();

      const KeyFunctionListMap& shiftAltKeyMap() const;
      KeyFunctionListMap& shiftAltKeyMap();

      const KeyFunctionListMap& ctrlAltKeyMap() const;
      KeyFunctionListMap& ctrlAltKeyMap();

      const KeyFunctionListMap& shiftCtrlAltKeyMap() const;
      KeyFunctionListMap& shiftCtrlAltKeyMap();


   protected:

      friend class boost::serialization::access;

      template <typename Archive>
      void serialize(Archive& ar,unsigned int version)
      {
         ar & BOOST_SERIALIZATION_NVP(myName);
         
         ar & BOOST_SERIALIZATION_NVP(myUnmodifiedKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myShiftKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myCtrlKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myAltKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myShiftCtrlKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myShiftAltKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myCtrlAltKeyMap);
         ar & BOOST_SERIALIZATION_NVP(myShiftCtrlAltKeyMap);
      }

   protected:

      std::string myName;
      KeyFunctionListMap myUnmodifiedKeyMap;
      KeyFunctionListMap myShiftKeyMap;
      KeyFunctionListMap myCtrlKeyMap;
      KeyFunctionListMap myAltKeyMap;
      KeyFunctionListMap myShiftCtrlKeyMap;
      KeyFunctionListMap myShiftAltKeyMap;
      KeyFunctionListMap myCtrlAltKeyMap;
      KeyFunctionListMap myShiftCtrlAltKeyMap;
   };
}

#endif

