michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:expandtab:shiftwidth=2:tabstop=2: michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsWinUtils_h_ michael@0: #define nsWinUtils_h_ michael@0: michael@0: #include michael@0: michael@0: #include "nsIDOMCSSStyleDeclaration.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsRefPtrHashtable.h" michael@0: michael@0: class nsIArray; michael@0: class nsIContent; michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: class DocAccessible; michael@0: michael@0: const LPCWSTR kClassNameRoot = L"MozillaUIWindowClass"; michael@0: const LPCWSTR kClassNameTabContent = L"MozillaContentWindowClass"; michael@0: michael@0: class nsWinUtils michael@0: { michael@0: public: michael@0: /** michael@0: * Return computed styles declaration for the given node. michael@0: * michael@0: * @note Please use it carefully since it can shutdown the accessible tree michael@0: * you operate on. michael@0: */ michael@0: static already_AddRefed michael@0: GetComputedStyleDeclaration(nsIContent* aContent); michael@0: michael@0: /** michael@0: * Start window emulation if presence of specific AT is detected. michael@0: */ michael@0: static bool MaybeStartWindowEmulation(); michael@0: michael@0: /** michael@0: * Free resources used for window emulation. michael@0: */ michael@0: static void ShutdownWindowEmulation(); michael@0: michael@0: /** michael@0: * Return true if window emulation is started. michael@0: */ michael@0: static bool IsWindowEmulationStarted(); michael@0: michael@0: /** michael@0: * Helper to register window class. michael@0: */ michael@0: static void RegisterNativeWindow(LPCWSTR aWindowClass); michael@0: michael@0: /** michael@0: * Helper to create a window. michael@0: */ michael@0: static HWND CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd, michael@0: int aX, int aY, int aWidth, int aHeight, michael@0: bool aIsActive); michael@0: michael@0: /** michael@0: * Helper to show window. michael@0: */ michael@0: static void ShowNativeWindow(HWND aWnd); michael@0: michael@0: /** michael@0: * Helper to hide window. michael@0: */ michael@0: static void HideNativeWindow(HWND aWnd); michael@0: michael@0: /** michael@0: * Cache for HWNDs of windows created for document accessibles in windows michael@0: * emulation mode. michael@0: */ michael@0: static nsRefPtrHashtable, DocAccessible>* sHWNDCache; michael@0: }; michael@0: michael@0: } // namespace a11y michael@0: } // namespace mozilla michael@0: michael@0: #endif