Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.2 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef IUILAYOUTMANAGER_H
  6. #define IUILAYOUTMANAGER_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "panoramatypes.h"
  11. #include "panoramasymbol.h"
  12. #include "layout/stylefiletypes.h"
  13. namespace panorama
  14. {
  15. class CStyleAnimation;
  16. class IUILayoutFile
  17. {
  18. public:
  19. virtual bool BReplaceDefines( CPanoramaSymbol symStyleFile, char *rgchBuffer, uint cubBuffer ) = 0;
  20. virtual void BuildMatchingStyleList( CUtlVector< CascadeStyleFileInfo_t > &vecStyles, const CPanelIdentifiers &panelID, IUILayoutFile *pPreviousLayoutFile ) = 0;
  21. virtual CPanoramaSymbol GetStyleFileSymbol( int i ) const = 0;
  22. virtual CPanoramaSymbol GetLayoutFileSymbol() const = 0;
  23. virtual const CStyleAnimation *GetAnimation( CPanoramaSymbol symName ) = 0;
  24. virtual const char *GetDefine( const char *pchName ) = 0;
  25. virtual bool ApplyMatchedStylesToPanelStyle( IUIPanelStyle *pPanelStyle, const CUtlVector< CascadeStyleFileInfo_t > &vecStyles, EStyleRepaint &eRepaint, bool &bInheritablePropertiesChanged ) = 0;
  26. };
  27. //-----------------------------------------------------------------------------
  28. // Purpose: Public interface to layout mamanger. Manages layout files, styles, etc.
  29. //-----------------------------------------------------------------------------
  30. class IUILayoutManager
  31. {
  32. public:
  33. // in memory updates
  34. enum EUpdateStyleType
  35. {
  36. k_EUpdateStyleStyle = 0,
  37. k_EUpdateStyleKeyframes = 1,
  38. };
  39. virtual IUILayoutFile *GetLayoutFile( const char *pchFile, bool bPartialLayout ) = 0;
  40. virtual IUILayoutFile *GetLayoutFile( CPanoramaSymbol symPath ) = 0;
  41. virtual void SaveInMemoryFiles() = 0;
  42. virtual void RevertInMemoryFiles() = 0;
  43. virtual bool BHasFilesInMemory() const = 0;
  44. virtual bool LoadStyleIntoBuffer( CPanoramaSymbol symFile, CUtlBuffer &buffer ) = 0;
  45. virtual bool UpdateStyleInMemory( EUpdateStyleType eUpdateType, CPanoramaSymbol symStyleFile, uint unLocation, const char *pchUpdatedStyle ) = 0;
  46. virtual bool BConvertHTTPPathToLocalP4Path( const char *pchFile, CUtlString &strOut ) = 0;
  47. };
  48. } // namespace panorama
  49. #endif // IUILAYOUTMANAGER_H