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