00001 #include <qapplication.h> 00002 00003 #include "othemestyle.h" 00004 #include "themeset.h" 00005 #include "plugin.h" 00006 00007 00008 00009 ThemeInterface::ThemeInterface ( ) 00010 { 00011 m_widget = 0; 00012 } 00013 00014 ThemeInterface::~ThemeInterface ( ) 00015 { 00016 } 00017 00018 QStyle *ThemeInterface::style ( ) 00019 { 00020 return new OThemeStyle ( "" ); 00021 } 00022 00023 QString ThemeInterface::name ( ) const 00024 { 00025 return qApp-> translate ( "Styles", "Themed style" ); 00026 } 00027 00028 QString ThemeInterface::description ( ) const 00029 { 00030 return qApp-> translate ( "Styles", "KDE2 theme compatible style engine" ); 00031 } 00032 00033 bool ThemeInterface::hasSettings ( ) const 00034 { 00035 return true; 00036 } 00037 00038 QWidget *ThemeInterface::create ( QWidget *parent, const char *name ) 00039 { 00040 m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" ); 00041 00042 return m_widget; 00043 } 00044 00045 bool ThemeInterface::accept ( ) 00046 { 00047 if ( !m_widget ) 00048 return false; 00049 00050 return m_widget-> writeConfig ( ); 00051 } 00052 00053 void ThemeInterface::reject ( ) 00054 { 00055 } 00056 00057 00058 QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 00059 { 00060 *iface = 0; 00061 00062 if ( uuid == IID_QUnknown ) 00063 *iface = this; 00064 else if ( uuid == IID_Style ) 00065 *iface = this; 00066 else if ( uuid == IID_StyleExtended ) 00067 *iface = this; 00068 else 00069 return QS_FALSE; 00070 00071 if ( *iface ) 00072 (*iface)-> addRef ( ); 00073 00074 return QS_OK; 00075 } 00076 00077 Q_EXPORT_INTERFACE() 00078 { 00079 Q_CREATE_INSTANCE( ThemeInterface ) 00080 } 00081 00082 00083
1.4.2