// CDVvWeb.h  : Microsoft Visual C++ で作成された ActiveX コントロール ラッパー クラスの宣言です。

#pragma once

/////////////////////////////////////////////////////////////////////////////
// CDVvWeb

class CDVvWeb : public CWnd
{
protected:
	DECLARE_DYNCREATE(CDVvWeb)
public:
    long m_nPosition;
    int  m_nStatus;
    CDVvWeb(void);
	CLSID const& GetClsid()
	{
		static CLSID const clsid
			= { 0x2466323, 0x75ED, 0x11CF, { 0xA2, 0x67, 0x0, 0x20, 0xAF, 0x25, 0x46, 0xEA } };
		return clsid;
	}
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
						const RECT& rect, CWnd* pParentWnd, UINT nID, 
						CCreateContext* pContext = NULL)
	{ 
		return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); 
	}

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, 
				UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
				BSTR bstrLicKey = NULL)
	{ 
		return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
		pPersist, bStorage, bstrLicKey); 
	}

// 属性
public:

// 操作
public:

	BOOL Fetch(LPCTSTR URL)
	{
		BOOL result;
		static BYTE parms[] = VTS_BSTR ;
		InvokeHelper(0x16, DISPATCH_METHOD, VT_BOOL, (void*)&result, parms, URL);
		return result;
	}
	void Restart()
	{
		InvokeHelper(0x17, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
	}
	short GetVideoWidth()
	{
		short result;
		InvokeHelper(0x18, DISPATCH_METHOD, VT_I2, (void*)&result, NULL);
		return result;
	}
	short GetVideoHeight()
	{
		short result;
		InvokeHelper(0x19, DISPATCH_METHOD, VT_I2, (void*)&result, NULL);
		return result;
	}
	BOOL Play()
	{
		BOOL result;
		InvokeHelper(0x1a, DISPATCH_METHOD, VT_BOOL, (void*)&result, NULL);
		return result;
	}
	BOOL Pause()
	{
		BOOL result;
		InvokeHelper(0x1b, DISPATCH_METHOD, VT_BOOL, (void*)&result, NULL);
		return result;
	}
	void SaveAs()
	{
		InvokeHelper(0x1c, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
	}
	void AboutMovie()
	{
		InvokeHelper(0x1d, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
	}
	void AboutBox()
	{
		InvokeHelper(DISPID_ABOUTBOX, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);
	}

    // Properties
    //

    CString GetText()
    {
        CString result;
        GetProperty(DISPID_TEXT, VT_BSTR, (void*)&result);
        return result;
    }
    void SetText(CString propVal)
    {
        SetProperty(DISPID_TEXT, VT_BSTR, propVal);
    }
    CString GetHeight()
    {
        CString result;
        GetProperty(0x1, VT_BSTR, (void*)&result);
        return result;
    }
    void SetHeight(CString propVal)
    {
        SetProperty(0x1, VT_BSTR, propVal);
    }
    CString GetWidth()
    {
        CString result;
        GetProperty(0x2, VT_BSTR, (void*)&result);
        return result;
    }
    void SetWidth(CString propVal)
    {
        SetProperty(0x2, VT_BSTR, propVal);
    }
    CString GetStretch()
    {
        CString result;
        GetProperty(0x3, VT_BSTR, (void*)&result);
        return result;
    }
    void SetStretch(CString propVal)
    {
        SetProperty(0x3, VT_BSTR, propVal);
    }
    CString GetAutostart()
    {
        CString result;
        GetProperty(0x4, VT_BSTR, (void*)&result);
        return result;
    }
    void SetAutostart(CString propVal)
    {
        SetProperty(0x4, VT_BSTR, propVal);
    }
    CString GetVideocontrols()
    {
        CString result;
        GetProperty(0x5, VT_BSTR, (void*)&result);
        return result;
    }
    void SetVideocontrols(CString propVal)
    {
        SetProperty(0x5, VT_BSTR, propVal);
    }
    CString GetURL()
    {
        CString result;
        GetProperty(0x6, VT_BSTR, (void*)&result);
        return result;
    }
    void SetURL(CString propVal)
    {
        SetProperty(0x6, VT_BSTR, propVal);
    }
    CString GetLocalName()
    {
        CString result;
        GetProperty(0x7, VT_BSTR, (void*)&result);
        return result;
    }
    void SetLocalName(CString propVal)
    {
        SetProperty(0x7, VT_BSTR, propVal);
    }
    CString GetVideoStore()
    {
        CString result;
        GetProperty(0x8, VT_BSTR, (void*)&result);
        return result;
    }
    void SetVideoStore(CString propVal)
    {
        SetProperty(0x8, VT_BSTR, propVal);
    }
    CString GetLeftMouseAction()
    {
        CString result;
        GetProperty(0x9, VT_BSTR, (void*)&result);
        return result;
    }
    void SetLeftMouseAction(CString propVal)
    {
        SetProperty(0x9, VT_BSTR, propVal);
    }
    CString GetRightMouseAction()
    {
        CString result;
        GetProperty(0xa, VT_BSTR, (void*)&result);
        return result;
    }
    void SetRightMouseAction(CString propVal)
    {
        SetProperty(0xa, VT_BSTR, propVal);
    }
    CString GetbackupURL()
    {
        CString result;
        GetProperty(0xb, VT_BSTR, (void*)&result);
        return result;
    }
    void SetbackupURL(CString propVal)
    {
        SetProperty(0xb, VT_BSTR, propVal);
    }
    CString GetVersion()
    {
        CString result;
        GetProperty(0xe, VT_BSTR, (void*)&result);
        return result;
    }
    void SetVersion(CString propVal)
    {
        SetProperty(0xe, VT_BSTR, propVal);
    }
    BOOL GetSaveable()
    {
        BOOL result;
        GetProperty(0xf, VT_BOOL, (void*)&result);
        return result;
    }
    void SetSaveable(BOOL propVal)
    {
        SetProperty(0xf, VT_BOOL, propVal);
    }
    long GetDuration()
    {
        long result;
        GetProperty(0x10, VT_I4, (void*)&result);
        return result;
    }
    void SetDuration(long propVal)
    {
        SetProperty(0x10, VT_I4, propVal);
    }
    BOOL GetStandalone()
    {
        BOOL result;
        GetProperty(0xc, VT_BOOL, (void*)&result);
        return result;
    }
    void SetStandalone(BOOL propVal)
    {
        SetProperty(0xc, VT_BOOL, propVal);
    }
    CString GetTitle()
    {
        CString result;
        GetProperty(0x11, VT_BSTR, (void*)&result);
        return result;
    }
    void SetTitle(CString propVal)
    {
        SetProperty(0x11, VT_BSTR, propVal);
    }
    CString GetAuthor()
    {
        CString result;
        GetProperty(0x12, VT_BSTR, (void*)&result);
        return result;
    }
    void SetAuthor(CString propVal)
    {
        SetProperty(0x12, VT_BSTR, propVal);
    }
    CString GetCopyright()
    {
        CString result;
        GetProperty(0x13, VT_BSTR, (void*)&result);
        return result;
    }
    void SetCopyright(CString propVal)
    {
        SetProperty(0x13, VT_BSTR, propVal);
    }
    CString GetIflag1()
    {
        CString result;
        GetProperty(0xd, VT_BSTR, (void*)&result);
        return result;
    }
    void SetIflag1(CString propVal)
    {
        SetProperty(0xd, VT_BSTR, propVal);
    }
    BOOL GetHasAudio()
    {
        BOOL result;
        GetProperty(0x14, VT_BOOL, (void*)&result);
        return result;
    }
    void SetHasAudio(BOOL propVal)
    {
        SetProperty(0x14, VT_BOOL, propVal);
    }
    BOOL GetHasVideo()
    {
        BOOL result;
        GetProperty(0x15, VT_BOOL, (void*)&result);
        return result;
    }
    void SetHasVideo(BOOL propVal)
    {
        SetProperty(0x15, VT_BOOL, propVal);
    }

    DECLARE_EVENTSINK_MAP()
    void OnTimeVvweb(long Time, LPCTSTR URL);
    void OnStateChangeVvweb(LPCTSTR State, LPCTSTR URL);
};
