summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/plugin.cpp
Unidiff
Diffstat (limited to 'noncore/styles/theme/plugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/plugin.cpp110
1 files changed, 101 insertions, 9 deletions
diff --git a/noncore/styles/theme/plugin.cpp b/noncore/styles/theme/plugin.cpp
index b334357..4383693 100644
--- a/noncore/styles/theme/plugin.cpp
+++ b/noncore/styles/theme/plugin.cpp
@@ -1,19 +1,111 @@
1//#include <klocale.h>
2#include "othemestyle.h" 1#include "othemestyle.h"
2#include "themeset.h"
3#include "plugin.h"
3 4
4extern "C" 5
6
7ThemeInterface::ThemeInterface ( ) : ref ( 0 )
8{
9}
10
11ThemeInterface::~ThemeInterface ( )
12{
13}
14
15QStyle *ThemeInterface::create ( )
5{ 16{
6 QStyle * allocate() {
7 return new OThemeStyle ( "" ); 17 return new OThemeStyle ( "" );
8 } 18 }
9 int minor_version() { 19
10 return 0; 20QString ThemeInterface::name ( )
21{
22 return QObject::tr( "Themed style", "name" );
23}
24
25QString ThemeInterface::description ( )
26{
27 return QObject::tr( "KDE2 theme compatible style engine", "description" );
28}
29
30QCString ThemeInterface::key ( )
31{
32 return QCString ( "theme" );
33}
34
35unsigned int ThemeInterface::version ( )
36{
37 return 100; // 1.0.0 (\d+.\d.\d)
38}
39
40QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
41{
42 static ThemeSettingsInterface *setiface = 0;
43
44 *iface = 0;
45
46 if ( uuid == IID_QUnknown )
47 *iface = this;
48 else if ( uuid == IID_Style )
49 *iface = this;
50 else if ( uuid == IID_StyleSettings ) {
51 if ( !setiface )
52 setiface = new ThemeSettingsInterface ( );
53 *iface = setiface;
54 }
55
56 if ( *iface )
57 (*iface)-> addRef ( );
58
59 return QS_OK;
60}
61
62Q_EXPORT_INTERFACE()
63{
64 Q_CREATE_INSTANCE( ThemeInterface )
65}
66
67
68ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 )
69{
70 m_widget = 0;
71}
72
73ThemeSettingsInterface::~ThemeSettingsInterface ( )
74{
75}
76
77QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name )
78{
79 m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" );
80
81 return m_widget;
11 } 82 }
12 int major_version() { 83
13 return 1; 84bool ThemeSettingsInterface::accept ( )
85{
86 if ( !m_widget )
87 return false;
88
89 return m_widget-> writeConfig ( );
14 } 90 }
15 const char * description() { 91
16 return ( "Theme Style" ); 92void ThemeSettingsInterface::reject ( )
93{
17 } 94 }
95
96QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
97{
98 *iface = 0;
99
100
101 if ( uuid == IID_QUnknown )
102 *iface = this;
103 else if ( uuid == IID_StyleSettings )
104 *iface = this;
105
106 if ( *iface )
107 (*iface)-> addRef ( );
108
109 return QS_OK;
18} 110}
19 111