StringCache.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /*
  2. * This source file is part of libRocket, the HTML/CSS Interface Middleware
  3. *
  4. * For the latest information, see http://www.librocket.com
  5. *
  6. * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. *
  26. */
  27. #ifndef ROCKETCORESTRINGCACHE_H
  28. #define ROCKETCORESTRINGCACHE_H
  29. #include "../../Include/Rocket/Core/String.h"
  30. #include "../../Include/Rocket/Core/Types.h"
  31. namespace Rocket {
  32. namespace Core {
  33. PropertyId GetPropertyId(const String& property_name);
  34. PropertyId CreateOrGetPropertyId(const String& name);
  35. const String& GetName(PropertyId property_id);
  36. EventId GetEventId(const String& event_name);
  37. EventId CreateOrGetEventId(const String& name);
  38. const String& GetName(EventId event_id);
  39. enum class PropertyId : uint16_t
  40. {
  41. Invalid,
  42. MarginTop,
  43. MarginRight,
  44. MarginBottom,
  45. MarginLeft,
  46. Margin,
  47. PaddingTop,
  48. PaddingRight,
  49. PaddingBottom,
  50. PaddingLeft,
  51. Padding,
  52. BorderTopWidth,
  53. BorderRightWidth,
  54. BorderBottomWidth,
  55. BorderLeftWidth,
  56. BorderWidth,
  57. BorderTopColor,
  58. BorderRightColor,
  59. BorderBottomColor,
  60. BorderLeftColor,
  61. BorderColor,
  62. BorderTop,
  63. BorderRight,
  64. BorderBottom,
  65. BorderLeft,
  66. Border,
  67. Display,
  68. Position,
  69. Top,
  70. Right,
  71. Bottom,
  72. Left,
  73. Float,
  74. Clear,
  75. ZIndex,
  76. Width,
  77. MinWidth,
  78. MaxWidth,
  79. Height,
  80. MinHeight,
  81. MaxHeight,
  82. LineHeight,
  83. VerticalAlign,
  84. Overflow,
  85. OverflowX,
  86. OverflowY,
  87. Clip,
  88. Visibility,
  89. BackgroundColor,
  90. Background,
  91. Color,
  92. ImageColor,
  93. FontFamily,
  94. FontCharset,
  95. FontStyle,
  96. FontWeight,
  97. FontSize,
  98. Font,
  99. TextAlign,
  100. TextDecoration,
  101. TextTransform,
  102. WhiteSpace,
  103. Cursor,
  104. Drag,
  105. TabIndex,
  106. ScrollbarMargin,
  107. Perspective,
  108. PerspectiveOrigin,
  109. PerspectiveOriginX,
  110. PerspectiveOriginY,
  111. Transform,
  112. TransformOrigin,
  113. TransformOriginX,
  114. TransformOriginY,
  115. TransformOriginZ,
  116. None,
  117. All,
  118. Transition,
  119. Animation,
  120. Keyframes,
  121. ScrollDefaultStepSize,
  122. Opacity,
  123. PointerEvents,
  124. Focus,
  125. NumDefinedIds,
  126. FirstCustomId = NumDefinedIds
  127. };
  128. enum class EventId : uint16_t
  129. {
  130. Invalid,
  131. Mousedown,
  132. Mousescroll,
  133. Mouseover,
  134. Mouseout,
  135. Focus,
  136. Blur,
  137. Keydown,
  138. Mouseup,
  139. Click,
  140. Load,
  141. Unload,
  142. Show,
  143. Hide,
  144. Keyup,
  145. Textinput,
  146. Mousemove,
  147. Dragmove,
  148. Dblclick,
  149. Drag,
  150. Dragstart,
  151. Dragover,
  152. Dragdrop,
  153. Dragout,
  154. Dragend,
  155. Handledrag,
  156. Resize,
  157. Scroll,
  158. Animationend,
  159. Transitionend,
  160. NumDefinedIds,
  161. FirstCustomId = NumDefinedIds
  162. };
  163. // Edit: Actually, this might be too complicated due to structural pseudo class selectors
  164. //PseudoId GetPseudoId(const String& event_name);
  165. //PseudoId GetOrCreatePseudoId(const String& name);
  166. //const String& GetName(PseudoId pseudo_id);
  167. //enum class PseudoId : uint16_t
  168. //{
  169. // Invalid,
  170. //
  171. // Hover,
  172. // Active,
  173. // Focus,
  174. // Dragged,
  175. //
  176. // Disabled,
  177. // Selected,
  178. // Checked,
  179. //
  180. // NumDefinedIds,
  181. // FirstCustomId = NumDefinedIds
  182. //};
  183. }
  184. }
  185. #endif