iXRefObjRecord.h

Go to the documentation of this file.
00001 //**************************************************************************/
00002 // Copyright (c) 1998-2005 Autodesk, Inc.
00003 // All rights reserved.
00004 // 
00005 // These coded instructions, statements, and computer programs contain
00006 // unpublished proprietary information written by Autodesk, Inc., and are
00007 // protected by Federal copyright law. They may not be disclosed to third
00008 // parties or copied or duplicated in any form, in whole or in part, without
00009 // the prior written consent of Autodesk, Inc.
00010 //**************************************************************************/
00011 // DESCRIPTION: Interface for working with xref records
00012 // AUTHOR: Attila Szabo - created Dec.10.2004
00013 //***************************************************************************/
00014 
00015 #pragma once
00016 
00017 #include "..\iFnPub.h"
00018 #include "iXrefItem.h"
00019 #include "..\tabtypes.h"
00020 
00021 // --- Forward decls
00022 class ReferenceTarget;
00023 class ClassDesc;
00024 
00025 // --- Type definitions
00027 
00034 typedef unsigned long XRefRecordHandle;
00035 
00037 const XRefRecordHandle kNullXRefRecordHandle = 0;
00038 
00040 #define IID_XREF_OBJ_RECORD Interface_ID(0x1a457bd1, 0x7584ff0)
00041 
00043 
00048 class IObjXRefRecord : public FPMixinInterface
00049 {
00050 public:
00052 
00053 
00054 
00057     virtual unsigned int ItemCount(IXRefItem::XRefItemType itemType) const = 0;
00058     
00060 
00068     virtual unsigned int GetItems(IXRefItem::XRefItemType itemType, Tab<ReferenceTarget*>& xrefItems) const = 0;
00069 
00071 
00076     virtual ReferenceTarget* GetItem(unsigned int i, IXRefItem::XRefItemType itemType) const = 0;
00077 
00079 
00085     virtual bool IsEmpty() const = 0;
00087 
00093 
00094 
00099     virtual unsigned int GetChildRecords(Tab<IObjXRefRecord*>& childRecords) const = 0;
00101 
00106     virtual unsigned int GetParentRecords(Tab<IObjXRefRecord*>& parentRecords) const = 0;
00108 
00113     virtual unsigned int GetRootRecords(Tab<IObjXRefRecord*>& rootRecords) const = 0;
00114 
00116 
00120     virtual bool IsNested() const = 0;
00122 
00127 
00128 
00133     virtual unsigned int GetXRefOptions() const = 0;
00134 
00136 
00140     virtual bool IsIncludeAll() const = 0;
00142 
00144     virtual void SetIncludeAll(bool bEnable) = 0;
00145 
00147 
00151     virtual bool IsEnabled() const = 0;
00153 
00158     virtual void SetEnable(bool bEnable) = 0;
00159 
00161 
00165     virtual bool IsAutoUpdate() const = 0;
00167 
00170     virtual void SetAutoUpdate(bool bEnable) = 0;
00171 
00173 
00179     virtual bool GetUpToDate() const = 0;
00181 
00184     virtual void SetUpToDate(bool bUpToDate) = 0;
00187 
00193     virtual bool CheckSrcFileChanged() = 0;
00194     
00196 
00202     virtual bool IsUnresolved() const = 0;
00203 
00205 
00210     virtual const MaxSDK::AssetManagement::AssetUser& GetSrcFile() const = 0;
00211 
00214     virtual const MSTR& GetParentSrcFileName()const = 0;
00216 
00218 
00219 
00220 
00229     virtual bool Update() = 0;
00230 
00232 
00238     virtual XRefRecordHandle GetHandle() const = 0;
00240     
00242 
00245     static IObjXRefRecord* GetInterface(InterfaceServer* is) {
00246         DbgAssert(is != NULL);
00247         return static_cast<IObjXRefRecord*>(is->GetInterface(IID_XREF_OBJ_RECORD));
00248     };
00249 
00250     // --- From FPMixinInterface
00251     // Retrieves the unique if of this interface class.
00252     virtual Interface_ID GetID() { return IID_XREF_OBJ_RECORD; }
00253     // Provides access to the metadata used to expose this interface class to maxscript
00254     virtual FPInterfaceDesc* GetDesc() { return &mFPInterfaceDesc; }
00255 
00256     // IDs of function published methods
00257     enum FPFuncIDs  
00258     { 
00259         kfpItemCount,
00260         kfpIsEmpty,
00261         kfpGetItem,
00262         kfpGetItems,
00263         kfpGetChildRecords, 
00264         kfpGetParentRecords,
00265         kfpGetRootRecords,
00266         kfpIsNested,
00267         kfpGetIncludeAll, kfpSetIncludeAll,
00268         kfpGetAutoUpdate, kfpSetAutoUpdate,
00269         kfpGetEnabled, kfpSetEnabled,
00270         kfpGetUpToDate, kfpSetUpToDate,
00271         kfpCheckSrcFileChanged,
00272         kfpIsUnresolved,
00273         kfpGetSrcFileName, kfpSetSrcFileName,
00274         kfpGetSrcFileAssetId, kfpSetSrcFileAssetId,
00275         kfpUpdate,
00276         kfpGetRecordId,
00277         kfpGetHandle,
00278         kfpGetXRefOptions,
00279     };
00280 
00281     // IDs of enumeration types used by function published methods
00282     enum FPEnums    
00283     { 
00284         kfpXRefItemTypes,
00285         kfpXRefItemTypesNoAll,
00286         kfpXrefOptions,
00287     };
00288 #pragma warning(push)
00289 #pragma warning(disable:4238)
00290     BEGIN_FUNCTION_MAP
00291         FN_1(kfpItemCount,  TYPE_DWORD, FPItemCount,    TYPE_ENUM_TAB_BR);
00292         FN_2(kfpGetItem,    TYPE_REFTARG,   FPGetItem,  TYPE_INDEX, TYPE_ENUM);
00293         FN_2(kfpGetItems,   TYPE_DWORD, FPGetItems, TYPE_ENUM_TAB_BR, TYPE_REFTARG_TAB_BR);
00294         FN_1(kfpGetChildRecords,    TYPE_DWORD, FPGetChildRecords,    TYPE_INTERFACE_TAB_BR);
00295         FN_1(kfpGetParentRecords,   TYPE_DWORD, FPGetParentRecords,   TYPE_INTERFACE_TAB_BR);
00296         FN_1(kfpGetRootRecords, TYPE_DWORD, FPGetRootRecords,     TYPE_INTERFACE_TAB_BR);
00297         FN_0(kfpCheckSrcFileChanged,    TYPE_bool,  CheckSrcFileChanged);
00298         FN_0(kfpUpdate, TYPE_bool,  Update);
00299         PROP_FNS(kfpGetIncludeAll, IsIncludeAll, kfpSetIncludeAll, SetIncludeAll, TYPE_bool);
00300         PROP_FNS(kfpGetAutoUpdate, IsAutoUpdate, kfpSetAutoUpdate, SetAutoUpdate, TYPE_bool);
00301         PROP_FNS(kfpGetEnabled, IsEnabled, kfpSetEnabled, SetEnable, TYPE_bool);
00302         PROP_FNS(kfpGetUpToDate, GetUpToDate, kfpSetUpToDate, SetUpToDate, TYPE_bool);
00303         RO_PROP_FN(kfpIsEmpty, IsEmpty, TYPE_bool);
00304         RO_PROP_FN(kfpIsUnresolved, IsUnresolved, TYPE_bool);
00305         PROP_FNS(kfpGetSrcFileName, FPGetSrcFileName, kfpSetSrcFileName, FPSetSrcFileName, TYPE_FILENAME);
00306         RO_PROP_FN(kfpGetHandle, GetHandle, TYPE_DWORD);
00307         RO_PROP_FN(kfpGetXRefOptions, FPGetXRefOptions, TYPE_ENUM_TAB_BV);
00308         RO_PROP_FN(kfpIsNested, IsNested, TYPE_bool);
00309     END_FUNCTION_MAP
00310 #pragma warning(pop)
00311 private:
00312     static FPInterfaceDesc mFPInterfaceDesc;
00313     unsigned int FPItemCount(IntTab& itemTypes) const;
00314     ReferenceTarget* FPGetItem(size_t i, unsigned int itemType) const;
00315     unsigned int FPGetItems(IntTab& itemTypes, Tab<ReferenceTarget*>& xrefItems) const;
00316     unsigned int FPGetChildRecords(Tab<FPInterface*>& childRecords) const;
00317     unsigned int FPGetParentRecords(Tab<FPInterface*>& parentRecords) const;
00318     unsigned int FPGetRootRecords(Tab<FPInterface*>& rootRecords) const;
00319     IntTab IObjXRefRecord::FPGetXRefOptions() const;
00320     void FPSetSrcFileName(const MCHAR* fileName);
00321     const MCHAR*  FPGetSrcFileName();
00322 };
00323 
00324 
00325