HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
STY_OverrideBlock.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: STY_OverrideBlock.h ( STY Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __STY_OverrideBlock__
12 #define __STY_OverrideBlock__
13 
14 #include "STY_API.h"
15 #include "STY_Types.h"
16 #include <UT/UT_StringHolder.h>
17 #include <UT/UT_StringMap.h>
18 #include <UT/UT_StringArray.h>
19 #include <UT/UT_NonCopyable.h>
20 #include <UT/UT_IntrusivePtr.h>
21 
22 class STY_LoadContext;
24 class STY_ResultsFilter;
25 class UT_JSONValue;
26 
27 /// Contains a map of category names to override categories.
29  public UT_NonCopyable,
30  public UT_IntrusiveRefCounter<STY_OverrideBlock>
31 {
32 public:
33  STY_OverrideBlock(const UT_JSONValue *json,
34  const STY_LoadContext *load_context);
37 
38  /// Returns true if we have no overrides.
39  bool isEmpty() const
40  { return myOverrideCategories.empty(); }
41 
42  /// Get a list of categories allowed by the filter.
43  void getMatchingCategories(
45  UT_StringArray &categories) const;
46 
47  /// Get the overrides for a paritcular category.
49  getOverrideCategory(const UT_StringRef &category) const;
50 
51  /// Obtains the list of data names that the override scripts
52  /// are interested in for their input argument binding.
53  const UT_StringArray &
54  getOverrideBindingDataNames() const;
55 
56  /// Save this override set as JSON to a style sheet.
57  void saveStyleSheets(UT_JSONValue *values,
59  const exint num_values,
60  bool evaluate_scripts,
61  bool allow_shared_scripts) const;
62 
63 private:
64  void load(const UT_JSONValue *json,
65  const STY_LoadContext *load_context);
66  void buildBindingDataNames();
67 
68  STY_OverrideCategoryMap myOverrideCategories;
69  UT_StringArray myOverrideBindingDataNames;
70 };
71 
72 #endif
73 
#define STY_API
Definition: STY_API.h:10
A reference counter base class for use with UT_IntrusivePtr.
Contains a map of category names to override categories.
int64 exint
Definition: SYS_Types.h:116
Wrapper around hboost::intrusive_ptr.
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1601
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:75
bool isEmpty() const
Returns true if we have no overrides.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296