home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kstdguiitem.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  5.4 KB  |  184 lines

  1. /* This file is part of the KDE libraries
  2.    Copyright (C) 2001 Holger Freyther <freyther@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.    Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef __kstdguiitem_h
  20. #define __kstdguiitem_h
  21.  
  22. // Needed for the template below
  23. #include <kguiitem.h>
  24.  
  25. #include <qstring.h>
  26. #include <qpair.h>
  27.  
  28. /**
  29.  * @short Provides a set of standardized KGuiItems.
  30.  *
  31.  * The various static methods returns standardized @ref KGuiItem's
  32.  * conforming to the KDE UI Standards. Use them instead of creating
  33.  * your own.
  34.  *
  35.  * @author Holger Freyther <freyther@kde.org>
  36.  */
  37. class KDEUI_EXPORT KStdGuiItem
  38. {
  39. public:
  40.     /**
  41.      * The back and forward items by default use the RTL settings for Hebrew
  42.      * and Arab countries. If you want those actions to ignore the RTL value
  43.      * and force 'Western' behavior instead, use the IgnoreRTL value instead.
  44.      */
  45.     enum BidiMode { UseRTL = 0, IgnoreRTL };
  46.  
  47.     enum StdItem
  48.     {
  49.         Ok=1, Cancel, Yes, No, Discard, Save, DontSave, SaveAs,
  50.         Apply, Clear, Help, Defaults, Close, Back, Forward, Print,
  51.         Continue, Open, Quit, AdminMode, Reset, Delete, Insert,
  52.     Configure,    ///< @since 3.4
  53.         Find,         ///< @since 3.4
  54.     Stop,         ///< @since 3.4
  55.     Add,          ///< @since 3.4
  56.     Remove,       ///< @since 3.4
  57.     Test,         ///< @since 3.4
  58.     Properties,   ///< @since 3.4
  59.     Overwrite     ///< @since 3.5
  60.     };
  61.     static KGuiItem guiItem ( StdItem ui_enum );
  62.     static QString  stdItem ( StdItem ui_enum );
  63.     static KGuiItem ok();
  64.     static KGuiItem cancel();
  65.     static KGuiItem yes();
  66.     static KGuiItem no();
  67.     static KGuiItem insert();
  68.     static KGuiItem discard();
  69.     static KGuiItem save();
  70.     static KGuiItem help();
  71.     static KGuiItem dontSave();
  72.     static KGuiItem saveAs();
  73.     static KGuiItem apply();
  74.     static KGuiItem clear();
  75.     static KGuiItem defaults();
  76.     static KGuiItem close();
  77.     static KGuiItem print();
  78.     /**
  79.      * @since 3.4
  80.      */
  81.     static KGuiItem properties();
  82.     static KGuiItem reset();
  83.     /**
  84.      * @since 3.5
  85.      */
  86.     static KGuiItem overwrite();
  87.     /**
  88.      * Returns a KGuiItem suiting for cases where code or functionality
  89.      * runs under root privileges. Used in conjunction with KConfig Modules.
  90.      */
  91.     static KGuiItem adminMode();
  92.  
  93.     /**
  94.      * Returns a "continue" item. The short name is due to "continue" being a
  95.      * reserved word in the C++ language.
  96.      */
  97.     static KGuiItem cont();
  98.  
  99.     /**
  100.      * Returns a "delete" item. The short name is due to "delete" being a
  101.      * reserved word in the C++ language.
  102.      * @since 3.3
  103.      */
  104.     static KGuiItem del();
  105.  
  106.     static KGuiItem open();
  107.  
  108.     /**
  109.      * Return a GUI item for a 'back' action, like Konqueror's back button.
  110.      * This GUI item can optionally honor the user's setting for BiDi, so the
  111.      * icon for right-to-left languages (Hebrew and Arab) has the arrow
  112.      * pointing in the opposite direction.
  113.      * By default the arrow points in the Western 'back' direction (i.e.
  114.      * to the left). This is because usually you only want the Bidi aware
  115.      * GUI item if you also want the 'forward' item. Those two are available
  116.      * in the separate backAndForward() method.
  117.      */
  118.     static KGuiItem back( BidiMode useBidi = IgnoreRTL );
  119.  
  120.     /**
  121.      * Return a GUI item for a 'forward' action, like Konqueror's forward
  122.      * button. This GUI item can optionally honor the user's setting for BiDi,
  123.      * so the icon for right-to-left languages (Hebrew and Arab) has the arrow
  124.      * pointing in the opposite direction.
  125.      * By default the arrow points in the Western 'forward' direction (i.e.
  126.      * to the right). This is because usually you only want the Bidi aware
  127.      * GUI item if you also want the 'back' item. Those two are available
  128.      * in the separate backAndForward() method.
  129.      */
  130.     static KGuiItem forward( BidiMode useBidi = IgnoreRTL );
  131.  
  132.     /**
  133.      * Returns a "configure" item.
  134.      * @since 3.4
  135.      */
  136.     static KGuiItem configure();
  137.  
  138.     /**
  139.      * Return both a back and a forward item. This function always returns
  140.      * items that are aware of the Right-to-Left setting for Arab and Hebrew
  141.      * locales. If you have a reason for wanting the 'Western' back/forward
  142.      * buttons, please use the back() and forward() items instead.
  143.      */
  144.     static QPair<KGuiItem, KGuiItem> backAndForward();
  145.  
  146.     static KGuiItem quit();
  147.  
  148.     /**
  149.     * Returns a "find" item.
  150.     * @since 3.4
  151.     */
  152.     static KGuiItem find();
  153.  
  154.     /**
  155.     * Returns a "stop" item.
  156.     * @since 3.4
  157.     */
  158.     static KGuiItem stop();
  159.  
  160.     /**
  161.     * Returns a "add" item.
  162.     * @since 3.4
  163.     */
  164.     static KGuiItem add();
  165.  
  166.     /**
  167.     * Returns a "remove" item.
  168.     * @since 3.4
  169.     */
  170.     static KGuiItem remove();
  171.  
  172.     /**
  173.     * Returns a "test" item.
  174.     * @since 3.4
  175.     */
  176.     static KGuiItem test();
  177.  
  178. };
  179.  
  180. #endif
  181.  
  182. // vim: set et ts=4 sw=4 sts=4:
  183.  
  184.