HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
UT_IconManager.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: UT_IconManager.h (C++)
7
*
8
* COMMENTS: A very simple class to help with finding and otherwise
9
* dealing with icon files.
10
*/
11
12
#ifndef __UT_IconManager__
13
#define __UT_IconManager__
14
15
#include "
UT_API.h
"
16
#include "
UT_UniquePtr.h
"
17
18
19
#define UT_ICON_MAXSIZE 64
20
21
enum
22
UT_IconType
23
{
24
UT_ICON_IMG
,
25
UT_ICON_SVG
26
};
27
28
class
UT_PathSearch
;
29
class
UT_String
;
30
31
class
UT_API
UT_IconManager
32
{
33
public
:
34
UT_IconManager
();
35
36
/// Gets the first icon (of type SGI, image, or SVG) in the icon path
37
/// that matches the icon root name. Sets 'iconpath' to the full path
38
/// to that icon file, and if type is set to a non-NULL pointer, sets
39
/// the type appropriately.
40
/// Returns true if an icon was found, and false otherwise.
41
bool
getFirstIconFile(
const
char
*iconroot,
42
UT_String
&iconpath,
43
UT_IconType
*
type
= NULL);
44
45
/// As in getFirstIconFile, but only finds image icons.
46
bool
getFirstImageFile(
const
char
*imageroot,
47
UT_String
&imagepath);
48
49
/// As in getFirstIconFile, but only finds SVG icons.
50
bool
getFirstSVGFile(
const
char
*svgroot,
51
UT_String
&svgpath);
52
53
// This returns a pointer to a list of pointers to strings. The last
54
// one will be null marking the end of the list.
55
static
const
char
**getValidExts();
56
57
// Returns true if the extension in the filename matches one of the valid
58
// extensions.
59
static
bool
hasValidExt(
const
UT_String
&
filename
);
60
61
private
:
62
bool
getFirstFile(
const
char
*iconroot,
63
UT_String
&iconpath,
64
UT_IconType
*
type
,
65
bool
doimages,
66
bool
dosvg);
67
68
static
const
char
*theValidExts[];
69
static
const
UT_IconType
theExtTypes[];
70
};
71
72
UT_API
UT_IconManager
*
UTgetIconManager
();
73
74
#endif
75
UT_IconManager
Definition:
UT_IconManager.h:31
UT_ICON_SVG
Definition:
UT_IconManager.h:25
GT_Names::filename
GT_API const UT_StringHolder filename
UT_API.h
UT_API
#define UT_API
Definition:
UT_API.h:14
UTgetIconManager
UT_API UT_IconManager * UTgetIconManager()
UT_PathSearch
Definition:
UT_PathSearch.h:54
UT_IconType
UT_IconType
Definition:
UT_IconManager.h:21
UT_UniquePtr.h
UT_String
Definition:
UT_String.h:73
type
type
Definition:
core.h:1059
UT_ICON_IMG
Definition:
UT_IconManager.h:24
UT
UT_IconManager.h
Generated on Sun Nov 17 2024 03:03:42 for HDK by
1.8.6