fbplug.h

Go to the documentation of this file.
00001 #ifndef __FBPLUG_H__
fbplug.h
00002 #define __FBPLUG_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00045 #include <kaydaradef.h>
00046 
00047 #ifndef FBSDK_DLL 
00048 
00051     #define FBSDK_DLL K_DLLIMPORT
00052 #endif
00053 
00054 // Global includes
00055 #include <object/i/icallback.h>
00056 #include <fbsdk/fbdefines.h>
00057 #include <fbsdk/fbscriptwrapper.h>
00058 
00059 #ifdef FBSDKUseNamespace
00060     namespace FBSDKNamespace {
00061 #endif
00062 
00063 
00065 // FBPlug
00067 FB_FORWARD( FBPlug );
00068 
00070 enum FBConnectionAction
00071 {
00072     // Connection notify actions
00073     kFBRequestConnectSrc,   
00074     kFBRequestConnectDst,   
00075     kFBConnectSrc,          
00076     kFBConnectDst,          
00077     kFBConnectedSrc,        
00078     kFBConnectedDst,        
00079     kFBDisconnectSrc,       
00080     kFBDisconnectDst,       
00081     kFBDisconnectedSrc,     
00082     kFBDisconnectedDst,     
00083     kFBBeginReplaceSrc,     
00084     kFBEndReplaceSrc,       
00085     kFBBeginReplaceDst,     
00086     kFBEndReplaceDst,       
00087     kFBReorderSrc,          
00088     kFBReorderedSrc,        
00089 
00090     kFBBeginChange,         
00091     kFBEndChange,           
00092     kFBConnectedOwner,      
00093     kFBDisconnectOwner,     
00094 
00095     // Data notify actions
00096     kFBCandidate,           
00097     kFBCandidated,          
00098     kFBCandidateGlobal,     
00099 
00100     // State notify actions
00101     kFBDetached,            
00102     kFBDestroy,             
00103     kFBSelect,              
00104     kFBUnselect,            
00105     kFBReselect,            
00106     kFBRename,              
00107     kFBRenamed,             
00108     kFBPrefixRename,        
00109     kFBPrefixRenamed,       
00110     kFBDescription,         
00111 
00112 // for backward compatibility
00113     kFBConnect = kFBConnectSrc,
00114     kFBConnected = kFBConnectedSrc,
00115     kFBDisconnect = kFBDisconnectSrc,
00116     kFBDisconnected = kFBDisconnectedSrc
00117 };
00118 
00120 enum FBConnectionType
00121 {
00122     kFBConnectionTypeNone,          
00123     kFBConnectionTypeSystem,        
00124     kFBConnectionTypeUnidirectional 
00125 };
00126 
00137 class FBSDK_DLL FBPlug : public ICallback
00138                        , public FBWrapperHolder
00139 {
00140 public:
00142     FBPlug( HIObject pObject );
00143 
00145     virtual ~FBPlug();
00146 
00147 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00149     virtual HIObject GetHIObject() const;
00150 
00152     virtual bool SetHIObject( HIObject pObject, bool pSDKComponent );
00153 #endif
00154 
00156     bool IsSDKComponent();
00157 
00163     bool                ConnectSrc( HFBPlug pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00164 
00170     bool                ConnectDst( HFBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00171 
00178     bool                ConnectSrcAt( int pDst_SrcIndex, HFBPlug pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00179 
00186     bool                ConnectDstAt( int pSrc_DstIndex, HFBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00187 
00196     K_DEPRECATED bool                ConnectAt( HFBPlug pSrc, int pSrc_DstIndex, HFBPlug pDst, int pDst_SrcIndex, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00197 
00202     bool                DisconnectDst( HFBPlug pDst );
00203 
00208     bool                DisconnectSrc( HFBPlug pSrc );
00209 
00211     void                DisconnectAllSrc();
00212 
00214     void                DisconnectAllDst();
00215 
00220     bool                DisconnectDstAt( int pIndex );
00221 
00226     bool                DisconnectSrcAt( int pIndex );
00227 
00233     bool                ReplaceDstAt( int pIndex, HFBPlug pDst );
00234 
00240     bool                ReplaceSrcAt( int pIndex, HFBPlug pSrc );
00241 
00247     bool                SwapSrc( int pIndexA, int pIndexB );
00248 
00255     bool                MoveSrcAt( int pIndex, int pAtIndex );
00256 
00263     bool                MoveSrcAt( HFBPlug pSrc, HFBPlug pAtSrc );
00264 
00268     int                 GetSrcCount();
00269 
00274     HFBPlug             GetSrc( int pIndex );
00275 
00280     FBConnectionType    GetSrcType( int pIndex );
00281 
00285     int                 GetDstCount();
00286 
00291     HFBPlug             GetDst( int pIndex );
00292 
00297     FBConnectionType    GetDstType( int pIndex );
00298 
00302     bool                BeginChange();
00303 
00305     void                EndChange();
00306 
00310     HFBPlug             GetOwner();
00311 
00315     int                 GetOwnerCount();
00316 
00321     HFBPlug             GetOwned( int pIndex );
00322 
00326     int                 GetOwnedCount();
00327 
00329     virtual char*       ClassName();
00331 
00334     virtual bool        Is( int pTypeId );
00335 
00337 
00340     virtual int        GetTypeId();
00341 
00343     static int TypeInfo;
00344 
00346     static int mInternalClassId;
00347 
00349     bool            mAllocated;
00350 
00359     virtual bool PlugDataNotify(FBConnectionAction pAction,FBPlug* pThis,void* pData=NULL,void* pDataOld=NULL,int pDataSize=0);
00360 
00369     virtual bool PlugStateNotify(FBConnectionAction pAction,FBPlug* pThis,void* pData=NULL,void* pDataOld=NULL,int pDataSize=0);
00370 
00380     virtual bool PlugNotify(FBConnectionAction pAction,FBPlug* pThis,int pIndex,FBPlug* pPlug = NULL,FBConnectionType pConnectionType=kFBConnectionTypeNone,FBPlug* pNewPlug=NULL );
00381 
00382 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00383     IObject_Declare(Implementation);
00384     ICallback_Declare(Implementation);
00385 #endif
00386 
00387 protected:
00391     virtual void        FBDelete();
00392 
00393     static int          mGlobalTypeInfo; 
00394     HIObject            mObject;         
00395     bool                mSDKComponent;   
00396 };
00397 
00398 
00400 // Connection related utility functions.
00402 
00409 FBSDK_DLL bool FBConnect( HFBPlug pSrc, HFBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00410 
00417 FBSDK_DLL bool FBDisconnect( HFBPlug pSrc, HFBPlug pDst );
00418 
00419 
00420 #ifdef FBSDKUseNamespace
00421     }
00422 #endif
00423 
00424 #endif

Please send us your comments about this page.