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 "PRM_Type.h"
18 #include <UT/UT_NonCopyable.h>
19 #include <UT/UT_StringHolder.h>
20 
21 class PRM_Template;
22 class PRM_ScriptPage;
23 class DS_Stream;
24 class UT_IStream;
25 
26 /// Constructs a PRM_Template list from an embedded .ds file or an istream.
28 {
29 public:
30  /// extra_parms is the number of additional parameter templates at the
31  /// head of templates(). That is, the first parameter from the .ds file is
32  /// loaded into templates()[extra_parms].
33  PRM_TemplateBuilder(const UT_StringHolder &name, const char *dstext,
34  const char **cpp_options = nullptr,
35  int extra_parms = 0);
37  const char **cpp_options = nullptr,
38  int extra_parms = 0);
40 
42 
43  PRM_Template *templates() const { return myTemplate; }
44 
45  int templateLength() const { return myTemplateLength; }
46 
47  void setCallback(const UT_StringRef &name,
48  PRM_Callback callback);
49  void setChoiceListPtr(const UT_StringRef &name,
50  PRM_ChoiceList *list);
51 
52  void setNoResim(const UT_StringRef &name, bool noresim);
53  void setNoCook(const UT_StringRef &name, bool nocook);
54 
55  /// Returns if it was just built, used for any successive one
56  /// time initialization. Calling this function will mark it as
57  /// built.
58  bool justBuilt();
59 
60  /// Returns a template pointer by name. Searches nested multiparms.
61  PRM_Template *findTemplate(const UT_StringRef &name);
62 
63 private:
64 
65  void load(UT_IStream &stream, const char **cpp_options,
66  int extra_parms);
67 
68  PRM_Template *myTemplate;
69  int myTemplateLength;
70  PRM_ScriptPage *myPage;
71  bool myJustBuilt;
72  UT_StringHolder myName;
73 };
74 
75 #endif
GLuint GLuint stream
Definition: glcorearb.h:1832
Constructs a PRM_Template list from an embedded .ds file or an istream.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint const GLchar * name
Definition: glcorearb.h:786
#define PRM_API
Definition: PRM_API.h:10