2009-09-15 07:12:54 +00:00
|
|
|
#ifndef oxygenconfiguration_h
|
|
|
|
#define oxygenconfiguration_h
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygenconfiguration.h
|
2009-08-24 16:12:50 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
2009-08-24 16:12:50 +00:00
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to
|
|
|
|
// deal in the Software without restriction, including without limitation the
|
|
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2009-09-09 00:55:55 +00:00
|
|
|
// IN THE SOFTWARE.
|
2009-08-24 16:12:50 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#include <KConfigGroup>
|
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace OxygenConfig
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
static const QString TITLE_ALIGNMENT = "TitleAlignment";
|
|
|
|
static const QString BUTTON_SIZE = "ButtonSize";
|
|
|
|
static const QString DRAW_SEPARATOR = "DrawSeparator";
|
2009-09-04 19:02:20 +00:00
|
|
|
static const QString DRAW_TITLE_OUTLINE = "DrawTitleOutline";
|
2009-08-22 08:24:06 +00:00
|
|
|
static const QString FRAME_BORDER = "FrameBorder";
|
|
|
|
static const QString BLEND_COLOR = "BlendColor";
|
2009-09-02 02:15:53 +00:00
|
|
|
static const QString SIZE_GRIP_MODE = "SizeGripMode";
|
2009-08-22 08:24:06 +00:00
|
|
|
static const QString USE_OXYGEN_SHADOWS = "UseOxygenShadows";
|
2009-11-07 03:33:53 +00:00
|
|
|
static const QString HIDE_TITLEBAR = "HideTitleBar";
|
2009-10-02 02:52:41 +00:00
|
|
|
static const QString USE_ANIMATIONS = "UseAnimations";
|
|
|
|
static const QString ANIMATIONS_DURATION = "AnimationsDuration";
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
}
|
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
class OxygenConfiguration
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
//! button size enumeration
|
|
|
|
enum ButtonSize
|
|
|
|
{
|
|
|
|
ButtonSmall = 18,
|
2009-10-11 19:03:47 +00:00
|
|
|
ButtonDefault = 20,
|
2009-08-22 08:24:06 +00:00
|
|
|
ButtonLarge = 32,
|
|
|
|
ButtonHuge = 48
|
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! frame border enumeration
|
|
|
|
enum FrameBorder
|
|
|
|
{
|
|
|
|
BorderNone = 0,
|
2009-09-09 07:39:16 +00:00
|
|
|
BorderNoSide = 1,
|
2009-08-24 16:12:50 +00:00
|
|
|
BorderTiny = 2,
|
2009-08-25 04:51:08 +00:00
|
|
|
BorderDefault = 4,
|
|
|
|
BorderLarge = 8,
|
|
|
|
BorderVeryLarge = 12,
|
|
|
|
BorderHuge = 18,
|
|
|
|
BorderVeryHuge = 27,
|
|
|
|
BorderOversized = 40
|
2009-08-22 08:24:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//! blend color enumeration
|
|
|
|
enum BlendColorType {
|
|
|
|
NoBlending,
|
|
|
|
RadialBlending
|
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-02 02:15:53 +00:00
|
|
|
//! size grip mode
|
|
|
|
enum SizeGripMode
|
|
|
|
{
|
|
|
|
SizeGripNever,
|
|
|
|
SizeGripWhenNeeded
|
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! default constructor
|
2009-09-15 07:12:54 +00:00
|
|
|
OxygenConfiguration( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! constructor from KConfig
|
2009-09-15 07:12:54 +00:00
|
|
|
OxygenConfiguration( KConfigGroup );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! destructor
|
2009-09-15 07:12:54 +00:00
|
|
|
virtual ~OxygenConfiguration( void )
|
2009-08-22 08:24:06 +00:00
|
|
|
{}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! equal to operator
|
2009-09-15 07:12:54 +00:00
|
|
|
bool operator == ( const OxygenConfiguration& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! write to kconfig group
|
|
|
|
virtual void write( KConfigGroup& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//!@name title alignment
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
static QString titleAlignmentName( Qt::Alignment, bool translated );
|
|
|
|
static Qt::Alignment titleAlignment( QString, bool translated );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual Qt::Alignment titleAlignment() const
|
|
|
|
{ return titleAlignment_; }
|
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual QString titleAlignmentName( bool translated ) const
|
|
|
|
{ return titleAlignmentName( titleAlignment(), translated ); }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
virtual void setTitleAlignment( Qt::Alignment value )
|
|
|
|
{ titleAlignment_ = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual void setTitleAlignment( QString value, bool translated )
|
|
|
|
{ titleAlignment_ = titleAlignment( value, translated ); }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//!@name button size
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
static QString buttonSizeName( ButtonSize, bool translated );
|
|
|
|
static ButtonSize buttonSize( QString, bool translated );
|
2009-08-29 05:38:58 +00:00
|
|
|
static int iconScale( ButtonSize );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual ButtonSize buttonSize( void ) const
|
|
|
|
{ return buttonSize_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-29 05:38:58 +00:00
|
|
|
virtual int iconScale( void ) const
|
|
|
|
{ return iconScale( buttonSize() ); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual QString buttonSizeName( bool translated ) const
|
|
|
|
{ return buttonSizeName( buttonSize(), translated ); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual void setButtonSize( ButtonSize value )
|
|
|
|
{ buttonSize_ = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//!@name frame border
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
static QString frameBorderName( FrameBorder, bool translated );
|
|
|
|
static FrameBorder frameBorder( QString, bool translated );
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
virtual FrameBorder frameBorder() const
|
|
|
|
{ return frameBorder_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual QString frameBorderName( bool translated ) const
|
|
|
|
{ return frameBorderName( frameBorder(), translated ); }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
virtual void setFrameBorder( FrameBorder value )
|
|
|
|
{ frameBorder_ = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual void setFrameBorder( QString value, bool translated )
|
|
|
|
{ frameBorder_ = frameBorder( value, translated ); }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//!@name blend color
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
static QString blendColorName( BlendColorType, bool translated );
|
|
|
|
static BlendColorType blendColor( QString, bool translated );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual BlendColorType blendColor( void ) const
|
|
|
|
{ return blendColor_; }
|
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual QString blendColorName( bool translated ) const
|
|
|
|
{ return blendColorName( blendColor(), translated ); }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
virtual void setBlendColor( BlendColorType value )
|
2009-09-09 00:55:55 +00:00
|
|
|
{ blendColor_ = value; }
|
|
|
|
|
2009-08-24 16:12:50 +00:00
|
|
|
virtual void setBlendColor( QString value, bool translated )
|
2009-09-09 00:55:55 +00:00
|
|
|
{ blendColor_ = blendColor( value, translated ); }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-02 02:15:53 +00:00
|
|
|
//!@name size grip
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-02 02:15:53 +00:00
|
|
|
static QString sizeGripModeName( SizeGripMode, bool translated );
|
|
|
|
static SizeGripMode sizeGripMode( QString, bool translated );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-02 02:15:53 +00:00
|
|
|
virtual SizeGripMode sizeGripMode( void ) const
|
|
|
|
{ return sizeGripMode_; }
|
|
|
|
|
|
|
|
virtual QString sizeGripModeName( bool translated ) const
|
|
|
|
{ return sizeGripModeName( sizeGripMode(), translated ); }
|
|
|
|
|
|
|
|
virtual void setSizeGripMode( SizeGripMode value )
|
2009-09-09 00:55:55 +00:00
|
|
|
{ sizeGripMode_ = value; }
|
|
|
|
|
2009-09-02 02:15:53 +00:00
|
|
|
virtual void setSizeGripMode( QString value, bool translated )
|
2009-09-09 00:55:55 +00:00
|
|
|
{ sizeGripMode_ = sizeGripMode( value, translated ); }
|
2009-09-02 02:15:53 +00:00
|
|
|
|
|
|
|
//! draw size grip
|
|
|
|
virtual bool drawSizeGrip( void ) const
|
2009-09-04 20:46:37 +00:00
|
|
|
{ return (sizeGripMode() == SizeGripWhenNeeded && frameBorder() == BorderNone ); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-02 02:15:53 +00:00
|
|
|
//@}
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! separator
|
|
|
|
virtual bool drawSeparator( void ) const
|
|
|
|
{ return drawSeparator_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! separator
|
|
|
|
virtual void setDrawSeparator( bool value )
|
|
|
|
{ drawSeparator_ = value; }
|
|
|
|
|
2009-09-04 19:02:20 +00:00
|
|
|
//! title outline
|
|
|
|
virtual bool drawTitleOutline( void ) const
|
|
|
|
{ return drawTitleOutline_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-04 19:02:20 +00:00
|
|
|
//! title outline
|
|
|
|
virtual void setDrawTitleOutline( bool value )
|
|
|
|
{ drawTitleOutline_ = value; }
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-11-07 03:33:53 +00:00
|
|
|
//! hide title bar
|
|
|
|
virtual bool hideTitleBar( void ) const
|
|
|
|
{ return hideTitleBar_; }
|
|
|
|
|
|
|
|
//! hide title bar
|
|
|
|
virtual void setHideTitleBar( bool value )
|
|
|
|
{ hideTitleBar_ = value; }
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! oxygen shadows
|
|
|
|
virtual bool useOxygenShadows( void ) const
|
|
|
|
{ return useOxygenShadows_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! oxygen shadows
|
|
|
|
virtual void setUseOxygenShadows( bool value )
|
|
|
|
{ useOxygenShadows_ = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-02 02:52:41 +00:00
|
|
|
//! animations
|
|
|
|
virtual bool useAnimations( void ) const
|
|
|
|
{ return useAnimations_; }
|
|
|
|
|
|
|
|
//! animations
|
|
|
|
virtual void setUseAnimations( bool value )
|
|
|
|
{ useAnimations_ = value; }
|
|
|
|
|
|
|
|
//! animations
|
|
|
|
virtual int animationsDuration( void ) const
|
|
|
|
{ return animationsDuration_; }
|
|
|
|
|
|
|
|
//! animations
|
|
|
|
virtual void setAnimationsDuration( int value )
|
|
|
|
{ animationsDuration_ = value; }
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
|
|
|
//! title alignment
|
2009-08-22 08:24:06 +00:00
|
|
|
Qt::Alignment titleAlignment_;
|
|
|
|
|
|
|
|
//! button size
|
|
|
|
ButtonSize buttonSize_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! blend color
|
2009-09-09 00:55:55 +00:00
|
|
|
FrameBorder frameBorder_;
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
//! frame border
|
|
|
|
BlendColorType blendColor_;
|
2009-09-02 02:15:53 +00:00
|
|
|
|
|
|
|
//! size grip mode
|
|
|
|
SizeGripMode sizeGripMode_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! separator
|
|
|
|
bool drawSeparator_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-04 19:02:20 +00:00
|
|
|
//! active window title outline
|
|
|
|
bool drawTitleOutline_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-07 03:33:53 +00:00
|
|
|
//! hide titlebar completely (but not window border)
|
|
|
|
bool hideTitleBar_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! oxygen shadows
|
|
|
|
bool useOxygenShadows_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-02 02:52:41 +00:00
|
|
|
//! animations
|
|
|
|
bool useAnimations_;
|
|
|
|
|
|
|
|
//! animations
|
|
|
|
int animationsDuration_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 06:23:44 +00:00
|
|
|
}
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif
|