pluginpicker.h
00001 /* 00002 This file is part of KitchenSync. 00003 00004 Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 #ifndef PLUGINPICKER_H 00022 #define PLUGINPICKER_H 00023 00024 #include <libqopensync/plugin.h> 00025 00026 #include <kdialogbase.h> 00027 #include <kwidgetlist.h> 00028 00029 #include <tqwidget.h> 00030 00031 class PluginItem : public KWidgetListItem 00032 { 00033 public: 00034 PluginItem( KWidgetList *, const QSync::Plugin & ); 00035 00036 QSync::Plugin plugin() const { return mPlugin; } 00037 00038 private: 00039 QSync::Plugin mPlugin; 00040 }; 00041 00042 class PluginPicker : public TQWidget 00043 { 00044 Q_OBJECT 00045 00046 00047 public: 00048 PluginPicker( TQWidget *parent ); 00049 00050 QSync::Plugin selectedPlugin() const; 00051 00052 signals: 00053 void selected(); 00054 00055 protected: 00056 void updatePluginList(); 00057 00058 private: 00059 KWidgetList *mPluginList; 00060 }; 00061 00062 class PluginPickerDialog : public KDialogBase 00063 { 00064 Q_OBJECT 00065 00066 00067 public: 00068 PluginPickerDialog( TQWidget *parent ); 00069 00070 QSync::Plugin selectedPlugin() const; 00071 00072 static QSync::Plugin getPlugin( TQWidget *parent ); 00073 00074 protected slots: 00075 void slotOk(); 00076 void slotCancel(); 00077 00078 private: 00079 PluginPicker *mPicker; 00080 }; 00081 00082 #endif