kdecorationfactory.cpp
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 #include "kdecorationfactory.h" 00026 00027 #include <assert.h> 00028 00029 #include "kdecoration_p.h" 00030 00031 KDecorationFactory::KDecorationFactory() 00032 { 00033 } 00034 00035 KDecorationFactory::~KDecorationFactory() 00036 { 00037 assert( _decorations.count() == 0 ); 00038 } 00039 00040 bool KDecorationFactory::reset( unsigned long ) 00041 { 00042 return false; 00043 } 00044 00045 bool KDecorationFactory::supports( Ability ) 00046 { 00047 return false; 00048 } 00049 00050 void KDecorationFactory::checkRequirements( KDecorationProvides* ) 00051 { 00052 } 00053 00054 QValueList< KDecorationDefines::BorderSize > KDecorationFactory::borderSizes() const 00055 { 00056 return QValueList< BorderSize >() << BorderNormal; 00057 } 00058 00059 bool KDecorationFactory::exists( const KDecoration* deco ) const 00060 { 00061 return _decorations.contains( const_cast< KDecoration* >( deco )); 00062 } 00063 00064 void KDecorationFactory::addDecoration( KDecoration* deco ) 00065 { 00066 _decorations.append( deco ); 00067 } 00068 00069 void KDecorationFactory::removeDecoration( KDecoration* deco ) 00070 { 00071 _decorations.remove( deco ); 00072 } 00073 00074 void KDecorationFactory::resetDecorations( unsigned long changed ) 00075 { 00076 for( QValueList< KDecoration* >::ConstIterator it = _decorations.begin(); 00077 it != _decorations.end(); 00078 ++it ) 00079 (*it)->reset( changed ); 00080 } 00081 00082 NET::WindowType KDecorationFactory::windowType( unsigned long supported_types, KDecorationBridge* bridge ) const 00083 { 00084 return bridge->windowType( supported_types ); 00085 }