CWallpaper.h 646 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <assert.h>
  3. #include "CProject.h"
  4. namespace WallpaperEngine::Core
  5. {
  6. class CProject;
  7. class CWallpaper
  8. {
  9. public:
  10. template<class T> const T* as () const { assert (is <T> ()); return (const T*) this; }
  11. template<class T> T* as () { assert (is <T> ()); return (T*) this; }
  12. template<class T> bool is () { return this->m_type == T::Type; }
  13. CWallpaper (std::string type);
  14. CProject* getProject ();
  15. protected:
  16. friend class CProject;
  17. void setProject (CProject* project);
  18. private:
  19. CProject* m_project;
  20. std::string m_type;
  21. };
  22. }