configgui.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 CONFIGGUI_H 00022 #define CONFIGGUI_H 00023 00024 #include <libqopensync/member.h> 00025 00026 #include <tqwidget.h> 00027 00028 class TQBoxLayout; 00029 class KLineEdit; 00030 class TQTextEdit; 00031 00032 class ConfigGui : public TQWidget 00033 { 00034 public: 00035 ConfigGui( const QSync::Member &, TQWidget *parent ); 00036 00037 class Factory 00038 { 00039 public: 00040 static ConfigGui *create( const QSync::Member &, TQWidget *parent ); 00041 }; 00042 00043 void setInstanceName( const TQString & ); 00044 TQString instanceName() const; 00045 00046 virtual void load( const TQString &xml ) = 0; 00047 virtual TQString save() const = 0; 00048 00049 QSync::Member member() const { return mMember; } 00050 00051 TQBoxLayout *topLayout() const { return mTopLayout; } 00052 00053 private: 00054 QSync::Member mMember; 00055 00056 TQBoxLayout *mTopLayout; 00057 KLineEdit *mNameEdit; 00058 }; 00059 00060 class ConfigGuiXml : public ConfigGui 00061 { 00062 public: 00063 ConfigGuiXml( const QSync::Member &, TQWidget *parent ); 00064 00065 void load( const TQString & ); 00066 TQString save() const; 00067 00068 private: 00069 TQTextEdit *mTextEdit; 00070 }; 00071 00072 #endif