1 // Copyright (c) 2012 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 UI_BASE_ACCELERATORS_PLATFORM_ACCELERATOR_GTK_H_
6 #define UI_BASE_ACCELERATORS_PLATFORM_ACCELERATOR_GTK_H_
10 #include "base/compiler_specific.h"
11 #include "ui/base/accelerators/accelerator.h"
12 #include "ui/base/accelerators/platform_accelerator.h"
18 // This is a GTK specific class for specifing accelerator keys.
19 class UI_BASE_EXPORT PlatformAcceleratorGtk : public PlatformAccelerator {
21 PlatformAcceleratorGtk();
22 PlatformAcceleratorGtk(guint gdk_key_code, GdkModifierType gdk_modifier);
23 virtual ~PlatformAcceleratorGtk();
25 // PlatformAccelerator:
26 virtual scoped_ptr<PlatformAccelerator> CreateCopy() const OVERRIDE;
27 virtual bool Equals(const PlatformAccelerator& rhs) const OVERRIDE;
29 guint gdk_key_code() const { return gdk_key_code_; }
30 GdkModifierType gdk_modifier() const { return gdk_modifier_; }
34 GdkModifierType gdk_modifier_;
36 DISALLOW_COPY_AND_ASSIGN(PlatformAcceleratorGtk);
39 UI_BASE_EXPORT Accelerator AcceleratorForGdkKeyCodeAndModifier(
41 GdkModifierType gdk_modifier);
43 GetGdkKeyCodeForAccelerator(const Accelerator& accelerator);
44 UI_BASE_EXPORT GdkModifierType GetGdkModifierForAccelerator(
45 const Accelerator& accelerator);
49 #endif // UI_BASE_ACCELERATORS_PLATFORM_ACCELERATOR_GTK_H_