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 };
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
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