GL Studio API
plugin.h
Go to the documentation of this file.
1 /*! \file
2  \brief The base class for GL Studio plugin file loaders, disti::Plugin.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2015 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 
41 #ifndef _PLUGIN_H
42 #define _PLUGIN_H
43 
44 #include "gls_include.h"
45 #include <string.h>
46 #include <iostream>
47 
48 namespace disti
49 {
50 
51 class DistiAttributePluginData;
52 
53 /** The Plugin class
54  */
55 class Plugin
56 {
57 public:
58 
59  /** \return A description string used for informational display
60  * by the plugin GUI
61  */
62  virtual const char *Description(void) = 0;
63 
64  /** \return A version string used for informational display
65  * by the plugin GUI
66  */
67  virtual const char *Version(void) = 0;
68 
69  /** \return The type of the plugin
70  */
71  virtual const char *PluginType(void) = 0;
72 
73  /** Allows plugin to specify the name of
74  * its entry in the PluginData section
75  * of the .gls file.
76  * This may contain spaces but shall not contain a ':' or a newline.
77  * If this is not overriden, PluginData will
78  * not be saved or restored.
79  */
80  virtual const char *PluginDataName() { return NULL; }
81 
82  /** Allows plugin to write out any persistant data
83  * in the form
84  * SomeAttribute: SomeValue
85  * Data must all be single-line.
86  * PluginDataName() must be overriden for this to be called.
87  */
88  virtual void WritePluginData(DistiAttributePluginData * /*pluginData*/) {};
89 
90  /** Allows plugin to read in any persistant data
91  * of the form
92  * SomeAttribute: SomeValue
93  * Data will all be single-line.
94  * Data will be terminated by '}' or EOF
95  * PluginDataName() must be overriden for this to be called.
96  */
97  virtual void ReadPluginData(DistiAttributePluginData * /*pluginData*/) {};
98 
99  /** Allows plugin to reset its attributes back to
100  * their default value. This allows for new documents
101  * to use the default attributes rather
102  * than whatever was used last
103  * PluginDataName() must be overriden for this to be called.
104  */
105  virtual void ResetPluginData() {};
106 
107  /** Indicates if the plugin is of the specified type.
108  * \param str The type of the plugin
109  * \return true if plugin is the type specified
110  * \remarks Used by the plug-in manager as a workaround on systems where RTTI is broken
111  */
112  inline bool IsPluginType(const char *str) { return !strcmp(str,PluginType()); }
113 
114  /* Allows plugin to handle destruction of its own data.
115  */
116  virtual void Destroy() = 0;
117 };
118 
119 } // namespace disti
120 
121 #endif
virtual const char * PluginType(void)=0
Definition: plugin.h:55
A file for all GL Studio files to include.
virtual const char * Version(void)=0
virtual const char * Description(void)=0
virtual void ResetPluginData()
Definition: plugin.h:105
virtual const char * PluginDataName()
Definition: plugin.h:80
bool IsPluginType(const char *str)
Definition: plugin.h:112
Definition: bmpimage.h:46
virtual void ReadPluginData(DistiAttributePluginData *)
Definition: plugin.h:97
virtual void WritePluginData(DistiAttributePluginData *)
Definition: plugin.h:88