nsGlobalWindowCommands.h (1320B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef nsGlobalWindowCommands_h__ 8 #define nsGlobalWindowCommands_h__ 9 10 #include "nsStringFwd.h" 11 #include "nscore.h" 12 13 namespace mozilla::layers { 14 struct KeyboardScrollAction; 15 } // namespace mozilla::layers 16 17 class nsControllerCommandTable; 18 19 class nsWindowCommandRegistration { 20 public: 21 static void RegisterWindowCommands(nsControllerCommandTable* aCommandTable); 22 }; 23 24 class nsGlobalWindowCommands { 25 public: 26 using KeyboardScrollAction = mozilla::layers::KeyboardScrollAction; 27 28 /** 29 * Search through nsGlobalWindowCommands to find the keyboard scrolling action 30 * that would be done in response to a command. 31 * 32 * @param aCommandName the name of the command 33 * @param aOutAction the result of searching for this command, must not be 34 * null 35 * @returns whether a keyboard action was found or not 36 */ 37 static bool FindScrollCommand(const nsACString& aCommandName, 38 KeyboardScrollAction* aOutAction); 39 }; 40 41 #endif // nsGlobalWindowCommands_h__