1 /*
2     This file is part of kdepim.
3 
4     Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5 
6     This library is free software; you can redistribute it and/or
7     modify it under the terms of the GNU Library General Public
8     License as published by the Free Software Foundation; either
9     version 2 of the License, or (at your option) any later version.
10 
11     This library 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 GNU
14     Library General Public License for more details.
15 
16     You should have received a copy of the GNU Library General Public License
17     along with this library; see the file COPYING.LIB.  If not, write to
18     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19     Boston, MA 02110-1301, USA.
20 */
21 #ifndef KODE_LICENSE_H
22 #define KODE_LICENSE_H
23 
24 #include <kode_export.h>
25 
26 #include <QtCore/QString>
27 
28 namespace KODE {
29 
30 /**
31  * @brief Represent a license clause.
32  * Use this class to setup a license clause for your generated file.
33  *
34  * @author Cornelius Schumacher <schumacher@kde.org>
35  */
36 class KODE_EXPORT License
37 {
38   public:
39     /**
40      * Possible types of licenses
41      * @li GPL  - The GNU General Public License.
42      * @li LGPL - The GNU Lesser/Library General Public License.
43      * @li BSD  - Berkeley Software Distribution
44      * @li GeneratedNoRestriction - Generated code with no restrictions.
45      */
46     enum Type {
47        GPL,
48        LGPL,
49        BSD,
50        GeneratedNoRestriction,
51        NoLicense
52     };
53 
54     /**
55      * Creates a new license.
56      */
57     License();
58 
59     /**
60      * Create a new license of the given @param type.
61      */
62     License( Type type );
63 
64     /**
65      * Creates a new license from @param other.
66      */
67     License( const License &other );
68 
69     /**
70      * Destroys the license.
71      */
72     ~License();
73 
74     /**
75      * Assignment operator.
76      */
77     License& operator=( const License &other );
78 
79     /**
80      * Sets whether a Qt expection should be appended to
81      * the license statement.
82      *
83      * This is only useful for Qt3 based code.
84      */
85     void setQtException( bool useQtException );
86 
87     /**
88      * Returns the textual presentation of the license.
89      */
90     QString text() const;
91 
92   private:
93     class Private;
94     Private *d;
95 };
96 
97 }
98 
99 #endif
100