kdecorationfactory.h

00001 /*****************************************************************
00002 This file is part of the KDE project.
00003 
00004 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a
00007 copy of this software and associated documentation files (the "Software"),
00008 to deal in the Software without restriction, including without limitation
00009 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00010 and/or sell copies of the Software, and to permit persons to whom the
00011 Software is furnished to do so, subject to the following conditions:
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00019 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00020 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00021 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00022 DEALINGS IN THE SOFTWARE.
00023 ******************************************************************/
00024 
00025 #ifndef KDECORATIONFACTORY_H
00026 #define KDECORATIONFACTORY_H
00027 
00028 #include "kdecoration.h"
00029 
00030 class KDecoration;
00031 class KDecorationBridge;
00032 class KDecorationFactoryPrivate;
00033 
00034 class KWIN_EXPORT KDecorationFactory
00035     : public KDecorationDefines
00036     {
00037     public:
00042         KDecorationFactory();
00047         virtual ~KDecorationFactory();
00053         virtual KDecoration* createDecoration( KDecorationBridge* bridge ) = 0;
00063         virtual bool reset( unsigned long changed ); // returns true if the decoration needs to be recreated
00064 
00071         virtual QValueList< BorderSize > borderSizes() const;
00072 
00073         virtual bool supports( Ability ability );
00074         
00075         virtual void checkRequirements( KDecorationProvides* provides );
00080         const KDecorationOptions* options(); // convenience
00087         bool exists( const KDecoration* deco ) const;
00091         void addDecoration( KDecoration* );
00095         void removeDecoration( KDecoration* );
00096     protected:
00101         void resetDecorations( unsigned long changed ); // convenience
00109         NET::WindowType windowType( unsigned long supported_types, KDecorationBridge* bridge ) const;
00110     private:
00111         QValueList< KDecoration* > _decorations;
00112         KDecorationFactoryPrivate* d;
00113     };
00114     
00115 inline const KDecorationOptions* KDecorationFactory::options()
00116     {
00117     return KDecoration::options();
00118     }
00119     
00120 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys