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