Click here to Skip to main content
15,894,362 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.9K   2.4K   54  
Outlook add-in integration for Skype IM: Skype events, Outlook Skype ribbon, and more.
#ifndef RibbonExtensibility_H
#define RibbonExtensibility_H

    #include "IRibbonUI.h"

    //  ribbon callback DISPIDs
    #define DISPID_RIBBONCALLBACK_BASE              (0x00000000)

    #define DISPID_RIBBONCALLBACK_ONLOAD            (DISPID_RIBBONCALLBACK_BASE + 0x00000001)
    #define DISPID_RIBBONCALLBACK_ONGETVISIBLE      (DISPID_RIBBONCALLBACK_BASE + 0x00000002)
    #define DISPID_RIBBONCALLBACK_ONGETLABEL        (DISPID_RIBBONCALLBACK_BASE + 0x00000003)
    #define DISPID_RIBBONCALLBACK_ONGETSIZE         (DISPID_RIBBONCALLBACK_BASE + 0x00000004)
    #define DISPID_RIBBONCALLBACK_ONGETSCREENTIP    (DISPID_RIBBONCALLBACK_BASE + 0x00000005)
    #define DISPID_RIBBONCALLBACK_ONGETSUPERTIP     (DISPID_RIBBONCALLBACK_BASE + 0x00000006)
    #define DISPID_RIBBONCALLBACK_ONGETIMAGEMSO     (DISPID_RIBBONCALLBACK_BASE + 0x00000007)
    #define DISPID_RIBBONCALLBACK_ONGETIMAGE        (DISPID_RIBBONCALLBACK_BASE + 0x00000008)
    #define DISPID_RIBBONCALLBACK_ONGETENABLED      (DISPID_RIBBONCALLBACK_BASE + 0x00000009)
    #define DISPID_RIBBONCALLBACK_ONGETPRESSED      (DISPID_RIBBONCALLBACK_BASE + 0x0000000A)
    #define DISPID_RIBBONCALLBACK_ONACTION          (DISPID_RIBBONCALLBACK_BASE + 0x0000000B)
    #define DISPID_RIBBONCALLBACK_ONGETTEXT         (DISPID_RIBBONCALLBACK_BASE + 0x0000000C)
    #define DISPID_RIBBONCALLBACK_ONCHANGE          (DISPID_RIBBONCALLBACK_BASE + 0x0000000D)

    #define DISPID_RIBBONCALLBACK_FIRST             (DISPID_RIBBONCALLBACK_ONLOAD)
    #define DISPID_RIBBONCALLBACK_LAST              (DISPID_RIBBONCALLBACK_ONCHANGE)

    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;

    typedef struct IRibbonExtensibility IRibbonExtensibility;

    typedef struct IRibbonExtensibilityVtbl {
        HRESULT (NDAPI *QueryInterface)(
            IRibbonExtensibility    *This,
            REFIID                  riid,
            void                    **ppvObject
            );
        ULONG (NDAPI *AddRef)( 
            IRibbonExtensibility    *This
            );
        ULONG (NDAPI *Release)( 
            IRibbonExtensibility    *This
            );
        HRESULT (NDAPI *GetTypeInfoCount)( 
            IRibbonExtensibility    *This,
            UINT                    *pctinfo
            );
        HRESULT (NDAPI *GetTypeInfo)( 
            IRibbonExtensibility    *This,
            UINT                    iTInfo,
            LCID                    lcid,
            ITypeInfo               **ppTInfo
            );
        HRESULT (NDAPI *GetIDsOfNames)( 
            IRibbonExtensibility    *This,
            REFIID                  riid,
            LPOLESTR                *rgszNames,
            UINT                    cNames,
            LCID                    lcid,
            DISPID                  *rgDispId
            );
        HRESULT (NDAPI *Invoke)( 
            IRibbonExtensibility    *This,
            DISPID                  dispIdMember,
            REFIID                  riid,
            LCID                    lcid,
            WORD                    wFlags,
            DISPPARAMS              *pDispParams,
            VARIANT                 *pVarResult,
            EXCEPINFO               *pExcepInfo,
            UINT                    *puArgErr
            );
        HRESULT (NDAPI *GetCustomUI)(
            IRibbonExtensibility    *This,
            BSTR                    RibbonID, 
            BSTR                    *RibbonXml
            );
    } IRibbonExtensibilityVtbl;

    typedef struct IRibbonExtensibility
    {
        const struct IRibbonExtensibilityVtbl *lpVtbl;
    } IRibbonExtensibility;

    const IID*
    IRibbonExtensibility_GetIID(
        VOID
    );

    //  macros
    #define IRibbonExtensibility_QueryInterface(This, riid, ppv) \
        ((((This)->lpVtbl)->QueryInterface)((This), (riid), (ppv)))
    #define IRibbonExtensibility_AddRef(This) \
        ((((This)->lpVtbl)->AddRef)(This))
    #define IRibbonExtensibility_Release(This) \
        ((((This)->lpVtbl)->Release)(This))
    #define IRibbonExtensibility_GetTypeInfoCount(This, pctinfo) \
        ((((This)->lpVtbl)->GetTypeInfoCount)((This), (pctinfo)))
    #define IRibbonExtensibility_GetTypeInfo(This, iTInfo, lcid, ppTInfo) \
        ((((This)->lpVtbl)->GetTypeInfo)((This), (iTInfo), (lcid), (pctinfo)))
    #define IRibbonExtensibility_GetIDsOfNames(This, riid, rgszNames, cNames, lcid, rgDispId) \
        ((((This)->lpVtbl)->GetIDsOfNames)((This), (riid), (rgszNames), (cNames), (lcid), (rgDispId)))
    #define IRibbonExtensibility_Invoke(This, dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr) \
        ((((This)->lpVtbl)->Invoke)((This), (riid), (lcid), (wFlags), (pDispParams), (pVarResult), (pExcepInfo), (puArgErr)))

#endif  //  RibbonExtensibility_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