HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PRM_TemplateBuilder.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: PRM_TemplateBuilder.h (Parameter Library)
7  *
8  * COMMENTS:
9  * Constructs a PRM_Template * list from an embedded .ds file.
10  *
11  */
12 
13 #ifndef __PRM_TemplateBuilder__
14 #define __PRM_TemplateBuilder__
15 
16 #include "PRM_API.h"
17 #include <UT/UT_StringHolder.h>
18 #include "PRM_Type.h"
19 
20 class PRM_Template;
21 class PRM_ScriptPage;
22 class DS_Stream;
23 class UT_IStream;
24 
25 /// Constructs a PRM_Template list from an embedded .ds file or an istream.
27 {
28 public:
29  PRM_TemplateBuilder(const UT_StringHolder &name, const char *dstext,
30  const char **cpp_options = nullptr);
32  const char **cpp_options = nullptr);
34 
35  PRM_Template *templates() const { return myTemplate; }
36 
37  int templateLength() const { return myTemplateLength; }
38 
39  void setCallback(const UT_StringRef &name,
40  PRM_Callback callback);
41  void setChoiceListPtr(const UT_StringRef &name,
42  PRM_ChoiceList *list);
43 
44  void setNoResim(const UT_StringRef &name, bool noresim);
45  void setNoCook(const UT_StringRef &name, bool nocook);
46 
47  /// Returns if it was just built, used for any successive one
48  /// time initialization. Calling this function will mark it as
49  /// built.
50  bool justBuilt();
51 
52 private:
53 
54  void load(UT_IStream &stream, const char **cpp_options);
55 
56  PRM_Template *myTemplate;
57  int myTemplateLength;
58  PRM_ScriptPage *myPage;
59  bool myJustBuilt;
60  UT_StringHolder myName;
61 };
62 
63 #endif
GLuint GLuint stream
Definition: glew.h:7265
GLuint const GLchar * name
Definition: glew.h:1814
Constructs a PRM_Template list from an embedded .ds file or an istream.
PRM_Template * templates() const
#define PRM_API
Definition: PRM_API.h:10