Click here to Skip to main content
15,881,812 members
Articles / Desktop Programming / Win32

Outlook add-in integrating Skype

Rate me:
Please Sign up or sign in to vote.
4.93/5 (32 votes)
28 May 2015CPOL20 min read 68.7K   2.4K   54  
Outlook add-in integration for Skype IM: Skype events, Outlook Skype ribbon, and more.
#ifndef IRibbonCallback_H
#define IRibbonCallback_H

    typedef enum RibbonElementType {
        RibbonElementType_Tab, 
        RibbonElementType_Group, 
        RibbonElementType_Button, 
        RibbonElementType_Label, 
        //  add more element types as needed
    } RibbonElementType;

    typedef enum RibbonControlSize
    {
	    RibbonControlSize_Regular   = 0,
	    RibbonControlSize_Large     = 1
    } RibbonControlSize;

    //  IRibbonCallback DISPIDs
    #define DISPID_RIBBONCALLBACK_ONLOAD            (0x00000001)
    #define DISPID_RIBBONCALLBACK_ONGETVISIBLE      (0x00000002)
    #define DISPID_RIBBONCALLBACK_ONGETLABEL        (0x00000003)
    #define DISPID_RIBBONCALLBACK_ONGETSIZE         (0x00000004)
    #define DISPID_RIBBONCALLBACK_ONGETSCREENTIP    (0x00000005)
    #define DISPID_RIBBONCALLBACK_ONGETSUPERTIP     (0x00000006)
    #define DISPID_RIBBONCALLBACK_ONGETIMAGEMSO     (0x00000007)
    #define DISPID_RIBBONCALLBACK_ONGETIMAGE        (0x00000008)
    #define DISPID_RIBBONCALLBACK_ONGETENABLED      (0x00000009)
    #define DISPID_RIBBONCALLBACK_ONACTION          (0x0000000A)


    typedef struct IRibbonCallback IRibbonCallback;

    typedef struct IRibbonCallbackVtbl {
        HRESULT (NDAPI *QueryInterface)(
            IRibbonCallback     *This,
            REFIID              riid,
            void                **ppvObject
            );
        ULONG (NDAPI *AddRef)( 
            IRibbonCallback     *This
            );
        ULONG (NDAPI *Release)( 
            IRibbonCallback     *This
            );
        HRESULT (NDAPI *GetTypeInfoCount)( 
            IRibbonCallback     *This,
            UINT                *pctinfo
            );
        HRESULT (NDAPI *GetTypeInfo)( 
            IRibbonCallback     *This,
            UINT                iTInfo,
            LCID                lcid,
            ITypeInfo           **ppTInfo
            );
        HRESULT (NDAPI *GetIDsOfNames)( 
            IRibbonCallback     *This,
            REFIID              riid,
            LPOLESTR            *rgszNames,
            UINT                cNames,
            LCID                lcid,
            DISPID              *rgDispId
            );
        HRESULT (NDAPI *Invoke)( 
            IRibbonCallback     *This,
            DISPID              dispIdMember,
            REFIID              riid,
            LCID                lcid,
            WORD                wFlags,
            DISPPARAMS          *pDispParams,
            VARIANT             *pVarResult,
            EXCEPINFO           *pExcepInfo,
            UINT                *puArgErr
            );
        HRESULT (NDAPI *OnLoad)(
            IRibbonCallback     *This, 
            IDispatch           *RibbonUI
            );
        HRESULT (NDAPI *OnAction)(
            IRibbonCallback     *This,
            IDispatch           *RibbonControl
            );
	    HRESULT (NDAPI *OnGetVisible)(
            IRibbonCallback     *This,
		    IDispatch           *RibbonControl, 
		    VARIANT_BOOL        *Visible
            );
	    HRESULT (NDAPI *OnGetLabel)(
            IRibbonCallback     *This,
		    IDispatch           *Control, 
		    BSTR                *Label
            );
	    HRESULT (NDAPI *OnGetSize)(
            IRibbonCallback     *This,
		    IDispatch           *Control, 
		    RibbonControlSize   *Size
            );
	    HRESULT (NDAPI *OnGetScreentip)(
            IRibbonCallback     *This,
		    IDispatch           *Control, 
		    BSTR                *Screentip
            );
	    HRESULT (NDAPI *OnGetSupertip)(
            IRibbonCallback     *This,
		    IDispatch           *Control, 
		    BSTR                *Supertip
            );
	    HRESULT (NDAPI *OnGetImageMso)(
            IRibbonCallback     *This,
		    IDispatch           *Control, 
		    BSTR                *ImageMso
            );
	    HRESULT (NDAPI *OnGetImage)(
            IRibbonCallback     *This,
		    IDispatch           *Control, 
		    IPictureDisp        **PictureDisp
            );
	    HRESULT (NDAPI *OnGetEnabled)(
            IRibbonCallback     *This,
		    IDispatch           *RibbonControl, 
		    VARIANT_BOOL        *Enabled
            );

    } IRibbonCallbackVtbl;

    typedef struct IRibbonCallback
    {
        const struct IRibbonCallbackVtbl *lpVtbl;
    } IRibbonCallback;

    const IID*
    IRibbonCallback_GetIID(
        VOID
    );


    //  macros
    #define RibbonCallback_QueryInterface(This, riid, ppv) \
        ((((This)->lpVtbl)->QueryInterface)((This), (riid), (ppv)))
    #define RibbonCallback_AddRef(This) \
        ((((This)->lpVtbl)->AddRef)(This))
    #define RibbonCallback_Release(This) \
        ((((This)->lpVtbl)->Release)(This))
    #define RibbonCallback_GetTypeInfoCount(This, pctinfo) \
        ((((This)->lpVtbl)->GetTypeInfoCount)((This), (pctinfo)))
    #define RibbonCallback_GetTypeInfo(This, iTInfo, lcid, ppTInfo) \
        ((((This)->lpVtbl)->GetTypeInfo)((This), (iTInfo), (lcid), (pctinfo)))
    #define RibbonCallback_GetIDsOfNames(This, riid, rgszNames, cNames, lcid, rgDispId) \
        ((((This)->lpVtbl)->GetIDsOfNames)((This), (riid), (rgszNames), (cNames), (lcid), (rgDispId)))
    #define RibbonCallback_Invoke(This, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr) \
        ((((This)->lpVtbl)->Invoke)((This), (riid), (lcid), (wFlags), (pDispParams), (pVarResult), (pExcepInfo), (puArgErr)))

    #define RibbonCallback_OnLoad(This, RibbonUI) \
        ((((This)->lpVtbl)->OnLoad)((This), (RibbonUI)))
    #define RibbonCallback_OnAction(This, RibbonControl) \
        ((((This)->lpVtbl)->OnAction)((This), (RibbonControl)))
    #define RibbonCallback_OnGetVisible(This, RibbonControl, Visible) \
        ((((This)->lpVtbl)->OnGetVisible)((This), (RibbonControl), (Visible)))
    #define RibbonCallback_OnGetLabel(This, RibbonControl, Label) \
        ((((This)->lpVtbl)->OnGetLabel)((This), (RibbonControl), (Label)))
    #define RibbonCallback_OnGetSize(This, RibbonControl, Size) \
        ((((This)->lpVtbl)->OnGetSize)((This), (RibbonControl), (Size)))
    #define RibbonCallback_OnGetScreentip(This, RibbonControl, Screentip) \
        ((((This)->lpVtbl)->OnGetScreentip)((This), (RibbonControl), (Screentip)))
    #define RibbonCallback_OnGetSupertip(This, RibbonControl, Supertip) \
        ((((This)->lpVtbl)->OnGetSupertip)((This), (RibbonControl), (Supertip)))
    #define RibbonCallback_OnGetImageMso(This, RibbonControl, ImageMso) \
        ((((This)->lpVtbl)->OnGetImageMso)((This), (RibbonControl), (ImageMso)))
    #define RibbonCallback_OnGetImage(This, RibbonControl, Image) \
        ((((This)->lpVtbl)->OnGetImage)((This), (RibbonControl), (Image)))
    #define RibbonCallback_OnGetEnabled(This, RibbonControl, Enabled) \
        ((((This)->lpVtbl)->OnGetEnabled)((This), (RibbonControl), (Enabled)))

#endif  //  IRibbonCallback_H

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader BitDefender
Romania Romania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions