PixelLightAPI  .
PLGuiDefinitions.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: PLGuiDefinitions.h                             *
00003  *
00004  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00005  *
00006  *  This file is part of PixelLight.
00007  *
00008  *  PixelLight is free software: you can redistribute it and/or modify
00009  *  it under the terms of the GNU Lesser General Public License as published by
00010  *  the Free Software Foundation, either version 3 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  PixelLight is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  *  GNU Lesser General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU Lesser General Public License
00019  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00020 \*********************************************************/
00021 
00022 
00023 #ifndef __PLGUI_DEFINITIONS_H__
00024 #define __PLGUI_DEFINITIONS_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include <PLCore/Base/Rtti.h>
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Namespace                                             ]
00036 //[-------------------------------------------------------]
00037 namespace PLGui {
00038 
00039 
00040 //[-------------------------------------------------------]
00041 //[ GUI messages                                          ]
00042 //[-------------------------------------------------------]
00043 /**
00044 *  @brief
00045 *    Message type
00046 */
00047 enum EMessageType {
00048     MessageOnUnknown = 0,               /**< Unknown message type */
00049     MessageOnInternalMessage,           /**< Internal message that is not passed on to widgets and modifiers */
00050     MessageOnWakeup,                    /**< Wakeup message loop */
00051     MessageOnExit,                      /**< Exit GUI */
00052     MessageOnTimer,                     /**< Timer message */
00053     MessageOnThemeChanged,              /**< Theme has been changed */
00054     MessageOnUpdateContent,             /**< Widget content has been changed */
00055     MessageOnUpdateChildWidget,         /**< Child widget has been changed */
00056     MessageOnAddChildWidget,            /**< Child widget has been added */
00057     MessageOnRemoveChildWidget,         /**< Child widget has been removed */
00058     MessageOnClose,                     /**< Widget shall be closed (ALT+F4 or X-Button pressed) */
00059     MessageOnCreate,                    /**< Widget has just been created */
00060     MessageOnDestroy,                   /**< Widget is going to be destroyed */
00061     MessageOnShow,                      /**< Widget gets shown */
00062     MessageOnHide,                      /**< Widget gets hidden */
00063     MessageOnEnable,                    /**< Widget gets enabled */
00064     MessageOnDisable,                   /**< Widget gets disabled */
00065     MessageOnGetFocus,                  /**< Widget gets focus */
00066     MessageOnLooseFocus,                /**< Widget looses focus */
00067     MessageOnActivate,                  /**< Widget has been activated or deactivated (focus-widget has changed) */
00068     MessageOnDrawBackground,            /**< Widget background gets drawn, graphics object used for painting as parameter */
00069     MessageOnDraw,                      /**< Widget gets drawn, graphics object used for painting as parameter */
00070     MessageOnMove,                      /**< Widget gets moved, new widget position as parameter */
00071     MessageOnSize,                      /**< Widget gets resized, new widget size as parameter */
00072     MessageOnWindowState,               /**< Window state has changed, new window state as parameter */
00073     MessageOnEnterFullscreen,           /**< Widget enters fullscreen mode */
00074     MessageOnLeaveFullscreen,           /**< Widget leaves fullscreen mode */
00075     MessageOnPreferredSize,             /**< Widget has calculated it's preferred size */
00076     MessageOnAdjustContent,             /**< Widget content has to be adjusted */
00077     MessageOnMouseEnter,                /**< Mouse enters widget */
00078     MessageOnMouseLeave,                /**< Mouse leaves widget */
00079     MessageOnMouseOver,                 /**< Mouse-over widget has changed */
00080     MessageOnMouseMove,                 /**< Mouse moves inside the widget, mouse position within the widget as parameter */
00081     MessageOnMouseHover,                /**< Mouse hovers over the widget */
00082     MessageOnMousePosUpdate,            /**< Mouse position inside the widget has changed due to the movement of widget */
00083     MessageOnMouseButtonDown,           /**< Mouse button is pressed, mouse button and mouse position within the widget as parameters */
00084     MessageOnMouseButtonUp,             /**< Mouse button is released, mouse button and mouse position within the widget as parameters */
00085     MessageOnMouseButtonClick,          /**< Mouse button has been clicked, mouse button and mouse position within the widget as parameters */
00086     MessageOnMouseButtonDoubleClick,    /**< Mouse button has been double-clicked, mouse button and mouse position within the widget as parameters */
00087     MessageOnMouseWheel,                /**< Mouse wheel moved, mouse wheel movement as parameter */
00088     MessageOnKeyDown,                   /**< Key gets pressed, pressed key and modifier keys pressed as parameters */
00089     MessageOnKeyUp,                     /**< Key gets released, released key and modifier keys pressed as parameters */
00090     MessageOnHotkey,                    /**< Hotkey pressed, hotkey ID as parameter */
00091     MessageOnDrop,                      /**< Data has been dropped onto the widget */
00092     MessageOnUserMessage                /**< User message */
00093 };
00094 
00095 /**
00096 *  @brief
00097 *    Internal message types
00098 */
00099 enum EInternalMessage {
00100     InternalDummy = 1                   /**< Unused, replace with first real internal message */
00101 };
00102 
00103 /**
00104 *  @brief
00105 *    Message type
00106 */
00107 enum EMessageFilter {
00108     FilterInclusive = 0,                /**< Pass all specified messages, ignore all others */
00109     FilterExclusive                     /**< Pass all messages except the specified ones */
00110 };
00111 
00112 /**
00113 *  @brief
00114 *    Debug modes
00115 */
00116 enum EDebugMode {
00117     DebugModeOff = 0,                   /**< Display no messages */
00118     DebugModeFocus,                     /**< Display messages regarding the keyboard focus */
00119     DebugModeAll                        /**< Display all messages */
00120 };
00121 
00122 
00123 //[-------------------------------------------------------]
00124 //[ General definitions                                   ]
00125 //[-------------------------------------------------------]
00126 /**
00127 *  @brief
00128 *    Orientation
00129 */
00130 enum EOrientation {
00131     Horizontal = 0,     /**< Horizontal orientation (X-axis) */
00132     Vertical            /**< Vertical orientation (Y-axis) */
00133 };
00134 
00135 // RTTI definition
00136 pl_enum(EOrientation)
00137     pl_enum_value(Horizontal, "Horizontal orientation")
00138     pl_enum_value(Vertical,   "Vertical orientation")
00139 pl_enum_end
00140 
00141 /**
00142 *  @brief
00143 *    Side
00144 */
00145 enum ESide {
00146     SideLeft = 0,       /**< Left side */
00147     SideRight,          /**< Right side */
00148     SideTop,            /**< Top side */
00149     SideBottom          /**< Bottom side */
00150 };
00151 
00152 // RTTI definition
00153 pl_enum(ESide)
00154     pl_enum_value(SideLeft,     "Left side")
00155     pl_enum_value(SideRight,    "Right side")
00156     pl_enum_value(SideTop,      "Top side")
00157     pl_enum_value(SideBottom,   "Bottom side")
00158 pl_enum_end
00159 
00160 /**
00161 *  @brief
00162 *    Alignment
00163 */
00164 enum EAlign {
00165     AlignLeft = 0,      /**< Align elements at the left side */
00166     AlignRight,         /**< Align elements at the right side */
00167     AlignCenter,        /**< Align elements centered */
00168 };
00169 
00170 // RTTI definition
00171 pl_enum(EAlign)
00172     pl_enum_value(AlignLeft,    "Align elements at the left side")
00173     pl_enum_value(AlignRight,   "Align elements at the right side")
00174     pl_enum_value(AlignCenter,  "Align elements centered")
00175 pl_enum_end
00176 
00177 /**
00178 *  @brief
00179 *    Vertical alignment
00180 */
00181 enum EVAlign {
00182     AlignTop = 0,       /**< Align elements at the top */
00183     AlignBottom,        /**< Align elements at the bottom */
00184     AlignMiddle,        /**< Align elements centered */
00185 };
00186 
00187 // RTTI definition
00188 pl_enum(EVAlign)
00189     pl_enum_value(AlignTop,     "Align elements at the top")
00190     pl_enum_value(AlignBottom,  "Align elements at the bottom")
00191     pl_enum_value(AlignMiddle,  "Align elements centered")
00192 pl_enum_end
00193 
00194 /**
00195 *  @brief
00196 *    Border styles
00197 */
00198 enum EBorderStyle {
00199     FlatBorder = 0,     /**< A flat border */
00200     RaisedBorder,       /**< A border with a raised 3D look */
00201     SunkenBorder        /**< A border with a sunken 3D look */
00202 };
00203 
00204 // RTTI definition
00205 pl_enum(EBorderStyle)
00206     pl_enum_value(FlatBorder,   "A flat border")
00207     pl_enum_value(RaisedBorder, "A border with a raised 3D look")
00208     pl_enum_value(SunkenBorder, "A border with a sunken 3D look")
00209 pl_enum_end
00210 
00211 /**
00212 *  @brief
00213 *    Line styles
00214 */
00215 enum ELineStyle {
00216     SolidLine = 0,      /**< A solid line */
00217     DashedLine,         /**< A line that is dashed (many small lines) */
00218     DottedLine          /**< A line that is dotted (many dots) */
00219 };
00220 
00221 // RTTI definition
00222 pl_enum(ELineStyle)
00223     pl_enum_value(SolidLine,    "A solid line")
00224     pl_enum_value(DashedLine,   "A line that is dashed (many small lines)")
00225     pl_enum_value(DottedLine,   "A line that is dotted (many dots)")
00226 pl_enum_end
00227 
00228 
00229 //[-------------------------------------------------------]
00230 //[ Widgets                                               ]
00231 //[-------------------------------------------------------]
00232 /**
00233 *  @brief
00234 *    Widget state
00235 */
00236 enum EWidgetState {
00237     WidgetEnabled   =  1,   /**< Widget is enabled */
00238     WidgetActive    =  2,   /**< Widget is active */
00239     WidgetFocus     =  4,   /**< Widget is inactive  */
00240     WidgetMouseOver =  8,   /**< Widget is selected by the mouse */
00241     WidgetPressed   = 16    /**< Widget is selected by the mouse and mouse button is pressed (only valid for buttons!) */
00242 };
00243 
00244 /**
00245 *  @brief
00246 *    Window state
00247 */
00248 enum EWindowState {
00249     StateNormal,        /**< Window is displayed as a normal window */
00250     StateMinimized,     /**< Window is minimized */
00251     StateMaximized,     /**< Window is maximized */
00252     StateFullscreen     /**< Window is in fullscreen mode */
00253 };
00254 
00255 /**
00256 *  @brief
00257 *    Z position of window
00258 */
00259 enum EZPos {
00260     ZAbove,         /**< Bring a window on top of another window */
00261     ZBehind,        /**< Bring a window behind another window */
00262     ZTop,           /**< Bring a window on top of all other windows */
00263     ZBottom         /**< Bring a window behind all other windows */
00264 };
00265 
00266 /**
00267 *  @brief
00268 *    Center modes
00269 */
00270 enum ECenter {
00271     CenterScreen,   /**< Center a window relative to the screen */
00272     CenterParent    /**< Center a window relative to it's parent window */
00273 };
00274 
00275 /**
00276 *  @brief
00277 *    Transparency modes
00278 */
00279 enum ETransparency {
00280     NoTransparency,         /**< No transparency */
00281     ColorKeyTransparency,   /**< Use a color key to mark transparent areas */
00282     AlphaTransparency       /**< Use alpha blending */
00283 };
00284 
00285 /**
00286 *  @brief
00287 *    Focus styles
00288 */
00289 enum EFocusStyle {
00290     NoFocus = 0,        /**< Widget will not accept the focus at all */
00291     ChildFocus,         /**< Widget will try to give the focus to a child widget */
00292     ChildFocusOrSelf,   /**< Widget will first try to give the focus to a child widget, then accept it itself*/
00293     AcceptFocus         /**< Widget will accept the keyboard focus */
00294 };
00295 
00296 /**
00297 *  @brief
00298 *    System buttons
00299 */
00300 enum ESystemButton {
00301     SystemButtonMinimize = 1,   /**< Minimize button */
00302     SystemButtonMaximize = 2,   /**< Maximize button */
00303     SystemButtonClose    = 4    /**< Close button */
00304 };
00305 
00306 // RTTI definition
00307 pl_enum(ESystemButton)
00308     pl_enum_value(SystemButtonMinimize, "Minimize button")
00309     pl_enum_value(SystemButtonMaximize, "Maximize button")
00310     pl_enum_value(SystemButtonClose,    "Close button")
00311 pl_enum_end
00312 
00313 /**
00314 *  @brief
00315 *    System commands
00316 */
00317 enum ESystemCommand {
00318     CommandMinimize,    /**< Minimize window */
00319     CommandMaximize,    /**< Maximize window */
00320     CommandRestore,     /**< Restore window size */
00321     CommandClose        /**< Close window */
00322 };
00323 
00324 // RTTI definition
00325 pl_enum(ESystemCommand)
00326     pl_enum_value(CommandMinimize,  "Minimize window")
00327     pl_enum_value(CommandMaximize,  "Maximize window")
00328     pl_enum_value(CommandRestore,   "Restore window size")
00329     pl_enum_value(CommandClose,     "Close window")
00330 pl_enum_end
00331 
00332 /**
00333 *  @brief
00334 *    ScrollBar styles
00335 */
00336 enum EScrollBarStyle {
00337     ScrollBarStyleNever = 0,    /**< Display no scrollbar at all */
00338     ScrollBarStyleAlways,       /**< Show scrollbar always */
00339     ScrollBarStyleDynamic       /**< Hide scrollbar when it is not needed */
00340 };
00341 
00342 // RTTI definition
00343 pl_enum(EScrollBarStyle)
00344     pl_enum_value(ScrollBarStyleNever,      "Display no scrollbar at all")
00345     pl_enum_value(ScrollBarStyleAlways,     "Show scrollbar always")
00346     pl_enum_value(ScrollBarStyleDynamic,    "Hide scrollbar when it is not needed")
00347 pl_enum_end
00348 
00349 
00350 //[-------------------------------------------------------]
00351 //[ Mouse definitions                                     ]
00352 //[-------------------------------------------------------]
00353 /**
00354 *  @brief
00355 *    Mouse buttons
00356 */
00357 enum EMouseButton {
00358     LeftButton = 0,     /**< Left mouse button */
00359     RightButton,        /**< Right mouse button */
00360     MiddleButton,       /**< Middle mouse button */
00361     Button0 = 0,        /**< Button 0 (Left) */
00362     Button1,            /**< Button 1 (Right) */
00363     Button2,            /**< Button 2 (Middle) */
00364     Button3,            /**< Button 3 */
00365     Button4,            /**< Button 4 */
00366     Button5,            /**< Button 5 */
00367     Button6,            /**< Button 6 */
00368     Button7,            /**< Button 7 */
00369     Button8,            /**< Button 8 */
00370     Button9,            /**< Button 9 */
00371     Button10,           /**< Button 10 */
00372     Button11,           /**< Button 11 */
00373     Button12,           /**< Button 12 */
00374     Button13,           /**< Button 13 */
00375     Button14,           /**< Button 14 */
00376     Button15            /**< Button 15 */
00377 };
00378 
00379 
00380 //[-------------------------------------------------------]
00381 //[ Mouse cursors                                         ]
00382 //[-------------------------------------------------------]
00383 /**
00384 *  @brief
00385 *    Standard mouse cursors
00386 */
00387 enum EMouseCursor {
00388     CursorNone,                     /**< No cursor (invisible) */
00389     CursorArrow,                    /**< Standard arrow */
00390     CursorUpArrow,                  /**< Up arrow */
00391     CursorWaitStart,                /**< Startup wait sign (small hourglass) */
00392     CursorWait,                     /**< Wait sign (hourglass) */
00393     CursorHelp,                     /**< Help cursor */
00394     CursorNo,                       /**< Slashed circle */
00395     CursorCrosshair,                /**< Crosshair */
00396     CursorHand,                     /**< Hand */
00397     CursorText,                     /**< Text cursor */
00398     CursorMove,                     /**< Moving (all directions) */
00399     CursorSize,                     /**< Sizing (all directions) */
00400     CursorSizeTop,                  /**< Sizing (up) */
00401     CursorSizeBottom,               /**< Sizing (down) */
00402     CursorSizeLeft,                 /**< Sizing (left) */
00403     CursorSizeRight,                /**< Sizing (right) */
00404     CursorSizeTopBottom,            /**< Sizing (up and down) */
00405     CursorSizeLeftRight,            /**< Sizing (left and right) */
00406     CursorSizeTopLeft,              /**< Sizing (top left) */
00407     CursorSizeTopRight,             /**< Sizing (top right) */
00408     CursorSizeBottomLeft,           /**< Sizing (bottom left) */
00409     CursorSizeBottomRight,          /**< Sizing (bottom right) */
00410     CursorSizeTopLeftBottomRight,   /**< Sizing (top left and bottom right) */
00411     CursorSizeTopRightBottomLeft,   /**< Sizing (top right and bottom left) */
00412     CursorCustom,                   /**< A custom (image) cursor is used */
00413     Cursor_Count
00414 };
00415 
00416 
00417 //[-------------------------------------------------------]
00418 //[ Fonts and text                                        ]
00419 //[-------------------------------------------------------]
00420 /**
00421 *  @brief
00422 *    Font weight
00423 *
00424 *  @remarks
00425 *    Font weight in a scale from 0..100
00426 */
00427 enum EFontWeight {
00428     WeightLight  = 25,      /**< Light text */
00429     WeightNormal = 50,      /**< Normal text */
00430     WeightBold   = 75       /**< Bold text */
00431 };
00432 
00433 // RTTI definition
00434 pl_enum(EFontWeight)
00435     pl_enum_value(WeightLight,  "Light text")
00436     pl_enum_value(WeightNormal, "Normal text")
00437     pl_enum_value(WeightBold,   "Bold text")
00438 pl_enum_end
00439 
00440 /**
00441 *  @brief
00442 *    Font style
00443 */
00444 enum EFontStyle {
00445     StyleNormal = 0,        /**< Normal text */
00446     StyleItalics            /**< Italics text */
00447 };
00448 
00449 // RTTI definition
00450 pl_enum(EFontStyle)
00451     pl_enum_value(StyleNormal,  "Normal text")
00452     pl_enum_value(StyleItalics, "Italics text")
00453 pl_enum_end
00454 
00455 /**
00456 *  @brief
00457 *    Text style
00458 */
00459 enum ETextStyle {
00460     UnderlineText = 1,  /**< Underline the text */
00461     CrossoutText  = 2   /**< Cross out the text */
00462 };
00463 
00464 // RTTI definition
00465 pl_enum(ETextStyle)
00466     pl_enum_value(UnderlineText, "Underline the text")
00467     pl_enum_value(CrossoutText,  "Cross out the text")
00468 pl_enum_end
00469 
00470 /**
00471 *  @brief
00472 *    Text wrapping
00473 */
00474 enum ETextWrap {
00475     NoTextWrap = 0,     /**< Do not wrap text */
00476     TextWrap,           /**< Wrap text, if the text does not fit on a line, and use standard alignment */
00477     TextWrapBlock       /**< Wrap text and use block text to align it */
00478 };
00479 
00480 // RTTI definition
00481 pl_enum(ETextWrap)
00482     pl_enum_value(NoTextWrap,    "Do not wrap text")
00483     pl_enum_value(TextWrap,      "Wrap text, if the text does not fit on a line, and use standard alignment")
00484     pl_enum_value(TextWrapBlock, "Wrap text and use block text to align it")
00485 pl_enum_end
00486 
00487 
00488 //[-------------------------------------------------------]
00489 //[ Button                                                ]
00490 //[-------------------------------------------------------]
00491 /**
00492 *  @brief
00493 *    Check state
00494 */
00495 enum ECheckState {
00496     NotChecked = 0,     /**< The check-button is unchecked */
00497     Checked,            /**< The check-button is checked */
00498     PartiallyChecked    /**< The check-button is partial checked */
00499 };
00500 
00501 // RTTI definition
00502 pl_enum(ECheckState)
00503     pl_enum_value(NotChecked,       "The check-button is unchecked")
00504     pl_enum_value(Checked,          "The check-button is checked")
00505     pl_enum_value(PartiallyChecked, "The check-button is partial checked")
00506 pl_enum_end
00507 
00508 
00509 //[-------------------------------------------------------]
00510 //[ Menu                                                  ]
00511 //[-------------------------------------------------------]
00512 /**
00513 *  @brief
00514 *    Menu item type
00515 */
00516 enum EMenuItemType {
00517     TypeMenuItem = 0,   /**< A usual menu item */
00518     TypeMenu,           /**< A (sub)menu */
00519     TypeSeparator       /**< A separator */
00520 };
00521 
00522 
00523 //[-------------------------------------------------------]
00524 //[ TabBar                                                ]
00525 //[-------------------------------------------------------]
00526 /**
00527 *  @brief
00528 *    TabBar options
00529 */
00530 enum ETabBarOption {
00531     TabOptionCreateTab  = 1,    /**< Allow user to create a new tab */
00532     TabOptionCloseTab   = 2,    /**< Allow user to close a tab */
00533     TabOptionMoveTab    = 4,    /**< Allow user to move a tab */
00534     TabOptionStaticSize = 8     /**< Each tab has the same static size */
00535 };
00536 
00537 /**
00538 *  @brief
00539 *    TabBar functions
00540 */
00541 enum ETabBarFunction {
00542     TabFunctionCreateTab = 0,   /**< Create new tab */
00543     TabFunctionCloseTab,        /**< Close tab */
00544     TabFunctionScrollNext,      /**< Scroll (next) */
00545     TabFunctionScrollPrev       /**< Scroll (previous) */
00546 };
00547 
00548 
00549 //[-------------------------------------------------------]
00550 //[ MessageBox                                            ]
00551 //[-------------------------------------------------------]
00552 /**
00553 *  @brief
00554 *    Message box types
00555 */
00556 enum EMessageBox {
00557     MessageBoxOk = 0,       /**< Message box with button  'Ok' */
00558     MessageBoxOkCancel,     /**< Message box with buttons 'Ok', 'Cancel' */
00559     MessageBoxYesNo,        /**< Message box with buttons 'Yes', 'No' */
00560     MessageBoxYesNoCancel,  /**< Message box with buttons 'Yes', 'No', 'Cancel' */
00561 };
00562 
00563 /**
00564 *  @brief
00565 *    Message box buttons
00566 */
00567 enum EMessageBoxButton {
00568     MessageBoxButtonCancel = -1,    /**< Message box button 'Cancel' */
00569     MessageBoxButtonOk = 0,         /**< Message box button 'Ok' */
00570     MessageBoxButtonYes,            /**< Message box button 'Yes' */
00571     MessageBoxButtonNo              /**< Message box button 'No' */
00572 };
00573 
00574 
00575 //[-------------------------------------------------------]
00576 //[ Data definitions                                      ]
00577 //[-------------------------------------------------------]
00578 /**
00579 *  @brief
00580 *    Data type
00581 */
00582 enum EDataType {
00583     DataEmpty = 0,      /**< Empty data */
00584     DataString,         /**< String data */
00585     DataFiles,          /**< List of file names */
00586     DataCustom,         /**< Custom data (uint32 value) */
00587     DataBinary          /**< Binary data (byte buffer and size) */
00588 };
00589 
00590 
00591 //[-------------------------------------------------------]
00592 //[ Namespace                                             ]
00593 //[-------------------------------------------------------]
00594 } // PLGui
00595 
00596 
00597 #endif // __PLGUI_DEFINITIONS_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:58
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported