Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Geyer <blueice@fobos.de>2012-08-16 00:47:41 +0400
committerFlorian Geyer <blueice@fobos.de>2012-08-18 19:33:41 +0400
commitde1a94ff614e8d618ba26a6410611606ab3a5cbb (patch)
treee4e5e77fb1377ab5d18751d7ea72d6b78819cace /src/core/TimeDelta.h
parent6c695e3fd0d73a0433d71589c6ba803b98b89573 (diff)
Add presets for expire date.
Closes #44
Diffstat (limited to 'src/core/TimeDelta.h')
-rw-r--r--src/core/TimeDelta.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/core/TimeDelta.h b/src/core/TimeDelta.h
new file mode 100644
index 000000000..c8fa9fd0c
--- /dev/null
+++ b/src/core/TimeDelta.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 Felix Geyer <debfx@fobos.de>
+ *
+ * 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 or (at your option)
+ * version 3 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef KEEPASSX_TIMEDELTA_H
+#define KEEPASSX_TIMEDELTA_H
+
+#include <QtCore/QMetaType>
+
+class QDateTime;
+class TimeDelta;
+
+QDateTime operator+(const QDateTime& dateTime, const TimeDelta& delta);
+
+class TimeDelta
+{
+public:
+ static TimeDelta fromDays(int days);
+ static TimeDelta fromMonths(int months);
+ static TimeDelta fromYears(int years);
+
+ TimeDelta();
+ TimeDelta(int days, int months, int years);
+
+ int getDays() const;
+ int getMonths() const;
+ int getYears() const;
+
+private:
+ int m_days;
+ int m_months;
+ int m_years;
+};
+
+Q_DECLARE_METATYPE(TimeDelta)
+
+#endif // KEEPASSX_TIMEDELTA_H