libtdepim

designerfields.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
5  Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #ifndef KPIM_DESIGNERFIELDS_H
23 #define KPIM_DESIGNERFIELDS_H
24 
25 #include <tdelocale.h>
26 
27 #include <tqmap.h>
28 #include <tqpair.h>
29 #include <tqstringlist.h>
30 
31 #include <tdemacros.h>
32 
33 namespace KPIM {
34 
35 class TDE_EXPORT DesignerFields : public TQWidget
36 {
37  TQ_OBJECT
38 
39  public:
40  DesignerFields( const TQString &uiFile, TQWidget *parent,
41  const char *name = 0 );
42 
43  class Storage
44  {
45  public:
46  virtual ~Storage() {}
47 
48  virtual TQStringList keys() = 0;
49  virtual TQString read( const TQString &key ) = 0;
50  virtual void write( const TQString &key, const TQString &value ) = 0;
51  };
52 
53  void load( Storage * );
54  void save( Storage * );
55 
56  void setReadOnly( bool readOnly );
57 
58  TQString identifier() const;
59  TQString title() const;
60 
61  signals:
62  void modified();
63 
64  private:
65  void initGUI( const TQString& );
66 
67  TQMap<TQString, TQWidget *> mWidgets;
68  TQValueList<TQWidget *> mDisabledWidgets;
69  TQString mTitle;
70  TQString mIdentifier;
71 };
72 
73 }
74 
75 #endif
TDEPIM classes for drag and drop of mails.