2009-09-15 07:12:54 +00:00
|
|
|
#ifndef oxygen_h
|
|
|
|
#define oxygen_h
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-08-24 16:17:15 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygen.h
|
2009-08-24 16:17:15 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira <hugo.pereira@free.fr>
|
2009-08-22 08:24:06 +00:00
|
|
|
// Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
|
|
|
|
//
|
|
|
|
// 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:17:15 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-09-20 07:42:03 +00:00
|
|
|
#include <QtCore/QObject>
|
2009-08-22 08:24:06 +00:00
|
|
|
#include <kdecorationfactory.h>
|
|
|
|
#include <kdeversion.h>
|
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenconfiguration.h"
|
|
|
|
#include "oxygenexceptionlist.h"
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-10-13 01:45:01 +00:00
|
|
|
#include "oxygenshadowcache.h"
|
2010-03-04 22:49:18 +00:00
|
|
|
#include "helper.h"
|
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-09 00:55:55 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
class OxygenClient;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! buttons
|
2009-09-09 00:55:55 +00:00
|
|
|
enum ButtonType
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
|
|
|
ButtonHelp=0,
|
|
|
|
ButtonMax,
|
|
|
|
ButtonMin,
|
|
|
|
ButtonClose,
|
|
|
|
ButtonMenu,
|
|
|
|
ButtonSticky,
|
|
|
|
ButtonAbove,
|
|
|
|
ButtonBelow,
|
|
|
|
ButtonShade,
|
2009-10-15 16:03:30 +00:00
|
|
|
ButtonTypeCount,
|
|
|
|
|
|
|
|
// Close only one tab
|
|
|
|
ButtonItemClose=100,
|
|
|
|
|
|
|
|
// shows the window menu for one tab
|
|
|
|
ButtonItemMenu
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Q_DECLARE_FLAGS(ButtonTypes, ButtonType)
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-13 01:45:01 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
|
|
|
|
//! this is the top title bar edge
|
|
|
|
TFRAMESIZE = 3,
|
|
|
|
|
|
|
|
/*!
|
|
|
|
this is the extra title bar top and bottom edges
|
|
|
|
needed to outline active window title bar
|
|
|
|
*/
|
|
|
|
HFRAMESIZE = 4
|
|
|
|
};
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! window decoration factory
|
2009-09-15 07:12:54 +00:00
|
|
|
class OxygenFactory: public QObject, public KDecorationFactoryUnstable
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
Q_OBJECT
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
public:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! constructor
|
2009-09-15 07:12:54 +00:00
|
|
|
OxygenFactory();
|
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 ~OxygenFactory();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! create decoration
|
|
|
|
virtual KDecoration *createDecoration(KDecorationBridge *b);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! configuration reset
|
|
|
|
virtual bool reset(unsigned long changed);
|
|
|
|
|
|
|
|
//! configuration capabilities
|
|
|
|
virtual bool supports( Ability ability ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! true if initialized
|
2009-10-13 01:45:01 +00:00
|
|
|
virtual bool initialized()
|
2009-08-22 08:24:06 +00:00
|
|
|
{ return initialized_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-13 01:45:01 +00:00
|
|
|
//! helper
|
2010-03-04 22:49:18 +00:00
|
|
|
virtual OxygenDecoHelper& helper( void )
|
2009-10-13 01:45:01 +00:00
|
|
|
{ return helper_; }
|
|
|
|
|
|
|
|
//! shadow cache
|
|
|
|
virtual OxygenShadowCache& shadowCache( void )
|
|
|
|
{ return shadowCache_; }
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! get configuration for a give client
|
2009-10-13 01:45:01 +00:00
|
|
|
virtual OxygenConfiguration configuration( const OxygenClient& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! read configuration from KConfig
|
|
|
|
bool readConfig();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! default configuration
|
2009-11-15 03:24:04 +00:00
|
|
|
const OxygenConfiguration& defaultConfiguration( void ) const
|
2009-08-22 08:24:06 +00:00
|
|
|
{ return defaultConfiguration_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! initialization
|
2009-10-13 01:45:01 +00:00
|
|
|
void setInitialized( bool value )
|
2009-08-22 08:24:06 +00:00
|
|
|
{ initialized_ = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! set default configuration
|
2009-10-13 01:45:01 +00:00
|
|
|
void setDefaultConfiguration( OxygenConfiguration value )
|
2009-08-22 08:24:06 +00:00
|
|
|
{ defaultConfiguration_ = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! initialization flag
|
2009-10-13 01:45:01 +00:00
|
|
|
bool initialized_;
|
|
|
|
|
|
|
|
//! helper
|
2010-03-04 22:49:18 +00:00
|
|
|
OxygenDecoHelper helper_;
|
2009-10-13 01:45:01 +00:00
|
|
|
|
|
|
|
//! shadow cache
|
|
|
|
OxygenShadowCache shadowCache_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! default configuration
|
2009-10-13 01:45:01 +00:00
|
|
|
OxygenConfiguration defaultConfiguration_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! exceptions
|
2009-10-13 01:45:01 +00:00
|
|
|
OxygenExceptionList exceptions_;
|
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-24 06:27:49 +00:00
|
|
|
}
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif
|