InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VirtualKey.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: lance bushore
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __VirtualKey__
25 #define __VirtualKey__
26 
27 #ifndef __ODFRC__
28 
29 class IPMStream;
30 
31 
38 {
39  public:
42  typedef base_type data_type;
43 
46  VirtualKey():fChar(0),fDVKeyCode(0){}
47  explicit VirtualKey(SysChar character);
48  explicit VirtualKey(uint32 keyCode);
49 
50  VirtualKey(const VirtualKey &other)
51  {
52  fChar = other.fChar;
53  fDVKeyCode = other.fDVKeyCode;
54  }
55 
59  void ReadWrite(IPMStream *s);
60 
65  {
66  if (&copy != this)
67  {
68  fChar = copy.fChar;
69  fDVKeyCode = copy.fDVKeyCode;
70  }
71  return *this;
72  }
73 
78  bool16 operator < (const VirtualKey &other) const
79  {
80  return (fDVKeyCode < other.fDVKeyCode);
81  }
82 
87  bool16 operator == (const VirtualKey &s) const;
88 
93  bool16 operator != (const VirtualKey &s) const { return !(*this == s); }
94 
98  SysChar GetChar() const { return fChar; }
99 
103  bool16 IsPlainChar() const;
104 
108  bool16 IsPressed() const;
109 
113  uint32 GetDVKeyCode() const { return fDVKeyCode; }
114  private:
115  SysChar fChar;
116  uint32 fDVKeyCode;
117 };
118 
119 #endif
120 #endif // __VirtualKey__