summaryrefslogtreecommitdiffabout
path: root/kaddressbook/details/look_basic.h
Unidiff
Diffstat (limited to 'kaddressbook/details/look_basic.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/details/look_basic.h134
1 files changed, 134 insertions, 0 deletions
diff --git a/kaddressbook/details/look_basic.h b/kaddressbook/details/look_basic.h
new file mode 100644
index 0000000..7e8baff
--- a/dev/null
+++ b/kaddressbook/details/look_basic.h
@@ -0,0 +1,134 @@
1/*
2 This file is part of KAddressBook.
3 Copyright (c) 1996-2002 Mirko Boehm <mirko@kde.org>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution.
22*/
23
24#ifndef LOOK_KABBASIC_H
25#define LOOK_KABBASIC_H
26
27#include <kabc/addressbook.h>
28#include <qvbox.h>
29
30class KConfig;
31
32/**
33 This is a pure virtual base class that defines the
34 interface for how to display and change entries of
35 the KDE addressbook.
36
37 This basic widget does not show anything in its client space.
38 Derive it and implement its look and how the user may edit the
39 entry.
40
41 The paintEvent() has to paint the whole widget, since repaint()
42 calls will not delete the widgets background.
43 */
44class KABBasicLook : public QVBox
45{
46 Q_OBJECT
47
48 public:
49 /**
50 The constructor.
51 */
52 KABBasicLook( QWidget *parent = 0, const char *name = 0 );
53
54 /**
55 Set the entry. It will be displayed automatically.
56 */
57 virtual void setAddressee( const KABC::Addressee& addressee );
58
59 /**
60 Get the current entry.
61 */
62 virtual KABC::Addressee addressee();
63
64 /**
65 Configure the view from the configuration file.
66 */
67 virtual void restoreSettings( KConfig* );
68
69 /**
70 Save the view settings to the configuration file.
71 */
72 virtual void saveSettings( KConfig* );
73
74 /**
75 Retrieve read-write state.
76 */
77 bool isReadOnly() const;
78
79 signals:
80 /**
81 This signal is emitted when the user changed the entry.
82 */
83 void entryChanged();
84
85 /**
86 This signal indicates that the entry needs to be changed
87 immidiately in the database. This might be due to changes in
88 values that are available in menus.
89 */
90 void saveMe();
91
92 /**
93 The user acticated the email address displayed. This may happen
94 by, for example, clicking on the displayed mailto-URL.
95 */
96 void sendEmail( const QString &email );
97
98 /**
99 The user activated one of the displayed HTTP URLs. For example
100 by clicking on the displayed homepage address.
101 */
102 void browse( const QString &url );
103
104 public slots:
105 /**
106 Set read-write state.
107 */
108 virtual void setReadOnly( bool state );
109
110 private:
111 KABC::Addressee mAddressee;
112 bool mReadOnly;
113};
114
115class KABLookFactory
116{
117 public:
118 KABLookFactory( QWidget *parent = 0, const char *name = 0 );
119 virtual ~KABLookFactory();
120
121 virtual KABBasicLook *create() = 0;
122
123 /**
124 Overload this method to provide a one-liner description
125 for your look.
126 */
127 virtual QString description() = 0;
128
129 protected:
130 QWidget *mParent;
131 const char* mName;
132};
133
134#endif