00001 #ifndef __FBPLUG_H__
00002 #define __FBPLUG_H__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00045 #include <kaydaradef.h>
00046
00047 #ifndef FBSDK_DLL
00048
00051 #define FBSDK_DLL K_DLLIMPORT
00052 #endif
00053
00054
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
00067 FB_FORWARD( FBPlug );
00068
00070 enum FBConnectionAction
00071 {
00072
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
00096 kFBCandidate,
00097 kFBCandidated,
00098 kFBCandidateGlobal,
00099
00100
00101 kFBDetached,
00102 kFBDestroy,
00103 kFBSelect,
00104 kFBUnselect,
00105 kFBReselect,
00106 kFBRename,
00107 kFBRenamed,
00108 kFBPrefixRename,
00109 kFBPrefixRenamed,
00110 kFBDescription,
00111
00112
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
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