HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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
23 {
26 };
27 
28 class UT_PathSearch;
29 class UT_String;
30 
32 {
33 public:
35  ~UT_IconManager();
36 
37  /// Gets the first icon (of type SGI, image, or SVG) in the icon path
38  /// that matches the icon root name. Sets 'iconpath' to the full path
39  /// to that icon file, and if type is set to a non-NULL pointer, sets
40  /// the type appropriately.
41  /// Returns true if an icon was found, and false otherwise.
42  bool getFirstIconFile(const char *iconroot,
43  UT_String &iconpath,
44  UT_IconType *type = NULL);
45 
46  /// As in getFirstIconFile, but only finds image icons.
47  bool getFirstImageFile(const char *imageroot,
48  UT_String &imagepath);
49 
50  /// As in getFirstIconFile, but only finds SVG icons.
51  bool getFirstSVGFile(const char *svgroot,
52  UT_String &svgpath);
53 
54  // This returns a pointer to a list of pointers to strings. The last
55  // one will be null marking the end of the list.
56  static const char **getValidExts();
57 
58  // Returns true if the extension in the filename matches one of the valid
59  // extensions.
60  static bool hasValidExt(const UT_String &filename);
61 
62 private:
63  bool getFirstFile(const char *iconroot,
64  UT_String &iconpath,
66  bool doimages,
67  bool dosvg);
68 
69  static const char *theValidExts[];
70  static const UT_IconType theExtTypes[];
71 };
72 
74 
75 #endif
76 
#define UT_API
Definition: UT_API.h:12
UT_API UT_IconManager * UTgetIconManager()
UT_IconType
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107