summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/mymoneycategory.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 22:38:03 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 22:38:03 +0000
commitdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch)
tree99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/mymoney/mymoneycategory.h
downloadkmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.tar.gz
kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.zip
Added kmymoney
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/mymoney/mymoneycategory.h')
-rw-r--r--kmymoney2/mymoney/mymoneycategory.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/kmymoney2/mymoney/mymoneycategory.h b/kmymoney2/mymoney/mymoneycategory.h
new file mode 100644
index 0000000..3f4babc
--- /dev/null
+++ b/kmymoney2/mymoney/mymoneycategory.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ mymoneycategory.h
+ -------------------
+ copyright : (C) 2000 by Michael Edwardes
+ email : mte@users.sourceforge.net
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef MYMONEYCATEGORY_H
+#define MYMONEYCATEGORY_H
+
+// ----------------------------------------------------------------------------
+// QT Includes
+
+#include <qstring.h>
+#include <qstringlist.h>
+
+/**
+ * @deprecated This class represents an Income or Expense category. Please don't
+ * use it anymore, as it will be removed sooner or later.
+ */
+class MyMoneyCategory {
+ bool m_income; // if false, m_income == expense
+ QString m_name;
+ QStringList m_minorCategories;
+
+ friend QDataStream &operator<<(QDataStream &, MyMoneyCategory &);
+ friend QDataStream &operator>>(QDataStream &, MyMoneyCategory &);
+
+public:
+ MyMoneyCategory();
+ MyMoneyCategory(const bool income, const QString name);
+ MyMoneyCategory(const bool income, const QString name, QStringList minors);
+ ~MyMoneyCategory();
+
+ // Simple get operations
+ QString name(void) { return m_name; }
+ QStringList& minorCategories(void) { return m_minorCategories; }
+
+ // Simple set operations
+ bool isIncome(void) { return m_income; }
+ void setIncome(const bool val) { m_income = val; }
+ void setName(const QString val) { m_name = val; }
+
+ bool setMinorCategories(QStringList values);
+ bool addMinorCategory(const QString val);
+ bool removeMinorCategory(const QString val);
+ bool renameMinorCategory(const QString oldVal, const QString newVal);
+ bool addMinorCategory(QStringList values);
+ bool removeAllMinors(void);
+ QString firstMinor(void);
+
+ void clear(void);
+
+ // Copy constructors
+ MyMoneyCategory(const MyMoneyCategory&);
+ MyMoneyCategory& operator = (const MyMoneyCategory&);
+};
+
+#endif