ClanLib  2.3.7
accelerator_key.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Harry Storbacka
27 */
28 
31 
32 #pragma once
33 
34 #include "api_gui.h"
35 #include "../Core/System/sharedptr.h"
36 #include "../Core/Signals/callback_v2.h"
37 #include "../GUI/gui_message.h"
38 #include "../GUI/gui_message_input.h"
39 #include <vector>
40 
41 class CL_AcceleratorKey_Impl;
42 
47 {
50 
51 public:
54 
61  CL_AcceleratorKey(int id, int mod1=-1, int mod2=-1, int mod3=-1);
62 
64 
68 
69 public:
71 
75  bool get_shift() const;
76 
80  bool get_alt() const;
81 
85  bool get_ctrl() const;
86 
90  int get_id() const;
91 
93  bool is_null() const { return impl ? true : false; }
94 
96  void throw_if_null() const;
97 
98 
102 
103 public:
104 
106  void set_shift(bool);
107 
109  void set_alt(bool);
110 
112  void set_ctrl(bool);
113 
115  void set_id(int);
116 
117 
121 
122 private:
123  CL_SharedPtr<CL_AcceleratorKey_Impl> impl;
125 };
126