0029559: Samples - wrong copyright statement in FuncDemo
[occt.git] / tools / TInspectorAPI / TInspectorAPI_Communicator.hxx
CommitLineData
14bbbdcb 1// Created on: 2017-06-16
2// Created by: Natalia ERMOLAEVA
3// Copyright (c) 2017 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef TInspectorAPI_Communicator_H
17#define TInspectorAPI_Communicator_H
18
19#include <NCollection_List.hxx>
20#include <Standard_Transient.hxx>
21#include <Standard_Version.hxx>
22#if OCC_VERSION_HEX > 0x060901
23 #include <Standard_Handle.hxx>
24#endif
0cb512c0 25#include <inspector/TInspectorAPI_PluginParameters.hxx>
14bbbdcb 26
27//! The Communicator is an interface that should be implemented for a separate plugin
28//! It will be placed in layout of the given parent. After the plugin is created, it is possible to
29//! set container of parameters into plugin to provide the plugin's initialization by some external
30//! objects(e.g. Interactive Context or OCAF Application). If the parameters are changed, it may be
31//! applyed in UpdateContent function. The communicator can change parameters in the following cases:
32//! - the plugin removes own processed parameters (e.g. file names, that was opened by the plugin)
33//! - the plugin sends some parameters to another plugin(by name) (e.g. shape to be analized)
34//! (at the same time we should be careful here to do not change essential parameters of other plugins)
35class TInspectorAPI_Communicator
36{
37public:
38
39 //! Loads the plugin library
40 //! \param thePluginName the name of the library
41 //! \return an instance of the communicator or NULL
42 static Standard_EXPORT TInspectorAPI_Communicator* LoadPluginLibrary (const TCollection_AsciiString& thePluginName);
43
44 //! Sets parameters container, it should be used when the plugin is initialized or in update content
45 //! \param theParameters a parameters container
46 Standard_EXPORT virtual void SetParameters (const Handle(TInspectorAPI_PluginParameters)& theParameters) = 0;
47
48 //! Provides the container with a parent where this container should be inserted.
49 //! If Qt implementation, it should be QWidget with QLayout set inside
50 //! \param theParent a parent class
51 Standard_EXPORT virtual void SetParent (void* theParent) = 0;
52
53 //! Calls update of the plugin's content
54 Standard_EXPORT virtual void UpdateContent() = 0;
55
56 //! Constructs the communicator.
57 TInspectorAPI_Communicator() {}
58
59 //! Destructor
60 virtual ~TInspectorAPI_Communicator() {}
61};
62
63//! Declare plugin method
64extern "C"
65{
66 //! Declares function to create an instance of communicator
67 //! It should be implemented in a child plugin
68 typedef TInspectorAPI_Communicator* (*COMMUNICATOR_INSTANCE)();
69}
70//! Defines name of the function that should be implemented in a child plugin
71#define CREATE_COMMUNICATOR_FUNCTION_NAME "CreateCommunicator"
72
73#endif