A .h file is essentially just code which, at compile time, is placed above any .cpp (or .h file for that matter) that it's included in. Therefore you CAN just place any code from the .cpp file into the .h and it should compile fine.
However it's the design which is important. Your code (e.g. your enum) SHOULD be placed in the .h file if you need to expose it to the code you're including the .h file. However if the enum is only specific to the code in your header's .cpp implementation, then you should encapsulate it just within the .cpp file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…