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.

51 lines
1.7 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef IUISTYLEFACTORY_H
  6. #define IUISTYLEFACTORY_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "panoramatypes.h"
  11. #include "layout/stylesymbol.h"
  12. namespace panorama
  13. {
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Public interface for style factory (usuable in client code)
  16. //-----------------------------------------------------------------------------
  17. class IUIStyleFactory
  18. {
  19. public:
  20. virtual bool BRegisteredProperty( panorama::CStyleSymbol symName ) = 0;
  21. virtual CStyleSymbol GetPropertyNameForAlias( panorama::CStyleSymbol symName ) = 0;
  22. virtual CStyleProperty *CreateStyleProperty( panorama::CStyleSymbol symName ) = 0;
  23. virtual void FreeStyleProperty( panorama::CStyleProperty *pProperty ) = 0;
  24. virtual const CUtlVector< CUtlString > &GetSortedPropertyAndAliasNames() = 0;
  25. };
  26. //-----------------------------------------------------------------------------
  27. // Purpose: Sort comparator
  28. //-----------------------------------------------------------------------------
  29. inline int CompareStylePropertyName( const CUtlString *plhs, const CUtlString *prhs )
  30. {
  31. return V_strcmp( plhs->Get(), prhs->Get() );
  32. }
  33. //-----------------------------------------------------------------------------
  34. // Purpose: Less than function
  35. //-----------------------------------------------------------------------------
  36. inline bool StylePropertyNameLessThan( const CUtlString &lhs, const CUtlString &rhs, void *pContext )
  37. {
  38. return CompareStylePropertyName( &lhs, &rhs ) < 0;
  39. }
  40. }
  41. #endif // IUISTYLEFACTORY_H