CFx SDK Documentation  2020SP3
FxPluginModule.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 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"
FxPragmaPop.h
CFxPluginModule::CFxPluginModule
CFxPluginModule(const CFxString &sGUIDs)
Definition: FxPluginModule.h:34
FxPluginModuleInternal.h
FxPluginModuleDefines.h
CFxPluginModule::event
int event(ModuleEvent e, CFxEventData *pData=0) override
Definition: FxPluginModule.h:53
CFxModule::ModuleEvent
ModuleEvent
Definition: FxModule.h:42
FxModule.h
CFxPluginModule::uninit
virtual void uninit()=0
CFxPluginModuleInternal
Definition: FxPluginModuleInternal.h:31
GetCFxPluginModuleInternal
DDKERNEL_API CFxPluginModuleInternal * GetCFxPluginModuleInternal()
CFxString
Definition: FxString.h:48
FX_PLUGINMODULE_INTERNAL
#define FX_PLUGINMODULE_INTERNAL
Definition: FxPluginModuleDefines.h:31
CFxPluginModule::~CFxPluginModule
~CFxPluginModule() override
Definition: FxPluginModule.h:40
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxPluginModule
Definition: FxPluginModule.h:31
CFxPluginModule::init
virtual void init()=0
CFxModule
Definition: FxModule.h:33
CFxModule::CFxEventData
Definition: FxModule.h:63
FxPragmaPush.h
CFxPluginModule::addGUID
void addGUID(const CFxString &sGUID)
Definition: FxPluginModule.h:49
CFxPluginModule::addGUIDs
void addGUIDs(const CFxString &sGUIDs)
Definition: FxPluginModule.h:50