aboutsummaryrefslogtreecommitdiffstats
path: root/typesystem.h
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-10-19 17:10:15 -0300
committerLuciano Miguel Wolf <luciano.wolf@indt.org.br>2009-10-21 16:34:20 -0300
commitac27d38d44bef714b08d8b675ae105ac41047bfa (patch)
treede5c420ebce75d8a1e9ecfab6e29024b0ed07f2c /typesystem.h
parentfa5c2fa99cd0dae464f3cfa6686e2a31f2684687 (diff)
improved AddedFunction struct with more informations;
extended ComplexTypeEntry with a list of AddedFunctions
Diffstat (limited to 'typesystem.h')
-rw-r--r--typesystem.h49
1 files changed, 44 insertions, 5 deletions
diff --git a/typesystem.h b/typesystem.h
index 80e5bfdc..8a8f7277 100644
--- a/typesystem.h
+++ b/typesystem.h
@@ -35,6 +35,7 @@ class Indentor;
class AbstractMetaType;
class QTextStream;
+class TypeEntry;
class EnumTypeEntry;
class FlagsTypeEntry;
@@ -443,13 +444,39 @@ typedef QList<FieldModification> FieldModificationList;
struct AddedFunction
{
- AddedFunction(QString signature, TypeEntry* returnType);
+
+ enum Access {
+ Private = 0x1,
+ Protected = 0x2,
+ Public = 0x3
+ };
+
+ // ArgumentPair.first: argument name
+ // ArgumentPair.second: default value
+ typedef QPair<QString, QString> ArgumentPair;
+
+ AddedFunction(QString signature, TypeEntry* returnType = 0);
QString name() const
{
return m_name;
}
+ void setAccess(Access access)
+ {
+ m_access = access;
+ }
+
+ Access access() const
+ {
+ return m_access;
+ }
+
+ void setReturnType(TypeEntry* returnType)
+ {
+ m_returnType = returnType;
+ }
+
TypeEntry* returnType() const
{
return m_returnType;
@@ -475,12 +502,9 @@ struct AddedFunction
return m_arguments;
}
- // ArgumentPair.first: argument name
- // ArgumentPair.second: default value
- typedef QPair<QString, QString> ArgumentPair;
-
private:
QString m_name;
+ Access m_access;
QList<QPair<ArgumentPair, const TypeEntry*> > m_arguments;
TypeEntry* m_returnType;
CodeSnipList m_codeSnips;
@@ -1289,6 +1313,7 @@ public:
ComplexTypeEntry *centry = new ComplexTypeEntry(name(), type());
centry->setInclude(include());
centry->setExtraIncludes(extraIncludes());
+ centry->setAddedFunctions(addedFunctions());
centry->setFunctionModifications(functionModifications());
centry->setFieldModifications(fieldModifications());
centry->setQObject(isQObject());
@@ -1338,6 +1363,19 @@ public:
}
FunctionModificationList functionModifications(const QString &signature) const;
+ AddedFunctionList addedFunctions() const
+ {
+ return m_addedFunctions;
+ }
+ void setAddedFunctions(const AddedFunctionList &addedFunctions)
+ {
+ m_addedFunctions = addedFunctions;
+ }
+ void addNewFunction(const AddedFunction &addedFunction)
+ {
+ m_addedFunctions << addedFunction;
+ }
+
FieldModification fieldModification(const QString &name) const;
void setFieldModifications(const FieldModificationList &mods)
{
@@ -1467,6 +1505,7 @@ public:
private:
+ AddedFunctionList m_addedFunctions;
FunctionModificationList m_functionMods;
FieldModificationList m_fieldMods;
QString m_package;