MTemplateItem.h
1 /*****************************************************************************
2 **
3 ** Header file for Virtual Vertex Template item base class
4 **
5 ** Name : MTemplateItem.h
6 ** Author : Leonardo Bernardini
7 ** Version : Alpha 9.0 Wed May 17th 2017
8 **
9 ** Copyright 2000-2017, Virtual Vertex
10 ** All Rights Reserved.
11 **
12 ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13 ** The contents of this file may not be disclosed to third parties, copied
14 ** or duplicated in any form, in whole or in part, without the prior written
15 ** permission of the author.
16 **
17 *****************************************************************************/
18 #ifndef MTEMPLATE_ITEM_H
19 #define MTEMPLATE_ITEM_H
20 
21 #ifdef WIN32
22 // Windows definitions
23 #ifdef MTEMPLATE_EXPORTS
24 #define MTEMPLATE_API __declspec(dllexport)
25 #else
26 #define MTEMPLATE_API __declspec(dllimport)
27 #endif
28 #else
29 
30 #ifndef MTEMPLATE_EXPORTS
31 #ifdef LINUX
32 #define MTEMPLATE_API
33 #else
34 #define MTEMPLATE_API
35 #endif
36 #else
37 #define MTEMPLATE_API
38 #endif
39 #endif
40 
41 // Disable STL Export warning
42 #if defined(_WIN32)
43 #pragma warning(disable: 4251)
44 #endif // _WIN32
45 
46 #include <string>
47 #include <vector>
48 
49 namespace MTemplateEngine {
60  class MTEMPLATE_API MTemplateItem {
61 
62  public:
63 
64  friend class MTemplate;
65  friend class MTemplateItemHolder;
66  friend class MTemplatePlatform;
67 
81  kTemplateItemFramesRange
82  };
83 
84  MTemplateItem();
85  MTemplateItem(const std::string& _name, const std::string& _description, const std::string& _extendedDescription,
86  const std::string& defaultValue, bool _isActivable, bool _applySubstitution, bool _isMandatory);
87  virtual ~MTemplateItem();
88 
89  std::string getName();
90  std::string getDescription();
91  std::string getExtendedDescription();
92  std::string getDefaultValue();
93  bool getDefaultActivatorValue();
94  bool getIsActivable();
95  bool getApplySubstitution();
96  bool getIsMandatory();
97  int getType();
98 
99  void setName(const std::string& _name);
100  void setDescription(const std::string& _description);
101  void setExtendedDescription(const std::string& _extendedDescription);
102  void setIsActivable(bool _isActivable);
103  void setApplySubstitution(bool _applySubstitution);
104  void setIsMandatory(bool _isMandatory);
105  void setType(int _type);
106  void setDefaultValue(const std::string& _defaultValue);
107  void setDefaultActivatorValue(bool _defaultValue);
108 
109  MTemplateItem* duplicateItem();
110  static void deallocateItemList(std::vector<MTemplateItem*>* list);
111  protected:
112  int type;
113  private:
114  std::string defaultValue;
115  std::string name;
116  std::string description;
117  std::string extendedDescription;
118  bool isActivable;
119  bool applySubstitution;
120  bool isMandatory;
121  bool defaultActivatorValue;
122  protected:
123  virtual void encodeTree(void* pt, std::string(*encodeFunc)(const std::string &), int encoding, void* fields, std::vector<std::string>* filters);
124 
125  };
126 
128 };
129 
130 #endif
Class that instantiate an item group holder class used to group template items in specific groups...
Class holding a template field item.
Definition: MTemplateItem.h:60
Class that instantiate a template specific platform settings.