// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
namespace Common.ComInterlop
{
///
/// Exposes methods for the display of rich previews.
///
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("8895b1c6-b41f-4c1c-a562-0d564250836f")]
public interface IPreviewHandler
{
///
/// Sets the parent window of the previewer window, as well as the area within the parent to be used for the previewer window.
///
/// A handle to the parent window.
/// A pointer to a defining the area for the previewer.
void SetWindow(IntPtr hwnd, ref RECT rect);
///
/// Directs the preview handler to change the area within the parent hwnd that it draws into.
///
/// A pointer to a to be used for the preview.
void SetRect(ref RECT rect);
///
/// Directs the preview handler to load data from the source specified in an earlier Initialize method call, and to begin rendering to the previewer window.
///
void DoPreview();
///
/// Directs the preview handler to cease rendering a preview and to release all resources that have been allocated based on the item passed in during the initialization.
///
void Unload();
///
/// Directs the preview handler to set focus to itself.
///
void SetFocus();
///
/// Directs the preview handler to return the HWND from calling the GetFocus Function.
///
/// When this method returns, contains a pointer to the HWND returned from calling the GetFocus Function from the preview handler's foreground thread.
void QueryFocus(out IntPtr phwnd);
///
/// Directs the preview handler to handle a keystroke passed up from the message pump of the process in which the preview handler is running.
///
/// A pointer to a window message.
/// If the keystroke message can be processed by the preview handler, the handler will process it and return S_OK(0). If the preview handler cannot process the keystroke message, it
/// will offer it to the host using . If the host processes the message, this method will return S_OK(0). If the host does not process the message, this method will return S_FALSE(1).
///
[PreserveSig]
uint TranslateAccelerator(ref MSG pmsg);
}
}