/** * @file XTPSkinManagerResource.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPSKINMANAGERRESOURCE_H__) # define __XTPSKINMANAGERRESOURCE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPSkinImage; class CXTPSkinManagerSchema; class CXTPSkinManager; /** * @brief * CXTPSkinManagerResourceFile is a standalone class that represents a * manager of visual style resources */ class _XTP_EXT_CLASS CXTPSkinManagerResourceFile : public CXTPCmdTarget , public CXTPSynchronized { public: /** * @brief * Constructs a CXTPSkinManagerResourceFile object. * @param pSkinManager Pointer to the parent SkinFramework manager. */ CXTPSkinManagerResourceFile(CXTPSkinManager* pSkinManager = NULL); /** * @brief * Destroys a CXTPSkinManagerResourceFile object, handles cleanup and deallocation. */ virtual ~CXTPSkinManagerResourceFile(); public: /** * @brief * Opens the visual style file. * @param lpszResourcePath Path to the specified visual style. * @param lpszIniFileName Name of the .ini file to load. * @return TRUE if successful, FALSE otherwise. */ virtual BOOL Open(LPCTSTR lpszResourcePath, LPCTSTR lpszIniFileName); /** * @brief * Reads the .ini file. * @param str Reference to the string used to load the next line * from the resource file. * @return TRUE if successful, FALSE otherwise. */ virtual BOOL ReadString(CString& str); /** * @brief * Closes the visual style file. */ virtual void Close(); /** * @brief * Loads a specified image from a resource file. * @param strImageFile Path to the specified image. * @return * A pointer to the newly loaded CXTPSkinImage object containing * the loaded bitmap. */ virtual CXTPSkinImage* LoadImage(CString strImageFile); /** * @brief * Creates the CXTPSkinManagerSchema class associated with loaded resources. * @return * A pointer to the newly created CXTPSkinManagerSchema class that * will be used to read resources. * @see * CXTPSkinManagerSchema */ virtual CXTPSkinManagerSchema* CreateSchema(); public: /** * @brief * Gets the resource path. * @return * The resource path. */ CString GetResourcePath() const; /** * @brief * Gets the .ini file name. * @return * The .ini file name. */ CString GetIniFileName() const; /** * @brief * Gets the handle of the skin module. * @return * The handle of the skin module. */ HMODULE GetModuleHandle() const; /** * @brief * Sets the handle of the skin module. * @param hModule Handle to be set. */ void SetModuleHandle(HMODULE hModule); /** * @brief * Gets the owner skin manager object. * @return * A pointer to the owner skin manager object. */ CXTPSkinManager* GetSkinManager() const; private: CString GetDefaultIniFileName(); protected: LPWSTR m_lpTextFile; /**< Pointer to the next string. */ LPWSTR m_lpTextFileEnd; /**< Pointer to end of the file. */ HMODULE m_hModule; /**< Handle of the visual style. */ HMODULE m_hInstance; /**< Handle of the visual style. */ CString m_strResourcePath; /**< Resource path. */ CString m_strIniFileName; /**< .ini file name. */ CXTPSkinManager* m_pManager; /**< Parent manager class. */ CStdioFile* m_pIniFile; /**< Pointer to the .ini file on disk. */ friend class CXTPSkinManager; }; AFX_INLINE CString CXTPSkinManagerResourceFile::GetIniFileName() const { return m_strIniFileName; } AFX_INLINE CString CXTPSkinManagerResourceFile::GetResourcePath() const { return m_strResourcePath; } AFX_INLINE HMODULE CXTPSkinManagerResourceFile::GetModuleHandle() const { return m_hModule; } AFX_INLINE void CXTPSkinManagerResourceFile::SetModuleHandle(HMODULE hModule) { m_hInstance = hModule; } AFX_INLINE CXTPSkinManager* CXTPSkinManagerResourceFile::GetSkinManager() const { return m_pManager; } # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPSKINMANAGERRESOURCE_H__) /** @endcond */