FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Proposal to add IDocHostUIHandler to mshtml.d

 
Post new topic   Reply to topic     Forum Index -> Bindings
View previous topic :: View next topic  
Author Message
sleets



Joined: 29 Jun 2007
Posts: 27

PostPosted: Sat Jul 05, 2008 9:06 pm    Post subject: Proposal to add IDocHostUIHandler to mshtml.d Reply with quote

http://svn.dsource.org/projects/core32/trunk/core32/win32/com/MSHTMHST.d

Code:

//-------------------------------------------------------------------------
//  IDocHostUIHandler
//-------------------------------------------------------------------------

enum DOCHOSTUITYPE {
        DOCHOSTUITYPE_BROWSE    = 0,
        DOCHOSTUITYPE_AUTHOR    = 1,
        BROWSE    = 0,
        AUTHOR    = 1,
}

enum DOCHOSTUIDBLCLK {
        DOCHOSTUIDBLCLK_DEFAULT         = 0,
        DOCHOSTUIDBLCLK_SHOWPROPERTIES  = 1,
        DOCHOSTUIDBLCLK_SHOWCODE        = 2,

        DEFAULT         = 0,
        SHOWPROPERTIES  = 1,
        SHOWCODE        = 2,
}

enum DOCHOSTUIFLAG {
        DOCHOSTUIFLAG_DIALOG            = 1,
        DOCHOSTUIFLAG_DISABLE_HELP_MENU = 2,
        DOCHOSTUIFLAG_NO3DBORDER        = 4,
        DOCHOSTUIFLAG_SCROLL_NO         = 8,
        DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 16,
        DOCHOSTUIFLAG_OPENNEWWIN        = 32,
        DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 64,
        DOCHOSTUIFLAG_FLAT_SCROLLBAR = 128,
        DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 256,
        DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 512,
        DOCHOSTUIFLAG_DISABLE_COOKIE = 1024,
//
//  DOCHOSTUIFLAG.name versions
//
        DIALOG            = 1,
        DISABLE_HELP_MENU = 2,
        NO3DBORDER        = 4,
        SCROLL_NO         = 8,
        DISABLE_SCRIPT_INACTIVE = 16,
        OPENNEWWIN        = 32,
        DISABLE_OFFSCREEN = 64,
        FLAT_SCROLLBAR = 128,
        DIV_BLOCKDEFAULT = 256,
        ACTIVATE_CLIENTHIT_ONLY = 512,
        DISABLE_COOKIE = 1024,
}
/* polute the global namespace */
enum {
        DOCHOSTUITYPE_BROWSE    = 0,
        DOCHOSTUITYPE_AUTHOR    = 1,
       
        DOCHOSTUIDBLCLK_DEFAULT         = 0,
        DOCHOSTUIDBLCLK_SHOWPROPERTIES  = 1,
        DOCHOSTUIDBLCLK_SHOWCODE        = 2,

       DOCHOSTUIFLAG_DIALOG            = 1,
        DOCHOSTUIFLAG_DISABLE_HELP_MENU = 2,
        DOCHOSTUIFLAG_NO3DBORDER        = 4,
        DOCHOSTUIFLAG_SCROLL_NO         = 8,
        DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 16,
        DOCHOSTUIFLAG_OPENNEWWIN        = 32,
        DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 64,
        DOCHOSTUIFLAG_FLAT_SCROLLBAR = 128,
        DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 256,
        DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 512,
        DOCHOSTUIFLAG_DISABLE_COOKIE = 1024,
}

struct DOCHOSTUIINFO
{
   ULONG cbSize;
   DWORD dwFlags;
   DWORD dwDoubleClick;
}

interface IDocHostUIHandler : IUnknown
{
   HRESULT ShowContextMenu( DWORD dwID, POINT* ppt, IUnknown pcmdtReserved, IDispatch pdispReserved);
   HRESULT GetHostInfo( DOCHOSTUIINFO * pInfo );
   HRESULT ShowUI( DWORD dwID, IOleInPlaceActiveObject pActiveObject, IOleCommandTarget pCommandTarget, IOleInPlaceFrame pFrame, IOleInPlaceUIWindow pDoc );
   HRESULT HideUI();
   HRESULT UpdateUI();
   HRESULT EnableModeless( BOOL fEnable );
   HRESULT OnDocWindowActivate( BOOL fActivate );
   HRESULT OnFrameWindowActivate( BOOL fActivate );
   HRESULT ResizeBorder( LPCRECT prcBorder, IOleInPlaceUIWindow pUIWindow, BOOL fRameWindow );
   HRESULT TranslateAccelerator( LPMSG lpMsg, GUID * pguidCmdGroup, DWORD nCmdID );
   HRESULT GetOptionKeyPath( LPOLESTR * pchKey, DWORD dw );
   HRESULT GetDropTarget( IDropTarget pDropTarget, IDropTarget * ppDropTarget );
   HRESULT GetExternal( IDispatch * ppDispatch );
   HRESULT TranslateUrl( DWORD dwTranslate, OLECHAR * pchURLIn, OLECHAR ** ppchURLOut );
   HRESULT FilterDataObject( IDataObject pDO, IDataObject * ppDORet );
}



I have just learning D, Unsuccessful attempt to convert it.
Back to top
View user's profile Send private message
sleets



Joined: 29 Jun 2007
Posts: 27

PostPosted: Sat Jul 05, 2008 9:11 pm    Post subject: Reply with quote

Code:

class  ImplIDocHostUIHandler : IDocHostUIHandler {
   //First Impl IUnknown
    HRESULT ShowContextMenu( DWORD dwID, POINT* ppt, IUnknown pcmdtReserved, IDispatch pdispReserved){return S_OK;}
    HRESULT GetHostInfo( DOCHOSTUIINFO * pInfo ){
        pInfo.cbSize = DOCHOSTUIINFO.sizeof;
        pInfo.dwFlags = DOCHOSTUIFLAG_NO3DBORDER;
        pInfo.dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT;   
        return(S_OK);
    }
    HRESULT ShowUI(DWORD dwID, IOleInPlaceActiveObject pActiveObject, IOleCommandTarget pCommandTarget, IOleInPlaceFrame pFrame, IOleInPlaceUIWindow pDoc ){return S_OK;}
    HRESULT HideUI(){return S_OK;}
    HRESULT UpdateUI(){return S_OK;}
    HRESULT EnableModeless( BOOL fEnable ){ return S_OK;}
    HRESULT OnDocWindowActivate( BOOL fActivate ){ return S_OK;}
    HRESULT OnFrameWindowActivate( BOOL fActivate ){return S_OK;}
    HRESULT ResizeBorder( LPCRECT prcBorder, IOleInPlaceUIWindow pUIWindow, BOOL fRameWindow ) {return S_OK;}   
    HRESULT TranslateAccelerator( LPMSG lpMsg, GUID * pguidCmdGroup, DWORD nCmdID ) {return S_FALSE;}
    HRESULT GetOptionKeyPath( LPOLESTR * pchKey, DWORD dw ){return S_FALSE;}
    HRESULT GetDropTarget( IDropTarget pDropTarget, IDropTarget * ppDropTarget ) {return S_FALSE;}
    HRESULT GetExternal( IDispatch * ppDispatch ){ *ppDispatch = null; S_FALSE;}
    HRESULT TranslateUrl( DWORD dwTranslate, OLECHAR * pchURLIn, OLECHAR ** ppchURLOut ){ *ppchURLOut = null; return S_FALSE;}
    HRESULT FilterDataObject( IDataObject pDO, IDataObject * ppDORet ){*ppDORet = null;return S_FALSE;}
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Bindings All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group