MTemplatePlatform.h
1 /*****************************************************************************
2 **
3 ** Header file for Virtual Vertex Template platform configuration class
4 **
5 ** Name : MTemplatePlatform.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_PLATFORM_H
19 #define MTEMPLATE_PLATFORM_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 #include "MTemplateItem.h"
50 
51 namespace MTemplateEngine {
52 
62  class MTEMPLATE_API MTemplatePlatform
63  {
64  friend class MTemplate;
65 
66  public:
70 
71  bool getPlatformEnabled();
72  bool getEnableErrorCheck();
73  bool getEnabledByDefault();
74  int getFramesFloating();
75  int getDetectionLogic();
76  std::string getDetectionLogicProcessName();
77  std::string getDetectionLogicChildProcessName();
78  int getDetectionLogic(const std::string& task);
79  std::string getDetectionLogicProcessName(const std::string& task);
80  std::string getDetectionLogicChildProcessName(const std::string& task);
81 
82  bool getHideProcessWindow();
83  bool getSampleEnvironmentFromBat();
84 
85  void setPlatformEnabled(bool _platformEnabled);
86  void setEnableErrorCheck(bool _enableErrorCheck);
87  void setEnabledByDefault(bool _enabledByDefault);
88  void setFramesFloating(int _framesFloating);
89  void setDetectionLogic(int _detectionLogic);
90  void setDetectionLogicProcessName(const std::string& _detectionLogicProcessName);
91  void setDetectionLogicChildProcessName(const std::string& _detectionLogicChildProcessName);
92  void setDetectionLogic(const std::string& task,int _detectionLogic);
93  void setDetectionLogicProcessName(const std::string& task, const std::string& _detectionLogicProcessName);
94  void setDetectionLogicChildProcessName(const std::string& task, const std::string& _detectionLogicChildProcessName);
95 
96  void setHideProcessWindow(bool _hideProcessWindow);
97  void setSampleEnvironmentFromBat(bool _sampleEnvironmentFromBat);
98 
99  void clearClientConfigurationItems();
100  void addClientConfigurationItem(MTemplateItem* item);
101  std::vector<MTemplateItem*>* getClientConfigurationItems();
102 
103  private:
104  bool platformEnabled;
105  bool enableErrorCheck;
106  bool enabledByDefault;
107  bool hideProcessWindow;
108  bool sampleEnvironmentFromBat;
109  int framesFloating;
110  std::map<std::string,int> detectionLogic;
111  std::map<std::string, std::string> detectionLogicProcessName;
112  std::map<std::string, std::string> detectionLogicChildProcessName;
113  std::vector<MTemplateItem*> clientAttributes;
114  void encodeTree(void* pt, std::string(*encodeFunc)(const std::string &), int encoding, void* fields, std::vector<std::string>* filters);
115  MTemplatePlatform& operator= (const MTemplatePlatform &src);
116  void copyFrom(const MTemplatePlatform& src);
117 
118  };
119 
121 };
122 
123 #endif
Class holding a template field item.
Definition: MTemplateItem.h:60
Class that instantiate a template specific platform settings.