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

0001 #ifndef oxygenxulinfo_h
0002 #define oxygenxulinfo_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 "oxygengtkutils.h"
0011 
0012 namespace Oxygen
0013 {
0014     //! checkbox info, needed for proper focus rendering in Xul applications
0015     class XulInfo
0016     {
0017 
0018         public:
0019 
0020         enum Type
0021         {
0022             Invalid,
0023             CheckBox,
0024             RadioButton
0025         };
0026 
0027         //! constructor
0028         XulInfo( void ):
0029             _type( Invalid ),
0030             _rect( Gtk::gdk_rectangle() )
0031         {}
0032 
0033         //! destructor
0034         virtual ~XulInfo( void )
0035         {}
0036 
0037         //!@name accessors
0038         //@{
0039 
0040         Type type( void ) const
0041         { return _type; }
0042 
0043         //! rectangle
0044         const GdkRectangle& rect( void ) const
0045         { return _rect; }
0046 
0047         //! validity
0048         bool isValid( void )
0049         { return _type != Invalid && Gtk::gdk_rectangle_is_valid( &_rect ); }
0050 
0051         //@}
0052 
0053         //!@name modifiers
0054         //@{
0055 
0056         //! type
0057         void setType( Type value )
0058         { _type = value; }
0059 
0060         //! rectangle
0061         void setRect( const GdkRectangle& value )
0062         { _rect = value; }
0063 
0064         //! clear
0065         void clear( void )
0066         {
0067             _type = Invalid;
0068             _rect = Gtk::gdk_rectangle();
0069         }
0070 
0071         //@}
0072 
0073         private:
0074 
0075         //! type
0076         Type _type;
0077 
0078         //! rectangle
0079         GdkRectangle _rect;
0080 
0081     };
0082 
0083 }
0084 #endif