
//////////////////////////////////////////////////////////////////////
// TableEx.h: interface for CTableEx class.
//
// Разработчик: Артур Аюханов aka artbear, mailto: artbear@inbox.ru
// Версия: 1.0
//////////////////////////////////////////////////////////////////////

#pragma once

//#undef VK_1CPP_SourceTable
#define VK_1CPP_SourceTable
#ifdef VK_1CPP_SourceTable

// инициализация перехвата
class CInitTableWrap
{
public:
	static void Init(void);
};

// класс для перехвата объекта Таблица
class CTableWrapEx : public CBLContext
{
public:
	CSheetDoc* m_pSheetDocOut; //20
	DWORD dwFlag1; //24
	DWORD dwFlag2; //28
	CSheetDoc* m_pSheetDocIn; //2C
	DWORD dwFlag3; //30
	DWORD dwFlag4; //34
	CSheet* m_pSheet; //38
	DWORD dwFlag6; //3C
	DWORD dwFlag7; //40
	DWORD dwFlag8;
	DWORD dwFlag9;
	DWORD dwFlag10;
	DWORD dwFlag11;

	virtual void DecrRef(void);

	virtual int GetNParams(int iMethNum)const;
	virtual int GetParamDefValue(int iMethNum,int iParamNum,CValue *)const;
	virtual int HasRetVal(int iMethNum)const;
	virtual int CallAsProc(int iMethNum,class CValue **ppValue);
	virtual int CallAsFunc(int iMethNum,class CValue & rValue,class CValue **ppValue);

	int SetTable(class CValue **ppValue);
	static void SetTableWrap(CBLContext* pTabCont);
};

class CTableWrapExDbl : public CGroupContext
{
public:
	CSheetDoc* m_pSheetDocOut; //20
	DWORD dwFlag1; //24
	DWORD dwFlag2; //28
	CSheetDoc* m_pSheetDocIn; //2C
	DWORD dwFlag3; //30
	DWORD dwFlag4; //34
	CSheet* m_pSheet; //38
	DWORD dwFlag6; //3C
	DWORD dwFlag7; //40
	DWORD dwFlag8;
	DWORD dwFlag9;
	DWORD dwFlag10;
	DWORD dwFlag11;

	virtual int CallAsProc(int iMethNum,class CValue **ppValue);
};
#endif

#ifdef ONECPP_ARTBEAR

class CTableEx: public CBLContext
{
DECLARE_DYNCREATE(CTableEx);
public:
    CTableEx();
    ~CTableEx();
    
private:
//CBLContext interface
public:
    virtual int  CallAsFunc(int,class CValue &,class CValue * *);
	virtual int  CallAsProc(int,class CValue * *);
	virtual void  DecrRef(void);
	virtual int  FindMethod(char const *)const;
	virtual int  FindProp(char const *)const;
	virtual char const *  GetCode(void)const;
	virtual int  GetDestroyUnRefd(void)const;
	virtual void  GetExactValue(class CValue &);
	virtual class CObjID   GetID(void)const;
	virtual class CBLContextInternalData *  GetInternalData(void);
	virtual char const *  GetMethodName(int,int)const;
	virtual int  GetNMethods(void)const;
	virtual int  GetNParams(int)const;
	virtual int  GetNProps(void)const;
	virtual int  GetParamDefValue(int,int,class CValue *)const;
	virtual char const *  GetPropName(int,int)const;
	virtual int  GetPropVal(int,class CValue &)const;
	virtual long  GetTypeID(void)const;
	virtual char const *  GetTypeString(void)const;
	virtual class CType   GetValueType(void)const;
	virtual int  HasRetVal(int)const;
	virtual void  IncrRef(void);
	virtual void  InitObject(class CType const &);
	virtual void  InitObject(char const *);
	virtual int  IsExactValue(void)const;
	virtual int  IsOleContext(void)const;
	virtual int  IsPropReadable(int)const;
	virtual int  IsPropWritable(int)const;
	virtual int  IsSerializable(void);
	virtual int  SaveToString(class CString &);
	virtual void  SelectByID(class CObjID,long);
	virtual int  SetPropVal(int,class CValue const &);

	static class CObjID ObjID;
private:
	CSheetDoc* m_pSheetDocOut; //20
	DWORD dwFlag1; //24
	DWORD dwFlag2; //28
	CSheetDoc* m_pSheetDocIn; //2C
	DWORD dwFlag3; //30
	DWORD dwFlag4; //34
	CSheet* m_pSheet; //38
	DWORD dwFlag6; //3C
	DWORD dwFlag7; //40
	DWORD dwFlag8;
	DWORD dwFlag9;
	DWORD dwFlag10;
	DWORD dwFlag11;

	CBLContext* pTabCont;

/*    static CParamDefs defFnNames;
    GUID m_guid;
    mutable CString m_StringView;
    int ConvertFormStr(const char* ptr, GUID* guid);
public:
    void Set(const GUID* guid) { memcpy(&m_guid, guid, sizeof(GUID)); m_StringView.Empty();};
    void Get(GUID* guid) const { memcpy(guid, &m_guid, sizeof(GUID)); };
    void GetBinaryString(CString &str) const;
	void CreateNew(void);//spock: 2005-12-11 ИМХО, в интерфейсе не хватает этого метода
*/
public:
	int SetTable(class CValue **ppValue);
	static bool bIsInit;
};

#endif
