1 /***************************************************************** 2 3 This file is a copy of the KWin internal API. It allows the KDE4 4 window decorator the loading of KWin decoration plugins. 5 6 Copyright © 2008 Dennis Kasprzyk <onestone@opencompositing.org> 7 8 ****************************************************************** 9 10 This file is part of the KDE project. 11 12 Copyright (C) 1999, 2000 Daniel M. Duley <mosfet@kde.org> 13 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> 14 15 Permission is hereby granted, free of charge, to any person obtaining a 16 copy of this software and associated documentation files (the "Software"), 17 to deal in the Software without restriction, including without limitation 18 the rights to use, copy, modify, merge, publish, distribute, sublicense, 19 and/or sell copies of the Software, and to permit persons to whom the 20 Software is furnished to do so, subject to the following conditions: 21 22 The above copyright notice and this permission notice shall be included in 23 all copies or substantial portions of the Software. 24 25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 28 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 30 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 31 DEALINGS IN THE SOFTWARE. 32 ******************************************************************/ 33 34 #ifndef KWD_KDECORATION_PLUGINS_H 35 #define KWD_KDECORATION_PLUGINS_H 36 37 // 38 // This header file is internal. I mean it. 39 // 40 41 42 #include <QtGui/QWidget> 43 #include <ksharedconfig.h> 44 45 #include "kdecoration.h" 46 47 class KLibrary; 48 class KDecoration; 49 class KDecorationBridge; 50 class KDecorationFactory; 51 52 namespace KWD 53 { 54 55 class KDecorationPlugins 56 : public KDecorationProvides 57 { 58 public: 59 KDecorationPlugins(const KSharedConfigPtr &cfg); 60 virtual ~KDecorationPlugins(); 61 bool loadPlugin( QString name ); 62 void destroyPreviousPlugin(); 63 KDecorationFactory* factory(); 64 KDecoration* createDecoration( KDecorationBridge* ); 65 QString currentPlugin(); 66 bool reset( unsigned long changed ); // returns true if decorations need to be recreated 67 protected: 68 virtual void error( const QString& error_msg ); 69 QString defaultPlugin; // FRAME normalne protected? 70 private: 71 KDecorationFactory* (*create_ptr)(); 72 KLibrary *library; 73 KDecorationFactory* fact; 74 KLibrary *old_library; 75 KDecorationFactory* old_fact; 76 QString pluginStr; 77 KSharedConfigPtr config; 78 }; 79 80 /* 81 82 Plugins API: 83 KDecorationFactory* create_factory(); - called once after loading 84 85 */ 86 } 87 88 /** @} */ 89 90 #endif 91