00001 //----------------------------------------------------------------------------- 00002 // Project : SDK Core 00003 // Version : 1.0 00004 // 00005 // Category : SDK Core Interfaces 00006 // Filename : ipluginbase.h 00007 // Created by : Steinberg, 01/2004 00008 // Modified : $Date: 2008/01/09 12:51:43 $ 00009 // Description : Basic Plug-In Interfaces 00010 // 00011 //----------------------------------------------------------------------------- 00012 // LICENSE 00013 // © 2008, Steinberg Media Technologies GmbH, All Rights Reserved 00014 //----------------------------------------------------------------------------- 00015 // This Software Development Kit may not be distributed in parts or its entirety 00016 // without prior written agreement by Steinberg Media Technologies GmbH. 00017 // This SDK must not be used to re-engineer or manipulate any technology used 00018 // in any Steinberg or Third-party application or software module, 00019 // unless permitted by law. 00020 // Neither the name of the Steinberg Media Technologies nor the names of its 00021 // contributors may be used to endorse or promote products derived from this 00022 // software without specific prior written permission. 00023 // 00024 // THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND 00025 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00026 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00027 // IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, 00028 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00029 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00030 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00031 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00032 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 00033 // OF THE POSSIBILITY OF SUCH DAMAGE. 00034 //------------------------------------------------------------------------------ 00035 00036 #ifndef __ipluginbase__ 00037 #define __ipluginbase__ 00038 00039 #ifndef __funknown__ 00040 #include "funknown.h" 00041 #endif 00042 00043 namespace Steinberg { 00044 00045 //------------------------------------------------------------------------ 00059 //------------------------------------------------------------------------ 00060 class IPluginBase: public FUnknown 00061 { 00062 public: 00063 //------------------------------------------------------------------------ 00067 virtual tresult PLUGIN_API initialize (FUnknown* context) = 0; 00068 00071 virtual tresult PLUGIN_API terminate () = 0; 00072 00073 //------------------------------------------------------------------------ 00074 static const FUID iid; 00075 }; 00076 00077 DECLARE_CLASS_IID (IPluginBase, 0x22888DDB, 0x156E45AE, 0x8358B348, 0x08190625) 00078 00079 00080 //------------------------------------------------------------------------ 00082 //------------------------------------------------------------------------ 00083 struct PFactoryInfo 00084 { 00085 //------------------------------------------------------------------------ 00086 enum FactoryFlags 00087 { 00088 kNoFlags = 0, 00089 kClassesDiscardable = 1 << 0, 00090 kLicenseCheck = 1 << 1, 00091 kComponentNonDiscardable = 1 << 3, 00092 kUnicode = 1 << 4 00093 }; 00094 00095 enum 00096 { 00097 kURLSize = 256, 00098 kEmailSize = 128, 00099 kNameSize = 64 00100 }; 00101 00102 //------------------------------------------------------------------------ 00103 char vendor[kNameSize]; 00104 char url[kURLSize]; 00105 char email[kEmailSize]; 00106 int32 flags; 00107 //------------------------------------------------------------------------ 00108 }; 00109 00110 //------------------------------------------------------------------------ 00112 //------------------------------------------------------------------------ 00113 struct PClassInfo 00114 { 00115 //------------------------------------------------------------------------ 00116 enum ClassCardinality 00117 { 00118 kManyInstances = 0x7FFFFFFF 00119 }; 00120 00121 enum 00122 { 00123 kCategorySize = 32, 00124 kNameSize = 64 00125 }; 00126 //------------------------------------------------------------------------ 00127 char cid[16]; 00128 int32 cardinality; 00129 char category[kCategorySize]; 00130 char name[kNameSize]; 00131 //------------------------------------------------------------------------ 00132 }; 00133 00134 //------------------------------------------------------------------------ 00135 #define LICENCE_UID(l1, l2, l3, l4) \ 00136 { \ 00137 (char)((l1 & 0xFF000000) >> 24), (char)((l1 & 0x00FF0000) >> 16), \ 00138 (char)((l1 & 0x0000FF00) >> 8), (char)((l1 & 0x000000FF) ), \ 00139 (char)((l2 & 0xFF000000) >> 24), (char)((l2 & 0x00FF0000) >> 16), \ 00140 (char)((l2 & 0x0000FF00) >> 8), (char)((l2 & 0x000000FF) ), \ 00141 (char)((l3 & 0xFF000000) >> 24), (char)((l3 & 0x00FF0000) >> 16), \ 00142 (char)((l3 & 0x0000FF00) >> 8), (char)((l3 & 0x000000FF) ), \ 00143 (char)((l4 & 0xFF000000) >> 24), (char)((l4 & 0x00FF0000) >> 16), \ 00144 (char)((l4 & 0x0000FF00) >> 8), (char)((l4 & 0x000000FF) ) \ 00145 } 00146 00147 00148 //------------------------------------------------------------------------ 00150 //------------------------------------------------------------------------ 00151 struct PClassInfo2 00152 { 00153 char cid[16]; 00154 int32 cardinality; 00155 char category[PClassInfo::kCategorySize]; 00156 char name[PClassInfo::kNameSize]; 00157 00158 enum { 00159 kVendorSize = 64, 00160 kVersionSize = 64, 00161 kSubCategoriesSize = 128 00162 }; 00163 00164 uint32 classFlags; 00165 char subCategories[kSubCategoriesSize]; 00166 char vendor[kVendorSize]; 00167 char version[kVersionSize]; 00168 char sdkVersion[kVersionSize]; 00169 }; 00170 00171 //------------------------------------------------------------------------ 00172 // IPluginFactory interface declaration 00173 //------------------------------------------------------------------------ 00185 //------------------------------------------------------------------------ 00186 class IPluginFactory : public FUnknown 00187 { 00188 public: 00189 //------------------------------------------------------------------------ 00191 virtual tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info) = 0; 00192 00195 virtual int32 PLUGIN_API countClasses () = 0; 00196 00198 virtual tresult PLUGIN_API getClassInfo (int32 index, PClassInfo* info) = 0; 00199 00201 virtual tresult PLUGIN_API createInstance (const char* cid, const char* iid, void** obj) = 0; 00202 00203 //------------------------------------------------------------------------ 00204 static const FUID iid; 00205 }; 00206 00207 DECLARE_CLASS_IID (IPluginFactory, 0x7A4D811C, 0x52114A1F, 0xAED9D2EE, 0x0B43BF9F) 00208 00209 //------------------------------------------------------------------------ 00210 // IPluginFactory2 interface declaration 00211 //------------------------------------------------------------------------ 00212 class IPluginFactory2 : public IPluginFactory 00213 { 00214 public: 00215 //------------------------------------------------------------------------ 00217 virtual tresult PLUGIN_API getClassInfo2 (int32 index, PClassInfo2* info) = 0; 00218 00219 //------------------------------------------------------------------------ 00220 static const FUID iid; 00221 }; 00222 DECLARE_CLASS_IID (IPluginFactory2, 0x0007B650, 0xF24B4C0B, 0xA464EDB9, 0xF00B2ABB) 00223 00224 } 00225 00226 //------------------------------------------------------------------------ 00227 // GetPluginFactory 00228 //------------------------------------------------------------------------ 00264 //------------------------------------------------------------------------ 00265 extern "C" 00266 { 00267 Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory (); 00268 typedef Steinberg::IPluginFactory* (PLUGIN_API *GetFactoryProc) (); 00269 } 00270 00271 #endif // __ipluginbase__