Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Created April 3, 2012 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumatti1/2296016 to your computer and use it in GitHub Desktop.
Save kumatti1/2296016 to your computer and use it in GitHub Desktop.
[
uuid(7E3B563C-7CF6-475D-A3AD-15A5FC42CA25),
version(1.0),
helpstring("myRibbon")
]
library myRibbon
{
importlib("stdole2.tlb");
// Forward declare all types defined in this typelib
interface IUIApplication;
interface IUIFramework;
interface IUICommandHandler;
typedef enum {
UI_INVALIDATIONS_STATE = 1,
UI_INVALIDATIONS_VALUE = 2,
UI_INVALIDATIONS_PROPERTY = 4,
UI_INVALIDATIONS_ALLPROPERTIES = 8
} UI_INVALIDATIONS;
typedef enum {
UI_EXECUTIONVERB_EXECUTE = 0,
UI_EXECUTIONVERB_PREVIEW = 1,
UI_EXECUTIONVERB_CANCELPREVIEW = 2
} UI_EXECUTIONVERB;
[
odl,
uuid(D428903C-729A-491D-910D-682A08FF2522),
helpstring("IUIApplication interface")
]
interface IUIApplication : IUnknown {
HRESULT _stdcall OnViewChanged(
[in] long viewId,
[in] long typeID,
[in] long view,
[in] long verb,
[in] long uReasonCode);
HRESULT _stdcall OnCreateUICommand(
[in] long commandId,
[in] long typeID,
[in] long commandHandler);
HRESULT _stdcall OnDestroyUICommand(
[in] long commandId,
[in] long typeID,
[in] long commandHandler);
};
[
odl,
uuid(F4F0385D-6872-43A8-AD09-4C339CB3F5C5),
helpstring("Windows Ribbon Application interface")
]
interface IUIFramework : IUnknown {
HRESULT _stdcall Initialize(
[in] long frameWnd,
[in] IUIApplication* application);
HRESULT _stdcall Destroy();
HRESULT _stdcall LoadUI(
[in] long instance,
[in] long resourceName);
HRESULT _stdcall GetView(
[in] long viewId,
[in] long riid,
[in] long ppv);
HRESULT _stdcall GetUICommandProperty(
[in] long commandId,
[in] long key,
[in] long value);
HRESULT _stdcall SetUICommandProperty(
[in] long commandId,
[in] long key,
[in] long value);
HRESULT _stdcall InvalidateUICommand(
[in] long commandId,
[in] long flags,
[in] long key);
HRESULT _stdcall FlushPendingInvalidations();
HRESULT _stdcall SetModes([in] long iModes);
};
[
odl,
uuid(75AE0A2D-DC03-4C9F-8883-069660D0BEB6),
helpstring("Command handler interface")
]
interface IUICommandHandler : IUnknown {
HRESULT _stdcall Execute(
[in] long commandId,
[in] long verb,
[in] long key,
[in] long currentValue,
[in] long commandExecutionProperties);
HRESULT _stdcall UpdateProperty(
[in] long commandId,
[in] long key,
[in] long currentValue,
[in] long newValue);
};
[
uuid(926749FA-2615-4987-8845-C33E65F2B957),
helpstring("UIRibbonFramework class")
]
coclass UIRibbonFramework {
[default] interface IUIFramework;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment