fbplug.h

Go to the documentation of this file.
00001 #ifndef __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 };
00125 
00136 class FBSDK_DLL FBPlug : public ICallback
00137                        , public FBWrapperHolder
00138 {
00139 public:
00141     FBPlug( HIObject pObject );
00142 
00144     virtual ~FBPlug();
00145 
00146 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00147 
00148     virtual HIObject GetHIObject() const;
00149 
00151     virtual bool SetHIObject( HIObject pObject, bool pSDKComponent );
00152 #endif
00153 
00155     bool IsSDKComponent();
00156 
00162     bool                ConnectSrc( HFBPlug pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00163 
00169     bool                ConnectDst( HFBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00170 
00177     bool                ConnectSrcAt( int pDst_SrcIndex, HFBPlug pSrc, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00178 
00185     bool                ConnectDstAt( int pSrc_DstIndex, HFBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00186 
00195     K_DEPRECATED bool                ConnectAt( HFBPlug pSrc, int pSrc_DstIndex, HFBPlug pDst, int pDst_SrcIndex, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00196 
00201     bool                DisconnectDst( HFBPlug pDst );
00202 
00207     bool                DisconnectSrc( HFBPlug pSrc );
00208 
00210     void                DisconnectAllSrc();
00211 
00213     void                DisconnectAllDst();
00214 
00219     bool                DisconnectDstAt( int pIndex );
00220 
00225     bool                DisconnectSrcAt( int pIndex );
00226 
00232     bool                ReplaceDstAt( int pIndex, HFBPlug pDst );
00233 
00239     bool                ReplaceSrcAt( int pIndex, HFBPlug pSrc );
00240 
00246     bool                SwapSrc( int pIndexA, int pIndexB );
00247 
00254     bool                MoveSrcAt( int pIndex, int pAtIndex );
00255 
00262     bool                MoveSrcAt( HFBPlug pSrc, HFBPlug pAtSrc );
00263 
00267     int                 GetSrcCount();
00268 
00273     HFBPlug             GetSrc( int pIndex );
00274 
00279     FBConnectionType    GetSrcType( int pIndex );
00280 
00284     int                 GetDstCount();
00285 
00290     HFBPlug             GetDst( int pIndex );
00291 
00296     FBConnectionType    GetDstType( int pIndex );
00297 
00301     bool                BeginChange();
00302 
00304     void                EndChange();
00305 
00309     HFBPlug             GetOwner();
00310 
00314     int                 GetOwnerCount();
00315 
00320     HFBPlug             GetOwned( int pIndex );
00321 
00325     int                 GetOwnedCount();
00326 
00328     virtual char*       ClassName();
00330 
00333     virtual bool        Is( int pTypeId );
00334 
00336 
00339     virtual int        GetTypeId();
00340 
00342     static int TypeInfo;
00343 
00345     bool            mAllocated;
00346 
00355     virtual bool PlugDataNotify(FBConnectionAction pAction,FBPlug* pThis,void* pData=NULL,void* pDataOld=NULL,int pDataSize=0);
00356 
00365     virtual bool PlugStateNotify(FBConnectionAction pAction,FBPlug* pThis,void* pData=NULL,void* pDataOld=NULL,int pDataSize=0);
00366 
00376     virtual bool PlugNotify(FBConnectionAction pAction,FBPlug* pThis,int pIndex,FBPlug* pPlug = NULL,FBConnectionType pConnectionType=kFBConnectionTypeNone,FBPlug* pNewPlug=NULL );
00377 
00378 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00379     IObject_Declare(Implementation);
00380     ICallback_Declare(Implementation);
00381 #endif
00382 
00383 protected:
00387     virtual void        FBDelete();
00388 
00389     static int          mGlobalTypeInfo;        
00390     static int          GetInternalClassId();   
00391     HIObject            mObject;                
00392     bool                mSDKComponent;          
00393 };
00394 
00395 
00397 // Connection related utility functions.
00399 
00406 FBSDK_DLL bool FBConnect( HFBPlug pSrc, HFBPlug pDst, FBConnectionType pConnectionType=kFBConnectionTypeNone );
00407 
00414 FBSDK_DLL bool FBDisconnect( HFBPlug pSrc, HFBPlug pDst );
00415 
00416 
00417 #ifdef FBSDKUseNamespace
00418     }
00419 #endif
00420 
00421 #endif