CFx SDK Documentation  2022 SP0
FxPluginModule.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2021 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 /* IMPORTANT: DO NOT CHANGE THIS FILE! */
20 
21 /* This class gets inherited by your custom class. */
22 
23 #include "FxPluginModuleInternal.h"
24 #include "FxPluginModuleDefines.h"
25 #include "FxModule.h"
26 
27 #include "FxPragmaPush.h"
28 
29 // Inherit from this class to initialise your plugin
31 {
32 public:
33  // Constructs the module and sets the GUID keys for the module used for encryption.
34  CFxPluginModule(const CFxString& sGUIDs) : CFxModule()
35  {
36  internal = GetCFxPluginModuleInternal();
37  addGUIDs( sGUIDs );
38  }
39 
40  ~CFxPluginModule() override { delete internal; }
41 
42  // You need to implement these methods. These are replacements for initApp and uninitApp.
43  virtual void init() = 0;
44  virtual void uninit() = 0;
45 
46  // Add valid GUIDs for this DRX file.
47  // The GUID is the same as in the PLG or XML file.
48  // Call this method in your init() implementation
49  void addGUID(const CFxString& sGUID ) { internal->addGUID(sGUID); }
50  void addGUIDs(const CFxString& sGUIDs) { internal->addGUIDs(sGUIDs); }
51 
52  // Method is called from application on different events.
53  int event( ModuleEvent e, CFxEventData* pData = 0 ) override { return 0; }
54 
57 };
58 
59 #include "FxPragmaPop.h"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
#define FX_PLUGINMODULE_INTERNAL
DDKERNEL_API CFxPluginModuleInternal * GetCFxPluginModuleInternal()
virtual void uninit()=0
void addGUID(const CFxString &sGUID)
CFxPluginModule(const CFxString &sGUIDs)
int event(ModuleEvent e, CFxEventData *pData=0) override
virtual void init()=0
void addGUIDs(const CFxString &sGUIDs)
~CFxPluginModule() override