File indexing completed on 2024-04-28 05:32:11

0001 #ifndef oxygengtkdetails_h
0002 #define oxygengtkdetails_h
0003 /*
0004 * this file is part of the oxygen gtk engine
0005 * SPDX-FileCopyrightText: 2010 Hugo Pereira Da Costa <hugo.pereira@free.fr>
0006 *
0007 * SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #include<string>
0011 namespace Oxygen
0012 {
0013     namespace Gtk
0014     {
0015 
0016         class Detail
0017         {
0018             public:
0019 
0020             //! constructor
0021             explicit Detail( const char* value = 0L )
0022             { if( value ) _value = value; }
0023 
0024             //! true when no valid value was passed
0025             bool isNull( void ) const { return _value.empty(); }
0026             bool is( const std::string value ) const
0027             { return _value == value; }
0028 
0029             bool isArrow( void ) const { return _value == "arrow"; }
0030             bool isBar( void ) const { return _value == "bar"; }
0031             bool isBase( void ) const { return _value == "base"; }
0032             bool isButton( void ) const { return _value == "button"; }
0033 
0034             //! iconview
0035             bool isIconViewItem( void ) const { return _value == "icon_view_item"; }
0036 
0037             //!@name treeview cells
0038             //@{
0039 
0040             bool isCellEvenSorted( void ) const { return _value == "cell_even_sorted"; }
0041             bool isCellEvenRuled( void ) const { return _value == "cell_even_ruled"; }
0042             bool isCellOddSorted( void ) const { return _value == "cell_odd_sorted"; }
0043             bool isCellOddRuled( void ) const { return _value == "cell_odd_ruled"; }
0044             bool isCell( void ) const { return _value.find( "cell_" ) == 0; }
0045 
0046             bool isCellOdd( void ) const { return isCell() && _value.find( "_odd" ) != std::string::npos; }
0047             bool isCellEven( void ) const { return isCell() && _value.find( "_even" ) != std::string::npos; }
0048 
0049             bool isCellRuled( void ) const { return isCell() && _value.find( "_ruled" ) != std::string::npos; }
0050             bool isCellStart( void ) const { return isCell() && _value.find( "_start" ) != std::string::npos; }
0051             bool isCellEnd( void ) const { return isCell() && _value.find( "_end" ) != std::string::npos; }
0052             bool isCellMiddle( void ) const { return isCell() && _value.find( "_middle" ) != std::string::npos; }
0053 
0054             bool isCellRadio( void ) const { return _value == "cellradio"; }
0055             //@}
0056 
0057             bool isDragAndDrop( void ) const { return _value == "dnd"; }
0058 
0059             //!@name scrollbars
0060             //@{
0061             bool isHScrollBar( void ) const { return _value == "hscrollbar"; }
0062             bool isVScrollBar( void ) const { return _value == "vscrollbar"; }
0063             bool isScrollBar( void ) const { return isVScrollBar() || isHScrollBar(); }
0064             //@}
0065 
0066             //!@name scales
0067             //@{
0068             bool isHScale( void ) const { return _value == "hscale"; }
0069             bool isVScale( void ) const { return _value == "vscale"; }
0070             bool isScale( void ) const { return isHScale() || isVScale(); }
0071             //@}
0072 
0073             bool isCellCheck( void ) const { return _value == "cellcheck"; }
0074             bool isCheck( void ) const { return _value == "check"; }
0075             bool isCheckButton( void ) const { return _value == "checkbutton"; }
0076             bool isDefaultButton( void ) const { return _value == "buttondefault"; }
0077             bool isDockItem( void ) const { return _value == "dockitem"; }
0078             bool isInfoBar( void ) const { return _value.find( "infobar" ) == 0; }
0079             bool isEntry( void ) const { return _value == "entry"; }
0080             bool isEntryBg( void ) const { return _value == "entry_bg"; }
0081             bool isEntryProgress( void ) const { return _value == "entry-progress"; }
0082             bool isEventBox( void ) const { return _value == "eventbox"; }
0083             bool isExpander( void ) const { return _value == "expander"; }
0084             bool isFrame( void ) const { return _value == "frame"; }
0085             bool isHandleBox( void ) const { return _value == "handlebox" || _value == "handlebox_bin"; }
0086             bool isMenu( void ) const { return _value == "menu"; }
0087             bool isMenuBar( void ) const { return _value == "menubar"; }
0088             bool isMenuItem( void ) const { return _value == "menuitem"; }
0089             bool isMenuScrollArrow( void ) const { return _value == "menu_scroll_arrow_down" || _value == "menu_scroll_arrow_up"; }
0090             bool isNotebook( void ) const { return _value == "notebook"; }
0091             bool isOption( void ) const { return _value == "option"; }
0092             bool isOptionMenu( void ) const { return _value == "optionmenu"; }
0093             bool isOptionMenuTab( void ) const { return _value == "optionmenutab"; }
0094             bool isPaned( void ) const { return _value == "paned"; }
0095             bool isRadioButton( void ) const { return _value == "radiobutton"; }
0096             bool isProgressBar( void) const { return _value == "progressbar"; }
0097 
0098             //!@name rulers
0099             //@{
0100             bool isRuler( void ) const { return _value == "vruler" || _value == "hruler"; }
0101             //@}
0102 
0103             bool isScrolledWindow( void ) const { return _value == "scrolled_window"; }
0104             bool isSlider( void ) const { return _value == "slider"; }
0105 
0106             //!@name spinbuttons
0107             //@{
0108             bool isSpinButton( void ) const { return _value == "spinbutton"; }
0109             bool isSpinButtonUp( void ) const { return _value=="spinbutton_up"; }
0110             bool isSpinButtonDown( void ) const { return _value=="spinbutton_down"; }
0111             bool isSpinButtonArrow( void ) const { return isSpinButtonUp() || isSpinButtonDown(); }
0112             //@}
0113 
0114             bool isStepper( void ) const { return _value == "stepper"; }
0115 
0116             bool isTab( void ) const { return _value == "tab"; }
0117             bool isTearOffMenuItem( void ) const { return _value == "tearoffmenuitem"; }
0118             bool isToggleButton( void ) const { return _value == "togglebutton"; }
0119             bool isToolBar( void ) const { return _value == "toolbar"; }
0120             bool isTooltip( void ) const { return _value == "tooltip"; }
0121             bool isTreeView( void ) const { return _value == "treeview"; }
0122 
0123             //!@name through
0124             //@{
0125             bool isTroughFillLevel( void ) const { return _value == "trough-fill-level"; }
0126             bool isTroughLower( void ) const { return _value == "trough-lower"; }
0127             bool isTroughUpper( void ) const { return _value == "trough-upper"; }
0128             bool isTrough( void ) const { return _value == "trough"; }
0129             bool isTroughAny( void ) const { return isTrough()||isTroughLower()||isTroughUpper(); }
0130             //@}
0131 
0132             bool isViewport( void ) const { return _value == "viewport"; }
0133             bool isViewportBin( void ) const { return _value == "viewportbin"; }
0134 
0135             private:
0136 
0137             //! value
0138             std::string _value;
0139 
0140         };
0141 
0142     }
0143 
0144 }
0145 #endif