Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / multi_key_equivalent_button.h
blob14811dcd08d0e43966ea598376b652b4c201b283
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_
6 #define CHROME_BROWSER_UI_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_
8 #import <AppKit/AppKit.h>
10 #include <vector>
12 struct KeyEquivalentAndModifierMask {
13 public:
14 KeyEquivalentAndModifierMask() : charCode(nil), mask(0) {}
15 NSString* charCode;
16 NSUInteger mask;
19 // MultiKeyEquivalentButton is an NSButton subclass that is capable of
20 // responding to additional key equivalents. It will respond to the ordinary
21 // NSButton key equivalent set by -setKeyEquivalent: and
22 // -setKeyEquivalentModifierMask:, and it will also respond to any additional
23 // equivalents provided to it in a KeyEquivalentAndModifierMask structure
24 // passed to -addKeyEquivalent:.
26 @interface MultiKeyEquivalentButton : NSButton {
27 @private
28 std::vector<KeyEquivalentAndModifierMask> extraKeys_;
31 - (void)addKeyEquivalent:(KeyEquivalentAndModifierMask)key;
33 @end
35 #endif // CHROME_BROWSER_UI_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_