summaryrefslogtreecommitdiff
path: root/public/panorama/iuistylefactory.h
blob: 235052e7c19f76ce89d1aa74f06edf63a40a0358 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//=========== Copyright Valve Corporation, All rights reserved. ===============//
//
// Purpose: 
//=============================================================================//

#ifndef IUISTYLEFACTORY_H
#define IUISTYLEFACTORY_H

#ifdef _WIN32
#pragma once
#endif

#include "panoramatypes.h"
#include "layout/stylesymbol.h"

namespace panorama
{

//-----------------------------------------------------------------------------
// Purpose: Public interface for style factory (usuable in client code)
//-----------------------------------------------------------------------------
class IUIStyleFactory
{
public:

	virtual bool BRegisteredProperty( panorama::CStyleSymbol symName ) = 0;
	virtual CStyleSymbol GetPropertyNameForAlias( panorama::CStyleSymbol symName ) = 0;
	virtual CStyleProperty *CreateStyleProperty( panorama::CStyleSymbol symName ) = 0;
	virtual void FreeStyleProperty( panorama::CStyleProperty *pProperty ) = 0;
	virtual const CUtlVector< CUtlString > &GetSortedPropertyAndAliasNames() = 0;
};

//-----------------------------------------------------------------------------
// Purpose: Sort comparator
//-----------------------------------------------------------------------------
inline int CompareStylePropertyName( const CUtlString *plhs, const CUtlString *prhs )
{
	return V_strcmp( plhs->Get(), prhs->Get() );
}


//-----------------------------------------------------------------------------
// Purpose: Less than function
//-----------------------------------------------------------------------------
inline bool StylePropertyNameLessThan( const CUtlString &lhs, const CUtlString &rhs, void *pContext )
{
	return CompareStylePropertyName( &lhs, &rhs ) < 0;
}


}
#endif // IUISTYLEFACTORY_H