Skip to content

Commit 269bfe7

Browse files
committed
Metadata class shell
1 parent 18478ab commit 269bfe7

File tree

5 files changed

+293
-0
lines changed

5 files changed

+293
-0
lines changed

python/core/core.sip

+2
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@
276276
%Include layertree/qgslayertreeregistrybridge.sip
277277
%Include layertree/qgslayertreeutils.sip
278278

279+
%Include metadata/qgslayermetadata.sip
280+
279281
%Include processing/qgsprocessingalgorithm.sip
280282
%Include processing/qgsprocessingcontext.sip
281283
%Include processing/qgsprocessingfeedback.sip
+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/metadata/qgslayermetadata.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
class QgsLayerMetadata
13+
{
14+
15+
%TypeHeaderCode
16+
#include "qgslayermetadata.h"
17+
%End
18+
public:
19+
20+
QgsLayerMetadata();
21+
22+
virtual ~QgsLayerMetadata();
23+
24+
25+
QString identifier() const;
26+
%Docstring
27+
:rtype: str
28+
%End
29+
void setIdentifier( const QString &identifier );
30+
31+
QString parentIdentifier() const;
32+
%Docstring
33+
Returns an empty string if no parent identifier is set.
34+
:rtype: str
35+
%End
36+
37+
38+
void setParentIdentifier( const QString &parentIdentifier );
39+
40+
QString type() const;
41+
%Docstring
42+
:rtype: str
43+
%End
44+
void setType( const QString &type );
45+
46+
QString title() const;
47+
%Docstring
48+
:rtype: str
49+
%End
50+
void setTitle( const QString &title );
51+
52+
QString abstract() const;
53+
%Docstring
54+
:rtype: str
55+
%End
56+
void setAbstract( const QString &abstract );
57+
58+
QString fees() const;
59+
%Docstring
60+
Returns an empty string if no fees are set.
61+
:rtype: str
62+
%End
63+
void setFees( const QString &fees );
64+
65+
QStringList constraints() const;
66+
%Docstring
67+
:rtype: list of str
68+
%End
69+
void setConstraints( const QStringList &constraints );
70+
71+
QStringList rights() const;
72+
%Docstring
73+
:rtype: list of str
74+
%End
75+
void setRights( const QStringList &rights );
76+
77+
QString encoding() const;
78+
%Docstring
79+
Returns an empty string if no encoding is set.
80+
:rtype: str
81+
%End
82+
void setEncoding( const QString &encoding );
83+
84+
};
85+
86+
/************************************************************************
87+
* This file has been generated automatically from *
88+
* *
89+
* src/core/metadata/qgslayermetadata.h *
90+
* *
91+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
92+
************************************************************************/

src/core/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ SET(QGIS_CORE_SRCS
7171
layertree/qgslayertreeutils.cpp
7272
layertree/qgslayertree.cpp
7373

74+
metadata/qgslayermetadata.cpp
75+
7476
auth/qgsauthcertutils.cpp
7577
auth/qgsauthconfig.cpp
7678
auth/qgsauthcrypto.cpp
@@ -855,6 +857,8 @@ SET(QGIS_CORE_HDRS
855857
composer/qgscomposertexttable.h
856858
composer/qgspaperitem.h
857859

860+
metadata/qgslayermetadata.h
861+
858862
processing/qgsprocessingalgorithm.h
859863
processing/qgsprocessingcontext.h
860864
processing/qgsprocessingutils.h
+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/***************************************************************************
2+
qgslayermetadata.cpp
3+
--------------------
4+
begin : April 2017
5+
copyright : (C) 2017 by Nyall Dawson
6+
email : nyall dot dawson at gmail dot com
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#include "qgslayermetadata.h"
19+
20+
QString QgsLayerMetadata::identifier() const
21+
{
22+
return mIdentifier;
23+
}
24+
25+
void QgsLayerMetadata::setIdentifier( const QString &identifier )
26+
{
27+
mIdentifier = identifier;
28+
}
29+
30+
QString QgsLayerMetadata::parentIdentifier() const
31+
{
32+
return mParentIdentifier;
33+
}
34+
35+
void QgsLayerMetadata::setParentIdentifier( const QString &parentIdentifier )
36+
{
37+
mParentIdentifier = parentIdentifier;
38+
}
39+
40+
QString QgsLayerMetadata::type() const
41+
{
42+
return mType;
43+
}
44+
45+
void QgsLayerMetadata::setType( const QString &type )
46+
{
47+
mType = type;
48+
}
49+
50+
QString QgsLayerMetadata::title() const
51+
{
52+
return mTitle;
53+
}
54+
55+
void QgsLayerMetadata::setTitle( const QString &title )
56+
{
57+
mTitle = title;
58+
}
59+
60+
QString QgsLayerMetadata::abstract() const
61+
{
62+
return mAbstract;
63+
}
64+
65+
void QgsLayerMetadata::setAbstract( const QString &abstract )
66+
{
67+
mAbstract = abstract;
68+
}
69+
70+
QString QgsLayerMetadata::fees() const
71+
{
72+
return mFees;
73+
}
74+
75+
void QgsLayerMetadata::setFees( const QString &fees )
76+
{
77+
mFees = fees;
78+
}
79+
80+
QStringList QgsLayerMetadata::constraints() const
81+
{
82+
return mConstraints;
83+
}
84+
85+
void QgsLayerMetadata::setConstraints( const QStringList &constraints )
86+
{
87+
mConstraints = constraints;
88+
}
89+
90+
QStringList QgsLayerMetadata::rights() const
91+
{
92+
return mRights;
93+
}
94+
95+
void QgsLayerMetadata::setRights( const QStringList &rights )
96+
{
97+
mRights = rights;
98+
}
99+
100+
QString QgsLayerMetadata::encoding() const
101+
{
102+
return mEncoding;
103+
}
104+
105+
void QgsLayerMetadata::setEncoding( const QString &encoding )
106+
{
107+
mEncoding = encoding;
108+
}

src/core/metadata/qgslayermetadata.h

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/***************************************************************************
2+
qgslayermetadata.h
3+
-------------------
4+
begin : April 2017
5+
copyright : (C) 2017 by Nyall Dawson
6+
email : nyall dot dawson at gmail dot com
7+
***************************************************************************/
8+
9+
/***************************************************************************
10+
* *
11+
* This program is free software; you can redistribute it and/or modify *
12+
* it under the terms of the GNU General Public License as published by *
13+
* the Free Software Foundation; either version 2 of the License, or *
14+
* (at your option) any later version. *
15+
* *
16+
***************************************************************************/
17+
18+
#ifndef QGSLAYERMETADATA_H
19+
#define QGSLAYERMETADATA_H
20+
21+
#include "qgis.h"
22+
#include "qgis_core.h"
23+
24+
class CORE_EXPORT QgsLayerMetadata
25+
{
26+
public:
27+
28+
QgsLayerMetadata() = default;
29+
30+
virtual ~QgsLayerMetadata() = default;
31+
32+
33+
QString identifier() const;
34+
void setIdentifier( const QString &identifier );
35+
36+
/**
37+
* Returns an empty string if no parent identifier is set.
38+
*/
39+
QString parentIdentifier() const;
40+
41+
42+
void setParentIdentifier( const QString &parentIdentifier );
43+
44+
QString type() const;
45+
void setType( const QString &type );
46+
47+
QString title() const;
48+
void setTitle( const QString &title );
49+
50+
QString abstract() const;
51+
void setAbstract( const QString &abstract );
52+
53+
/**
54+
* Returns an empty string if no fees are set.
55+
*/
56+
QString fees() const;
57+
void setFees( const QString &fees );
58+
59+
QStringList constraints() const;
60+
void setConstraints( const QStringList &constraints );
61+
62+
QStringList rights() const;
63+
void setRights( const QStringList &rights );
64+
65+
/**
66+
* Returns an empty string if no encoding is set.
67+
*/
68+
QString encoding() const;
69+
void setEncoding( const QString &encoding );
70+
71+
private:
72+
73+
QString mIdentifier;
74+
QString mParentIdentifier;
75+
QString mType;
76+
QString mTitle;
77+
QString mAbstract;
78+
QString mFees;
79+
QStringList mConstraints;
80+
QStringList mRights;
81+
QString mEncoding;
82+
83+
84+
85+
};
86+
87+
#endif // QGSLAYERMETADATA_H

0 commit comments

Comments
 (0)