summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/plugin.cpp
Unidiff
Diffstat (limited to 'noncore/styles/liquid/plugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/plugin.cpp108
1 files changed, 95 insertions, 13 deletions
diff --git a/noncore/styles/liquid/plugin.cpp b/noncore/styles/liquid/plugin.cpp
index d9aa8ef..f149c29 100644
--- a/noncore/styles/liquid/plugin.cpp
+++ b/noncore/styles/liquid/plugin.cpp
@@ -1,29 +1,111 @@
1#include "liquid.h" 1#include "liquid.h"
2#include "liquidset.h"
3#include "plugin.h"
2 4
3 5
4extern "C" { 6
5 QStyle* allocate ( ); 7LiquidInterface::LiquidInterface ( ) : ref ( 0 )
6 int minor_version ( ); 8{
7 int major_version ( ); 9}
8 const char *description ( ); 10
11LiquidInterface::~LiquidInterface ( )
12{
13}
14
15QStyle *LiquidInterface::create ( )
16{
17 return new LiquidStyle ( );
18}
19
20QString LiquidInterface::name ( )
21{
22 return QObject::tr( "Liquid", "name" );
23}
24
25QString LiquidInterface::description ( )
26{
27 return QObject::tr( "High Performance Liquid style by Mosfet", "description" );
28}
29
30QCString LiquidInterface::key ( )
31{
32 return QCString ( "liquid" );
33}
34
35unsigned int LiquidInterface::version ( )
36{
37 return 100; // 1.0.0 (\d+.\d.\d)
38}
39
40QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
41{
42 static LiquidSettingsInterface *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 LiquidSettingsInterface ( );
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( LiquidInterface )
9} 65}
10 66
11QStyle* allocate ( ) 67
68LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
69{
70 m_widget = 0;
71}
72
73LiquidSettingsInterface::~LiquidSettingsInterface ( )
12{ 74{
13 return new LiquidStyle ( ); 75}
76
77QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
78{
79 m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
80
81 return m_widget;
14} 82}
15 83
16int minor_version ( ) 84bool LiquidSettingsInterface::accept ( )
17{ 85{
18 return 0; 86 if ( !m_widget )
87 return false;
88
89 return m_widget-> writeConfig ( );
19} 90}
20 91
21int major_version ( ) 92void LiquidSettingsInterface::reject ( )
22{ 93{
23 return 1;
24} 94}
25 95
26const char *description ( ) 96QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
27{ 97{
28 return "High Performance Liquid"; 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;
29} 110}
111