kitchensync

configgui.h
1 /*
2  This file is part of KitchenSync.
3 
4  Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19  USA.
20 */
21 #ifndef CONFIGGUI_H
22 #define CONFIGGUI_H
23 
24 #include <libqopensync/member.h>
25 
26 #include <tqwidget.h>
27 
28 class TQBoxLayout;
29 class KLineEdit;
30 class TQTextEdit;
31 
32 class ConfigGui : public TQWidget
33 {
34  public:
35  ConfigGui( const QSync::Member &, TQWidget *parent );
36 
37  class Factory
38  {
39  public:
40  static ConfigGui *create( const QSync::Member &, TQWidget *parent );
41  };
42 
43  void setInstanceName( const TQString & );
44  TQString instanceName() const;
45 
46  virtual void load( const TQString &xml ) = 0;
47  virtual TQString save() const = 0;
48 
49  QSync::Member member() const { return mMember; }
50 
51  TQBoxLayout *topLayout() const { return mTopLayout; }
52 
53  private:
54  QSync::Member mMember;
55 
56  TQBoxLayout *mTopLayout;
57  KLineEdit *mNameEdit;
58 };
59 
60 class ConfigGuiXml : public ConfigGui
61 {
62  public:
63  ConfigGuiXml( const QSync::Member &, TQWidget *parent );
64 
65  void load( const TQString & );
66  TQString save() const;
67 
68  private:
69  TQTextEdit *mTextEdit;
70 };
71 
72 #endif