KWinLibraries
kdecorationfactory.h
Go to the documentation of this file.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 00033 class KDecoration; 00034 class KDecorationBridge; 00035 class KDecorationFactoryPrivate; 00036 00037 class KWIN_EXPORT KDecorationFactory 00038 : public KDecorationDefines 00039 { 00040 public: 00045 KDecorationFactory(); 00050 virtual ~KDecorationFactory(); 00056 virtual KDecoration* createDecoration( KDecorationBridge* bridge ) = 0; 00066 virtual bool reset( unsigned long changed ); // returns true if the decoration needs to be recreated 00067 00074 virtual QList< BorderSize > borderSizes() const; 00075 00076 virtual bool supports( Ability ability ) const = 0; 00077 00078 virtual void checkRequirements( KDecorationProvides* provides ); 00083 const KDecorationOptions* options(); // convenience 00090 bool exists( const KDecoration* deco ) const; 00094 void addDecoration( KDecoration* ); 00098 void removeDecoration( KDecoration* ); 00099 protected: 00104 void resetDecorations( unsigned long changed ); // convenience 00112 NET::WindowType windowType( unsigned long supported_types, KDecorationBridge* bridge ) const; 00113 private: 00114 QList< KDecoration* > _decorations; 00115 KDecorationFactoryPrivate* d; 00116 }; 00117 00118 inline const KDecorationOptions* KDecorationFactory::options() 00119 { 00120 return KDecoration::options(); 00121 } 00122 00125 #endif