1st attempt at an initial import.
authorJamie Thompson <coding@jamie-thompson.co.uk>
Sun, 7 Aug 2011 01:24:08 +0000 (02:24 +0100)
committerJamie Thompson <coding@jamie-thompson.co.uk>
Sun, 7 Aug 2011 01:24:08 +0000 (02:24 +0100)
106 files changed:
.gitignore [new file with mode: 0644]
Attachment.cpp [new file with mode: 0644]
Attachment.h [new file with mode: 0644]
AttachmentCollection.cpp [new file with mode: 0644]
AttachmentCollection.h [new file with mode: 0644]
COPYING [new file with mode: 0644]
CellularRadio.cpp [new file with mode: 0644]
CellularRadio.h [new file with mode: 0644]
DBBackends/AllBackends.h [new file with mode: 0644]
DBBackends/DBBackends.cpp [new file with mode: 0644]
DBBackends/Fmms.cpp [new file with mode: 0644]
DBBackends/Fmms.h [new file with mode: 0644]
DBBackends/RtcomEventLogger.cpp [new file with mode: 0644]
DBBackends/RtcomEventLogger.h [new file with mode: 0644]
DBBackends/iDBBackend.h [new file with mode: 0644]
EventLogBackupManager.cpp [new file with mode: 0644]
EventLogBackupManager.h [new file with mode: 0644]
EventLogReindexer.cpp [new file with mode: 0644]
EventLogReindexer.h [new file with mode: 0644]
EventParsers/CSVSymbianEventLogParser.cpp [new file with mode: 0644]
EventParsers/CSVSymbianEventLogParser.h [new file with mode: 0644]
EventParsers/Factory.cpp [new file with mode: 0644]
EventParsers/Factory.h [new file with mode: 0644]
EventParsers/MMSParser.cpp [new file with mode: 0644]
EventParsers/MMSParser.h [new file with mode: 0644]
EventParsers/VMGEntities/Factory.h [new file with mode: 0644]
EventParsers/VMGEntities/SMSEntity.cpp [new file with mode: 0644]
EventParsers/VMGEntities/SMSEntity.h [new file with mode: 0644]
EventParsers/VMGEntities/VBody.cpp [new file with mode: 0644]
EventParsers/VMGEntities/VBody.h [new file with mode: 0644]
EventParsers/VMGEntities/VCalendar.cpp [new file with mode: 0644]
EventParsers/VMGEntities/VCalendar.h [new file with mode: 0644]
EventParsers/VMGEntities/VCard.cpp [new file with mode: 0644]
EventParsers/VMGEntities/VCard.h [new file with mode: 0644]
EventParsers/VMGEntities/VEnvelope.cpp [new file with mode: 0644]
EventParsers/VMGEntities/VEnvelope.h [new file with mode: 0644]
EventParsers/VMGEntities/VMGFactory.cpp [new file with mode: 0644]
EventParsers/VMGEntities/VMessage.cpp [new file with mode: 0644]
EventParsers/VMGEntities/VMessage.h [new file with mode: 0644]
EventParsers/VMGEntities/iReader.h [new file with mode: 0644]
EventParsers/VMGEntities/iWriter.h [new file with mode: 0644]
EventParsers/VMGParser.cpp [new file with mode: 0644]
EventParsers/VMGParser.h [new file with mode: 0644]
EventParsers/iEventParser.h [new file with mode: 0644]
EventPreventer.cpp [new file with mode: 0644]
EventPreventer.h [new file with mode: 0644]
EventProcessors/Hasher.cpp [new file with mode: 0644]
EventProcessors/Hasher.h [new file with mode: 0644]
EventProcessors/Writer.cpp [new file with mode: 0644]
EventProcessors/Writer.h [new file with mode: 0644]
EventProcessors/iEventProcessor.h [new file with mode: 0644]
EventTypes/EventFromFile.h [new file with mode: 0644]
EventTypes/EventFromFileList.h [new file with mode: 0644]
EventTypes/EventList.h [new file with mode: 0644]
EventTypes/PhoneCall.cpp [new file with mode: 0644]
EventTypes/PhoneCall.h [new file with mode: 0644]
EventTypes/RtcomEvent.cpp [new file with mode: 0644]
EventTypes/RtcomEvent.h [new file with mode: 0644]
EventTypes/SMS.cpp [new file with mode: 0644]
EventTypes/SMS.h [new file with mode: 0644]
EventTypes/iEvent.h [new file with mode: 0644]
NumberToNameLookup.cpp [new file with mode: 0644]
NumberToNameLookup.h [new file with mode: 0644]
Resources1.qrc [new file with mode: 0644]
Settings.cpp [new file with mode: 0644]
Settings.h [new file with mode: 0644]
SyncerThread.cpp [new file with mode: 0644]
SyncerThread.h [new file with mode: 0644]
Windows/BaseWindow.cpp [new file with mode: 0644]
Windows/BaseWindow.h [new file with mode: 0644]
Windows/DirectoryWindow.cpp [new file with mode: 0644]
Windows/DirectoryWindow.h [new file with mode: 0644]
Windows/ModeWindow.cpp [new file with mode: 0644]
Windows/ModeWindow.h [new file with mode: 0644]
Windows/ProgressWindow.cpp [new file with mode: 0644]
Windows/ProgressWindow.h [new file with mode: 0644]
Windows/RestoreAccountStateWindow.cpp [new file with mode: 0644]
Windows/RestoreAccountStateWindow.h [new file with mode: 0644]
Windows/RestoreCrashBackupWindow.cpp [new file with mode: 0644]
Windows/RestoreCrashBackupWindow.h [new file with mode: 0644]
Windows/TypesWindow.cpp [new file with mode: 0644]
Windows/TypesWindow.h [new file with mode: 0644]
dialog.ui [new file with mode: 0644]
iHashable.h [new file with mode: 0644]
main.cpp [new file with mode: 0644]
qtc_packaging/debian_fremantle/README [new file with mode: 0644]
qtc_packaging/debian_fremantle/changelog [new file with mode: 0644]
qtc_packaging/debian_fremantle/compat [new file with mode: 0644]
qtc_packaging/debian_fremantle/control [new file with mode: 0644]
qtc_packaging/debian_fremantle/copyright [new file with mode: 0644]
qtc_packaging/debian_fremantle/rules [new file with mode: 0644]
qtc_packaging/debian_harmattan/README [new file with mode: 0644]
qtc_packaging/debian_harmattan/changelog [new file with mode: 0644]
qtc_packaging/debian_harmattan/compat [new file with mode: 0644]
qtc_packaging/debian_harmattan/control [new file with mode: 0644]
qtc_packaging/debian_harmattan/copyright [new file with mode: 0644]
qtc_packaging/debian_harmattan/rules [new file with mode: 0644]
qwerkisync.desktop [new file with mode: 0644]
qwerkisync.png [new file with mode: 0644]
qwerkisync.pro [new file with mode: 0644]
qwerkisync.svg [new file with mode: 0644]
rcc/qrc_Resources1.cpp [new file with mode: 0644]
resources/phone.png [new file with mode: 0644]
resources/sphone.png [new file with mode: 0644]
ui_dialog.h [new file with mode: 0644]
welcome [deleted file]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..b90ef37
--- /dev/null
@@ -0,0 +1,12 @@
+
+/Build
+/moc
+/obj
+/Thumbs.db
+/Makefile
+/qtc_packaging/debian_fremantle/Thumbs.db
+*.user
+/resources/Thumbs.db
+*.deb
+*.changes
+/debian
\ No newline at end of file
diff --git a/Attachment.cpp b/Attachment.cpp
new file mode 100644 (file)
index 0000000..bb59411
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Attachment.h"
+
+#include <QCryptographicHash>
+#include <QDir>
+#include <QFile>
+#include <QTextStream>
+
+#include <stdexcept>
+
+#include <sys/mman.h>
+#include <fcntl.h>
+
+#include <rtcom-eventlogger/eventlogger-attach-iter.h>
+
+Attachment::Attachment(QString path, QString description) :
+       m_Path(path),
+       m_Description(description),
+       m_FileHandle(m_Path),
+       m_DeleteFileOnDestruction(true)
+{
+       if(m_FileHandle.open(QFile::WriteOnly | QFile::Unbuffered))
+       {
+               m_Stream = new QTextStream(&m_FileHandle);
+               if(m_Stream != NULL)
+               {
+                       m_Stream->setCodec("UTF8");
+               }
+               else
+                       throw std::runtime_error(QString("Unable to create attachment stream: '%1'").arg(m_Path).toStdString());
+       }
+       else
+               throw std::runtime_error(QString("Unable to open attachment file: '%1'. The reason was: %2").arg(m_Path).arg(m_FileHandle.errorString()).toStdString());
+}
+
+Attachment::~Attachment()
+{
+       if(m_Stream != NULL)
+               delete m_Stream;
+
+       m_FileHandle.close();
+
+       if(m_DeleteFileOnDestruction && m_Path.length() > 0)
+               QFile::remove(m_Path);
+}
+
+Attachment::Attachment(const _RTComElAttachment& attachment) :
+       m_Path(attachment.path),
+       m_Description(attachment.desc),
+       m_FileHandle(m_Path),
+       m_DeleteFileOnDestruction(attachment.id < 1) // Don't delete the file if we have a valid attachment ID
+{
+       if(m_FileHandle.open(QFile::ReadWrite))
+       {
+               m_Stream = new QTextStream(&m_FileHandle);
+               if(m_Stream != NULL)
+               {
+                       m_Stream->setCodec("UTF8");
+               }
+               else
+                       throw std::runtime_error(QString("Unable to create attachment stream: '%1'").arg(m_Path).toStdString());
+       }
+       else
+               throw std::runtime_error(QString("Unable to open attachment file: '%1'. The reason was: %2").arg(m_Path).arg(m_FileHandle.errorString()).toStdString());
+}
+
+RTComElAttachment * Attachment::toRTComAttachment() const
+{
+       RTComElAttachment *attachment(
+               rtcom_el_attachment_new(
+                       g_strdup(Path().toUtf8()),
+                       g_strdup(Description().toUtf8())));
+       return attachment;
+}
+
+void Attachment::freeRTComContents(RTComElAttachment &attachment)
+{
+       g_free(attachment.path);
+       attachment.path = NULL;
+
+       g_free(attachment.desc);
+       attachment.desc = NULL;
+}
+
+const uint Attachment::HashCode() const
+{
+       qDebug() << "Hashing attachment: " << Path();
+
+       QFile file(Path());
+       if(file.open(QFile::ReadOnly))
+       {
+               uchar *memory(file.map(0, file.size()));
+               if (memory)
+               {
+                       QByteArray data;
+                       data.fromRawData((char*)memory, file.size());
+                       uint hashcode = QCryptographicHash::hash(data, QCryptographicHash::Md5).toUInt();
+
+                       file.unmap(memory);
+
+                       return hashcode;
+               }
+               else
+                       throw std::runtime_error(QString("Unable to map attachment file: %1").arg(Path()).toStdString());
+       }
+       else
+               throw std::runtime_error(QString("Unable to open attachment file: '%1'. The reason was: %2").arg(m_Path).arg(m_FileHandle.errorString()).toStdString());
+}
+
+QDebug operator<<(QDebug dbg, Attachment& attachment)
+{
+       dbg.nospace() << "Path:\t" << attachment.Path() << "\n";
+       dbg.nospace() << "Desc:\t" << attachment.Description() << "\n";
+
+       return dbg;
+}
diff --git a/Attachment.h b/Attachment.h
new file mode 100644 (file)
index 0000000..dc8d707
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 ATTACHMENT_H
+#define ATTACHMENT_H
+
+#include <QDebug>
+#include <QFile>
+#include <QString>
+
+class _RTComElAttachment;
+typedef _RTComElAttachment RTComElAttachment;
+
+class QTextStream;
+
+#include "iHashable.h"
+
+class Attachment : public iHashable
+{
+public:
+       Attachment(const QString filename, const QString description);
+       ~Attachment();
+
+       Attachment(const RTComElAttachment &attachment);
+
+       const QString &Path() const { return m_Path; }
+       const QString &Description() const { return m_Description; }
+       QTextStream &Stream() const { return *m_Stream; }
+
+       RTComElAttachment * toRTComAttachment() const;
+       static void freeRTComContents(RTComElAttachment &attachment);
+
+       virtual const uint HashCode() const;
+void killStream()
+{
+       delete m_Stream;
+       m_Stream = NULL;
+}
+
+private:
+       void setPath(QString &path) { m_Path = path; }
+       void setDescription(QString &description) { m_Description = description; }
+       //void setStream(QTextStream &stream) { m_Stream = stream; }
+
+private:
+       QString m_Path;
+       QString m_Description;
+
+       QFile m_FileHandle;
+       QTextStream *m_Stream;
+
+       bool m_DeleteFileOnDestruction;
+};
+
+QDebug operator<<(QDebug dbg, Attachment& attachment);
+
+#endif // ATTACHMENT_H
diff --git a/AttachmentCollection.cpp b/AttachmentCollection.cpp
new file mode 100644 (file)
index 0000000..85267c9
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include <rtcom-eventlogger/eventlogger-attach-iter.h>
+#include <rtcom-eventlogger/event.h>
+
+#include "AttachmentCollection.h"
+
+#include <QHash>
+
+#include "Attachment.h"
+
+const uint AttachmentCollection::HashCode() const
+{
+       uint hashCode = qHash(size());
+
+       if(size() > 0)
+       {
+               foreach(QSharedPointer<Attachment> attachment, *this)
+               {
+                       qDebug() << attachment->Description();
+                       qDebug() << attachment->Path();
+                       hashCode ^= attachment->HashCode();
+               }
+       }
+       return hashCode;
+}
+
+GList * AttachmentCollection::toRTComAttachments() const
+{
+       GList *rattachments(NULL);
+
+       foreach(QSharedPointer<Attachment> attachment, *this)
+               rattachments = g_list_prepend(rattachments, attachment->toRTComAttachment());
+
+       return rattachments;
+}
+
+void AttachmentCollection::freeRTComContents(GList &attachments)
+{
+       for (GList *attachment(&attachments); NULL != attachment; attachment = attachment->next)
+       {
+               Attachment::freeRTComContents(*(RTComElAttachment*)attachment->data);
+               rtcom_el_free_attachment((RTComElAttachment*)attachment->data);
+       }
+
+       g_list_free (&attachments);
+}
diff --git a/AttachmentCollection.h b/AttachmentCollection.h
new file mode 100644 (file)
index 0000000..acabd1f
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 ATTACHMENTS_H
+#define ATTACHMENTS_H
+
+#include <QList>
+#include <QSharedPointer>
+
+#include "Attachment.h"
+
+#include "iHashable.h"
+
+class _GList;
+typedef struct _GList GList;
+
+class AttachmentCollection : public QList<QSharedPointer<Attachment> >, public iHashable
+{
+public:
+       AttachmentCollection() : QList<QSharedPointer<Attachment> >() {}
+       AttachmentCollection( const QList<QSharedPointer<Attachment> > other) : QList<QSharedPointer<Attachment> >(other) {}
+
+       GList *toRTComAttachments() const;
+       static void freeRTComContents(GList &attachments);
+
+       void append(Attachment *attachment)
+       {
+               QList<QSharedPointer<Attachment> >::append(QSharedPointer<Attachment>(attachment));
+       }
+
+       const uint HashCode() const;
+};
+
+#endif // ATTACHMENTS_H
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 3 of the License, or
+    (at your option) any later version.
+
+    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/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/CellularRadio.cpp b/CellularRadio.cpp
new file mode 100644 (file)
index 0000000..ad4bbd4
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "CellularRadio.h"
+
+#include <QDebug>
+
+#include <QtDBus>
+
+#include <stdexcept>
+
+const char * NOKIA_SERVICE_PHONE_SCC("com.nokia.phone.SSC");
+const char * NOKIA_PATH_PHONE_SCC("/com/nokia/phone/SSC");
+const char * NOKIA_IFACE_PHONE_SCC("com.nokia.phone.SSC");
+
+bool CellularRadio::CurrentState()
+{
+       QDBusInterface nokiaPhone(NOKIA_SERVICE_PHONE_SCC, NOKIA_PATH_PHONE_SCC, NOKIA_IFACE_PHONE_SCC, QDBusConnection::systemBus());
+       if (nokiaPhone.isValid())
+       {
+               QDBusReply<QString> isEnabledReply = nokiaPhone.call("get_modem_state");
+               if(isEnabledReply.isValid())
+               {
+                       bool isEnabled(isEnabledReply.value() == "online" || isEnabledReply.value() == "actvation_pending");
+                       qDebug() << (isEnabled ? "Enabled:\t\t" : "Not enabled:\t") << "Cellular";
+                       return isEnabled;
+               }
+               else
+                       qDebug() << isEnabledReply.error();
+       }
+       else
+               qDebug() << nokiaPhone.lastError();
+
+       throw std::runtime_error("Unable to query cellular modem state");
+}
+
+void CellularRadio::SetState(bool shouldRadioBeEnabled)
+{
+       QDBusInterface nokiaPhone(NOKIA_SERVICE_PHONE_SCC, NOKIA_PATH_PHONE_SCC, NOKIA_IFACE_PHONE_SCC, QDBusConnection::systemBus());
+       if (nokiaPhone.isValid())
+       {
+               QDBusReply<void> disableModemReply = nokiaPhone.call("set_radio", shouldRadioBeEnabled);
+
+               if(!disableModemReply.isValid())
+                       qDebug() << disableModemReply.error().message();
+       }
+       else
+               qDebug() << nokiaPhone.lastError().message();
+}
diff --git a/CellularRadio.h b/CellularRadio.h
new file mode 100644 (file)
index 0000000..d4a2fd6
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 CELLULARRADIO_H
+#define CELLULARRADIO_H
+
+class CellularRadio
+{
+public:
+       static void Enable() { return SetState(true); }
+       static void Disable() { return SetState(false); }
+       static void Toggle() { return SetState(!CurrentState()); }
+       static void SetState(bool shouldRadioBeEnabled);
+
+       static bool CurrentState();
+};
+
+#endif // CELLULARRADIO_H
diff --git a/DBBackends/AllBackends.h b/DBBackends/AllBackends.h
new file mode 100644 (file)
index 0000000..c9eb4ea
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 DBBACKENDS_ALLBACKENDS_H
+#define DBBACKENDS_ALLBACKENDS_H
+
+namespace EventProcessors { class iEventProcessor; }
+namespace EventTypes { class iEvent; }
+
+class NumberToNameLookup;
+class Settings;
+template <typename T1> class QList;
+
+namespace DBBackends
+{
+       class iDBBackend;
+
+       class AllBackends
+       {
+       public:
+               AllBackends(const Settings &settings);
+
+               const QList<iDBBackend *> & Backends() const;
+               void Process(EventProcessors::iEventProcessor &eventProcessor);
+               void Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup);
+
+       public:
+               const Settings &CurrentSettings() const { return m_Settings; }
+
+       private:
+               const Settings &m_Settings;
+       };
+}
+
+#endif // DBBACKENDS_ALLBACKENDS_H
diff --git a/DBBackends/DBBackends.cpp b/DBBackends/DBBackends.cpp
new file mode 100644 (file)
index 0000000..05762d2
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "AllBackends.h"
+
+#include "Fmms.h"
+#include "RtcomEventLogger.h"
+
+#include <QList>
+
+using namespace DBBackends;
+
+AllBackends::AllBackends(const Settings &settings) :
+       m_Settings(settings)
+{
+}
+
+const QList<iDBBackend *> & AllBackends::Backends() const
+{
+       const static QList<iDBBackend *> availableBackends(QList<iDBBackend *>()
+               << new RtcomEventLogger(CurrentSettings())
+               << new Fmms(CurrentSettings()));
+
+       return availableBackends;
+}
+
+void AllBackends::Process(EventProcessors::iEventProcessor &eventProcessor)
+{
+       foreach(iDBBackend *backend, Backends())
+               backend->Process(eventProcessor);
+}
+
+void AllBackends::Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup)
+{
+       foreach(iDBBackend *backend, Backends())
+               backend->Insert(event, numberToNameLookup);
+}
diff --git a/DBBackends/Fmms.cpp b/DBBackends/Fmms.cpp
new file mode 100644 (file)
index 0000000..38dbd4f
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Fmms.h"
+
+using namespace DBBackends;
+
+Fmms::Fmms(const Settings &settings) :
+       m_Settings(settings)
+{
+}
+
+Fmms::Fmms(const Settings &settings, const EventTypes::FmmsEvent &event) :
+       m_Settings(settings)
+{
+}
+
+void Fmms::Process(EventProcessors::iEventProcessor &eventProcessor)
+{
+
+}
+
+EventTypes::iEvent *const Fmms::CreateEvent(int &fevent, QList<void *> &fattachments)
+{
+       return 0;
+}
+
+void Fmms::Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup)
+{
+       return;
+}
diff --git a/DBBackends/Fmms.h b/DBBackends/Fmms.h
new file mode 100644 (file)
index 0000000..12c82e9
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 DBBACKENDS_FMMS_H
+#define DBBACKENDS_FMMS_H
+
+#include "iDBBackend.h"
+
+namespace EventTypes { class iEvent; class FmmsEvent; }
+class Settings;
+
+template <typename T1> class QList;
+
+namespace DBBackends
+{
+       class Fmms : public iDBBackend
+       {
+       public:
+               Fmms(const Settings &settings);
+               Fmms(const Settings &settings, const EventTypes::FmmsEvent &event);
+
+               virtual void Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup);
+               virtual void Process(EventProcessors::iEventProcessor &eventProcessor);
+
+       protected:
+               const Settings &CurrentSettings() const { return m_Settings; }
+
+       protected:
+               virtual EventTypes::iEvent *const CreateEvent(int &fevent, QList<void*> &fattachments);
+
+       private:
+               const Settings &m_Settings;
+       };
+}
+
+#endif // DBBACKENDS_FMMS_H
diff --git a/DBBackends/RtcomEventLogger.cpp b/DBBackends/RtcomEventLogger.cpp
new file mode 100644 (file)
index 0000000..2e1ee83
--- /dev/null
@@ -0,0 +1,331 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "RtcomEventLogger.h"
+
+#include "EventProcessors/iEventProcessor.h"
+#include "EventTypes/iEvent.h"
+#include "EventTypes/SMS.h"
+#include "Settings.h"
+
+#include <QDebug>
+
+#include <uuid/uuid.h>
+
+#include <rtcom-eventlogger/event.h>
+#include <rtcom-eventlogger/eventlogger.h>
+
+using namespace DBBackends;
+
+QDebug operator<<(QDebug, RTComElEvent &);
+QDebug operator<<(QDebug, RTComElAttachment &);
+QDebug operator<<(QDebug, GList &);
+QDebug operator<<(QDebug, QList<RTComElAttachment*> &);
+
+RtcomEventLogger::RtcomEventLogger(const Settings &settings) :
+       m_Settings(settings)
+{
+       RTComEl *el(rtcom_el_new());
+       if(NULL != el)
+       {
+               // Grab the service IDs we want to work with
+               m_ServiceIDs.insert(SERVICE_ID_CALL, rtcom_el_get_service_id(el, "RTCOM_EL_SERVICE_CALL"));
+               m_ServiceIDs.insert(SERVICE_ID_CHAT, rtcom_el_get_service_id(el, "RTCOM_EL_SERVICE_CHAT"));
+               m_ServiceIDs.insert(SERVICE_ID_SMS, rtcom_el_get_service_id(el, "RTCOM_EL_SERVICE_SMS"));
+               m_ServiceIDs.insert(SERVICE_ID_MMS, rtcom_el_get_service_id(el, "RTCOM_EL_SERVICE_MMS"));
+
+               // Remove any service IDs that weren't found
+               foreach(ServiceID serviceID, m_ServiceIDs.keys())
+                       if(m_ServiceIDs.value(serviceID) == -1)
+                               m_ServiceIDs.remove(serviceID);
+
+               g_object_unref(el);
+       }
+       else
+               qDebug() << "Failed to create event logger.";
+}
+
+RtcomEventLogger::RtcomEventLogger(const Settings &settings, const EventTypes::RtcomEvent &event) :
+       m_Settings(settings)
+{
+}
+
+void RtcomEventLogger::Process(EventProcessors::iEventProcessor &processor)
+{
+       // Initialise the event logger
+       RTComEl *el = rtcom_el_new();
+       if(NULL != el)
+       {
+               // Initialise a query
+               RTComElQuery *query = rtcom_el_query_new(el);
+               if(query != NULL)
+               {
+                       bool incoming = CurrentSettings().ShouldProcess( Settings::TYPE_RECIEVED, Settings::EVENTTYPE_SMS);
+                       bool outgoing = CurrentSettings().ShouldProcess( Settings::TYPE_SENT, Settings::EVENTTYPE_SMS);
+
+                       // Prepare it...
+                       bool prepared = false;
+                       if(incoming && outgoing)
+                       {
+                               prepared = rtcom_el_query_prepare(query,
+                                       "service-id",
+                                       m_ServiceIDs.value(SERVICE_ID_SMS),
+                                       RTCOM_EL_OP_EQUAL,
+
+                                       NULL);
+                       }
+                       else
+                       {
+                               prepared = rtcom_el_query_prepare(query,
+                                       "service-id",
+                                       m_ServiceIDs.value(SERVICE_ID_SMS),
+                                       RTCOM_EL_OP_EQUAL,
+
+                                       "outgoing",
+                                       incoming ? 0 : 1,
+                                       RTCOM_EL_OP_EQUAL,
+
+                                       NULL);
+                       }
+
+                       qDebug() << "SQL:\n" << rtcom_el_query_get_sql(query);
+
+                       if(prepared)
+                       {
+                               RTComElIter *it = rtcom_el_get_events(el, query);
+                               if(it != NULL)
+                               {
+                                       if(rtcom_el_iter_first(it))
+                                       {
+                                               int eventCount = 0;
+                                               qDebug() << "Getting event count...";
+                                               while(rtcom_el_iter_next(it))
+                                                       ++eventCount;
+
+                                               // Reset the iterator and grab the actual values
+                                               qDebug() << "Resetting iterator...";
+                                               g_object_unref(it);
+                                               it = rtcom_el_get_events(el, query);
+                                               if(it != NULL)
+                                               {
+                                                       if(rtcom_el_iter_first(it))
+                                                       {
+                                                               int idx = 0;
+                                                               qDebug() << "Getting events...";
+                                                               do
+                                                               {
+                                                                       ++idx;
+                                                                       qDebug() << "Event #" << idx;
+
+                                                                       RTComElEvent revent;
+                                                                       memset(&revent, 0, sizeof(revent));
+
+                                                                       if(rtcom_el_iter_get_values (
+                                                                               it,
+                                                                               "id", &revent.fld_id,
+                                                                               "service-id", &revent.fld_service_id,
+                                                                               "start-time", &revent.fld_start_time,
+                                                                               "end-time", &revent.fld_end_time,
+                                                                               "local-uid", &revent.fld_local_uid,
+                                                                               "local-name", &revent.fld_local_name,
+                                                                               "remote-uid", &revent.fld_remote_uid,
+                                                                               "remote-name", &revent.fld_remote_name,
+                                                                               "is-read", &revent.fld_is_read,
+                                                                               "outgoing", &revent.fld_outgoing,
+                                                                               "free-text", &revent.fld_free_text,
+                                                                               NULL))
+                                                                       {
+                                                                               qDebug() << revent;
+
+                                                                               QList<RTComElAttachment *> rattachments;
+                                                                               RTComElAttachIter *at_it = rtcom_el_iter_get_attachments(it);
+                                                                               if(it != NULL)
+                                                                               {
+                                                                                       qDebug() << "Attachments OK";
+                                                                                       if(rtcom_el_attach_iter_first(at_it))
+                                                                                       {
+                                                                                               qDebug() << "Getting events...";
+
+                                                                                               do
+                                                                                               {
+                                                                                                       rattachments.append(rtcom_el_attach_iter_get(at_it));
+                                                                                                       qDebug() << "Attachment ID #" << rattachments.last()->id << endl;
+                                                                                                       qDebug() << "desc: " << rattachments.last()->desc << endl;
+                                                                                                       qDebug() << "path: " << rattachments.last()->path << endl;
+                                                                                               }while(rtcom_el_attach_iter_next(at_it));
+                                                                                       }
+                                                                               }
+
+                                                                               EventTypes::iEvent *const newEvent(CreateEvent(revent, rattachments));
+                                                                               processor.Process(*newEvent);
+                                                                               delete newEvent;
+
+                                                                               processor.EmitEventProcessed(idx, eventCount);
+                                                                       }
+
+                                                                       rtcom_el_event_free_contents(&revent);
+                                                               }
+                                                               while(rtcom_el_iter_next(it));
+                                                               qDebug() << "...all events retrieved.";
+                                                       }
+                                               }
+                                               else
+                                                       qDebug() << "Failed to reset iterator";
+                                       }
+                                       else
+                                               qDebug() << "Failed to start iterator";
+                               }
+                               else
+                                       qDebug() << "Failed to get iterator. Do you have any events?";
+                       }
+                       else
+                               qDebug() << "Failed to prepare the query.";
+
+                       g_object_unref(query);
+               }
+               else
+                       qDebug() << "Failed to create query.";
+
+               g_object_unref(el);
+       }
+       else
+               qDebug() << "Failed to create event logger.";
+}
+
+EventTypes::iEvent *const RtcomEventLogger::CreateEvent(RTComElEvent &revent, QList<RTComElAttachment*> &rattachments)
+{
+       //if(m_ServiceIDs.contains(SERVICE_ID_CALL) && revent.fld_service_id == m_ServiceIDs.value(SERVICE_ID_CALL))
+       //      return new EventTypes::Call(CurrentSettings(), revent, rattachments);
+
+       //if(m_ServiceIDs.contains(SERVICE_ID_CHAT) && revent.fld_service_id == m_ServiceIDs.value(SERVICE_ID_CHAT))
+       //      return new EventTypes::Chat(CurrentSettings(), revent, rattachments);
+
+       if(m_ServiceIDs.contains(SERVICE_ID_SMS) && revent.fld_service_id == m_ServiceIDs.value(SERVICE_ID_SMS))
+               return new EventTypes::SMS(CurrentSettings(), revent, rattachments);
+
+       //if(m_ServiceIDs.contains(SERVICE_ID_MMS) && revent.fld_service_id == m_ServiceIDs.value(SERVICE_ID_MMS))
+       //      return new EventTypes::MMS(CurrentSettings(), revent, rattachments);
+
+       return NULL;
+}
+
+void RtcomEventLogger::Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup)
+{
+       if(EventTypes::RtcomEvent *rtcomEvent = dynamic_cast<EventTypes::RtcomEvent *>(&event))
+       {
+               const uint UUID_STR_LEN(36);
+
+               int newEventID(0);
+               _RTComEl *el(rtcom_el_new());
+               if(NULL != el)
+               {
+                       // Convert our objects into RTCom structs
+                       RTComElEvent *revent(rtcomEvent->toRTComEvent(numberToNameLookup));
+                       GList *rattachments(event.Attachments().toRTComAttachments());
+
+                       GError *error(NULL);
+
+                       // Generate the headers for the event
+                       GHashTable *rheaders(g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free));
+                       uuid_t uuid;
+                       char key[UUID_STR_LEN + 1];
+                       uuid_generate_random(uuid);
+                       uuid_unparse(uuid, key);
+                       g_hash_table_insert(rheaders, g_strdup ("message-token"), key);
+                       qDebug() << "headers: " << rheaders;
+
+                       qDebug() << "Inserting event:";
+                       qDebug() << *revent;
+                       qDebug() << *rattachments;
+
+                       // Add the event
+                       newEventID = rtcom_el_add_event_full(el, revent, rheaders, rattachments, &error);
+                       qDebug() << "new id: " << newEventID;
+                       if(error != NULL)
+                       {
+                               qDebug() << "err: " << error->message;
+                               g_error_free(error);
+                       }
+
+                       // Release the attachments
+                       g_list_foreach (rattachments, (GFunc) rtcom_el_free_attachment, NULL);
+                       g_list_free (rattachments);
+
+                       rtcom_el_event_free_contents(revent);
+                       rtcom_el_event_free(revent);
+               }
+               else
+                       qDebug() << "Unable to initalise eventlogger for insertion.";
+
+               g_object_unref(el);
+       }
+
+       return;
+}
+
+QDebug operator<<(QDebug dbg, RTComElEvent &event)
+{
+       dbg.nospace() << "\tid:\t\t" << event.fld_id << "\n";
+       dbg.nospace() << "\tFolder:\t\t" << (event.fld_outgoing ? "Sent" : "Inbox") << "\n";
+       dbg.nospace() << "\tstart-time:\t" << QDateTime::fromTime_t(event.fld_start_time) << "\n";
+       dbg.nospace() << "\tend-time:\t\t" << QDateTime::fromTime_t(event.fld_end_time) << "\n";
+       //dbg.nospace() << "\tlocal-uid:\t" << event.fld_local_uid << "\n";
+       //dbg.nospace() << "\tlocal-name:\t" << event.fld_local_name << "\n";
+       dbg.nospace() << "\tremote-uid:\t" << event.fld_remote_uid << "\n";
+       dbg.nospace() << "\tremote-name:\t" << event.fld_remote_name << "\n";
+       dbg.nospace() << "\tis-read:\t\t" << (event.fld_is_read ? "true" : "false") << "\n";
+       dbg.nospace() << "\tfree-text:\t" << event.fld_free_text << "\n";
+       dbg.nospace() << "\tgroup-uid:\t" << event.fld_group_uid << "\n";
+
+       return dbg;
+}
+
+QDebug operator<<(QDebug dbg, RTComElAttachment &attachment)
+{
+       dbg.nospace() << "Event-id:\t" << attachment.event_id << "\n";
+       dbg.nospace() << "Path:\t" << attachment.path << "\n";
+       dbg.nospace() << "Desc:\t" << attachment.desc << "\n";
+
+       return dbg;
+}
+
+QDebug operator<<(QDebug dbg, GList &attachments)
+{
+       dbg.nospace() << "Attachments" << "\n";
+
+       for (GList *attachment(&attachments); NULL != attachment; attachment = attachment->next)
+       {
+               qDebug() << *(RTComElAttachment*)attachment->data;
+       }
+
+       dbg.nospace() << "\n";
+
+       return dbg;
+}
+
+QDebug operator<<(QDebug dbg, QList<RTComElAttachment *> &attachments)
+{
+       dbg.nospace() << "Attachments" << "\n";
+
+       foreach(RTComElAttachment *attachment, attachments)
+               dbg.nospace() << *attachment << "\n";
+
+       dbg.nospace() << "\n";
+
+       return dbg;
+}
diff --git a/DBBackends/RtcomEventLogger.h b/DBBackends/RtcomEventLogger.h
new file mode 100644 (file)
index 0000000..d99d4c4
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 DBBACKENDS_RTCOMEVENTLOGGER_H
+#define DBBACKENDS_RTCOMEVENTLOGGER_H
+
+#include "iDBBackend.h"
+
+class Settings;
+
+class _RTComElAttachment;
+typedef _RTComElAttachment RTComElAttachment;
+class _RTComElEvent;
+typedef _RTComElEvent RTComElEvent;
+
+template <typename T1> class QList;
+
+#include <QHash>
+
+namespace DBBackends
+{
+       class RtcomEventLogger : public iDBBackend
+       {
+       public:
+               RtcomEventLogger(const Settings &settings);
+               RtcomEventLogger(const Settings &settings, const EventTypes::RtcomEvent &event);
+
+               virtual void Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup);
+               virtual void Process(EventProcessors::iEventProcessor &eventProcessor);
+
+       protected:
+               const Settings &CurrentSettings() const { return m_Settings; }
+
+       protected:
+               virtual EventTypes::iEvent *const CreateEvent(RTComElEvent &revent, QList<RTComElAttachment*> &rattachments);
+
+       private:
+               const Settings &m_Settings;
+
+               enum ServiceID
+               {
+                       SERVICE_ID_CALL,
+                       SERVICE_ID_CHAT,
+                       SERVICE_ID_SMS,
+                       SERVICE_ID_MMS,
+                       SERVICE_ID_SIZE
+               };
+
+               QHash<ServiceID, int> m_ServiceIDs;
+       };
+}
+
+#endif // DBBACKENDS_RTCOMEVENTLOGGER_H
diff --git a/DBBackends/iDBBackend.h b/DBBackends/iDBBackend.h
new file mode 100644 (file)
index 0000000..841bd94
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 DBBACKENDS_IDBBACKEND_H
+#define DBBACKENDS_IDBBACKEND_H
+
+namespace EventProcessors { class iEventProcessor; }
+namespace EventTypes { class RtcomEvent; class iEvent; }
+class NumberToNameLookup;
+
+namespace DBBackends
+{
+       class iDBBackend
+       {
+       public:
+               virtual void Insert(EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup) =0;
+               //virtual uint Remove();
+
+               virtual void Process(EventProcessors::iEventProcessor &eventProcessor) =0;
+       };
+}
+
+#endif // DBBACKENDS_IDBBACKEND_H
diff --git a/EventLogBackupManager.cpp b/EventLogBackupManager.cpp
new file mode 100644 (file)
index 0000000..271b4cc
--- /dev/null
@@ -0,0 +1,283 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "EventLogBackupManager.h"
+#include "EventPreventer.h"
+
+#include <QtDebug>
+
+#include <QDateTime>
+#include <QDir>
+#include <QFile>
+#include <QStringList>
+#include <QtAlgorithms>
+
+#include <stdexcept>
+
+EventLogBackupManager::EventLogBackupManager(const Settings & currentSettings) :
+       m_kCurrentSettings(currentSettings)
+{
+       setBackupDirectoryPath("/home/user/MyDocs/backups/");
+       setDataDirectoryPath("/home/user/.rtcom-eventlogger/");
+       setCurrentBackupName(QString::number(QDateTime::currentDateTimeUtc().toTime_t()) + ".qsbackup/");
+       setMaxNumberOfBackups(3);
+       setLockFilename(".inuse");
+}
+
+EventLogBackupManager::~EventLogBackupManager()
+{
+}
+
+void copyFileInfoListRecusively(const QFileInfoList &sourceItems, const QString &sourcePath, const QString &destinationPath)
+{
+       foreach(QFileInfo entry, sourceItems)
+       {
+               QString entryStubFilePath(entry.absoluteFilePath().replace(QRegExp("^" + sourcePath), ""));
+               if(entry.isDir())
+               {
+                       if(!QDir().mkpath(destinationPath + entryStubFilePath))
+                               throw std::runtime_error(QString("Unable to make the directory: %1%2").arg(destinationPath).arg(entryStubFilePath).toLocal8Bit().constData());
+
+                       copyFileInfoListRecusively(
+                               QDir(entry.absoluteFilePath()).entryInfoList(
+                                       QDir::AllEntries | QDir::NoDotAndDotDot,
+                                       QDir::DirsFirst),
+                               sourcePath,
+                               destinationPath);
+               }
+               else
+                       if(!QFile(entry.absoluteFilePath()).copy(destinationPath + entryStubFilePath))
+                               throw std::runtime_error(QString("Unable to copy the file '%1'' to '%2%3'").arg(entry.absoluteFilePath()).arg(destinationPath).arg(entryStubFilePath).toLocal8Bit().constData());
+       }
+}
+
+void EventLogBackupManager::CreateBackup()
+{
+       PurgeOldBackups();
+
+       // Make the new directory
+       if(QDir().mkpath(CurrentBackupPath()))
+       {
+               try
+               {
+                       // Copy the data to it
+                       copyFileInfoListRecusively(
+                               QDir(DataDirectoryPath()).entryInfoList(
+                                       QStringList() << "*.db*" << "attachments" << "plugins",
+                                       QDir::AllEntries | QDir::NoDotAndDotDot,
+                                       QDir::DirsFirst),
+                               DataDirectoryPath(),
+                               CurrentBackupPath()
+                       );
+
+                       LockCurrentBackup();
+               }
+               catch(const std::runtime_error &exception)
+               {
+                       RemoveDirRecusively(CurrentBackupPath());
+               }
+       }
+       else
+               throw std::runtime_error(QString("Unable to create backup directory '%1'").arg(CurrentBackupPath()).toLocal8Bit().constData());
+}
+
+void EventLogBackupManager::RestoreBackup(const QString &backupPath)
+{
+       qDebug() << "Restoring backup: " << backupPath;
+
+       // Check backup is valid
+       EnsureBackupValid(backupPath);
+
+       // Remove old working-copy backups
+       {
+               RemoveDirRecusively(QFileInfo(DataDirectoryPath() + "/attachments.qsrestore"));
+               RemoveDirRecusively(QFileInfo(DataDirectoryPath() + "/plugins.qsrestore"));
+               foreach(QFileInfo entry, QDir(DataDirectoryPath()).entryInfoList(QStringList("*.db*.qsrestore")))
+                       QFile(entry.absoluteFilePath()).remove();
+       }
+
+       // Disable new events and try restoring the content
+       EventPreventer noEventsPlease(CurrentSettings());
+       noEventsPlease.DisableAccounts();
+       try
+       {
+               // Move the attachments out of the way and copy in from the backup
+               if(!QDir().rename(DataDirectoryPath() + "/attachments", DataDirectoryPath() + "/attachments.qsrestore"))
+                       throw std::runtime_error("");
+               copyFileInfoListRecusively(QDir(backupPath).entryInfoList(QStringList("attachments")), backupPath, DataDirectoryPath());
+
+               // Move the plugins out of the way and copy in from the backup
+               if(!QDir().rename(DataDirectoryPath() + "/plugins", DataDirectoryPath() + "/plugins.qsrestore"))
+                       throw std::runtime_error("");
+               copyFileInfoListRecusively(QDir(backupPath).entryInfoList(QStringList("plugins")), backupPath, DataDirectoryPath());
+
+               // Move the database files out of the way and copy in from the backup
+               foreach(QFileInfo entry, QDir(DataDirectoryPath()).entryInfoList(QStringList("*.db*")))
+                       QFile(entry.absoluteFilePath()).copy(DataDirectoryPath() + entry.fileName() + ".qsrestore");
+               foreach(QFileInfo entry, QDir(backupPath).entryInfoList(QStringList("*.db*")))
+                       QFile(entry.absoluteFilePath()).copy(DataDirectoryPath() + entry.fileName());
+
+               // Now all of the backup components have been restored, we can reenable the accounts safely
+               noEventsPlease.RestoreAccounts();
+
+               // ...and we can remove the working-copy backups
+               foreach(QFileInfo entry, QDir(DataDirectoryPath()).entryInfoList(QStringList("*.db*.qsrestore")))
+                       QFile(entry.absoluteFilePath()).remove();
+               RemoveDirRecusively(QFileInfo(DataDirectoryPath() + "/plugins.qsrestore"));
+               RemoveDirRecusively(QFileInfo(DataDirectoryPath() + "/attachments.qsrestore"));
+       }
+       catch(const std::runtime_error &exception)
+       {
+               // Remove the partially-restored data
+               foreach(QFileInfo entry, QDir(DataDirectoryPath()).entryInfoList(QStringList("*.db*.qsrestore")))
+                       QFile(entry.absoluteFilePath().remove(".qsrestore")).remove();
+               RemoveDirRecusively(QFileInfo(DataDirectoryPath() + "/plugins"));
+               RemoveDirRecusively(QFileInfo(DataDirectoryPath() + "/attachments"));
+
+               // Revert attachments
+               if(!QDir().rename(DataDirectoryPath() + "/attachments.qsrestore", DataDirectoryPath() + "/attachments"))
+                       throw std::runtime_error("");
+
+               // Revert plugins
+               if(!QDir().rename(DataDirectoryPath() + "/plugins.qsrestore", DataDirectoryPath() + "/plugins"))
+                       throw std::runtime_error("");
+
+               // Revert databases
+               foreach(QFileInfo entry, QDir(DataDirectoryPath()).entryInfoList(QStringList("*.db*.qsrestore")))
+                       QFile(entry.absoluteFilePath()).copy(DataDirectoryPath() + entry.fileName().remove(".qsrestore"));
+
+               // Now all of the working-copy components have been restored, we can reenable the accounts safely
+               noEventsPlease.RestoreAccounts();
+
+               // ..but the restoe still failed, so tell the caller about it.
+               throw;
+       }
+}
+
+void EventLogBackupManager::LockCurrentBackup()
+{
+       LockBackup(CurrentBackupPath());
+}
+
+void EventLogBackupManager::UnlockCurrentBackup()
+{
+       UnlockBackup(CurrentBackupPath());
+}
+
+void EventLogBackupManager::LockBackup(const QString &backupPath)
+{
+       qDebug() << "Locking backup: " << backupPath;
+
+       // Mark the backup as "in use" by touching a lockfile.
+       QFile lockfile(backupPath + LockFilename());
+       lockfile.open(QIODevice::WriteOnly);
+}
+
+void EventLogBackupManager::UnlockBackup(const QString &backupPath)
+{
+       qDebug() << "Unlocking backup: " << backupPath;
+
+       QFile lockfile(QString("%1/%2").arg(backupPath).arg(LockFilename()));
+       lockfile.remove();
+}
+
+// Ideally would be local to PurgeOldBackups, but template arguments have to
+// refer to types with external linkage. Roll on C++0x!
+class OrderByTimestamp
+{
+public:
+       inline bool operator()(const QFileInfo &a, QFileInfo &b) const
+       {
+               return b.created() < a.created();
+       }
+};
+
+void EventLogBackupManager::PurgeOldBackups()
+{
+       // Enumerate backups directory
+       QFileInfoList existingBackups(CurrentBackups(false));
+
+       // If more than maximum number of backups found, delete the oldest
+       if((uint)existingBackups.count() > MaxNumberOfBackups() - 1)
+       {
+               // This is important, so explicitly make sure the list is in the correct order
+               qSort(existingBackups.begin(), existingBackups.end(), OrderByTimestamp());
+
+               for(int i(0); i < existingBackups.count(); ++i)
+               {
+                       if(i < 2)
+                               qDebug() << existingBackups.value(i).absoluteFilePath();
+                       else
+                               RemoveDirRecusively(existingBackups.value(i));
+               }
+       }
+}
+
+const QFileInfoList EventLogBackupManager::CurrentBackups(bool lockedOnly)
+{
+       QFileInfoList existingBackups;
+       QDir backupDirectory(BackupDirectoryPath());
+       foreach(QFileInfo entry, backupDirectory.entryInfoList(QStringList("*.qsbackup"), QDir::AllEntries | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed))
+       {
+               // If we only want locked backups, then skip those without the lock file present...
+               if(lockedOnly && QDir(entry.absoluteFilePath()).entryInfoList(QStringList(LockFilename()), QDir::Hidden).count() == 0)
+               {
+                       qDebug() << "Ignoring unlocked backup: " << entry.absoluteFilePath();
+                       continue;
+               }
+
+               qDebug() << "Locked backup found: " << entry.absoluteFilePath();
+               existingBackups.append(QFileInfo(entry));
+       }
+
+       return existingBackups;
+}
+
+void EventLogBackupManager::RemoveDirRecusively(const QFileInfo &dirInfo)
+{
+       foreach(QFileInfo entry,
+                       QDir(dirInfo.absoluteFilePath()).entryInfoList(
+                               QDir::AllEntries | QDir::NoDotAndDotDot,
+                               QDir::DirsFirst))
+       {
+               if(entry.isDir())
+                       RemoveDirRecusively(entry);
+               else
+                       QDir().remove(entry.absoluteFilePath());
+       }
+
+       // Dir will be empty as we've removed all dirs and files...
+       QDir().rmdir(dirInfo.absoluteFilePath());
+}
+
+void EventLogBackupManager::EnsureBackupValid(const QString &backupPath)
+{
+       QString shortBackupPath(backupPath);
+       shortBackupPath.remove(BackupDirectoryPath());
+
+       bool oldDBPresent(QFile(backupPath + "/el.db").exists() && QFile(backupPath + "/el.db-journal").exists());
+       bool v1DBPresent(QFile(backupPath + "/el-v1.db").exists() && QFile(backupPath + "/el-v1.db-journal").exists());
+       if( !(oldDBPresent || v1DBPresent ) )
+               throw std::runtime_error(QString("The backup '%1' is missing the main event logger database.").arg(shortBackupPath).toLocal8Bit().constData());
+
+       if(!QDir(backupPath + "/attachments").exists())
+               throw std::runtime_error(QString("The backup '%1' is missing the attachments directory.").arg(shortBackupPath).toLocal8Bit().constData());
+
+       if(!QDir(backupPath + "/plugins").exists())
+               throw std::runtime_error(QString("The backup '%1' is missing the plugins directory.").arg(shortBackupPath).toLocal8Bit().constData());
+}
diff --git a/EventLogBackupManager.h b/EventLogBackupManager.h
new file mode 100644 (file)
index 0000000..5b035f3
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTLOGBACKUPMANAGER_H
+#define EVENTLOGBACKUPMANAGER_H
+
+class Settings;
+
+#include <QFileInfoList>
+#include <QString>
+
+class EventLogBackupManager
+{
+public:
+       EventLogBackupManager(const Settings & currentSettings);
+       ~EventLogBackupManager();
+
+       void CreateBackup();
+       void RestoreBackup(const QString &backup);
+
+       void LockCurrentBackup();
+       void UnlockCurrentBackup();
+
+       void LockBackup(const QString &backupPath);
+       void UnlockBackup(const QString &backupPath);
+
+       void PurgeOldBackups();
+       void EnsureBackupValid(const QString &backupPath);
+
+public:
+       const QString & BackupDirectoryPath() const { return m_BackupDirectoryPath; }
+       void setBackupDirectoryPath(const QString & backupDirectoryPath) { m_BackupDirectoryPath = backupDirectoryPath; }
+       const QString & DataDirectoryPath() const { return m_DataDirectoryPath; }
+       void setDataDirectoryPath(const QString & dataDirectoryPath) { m_DataDirectoryPath = dataDirectoryPath; }
+       const QString & CurrentBackupName() const { return m_CurrentBackupName; }
+       void setCurrentBackupName(const QString & currentBackupName) { m_CurrentBackupName = currentBackupName; }
+       const QString & LockFilename() const { return m_LockFilename; }
+       void setLockFilename(const QString & lockFilename) { m_LockFilename = lockFilename; }
+       const uint & MaxNumberOfBackups() const { return m_MaxNumberOfBackups; }
+       void setMaxNumberOfBackups(const uint maxNumberOfBackups) { m_MaxNumberOfBackups = maxNumberOfBackups; }
+       const QString CurrentBackupPath() const { return BackupDirectoryPath() + CurrentBackupName(); }
+       const QFileInfoList CurrentBackups(bool lockedOnly);
+       const Settings & CurrentSettings() const { return m_kCurrentSettings; }
+
+private:
+       void RemoveDirRecusively(const QFileInfo &dirInfo);
+
+private:
+       QString m_BackupDirectoryPath;
+       QString m_DataDirectoryPath;
+       QString m_CurrentBackupName;
+       QString m_LockFilename;
+       uint m_MaxNumberOfBackups;
+       const Settings & m_kCurrentSettings;
+};
+
+#endif // EVENTLOGBACKUPMANAGER_H
diff --git a/EventLogReindexer.cpp b/EventLogReindexer.cpp
new file mode 100644 (file)
index 0000000..a2978b3
--- /dev/null
@@ -0,0 +1,317 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include <QDebug>
+#include <QDir>
+#include <QPair>
+#include <QStringList>
+#include <QtSql/QSqlDatabase>
+#include <QtSql/QSqlQuery>
+#include <QVariant>
+
+#include <stdexcept>
+
+#include "EventLogReindexer.h"
+
+#define DB_LOC "/.rtcom-eventlogger/el-v1.db"
+
+EventLogReindexer::EventLogReindexer()
+{
+}
+
+void EventLogReindexer::Reindex()
+{
+       // Set up the database connection...
+       QSqlDatabase db(QSqlDatabase::addDatabase( "QSQLITE" ));
+
+       db.setDatabaseName( QDir::homePath() + DB_LOC );
+       if ( ! db.open() )
+       {
+               throw std::runtime_error("Cannot open database: Unable to establish database connection");
+       }
+       else
+       {
+               // Reorder the evnts by their start time
+               uint changesRequired(0);
+               do
+               {
+                       // Note the smallest event ID found, so we have a place to start.
+                       int min(0);
+
+                       // The required ID changes ( current, correct );
+                       QHash<int, int> mapping;
+
+                       // Grab the current records, and determine what changes need to
+                       // happen to get to the sorted results
+                       {
+                               qDebug() << "DB Opened";
+
+                               QSqlQuery * dbq1(new QSqlQuery( db )), * dbq2(new QSqlQuery( db ));
+
+                               dbq1->setForwardOnly( true );
+                               dbq2->setForwardOnly( true );
+
+                               QString s1("SELECT id, event_type_id, start_time, end_time "
+                                                  " FROM Events");
+                               QString s2("SELECT id, event_type_id, start_time, end_time "
+                                                  " FROM Events ORDER BY start_time ASC");
+
+                               if ( dbq1->exec( s1 ) && dbq2->exec( s2 ))
+                               {
+                                       qDebug() << "Query OK, " << dbq1->numRowsAffected() << " & " << dbq2->numRowsAffected() << " rows affected.";
+
+                                       while( dbq1->next() && dbq2->next())
+                                       {
+                                               int one (dbq1->value( 0 ).value< int >());
+                                               int two (dbq2->value( 0 ).value< int >());
+                                               //uint startTime( m_dbq->value( 1 ).value< uint >() );
+                                               //uint endTime( m_dbq->value( 2 ).value< uint >() );
+
+                                               //qDebug() << "Event: " << type << ", " << startTime << ", " << endTime << "";
+                                               //qDebug() << "( " << one << ", " << two << " )";
+
+                                               if(two != one)
+                                               {
+                                                       if(min == 0)
+                                                               min = one;
+
+                                                       qDebug() << "( " << one << ", " << two << " )";
+                                                       mapping.insert(one, two);
+                                               }
+                                       }
+                               }
+                               else
+                               {
+                                       qDebug() << "SQL EXEC Error: "<< "EXEC query failed";
+                                       qDebug() << "Query1: " << s1;
+                                       qDebug() << "Query2: " << s1;
+                               }
+
+                               // Clear up database connections
+                               if ( dbq1 != NULL )
+                               {
+                                       qDebug() << "Cleaning up connection 1";
+
+                                       dbq1->finish();
+
+                                       delete dbq1;
+                                       dbq1 = NULL;
+                               }
+
+                               if ( dbq2 != NULL )
+                               {
+                                       qDebug() << "Cleaning up connection 2";
+
+                                       dbq2->finish();
+
+                                       delete dbq2;
+                                       dbq2 = NULL;
+                               }
+                       }
+
+                       QList<int> sequence;
+                       int val(min);
+                       sequence.append(0);
+                       sequence.append(val);
+                       qDebug().nospace() << "val1: " << val << ", ";
+
+                       while((val = mapping[val]) && val != min)
+                       {
+                               sequence.append(val);
+                               qDebug().nospace() << val << ", ";
+                       }
+                       sequence.append(0);
+
+                       qDebug().nospace() << "seq: ";
+                       QList<QPair<int,int> > updates;
+                       int last(sequence.first());
+                       foreach(int seq, sequence)
+                       {
+                               if(seq != last)
+                               {
+                                       qDebug().nospace() << seq << ", " << last << ", ";
+                                       updates.append(QPair<int,int>(seq, last));
+                               }
+
+                               last = seq;
+                       }
+
+                       // Used to keep iterating until no changes are required.
+                       // TODO: Shouldn't be required, but is. One to revisit later.
+                       changesRequired = updates.count();
+
+                       for( QList<QPair<int,int> >::const_iterator it(updates.constBegin()); it != updates.constEnd(); ++it)
+                       {
+                               //qDebug().nospace() << (*it).first << ", " << (*it).second;
+                       }
+
+                       QList<QString> tables = QList<QString>() << "Events" << "Attachments" << "Headers" << "GroupCache";
+                       QString query;
+                       for( QList<QString>::const_iterator currentTable(tables.constBegin()); currentTable != tables.constEnd(); ++currentTable)
+                       {
+                               QString curquery = "UPDATE %3 set %4 = %1 WHERE %4 = %2;";
+                               for( QList<QPair<int,int> >::const_iterator currentUpdate(updates.constBegin()); currentUpdate != updates.constEnd(); ++currentUpdate)
+                               {
+                                       query.append(
+                                               curquery
+                                                       .arg((*currentUpdate).second)
+                                                       .arg((*currentUpdate).first)
+                                                       .arg((*currentTable))
+                                                       .arg((*currentTable) == "Events" ? "id" : "event_id")
+                                               ).append("\n");
+
+                                       //qDebug().nospace() << (*it).first << ", " << (*it).second;
+                               }
+                       }
+
+                       qDebug() << query;
+
+                       QSqlQuery * UpdateQuery(new QSqlQuery( db ));
+                       if(UpdateQuery != NULL)
+                       {
+                               UpdateQuery->setForwardOnly( true );
+
+                               if(db.transaction())
+                               {
+                                       QStringList statements = query.trimmed().split(";", QString::SkipEmptyParts);
+                                       try
+                                       {
+                                               for( QStringList::const_iterator currentStatement(statements.constBegin()); currentStatement != statements.constEnd(); ++currentStatement)
+                                               {
+                                                       if ( UpdateQuery->exec( *currentStatement ))
+                                                               qDebug() << "Query OK, " << UpdateQuery->numRowsAffected() << " rows affected.";
+                                                       else
+                                                       {
+                                                               qDebug() << "Query Failed: " << *currentStatement;
+                                                               throw std::exception();
+                                                       }
+                                               }
+
+                                               qDebug() << "Committing.";
+                                               db.commit();
+                                       }
+                                       catch(...)
+                                       {
+                                               qDebug() << "Rolling back.";
+                                               db.rollback();
+                                       }
+                               }
+                               else
+                                       qDebug() << "Unable to start transaction.";
+                       }
+               }while(changesRequired > 0);
+
+               // Update the group cache so the last events are correct
+               {
+                       qDebug() << "Updating most recent events.";
+
+                       // Grab group UIDs from group cache
+                       QSqlQuery * dbq(new QSqlQuery( db ));
+                       dbq->setForwardOnly( true );
+
+                       const char * groupUIDListSQL("SELECT group_uid FROM GroupCache");
+                       if (dbq->exec(groupUIDListSQL))
+                       {
+                               qDebug() << "Query OK, " << dbq->numRowsAffected() << " rows affected.";
+                               qDebug() << "GroupUIDs:";
+
+                               QSet<QString> groupUIDs;
+                               while( dbq->next() )
+                               {
+                                       QString groupUID(dbq->value(0).value<QString>());
+
+                                       qDebug() << groupUID;
+                                       groupUIDs.insert(groupUID);
+                               }
+
+                               // Iterate over group UIDS
+                               if(groupUIDs.count() > 0)
+                               {
+                                       // Build a batch statement to update every group with
+                                       // the most recent event
+
+                                       // Ignore 'data' failures (i.e. no events but present in the
+                                       // cache)- something else's been monkeying with the DB, and
+                                       // we can't account for everything.
+                                       QString updateGroupCacheWithLatestEventsSQL(
+                                               "UPDATE OR IGNORE GroupCache SET event_id = "
+                                                       "(SELECT id FROM events WHERE group_uid = \"%1\" "
+                                                       " ORDER BY id DESC LIMIT 1)"
+                                               " WHERE group_uid = \"%1\";");
+                                       QString updateGroupCacheWithLatestEventsBatchSQL;
+                                       foreach(QString groupUID, groupUIDs)
+                                       {
+                                               updateGroupCacheWithLatestEventsBatchSQL.append(
+                                                       updateGroupCacheWithLatestEventsSQL
+                                                       .arg(groupUID)
+                                                       ).append("\n");
+                                       }
+
+                                       // Execute the statement in single-statement chunks thanks
+                                       // to QT's inability to call the SQLite function supporting
+                                       // multiple statements
+
+                                       QSqlQuery * setLatestEventInGroupCacheSQL(new QSqlQuery( db ));
+                                       if(NULL != setLatestEventInGroupCacheSQL)
+                                       {
+                                               setLatestEventInGroupCacheSQL->setForwardOnly( true );
+
+                                               if(db.transaction())
+                                               {
+                                                       QStringList statements = updateGroupCacheWithLatestEventsBatchSQL.trimmed().split(";", QString::SkipEmptyParts);
+                                                       try
+                                                       {
+                                                               for( QStringList::const_iterator currentStatement(statements.constBegin()); currentStatement != statements.constEnd(); ++currentStatement)
+                                                               {
+                                                                       if ( setLatestEventInGroupCacheSQL->exec( *currentStatement ))
+                                                                               qDebug() << "Query OK, " << setLatestEventInGroupCacheSQL->numRowsAffected() << " rows affected.";
+                                                                       else
+                                                                       {
+                                                                               qDebug() << "Query Failed: " << *currentStatement;
+                                                                               throw std::exception();
+                                                                       }
+                                                               }
+
+                                                               qDebug() << "Committing.";
+                                                               db.commit();
+                                                       }
+                                                       catch(...)
+                                                       {
+                                                               qDebug() << "Rolling back.";
+                                                               db.rollback();
+                                                       }
+                                               }
+                                               else
+                                                       qDebug() << "Unable to start transaction.";
+                                       }
+                               }
+                       }
+                       else
+                       {
+                               qDebug() << "SQL EXEC Error: "<< "EXEC query failed";
+                               qDebug() << "Query: " << groupUIDListSQL;
+                       }
+               }
+
+               qDebug() << "Closing.";
+               db.close();
+               QSqlDatabase::removeDatabase( "QSQLITE" );
+       }
+
+       return;
+}
diff --git a/EventLogReindexer.h b/EventLogReindexer.h
new file mode 100644 (file)
index 0000000..18db01b
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTLOGREINDEXER_H
+#define EVENTLOGREINDEXER_H
+
+class EventLogReindexer
+{
+public:
+       EventLogReindexer();
+
+       void Reindex();
+};
+
+#endif // EVENTLOGREINDEXER_H
diff --git a/EventParsers/CSVSymbianEventLogParser.cpp b/EventParsers/CSVSymbianEventLogParser.cpp
new file mode 100644 (file)
index 0000000..8d38ffe
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "CSVSymbianEventLogParser.h"
+
+#include <QDebug>
+
+#include <QFile>
+#include <QString>
+#include <QStringList>
+
+using namespace EventParsers;
+
+class SortByValueDesc
+{
+public:
+       inline bool operator()(const QPair<char, uint> &a, const QPair<char, uint> &b) const
+       {
+               return b.second < a.second;
+       }
+};
+
+iEventParser *CSVSymbianEventLogParser::IsValid(QFile &eventFile)
+{
+       qDebug() << "Checking if a CSV call log file...";
+
+       QByteArray firstLineContent(eventFile.readLine());
+       eventFile.seek(0);
+       if(firstLineContent.length() > 0)
+       {
+               // Count the non-alphanumeric characters used
+               QHash<char, uint> counts;
+               foreach(char c, firstLineContent)
+                       ++counts[c];
+
+               QList<QPair<char, uint> > orderedCounts;
+               orderedCounts.reserve(counts.size());
+               foreach(char c, counts.keys())
+                       if(!QChar(c).isLetterOrNumber())
+                               orderedCounts.append(QPair<char, uint>(c, counts.value(c)));
+
+               qSort(orderedCounts.begin(), orderedCounts.end(), SortByValueDesc());
+
+               // Work around Q_FOREACH macro limitation when dealing with
+               // multi-typed templates (comma issue)
+               typedef QPair<char, uint> bodge;
+               foreach(bodge count, orderedCounts)
+                       qDebug() << count.first << " = " << count.second;
+
+               char delim;
+               // No-one would be mad enough to use quotation marks or apostrophes
+               // as their delimiter,but just in case, check the second most
+               // frequent character is present thr right number of times for
+               // the qutation marks to be present on every column heading (two
+               // per heading, less one as they're seperators)
+               if((orderedCounts.value(0).first == '"' || orderedCounts.value(0).first == '\'')
+                       && ((orderedCounts.value(0).second / 2) - 1 == orderedCounts.value(1).second ))
+               {
+                       // We're good.
+                       delim = orderedCounts.value(1).first;
+               }
+               else
+                       delim = orderedCounts.value(0).first;
+
+               // Check we have the essential fields we need, and grab their
+               // column ordering
+               QStringList requiredHeadings;
+               requiredHeadings << "etype" << "etime" << "remote"
+                                                << "direction" << "duration" << "number";
+
+               EventParsers::CSVSymbianEventLogParser::ColumnIndicesHash headingPositions;
+               headingPositions.reserve(requiredHeadings.count());
+
+               QStringList headings(QString(firstLineContent).split(delim));
+               for(QStringList::size_type i(0); i < headings.count(); ++i)
+               {
+                       QRegExp content("^[\"\']?(\\w*)?[\"\']?$");
+                       content.indexIn(headings.value(i).trimmed());
+                       QString heading(content.cap(1));
+                       qDebug() << headings.value(i) << " : " << heading;
+
+                       // Check over the required headings
+                       foreach(QString requiredHeading, requiredHeadings)
+                       {
+                               if(heading.toLower() == requiredHeading)
+                               {
+                                       headingPositions[requiredHeading] = i;
+                                       requiredHeadings.removeOne(requiredHeading);
+                               }
+                       }
+               }
+
+               // If we found all of the required headings, continue
+               if(requiredHeadings.count() == 0)
+               {
+                       return new EventParsers::CSVSymbianEventLogParser(eventFile.fileName(), headingPositions);
+               }
+       }
+
+       return NULL;
+}
+
+CSVSymbianEventLogParser::CSVSymbianEventLogParser(const QString &filename, const ColumnIndicesHash &columns)
+{
+}
+
+EventTypes::EventFromFileList CSVSymbianEventLogParser::ParseFile(QFile &eventFile, const QList<uint> &recordsToReturn)
+{
+       qDebug() << "CSV Parsing NYI!";
+       return EventTypes::EventFromFileList();
+}
diff --git a/EventParsers/CSVSymbianEventLogParser.h b/EventParsers/CSVSymbianEventLogParser.h
new file mode 100644 (file)
index 0000000..4b155fb
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_CSVSYMBIANEVENTLOGPARSER_H
+#define EVENTPARSERS_CSVSYMBIANEVENTLOGPARSER_H
+
+#include "iEventParser.h"
+
+template <typename T1, typename T2> class QHash;
+class QFile;
+class QString;
+
+namespace EventParsers
+{
+       class CSVSymbianEventLogParser : public iEventParser
+       {
+       public:
+               typedef QHash<QString, int> ColumnIndicesHash;
+
+               static iEventParser *IsValid(QFile &eventFile);
+
+               CSVSymbianEventLogParser(const QString &filename, const ColumnIndicesHash &columns);
+
+               virtual EventTypes::EventFromFileList ParseFile(QFile &eventFile, const QList<unsigned int> &recordsToReturn);
+       };
+}
+
+#endif // EVENTPARSERS_CSVSYMBIANEVENTLOGPARSER_H
diff --git a/EventParsers/Factory.cpp b/EventParsers/Factory.cpp
new file mode 100644 (file)
index 0000000..4eb74c0
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Factory.h"
+
+#include "CSVSymbianEventLogParser.h"
+#include "MMSParser.h"
+#include "VMGParser.h"
+
+#include <QDebug>
+
+#include <QFile>
+
+using namespace EventParsers;
+
+iEventParser * Factory::CreateParser(const Settings &settings, const QString &filename)
+{
+       qDebug() << filename << endl;
+       QFile eventFile(filename);
+
+       // If the file's ok, process it...
+       if (eventFile.open(QFile::ReadOnly))
+       {
+               iEventParser *parser(NULL);
+
+               // Check for VMG-format SMS messages
+               if((parser = VMGParser::IsValid(settings, eventFile)))
+                       return parser;
+
+               // Check for CSV-format call logs
+               if((parser = CSVSymbianEventLogParser::IsValid(eventFile)))
+                       return parser;
+
+               // Check for MMS-format MMS messages
+               if((parser = MMSParser::IsValid(eventFile)))
+                       return parser;
+
+               // Check for Pidgin-formatted chat logs (NYI)
+               if((parser = NULL))
+                       return parser;
+       }
+
+       qDebug() << filename << " is unrecognised. Ignoring.";
+
+       return NULL;
+}
diff --git a/EventParsers/Factory.h b/EventParsers/Factory.h
new file mode 100644 (file)
index 0000000..4b398e0
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_FACTORY_H
+#define EVENTPARSERS_FACTORY_H
+
+class Settings;
+
+class QString;
+
+namespace EventParsers
+{
+       class iEventParser;
+
+       class Factory
+       {
+       public:
+               static iEventParser * CreateParser(const Settings &settings, const QString &filename);
+       };
+}
+
+#endif // EVENTPARSERS_FACTORY_H
diff --git a/EventParsers/MMSParser.cpp b/EventParsers/MMSParser.cpp
new file mode 100644 (file)
index 0000000..55109f9
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "MMSParser.h"
+
+#include <QDebug>
+
+#include <QFile>
+#include <QString>
+
+using namespace EventParsers;
+
+iEventParser *MMSParser::IsValid(QFile &eventFile)
+{
+       qDebug() << "Checking if a MMS file...";
+
+       // A buffer that can hold 3 fields with a single byte value...and a
+       // bonus terminator byte if required (2*3 + 1)
+       char fileIDBuf[0x07];
+       qint64 bytesRead(eventFile.read(fileIDBuf, sizeof(fileIDBuf) - 1));
+       eventFile.seek(0);
+       if(bytesRead == sizeof(fileIDBuf) - 1)
+       {
+               // This is the hex 8c (message type '0c' with high bit set), 80 (transaction id), 8D, 92, 85, 04
+               char fieldMessageType = 0x8C;
+               char fieldTransactionID = 0x98; // Optional
+               char fieldMessageMMSVersion = 0x8D;
+               char fieldMessageDate = 0x85;
+               uint offset = 0;
+               if(fileIDBuf[offset++] == fieldMessageType)
+               {
+                       char valueMessageType = fileIDBuf[offset++] ^ 0x80;
+                       qDebug() << "...looks like a MMS file. Message type is: " << valueMessageType;
+
+                       char valueTransactionID = -1;
+                       if(fileIDBuf[offset] == fieldTransactionID)
+                               valueTransactionID = fileIDBuf[offset++] ^ 0x80;
+
+                       if(fileIDBuf[offset] == fieldMessageMMSVersion)
+                       {
+                               char valueMessageMMSVersion = fileIDBuf[offset++] ^ 0x80;
+                               int majorVersion(valueMessageMMSVersion >> 4);
+                               int minorVersion(valueMessageMMSVersion & 0x0F);
+                               qDebug() << QString("...MMS version type is: %1.%2")
+                                                       .arg(majorVersion)
+                                                       .arg(minorVersion);
+
+                               // We only support up to version 1.3
+                               if(majorVersion == 1 && minorVersion <= 3)
+                                       return new MMSParser(eventFile.fileName());
+                               else
+                                       qDebug() << QString("%1 is an unsupported MMS version")
+                                                               .arg(eventFile.fileName());
+                       }
+                       else
+                               qDebug() << QString("%1 is a malformed MMS. Expected %2, got %3")
+                                                       .arg(eventFile.fileName())
+                                                       .arg(fieldMessageMMSVersion).arg(fileIDBuf[offset]);
+//                             }
+//                             else
+//                             {
+//                                     QString hexs;
+//                                     for(int i(0); i<0x16; ++i)
+//                                             hexs.append(QString::number(fileIDBuf[i], 16).rightJustified(2, '0'));
+//                                     qDebug() << eventFile.fileName() << " has bad signature: " << hexs;
+               }
+       }
+       else
+               qDebug() << eventFile.fileName() << " has size mismatch.";
+
+       return false;
+}
+
+MMSParser::MMSParser(const QString &filename)
+{
+}
+
+EventTypes::EventFromFileList MMSParser::ParseFile(QFile &eventFile, const QList<uint> &recordsToReturn)
+{
+       qDebug() << "MMS Parsing NYI!";
+       return EventTypes::EventFromFileList();
+}
diff --git a/EventParsers/MMSParser.h b/EventParsers/MMSParser.h
new file mode 100644 (file)
index 0000000..3101e2a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_MMSPARSER_H
+#define EVENTPARSERS_MMSPARSER_H
+
+#include "iEventParser.h"
+
+class QFile;
+class QString;
+
+namespace EventParsers
+{
+       class MMSParser : public iEventParser
+       {
+       public:
+               static iEventParser *IsValid(QFile &eventFile);
+
+               MMSParser(const QString &filename);
+
+               virtual EventTypes::EventFromFileList ParseFile(QFile &eventFile, const QList<uint> &recordsToReturn);
+       };
+}
+
+#endif // EVENTPARSERS_MMSPARSER_H
diff --git a/EventParsers/VMGEntities/Factory.h b/EventParsers/VMGEntities/Factory.h
new file mode 100644 (file)
index 0000000..f6ce10b
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_FACTORY_H
+#define EVENTPARSERS_VMGEntities_FACTORY_H
+
+class QString;
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class SMSEntity;
+               class iReader;
+
+               class Factory
+               {
+               private:
+                       Factory() {};
+
+               public:
+                       static iReader* Instantiate(QString& lineData, const SMSEntity* parent);
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_FACTORY_H
diff --git a/EventParsers/VMGEntities/SMSEntity.cpp b/EventParsers/VMGEntities/SMSEntity.cpp
new file mode 100644 (file)
index 0000000..1a23c6c
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "SMSEntity.h"
+
+#include "VBody.h"
+
+using namespace EventParsers::VMGEntities;
+
+SMSEntity::SMSEntity(const SMSEntity* parent):
+       m_Parent(parent)
+{
+}
+
+const bool SMSEntity::isAttachment() const
+{
+       return getParent() != NULL && typeid(*getParent()) == typeid(VBody);
+}
diff --git a/EventParsers/VMGEntities/SMSEntity.h b/EventParsers/VMGEntities/SMSEntity.h
new file mode 100644 (file)
index 0000000..9ed198a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_SMSENTITY_H
+#define EVENTPARSERS_VMGEntities_SMSENTITY_H
+
+#include <cstddef>
+#include <typeinfo>
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class iReader;
+
+               class SMSEntity
+               {
+               public:
+                       SMSEntity(const SMSEntity* parent);
+                       virtual ~SMSEntity() {};
+
+               protected:
+                       const bool isAttachment() const;
+
+                       const SMSEntity* m_Parent;
+                       const SMSEntity* getParent() const { return m_Parent; };
+
+                       virtual const char* getTagName() const { return "VBODY"; }
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_SMSENTITY_H
diff --git a/EventParsers/VMGEntities/VBody.cpp b/EventParsers/VMGEntities/VBody.cpp
new file mode 100644 (file)
index 0000000..dba3fd7
--- /dev/null
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "VBody.h"
+
+#include "Attachment.h"
+#include "Factory.h"
+#include "EventTypes/SMS.h"
+
+#include <QDateTime>
+#include <QDir>
+#include <QTextStream>
+
+#include <QDebug>
+
+using namespace EventParsers::VMGEntities;
+
+VBody::VBody(const SMSEntity* parent) :
+       SMSEntity(parent)
+{
+}
+
+//VBody::VBody(QTextStream& stream)
+//{
+//}
+
+VBody::~VBody()
+{
+}
+
+void VBody::Write(QTextStream &stream, const EventTypes::SMS &event)
+{
+       stream << "BEGIN:" << getTagName() << endl;
+
+       // First, the event's date field.
+       stream << "Date:" << event.Timestamp().toString("d.M.yyyy hh:mm:ss") << endl;
+
+       // ...next, the event's attachments
+       foreach(QSharedPointer<Attachment> attachment, event.Attachments())
+               stream << attachment->Stream().readAll() << endl;
+
+       // ...and now the event's contents
+       stream << event.Contents() << endl;
+
+       stream << "END:" << getTagName() << endl;
+}
+
+bool VBody::Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event)
+{
+       bool hasEnded(false);
+       float version(0);
+       QString text;
+
+       // Stream may or may not have a 'BEGIN' present. Swallow it if it's ours.
+       uint linePos(stream.pos());
+       QString lineData(initialLine.length() > 0 ? initialLine : stream.readLine());
+       if(lineData.startsWith("BEGIN:"))
+       {
+               if(lineData != QString("BEGIN:") + getTagName())
+               {
+                       qDebug() << "Invalid stream";
+                       return false;
+               }
+               else
+               {
+                       if(isAttachment())
+                       {
+                       }
+                       else
+                       {
+                               // ...discard this line
+                               lineData = stream.readLine();
+                       }
+               }
+       }
+
+       do
+       {
+               if(lineData.startsWith("Date:"))
+               {
+                       version = lineData.mid(lineData.indexOf(":")+1).toFloat();
+               }
+               else if(lineData.startsWith("BEGIN:"))
+               {
+                       iReader* reader = Factory::Instantiate(lineData, this);
+                       bool valid(NULL != reader && reader->Read(lineData, stream, event));
+                       delete reader;
+
+                       // Quit processing if the nested content is not valid
+                       if(!valid)
+                               return valid;
+               }
+               else if(lineData.startsWith("END:"))
+               {
+                       if(lineData != QString("END:") + getTagName())
+                       {
+                               qDebug() << getTagName() << " parser mismatch error: " << lineData;
+                               return false;
+                       }
+                       else
+                       {
+                               hasEnded = true;
+                               break;
+                       }
+               }
+               else
+               {
+                       if(text.isEmpty() && !lineData.isEmpty() && lineData.at(0) == 1)
+                       {
+                               // It's a binary SMS. Oh joy.
+                               if(lineData.count() >= 5)
+                               {
+                                       int wspMIMETypeID = lineData.at(5).unicode() & 0x7F;
+                                       if(BinaryMIMETypes().contains(wspMIMETypeID))
+                                       {
+                                               QString mimeType(BinaryMIMETypes().value(wspMIMETypeID));
+                                               qDebug() << "Attachment is: " << mimeType;
+                                               Attachment *binaryAttachment(new Attachment(
+                                                       (QDir::tempPath() + "/attachment-" + QString::number(event.Timestamp().toTime_t()) + "-" + QString::number(event.Attachments().count()) + ".bin").toUtf8(),
+                                                       mimeType));
+
+                                               // Grab the content
+
+                                               // Alias the stream's device so we can asily access it
+                                               // directly in binary mode
+                                               QIODevice &binfile(*stream.device());
+
+                                               // Were going to ignore this data for the moment, but
+                                               // get an approximation of the range in the file.
+                                               int startPos(linePos);
+                                               stream.readLine();
+                                               int endPos(stream.pos());
+                                               binfile.seek(startPos);
+
+                                               qDebug() << "Binary offsets in file: " << startPos << ", " << endPos;
+
+                                               // Prepare our pointers for storing the data
+                                               int binDataLength((endPos - startPos) / sizeof(quint16));
+                                               char binaryData[binDataLength];
+                                               memset(&binaryData, 0, binDataLength);
+                                               char *binaryDataByte(binaryData);
+
+                                               // Grab the content from the file a byte at a time,
+                                               // skipping over every alternate byte (VMGs are UTF16LE)
+                                               // ...yes, even the binary data :(
+                                               int curpos(startPos);
+                                               while(binfile.pos() < endPos)
+                                               {
+                                                       binfile.seek(curpos);
+                                                       binfile.read(binaryDataByte++, 1);
+
+                                                       // Look at the byte just stored. If it's an EOL,
+                                                       // we're done. Even binary data ends on a valid line.
+                                                       if(*(binaryDataByte - 1) == 0x0A)
+                                                       {
+                                                               // Note where the data actually ended.
+                                                               binDataLength = (binfile.pos() - startPos) / sizeof(quint16);
+                                                               break;
+                                                       }
+
+                                                       qDebug() << hex << (int)binfile.pos() << "/" << hex << endPos << ": " << hex << (int)*(binaryDataByte - 1);
+
+                                                       // Advance, skipping over every other byte.
+                                                       curpos += sizeof(quint16);
+                                               }
+                                               // Move back a bit so the stream is ready to continue in
+                                               // text mode once we're done with the attachment.
+                                               stream.seek(endPos - 1);
+
+                                               // Directly access the output device and dump the binary
+                                               // data into it.
+                                               // NOTE: This is why the QFile needs to be unbuffered
+                                               binaryAttachment->Stream().device()->write(binaryData, binDataLength);
+
+                                               // Save attachment
+                                               event.Attachments().append(binaryAttachment);
+                                       }
+                                       else
+                                       {
+                                               qDebug() << "Unrecognised binary mime type: " << hex << wspMIMETypeID;
+                                               return false; // Not supported for now
+                                       }
+                               }
+                               else
+                               {
+                                       qDebug() << "Binary attachment too short (" << lineData.count() << " bytes). Not supported.";
+                                       return false; // Not supported for now
+                               }
+                       }
+                       else
+                       {
+                               // If this isn't the first line, add a newline.
+                               if(!text.isEmpty())
+                                       text.append(0x0A);
+                               text.append(lineData);
+                       }
+               }
+
+               linePos = stream.pos();
+               lineData = stream.readLine();
+       }while(!hasEnded && !stream.atEnd());
+
+       if(hasEnded)
+       {
+               event.setContents(text);
+               //event.fld_storage_time
+       }
+
+       return true;
+}
diff --git a/EventParsers/VMGEntities/VBody.h b/EventParsers/VMGEntities/VBody.h
new file mode 100644 (file)
index 0000000..5a9bb6c
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_VBODYWRITER_H
+#define EVENTPARSERS_VMGEntities_VBODYWRITER_H
+
+#include <QMap>
+
+#include "SMSEntity.h"
+#include "iReader.h"
+#include "iWriter.h"
+
+class QString;
+
+namespace EventTypes { class SMS; }
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class VBody : public SMSEntity, public iWriter, public iReader
+               {
+               public:
+                       VBody(const SMSEntity *parent);
+                       //VBody(QTextStream& stream);
+                       ~VBody();
+
+                       virtual bool Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event);
+                       virtual void Write(QTextStream &stream, const EventTypes::SMS &event);
+
+               protected:
+                       virtual const char *getTagName() const { return "VBODY"; }
+
+               private:
+                       static const QMap<int, const char *> & BinaryMIMETypes()
+                       {
+                               static QMap<int, const char *> s_BinaryMIMETypes;
+                               if(s_BinaryMIMETypes.count() == 0)
+                               {
+                                       s_BinaryMIMETypes.insert(0x00, "*/*");
+                                       s_BinaryMIMETypes.insert(0x01, "text/*");
+                                       s_BinaryMIMETypes.insert(0x02, "text/html");
+                                       s_BinaryMIMETypes.insert(0x03, "text/plain");
+                                       s_BinaryMIMETypes.insert(0x04, "text/x-hdml");
+                                       s_BinaryMIMETypes.insert(0x05, "text/x-ttml");
+                                       s_BinaryMIMETypes.insert(0x06, "text/x-vCalendar");
+                                       s_BinaryMIMETypes.insert(0x07, "text/x-vCard");
+                                       s_BinaryMIMETypes.insert(0x08, "text/vnd.wap.wml");
+                                       s_BinaryMIMETypes.insert(0x09, "text/vnd.wap.wmlscript");
+                                       s_BinaryMIMETypes.insert(0x0A, "text/vnd.wap.wta-event");
+                                       s_BinaryMIMETypes.insert(0x0B, "multipart/*");
+                                       s_BinaryMIMETypes.insert(0x0C, "multipart/mixed");
+                                       s_BinaryMIMETypes.insert(0x0D, "multipart/form-data");
+                                       s_BinaryMIMETypes.insert(0x0E, "multipart/byterantes");
+                                       s_BinaryMIMETypes.insert(0x0F, "multipart/alternative");
+                                       s_BinaryMIMETypes.insert(0x10, "application/*");
+                                       s_BinaryMIMETypes.insert(0x11, "application/java-vm");
+                                       s_BinaryMIMETypes.insert(0x12, "application/x-www-form-urlencoded");
+                                       s_BinaryMIMETypes.insert(0x13, "application/x-hdmlc");
+                                       s_BinaryMIMETypes.insert(0x14, "application/vnd.wap.wmlc");
+                                       s_BinaryMIMETypes.insert(0x15, "application/vnd.wap.wmlscriptc");
+                                       s_BinaryMIMETypes.insert(0x16, "application/vnd.wap.wta-eventc");
+                                       s_BinaryMIMETypes.insert(0x17, "application/vnd.wap.uaprof");
+                                       s_BinaryMIMETypes.insert(0x18, "application/vnd.wap.wtls-ca-certificate");
+                                       s_BinaryMIMETypes.insert(0x19, "application/vnd.wap.wtls-user-certificate");
+                                       s_BinaryMIMETypes.insert(0x1A, "application/x-x509-ca-cert");
+                                       s_BinaryMIMETypes.insert(0x1B, "application/x-x509-user-cert");
+                                       s_BinaryMIMETypes.insert(0x1C, "image/*");
+                                       s_BinaryMIMETypes.insert(0x1D, "image/gif");
+                                       s_BinaryMIMETypes.insert(0x1E, "image/jpeg");
+                                       s_BinaryMIMETypes.insert(0x1F, "image/tiff");
+                                       s_BinaryMIMETypes.insert(0x20, "image/png");
+                                       s_BinaryMIMETypes.insert(0x21, "image/vnd.wap.wbmp");
+                                       s_BinaryMIMETypes.insert(0x22, "application/vnd.wap.multipart.*");
+                                       s_BinaryMIMETypes.insert(0x23, "application/vnd.wap.multipart.mixed");
+                                       s_BinaryMIMETypes.insert(0x24, "application/vnd.wap.multipart.form-data");
+                                       s_BinaryMIMETypes.insert(0x25, "application/vnd.wap.multipart.byteranges");
+                                       s_BinaryMIMETypes.insert(0x26, "application/vnd.wap.multipart.alternative");
+                                       s_BinaryMIMETypes.insert(0x27, "application/xml");
+                                       s_BinaryMIMETypes.insert(0x28, "text/xml");
+                                       s_BinaryMIMETypes.insert(0x29, "application/vnd.wap.wbxml");
+                                       s_BinaryMIMETypes.insert(0x2A, "application/x-x968-cross-cert");
+                                       s_BinaryMIMETypes.insert(0x2B, "application/x-x968-ca-cert");
+                                       s_BinaryMIMETypes.insert(0x2C, "application/x-x968-user-cert");
+                                       s_BinaryMIMETypes.insert(0x2D, "text/vnd.wap.si");
+                                       s_BinaryMIMETypes.insert(0x2E, "application/vnd.wap.sic");
+                                       s_BinaryMIMETypes.insert(0x2F, "text/vnd.wap.sl");
+                                       s_BinaryMIMETypes.insert(0x30, "application/vnd.wap.slc");
+                                       s_BinaryMIMETypes.insert(0x31, "text/vnd.wap.co");
+                                       s_BinaryMIMETypes.insert(0x32, "application/vnd.wap.coc");
+                                       s_BinaryMIMETypes.insert(0x33, "application/vnd.wap.multipart.related");
+                                       s_BinaryMIMETypes.insert(0x34, "application/vnd.wap.sia");
+                                       s_BinaryMIMETypes.insert(0x35, "text/vnd.wap.connectivity-xml");
+                                       s_BinaryMIMETypes.insert(0x36, "application/vnd.wap.connectivity-wbxml");
+                                       s_BinaryMIMETypes.insert(0x37, "application/pkcs7-mime");
+                                       s_BinaryMIMETypes.insert(0x38, "application/vnd.wap.hashed-certificate");
+                                       s_BinaryMIMETypes.insert(0x39, "application/vnd.wap.signed-certificate");
+                                       s_BinaryMIMETypes.insert(0x3A, "application/vnd.wap.cert-response");
+                                       s_BinaryMIMETypes.insert(0x3B, "application/xhtml+xml");
+                                       s_BinaryMIMETypes.insert(0x3C, "application/wml+xml");
+                                       s_BinaryMIMETypes.insert(0x3D, "text/css");
+                                       s_BinaryMIMETypes.insert(0x3E, "application/vnd.wap.mms-message");
+                                       s_BinaryMIMETypes.insert(0x3F, "application/vnd.wap.rollover-certificate");
+                                       s_BinaryMIMETypes.insert(0x40, "application/vnd.wap.locc+wbxml");
+                                       s_BinaryMIMETypes.insert(0x41, "application/vnd.wap.loc+xml");
+                                       s_BinaryMIMETypes.insert(0x42, "application/vnd.syncml.dm+wbxml");
+                                       s_BinaryMIMETypes.insert(0x43, "application/vnd.syncml.dm+xml");
+                                       s_BinaryMIMETypes.insert(0x44, "application/vnd.syncml.notification");
+                                       s_BinaryMIMETypes.insert(0x45, "application/vnd.wap.xhtml+xml");
+                                       s_BinaryMIMETypes.insert(0x46, "application/vnd.wv.csp.cir");
+                                       s_BinaryMIMETypes.insert(0x47, "application/vnd.oma.dd+xml");
+                                       s_BinaryMIMETypes.insert(0x48, "application/vnd.oma.drm.message");
+                                       s_BinaryMIMETypes.insert(0x49, "application/vnd.oma.drm.content");
+                                       s_BinaryMIMETypes.insert(0x4A, "application/vnd.oma.drm.rights+xml");
+                                       s_BinaryMIMETypes.insert(0x4B, "application/vnd.oma.drm.rights+wbxml");
+                               }
+
+                               return s_BinaryMIMETypes;
+                       }
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_VBODYWRITER_H
diff --git a/EventParsers/VMGEntities/VCalendar.cpp b/EventParsers/VMGEntities/VCalendar.cpp
new file mode 100644 (file)
index 0000000..8b97dab
--- /dev/null
@@ -0,0 +1,169 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "VCalendar.h"
+
+#include "Attachment.h"
+#include "Factory.h"
+#include "EventTypes/SMS.h"
+#include "VBody.h"
+#include "VEnvelope.h"
+#include "VMessage.h"
+
+#include <QDebug>
+#include <QDir>
+#include <QTextStream>
+#include <QTemporaryFile>
+
+#include <glib.h>
+
+#include <rtcom-eventlogger/eventlogger.h>
+
+#include <typeinfo>
+
+using namespace EventParsers::VMGEntities;
+
+VCalendar::VCalendar(const SMSEntity* parent) :
+       SMSEntity(parent), m_Version(1.0)
+{
+}
+
+//VCalendar::VCalendar(QTextStream& stream)
+//{
+//}
+
+VCalendar::VCalendar(const SMSEntity* parent, float version) :
+       SMSEntity(parent), m_Version(version)
+{
+}
+
+VCalendar::~VCalendar()
+{
+}
+
+void VCalendar::Write(QTextStream &stream, const EventTypes::SMS &event)
+{
+       //stream << "BEGIN:" << getTagName() << "\n";
+
+       //stream << "VERSION:" << m_Version << "\n";
+       //stream << "N:" << (m_Target == VCARD_LOCAL ? "" : event.Name()) << "\n";
+       //stream << "TEL:" << (m_Target == VCARD_LOCAL ? "" : event.Tel()) << "\n";
+
+       //stream << "END:" << getTagName() << "\n";
+}
+
+bool VCalendar::Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event)
+{
+       bool hasEnded(false);
+       float version(0);
+       bool isTopLevel(typeid(*getParent()) == typeid(VMessage));
+       bool isSender(typeid(*getParent()) == typeid(VEnvelope));
+       Attachment *vCalendarAttachment;
+
+       if(isAttachment())
+       {
+               vCalendarAttachment = new Attachment(
+                       (QDir::tempPath() + "/attachment-" + QString::number(event.Timestamp().toTime_t()) + "-" + QString::number(event.Attachments().count()) + ".vcalendar").toUtf8(),
+                       "text/x-vcalendar");
+       }
+
+       // Stream may or may not have a 'BEGIN' present. Swallow it if it's ours.
+       QString lineData(initialLine.length() > 0 ? initialLine : stream.readLine());
+       if(lineData.startsWith("BEGIN:"))
+       {
+               if(lineData != QString("BEGIN:") + getTagName())
+               {
+                       qDebug() << "Invalid stream";
+                       return false;
+               }
+               else if(!isAttachment())
+               {
+                       // ...discard this line
+                       lineData = stream.readLine();
+               }
+       }
+
+       do
+       {
+               if(isAttachment())
+               {
+                       vCalendarAttachment->Stream() << lineData << endl;
+
+                       if(lineData.startsWith("END:"))
+                       {
+                               if(lineData == QString("END:VTODO")
+                                       || lineData == QString("END:VEVENT"))
+                               {
+                                       // Ignore these. We treat these nested structures as content
+                               }
+                               else if(lineData != QString("END:") + getTagName())
+                               {
+                                       qDebug() << getTagName() << " parser mismatch error" << lineData;
+                                       break;
+                               }
+                               else
+                               {
+                                       // Save attachment
+                                       event.Attachments().append(vCalendarAttachment);
+
+                                       hasEnded = true;
+                                       break;
+                               }
+                       }
+               }
+               else
+               {
+                       if(lineData.startsWith("VERSION:"))
+                       {
+                               version = lineData.mid(lineData.indexOf(":")+1).toFloat();
+                       }
+                       else if(lineData.startsWith("BEGIN:"))
+                       {
+                               iReader* reader = Factory::Instantiate(lineData, this);
+                               bool valid(NULL != reader && reader->Read(lineData, stream, event));
+                               delete reader;
+
+                               // Quit processing if the nested content is not valid
+                               if(!valid)
+                                       return valid;
+                       }
+                       else if(lineData.startsWith("END:"))
+                       {
+                               if(lineData != QString("END:") + getTagName())
+                               {
+                                       qDebug() << getTagName() << " parser mismatch error" << lineData;
+                                       break;
+                               }
+                               else
+                               {
+                                       hasEnded = true;
+                                       break;
+                               }
+                       }
+               }
+
+               lineData = stream.readLine();
+       }while(!hasEnded && !stream.atEnd());
+
+       if(hasEnded)
+       {
+
+       }
+
+       return true;
+}
diff --git a/EventParsers/VMGEntities/VCalendar.h b/EventParsers/VMGEntities/VCalendar.h
new file mode 100644 (file)
index 0000000..f64c72d
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_VCALENDAR_H
+#define EVENTPARSERS_VMGEntities_VCALENDAR_H
+
+#include "SMSEntity.h"
+#include "iReader.h"
+#include "iWriter.h"
+
+class QString;
+
+namespace EventTypes { class SMS; }
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class VCalendar : public SMSEntity, public iWriter, public iReader
+               {
+               public:
+                       VCalendar (const SMSEntity *parent);
+                       //VCalendar (QTextStream& stream);
+                       VCalendar (const SMSEntity *parent, float version);
+                       ~VCalendar ();
+
+                       virtual bool Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event);
+                       virtual void Write(QTextStream &stream, const EventTypes::SMS &event);
+
+               protected:
+                       virtual const char *getTagName() const { return "VCALENDAR"; }
+
+               private:
+                       float m_Version;
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_VCALENDAR_H
diff --git a/EventParsers/VMGEntities/VCard.cpp b/EventParsers/VMGEntities/VCard.cpp
new file mode 100644 (file)
index 0000000..b6d6b63
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "VCard.h"
+
+#include "Attachment.h"
+#include "Factory.h"
+#include "EventTypes/SMS.h"
+#include "VBody.h"
+#include "VEnvelope.h"
+#include "VMessage.h"
+
+#include <QDebug>
+#include <QDir>
+#include <QTextStream>
+#include <QTemporaryFile>
+
+#include <glib.h>
+
+#include <rtcom-eventlogger/eventlogger.h>
+
+#include <typeinfo>
+
+using namespace EventParsers::VMGEntities;
+
+VCard::VCard(const SMSEntity* parent) :
+       SMSEntity(parent), m_Version(2.1), m_Target(VCARD_LOCAL)
+{
+}
+
+//VCard::VCard(QTextStream& stream)
+//{
+//}
+
+VCard::VCard(const SMSEntity* parent, float version, eTarget target) :
+       SMSEntity(parent), m_Version(version), m_Target(target)
+{
+}
+
+VCard::~VCard()
+{
+}
+
+void VCard::Write(QTextStream &stream, const EventTypes::SMS &event)
+{
+       stream << "BEGIN:" << getTagName() << "\n";
+
+       stream << "VERSION:" << m_Version << "\n";
+       //stream << "N:" << (m_Target == VCARD_LOCAL ? "" : event.Name()) << "\n";
+       stream << "TEL:" << (m_Target == VCARD_LOCAL ? "" : event.Tel()) << "\n";
+
+       stream << "END:" << getTagName() << "\n";
+}
+
+bool VCard::Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event)
+{
+       bool hasEnded(false);
+       float version(0);
+       bool isTopLevel(typeid(*getParent()) == typeid(VMessage));
+       bool isSender(typeid(*getParent()) == typeid(VEnvelope));
+       Attachment *vCardAttachment;
+
+       if(isAttachment())
+       {
+               vCardAttachment = new Attachment(
+                       (QDir::tempPath() + "/attachment-" + QString::number(event.Timestamp().toTime_t()) + "-" + QString::number(event.Attachments().count()) + ".vcard").toUtf8(),
+                       "text/x-vcard");
+       }
+
+       // Stream may or may not have a 'BEGIN' present. Swallow it if it's ours.
+       QString lineData(initialLine.length() > 0 ? initialLine : stream.readLine());
+       if(lineData.startsWith("BEGIN:"))
+       {
+               if(lineData != QString("BEGIN:") + getTagName())
+               {
+                       qDebug() << "Invalid stream";
+                       return false;
+               }
+               else if(!isAttachment())
+               {
+                       // ...discard this line
+                       lineData = stream.readLine();
+               }
+       }
+
+       do
+       {
+               if(isAttachment())
+               {
+                       vCardAttachment->Stream() << lineData << endl;
+
+                       if(lineData.startsWith("END:"))
+                       {
+                               if(lineData != QString("END:") + getTagName())
+                               {
+                                       qDebug() << getTagName() << " parser mismatch error" << lineData;
+                                       break;
+                               }
+                               else
+                               {
+                                       // Save attachment
+                                       event.Attachments().append(vCardAttachment);
+
+                                       hasEnded = true;
+                                       break;
+                               }
+                       }
+               }
+               else
+               {
+                       if(lineData.startsWith("VERSION:"))
+                       {
+                               version = lineData.mid(lineData.indexOf(":")+1).toFloat();
+                       }
+                       else if(lineData.startsWith("N:"))
+                       {
+                               if((isTopLevel && !event.Destination() == EventTypes::SMS::SENT) || (isSender && event.Destination() == EventTypes::SMS::SENT))
+                               {
+                                       //QString name = lineData.mid(lineData.indexOf(":") + 1);
+                                       //gchar* g_name = g_strdup(name.toUtf8());
+                                       //event.fld_remote_name = g_name;
+                               }
+                               else if(isTopLevel)
+                               {
+                                       //event.fld_local_name = g_strdup("<SelfHandle>");
+                               }
+                       }
+                       else if(lineData.startsWith("TEL:"))
+                       {
+                               if((isTopLevel && !event.Destination() == EventTypes::SMS::SENT) || (isSender && event.Destination() == EventTypes::SMS::SENT))
+                               {
+                                       QString tel = lineData.mid(lineData.indexOf(":") + 1);
+
+                                       if(tel.indexOf("0") == 0)
+                                               tel = tel.replace(QRegExp("^0"), "+44");
+
+                                       gchar* g_tel = g_strdup(tel.toUtf8());
+                                       event.setTel(g_tel);
+
+//                                     if(tel.length() < 7 || tel.indexOf(QRegExp("[:alpha:]+")) > -1)
+//                                             event.fld_group_uid = g_tel;
+//                                     else
+//                                             event.fld_group_uid = g_strdup(tel.right(7).toUtf8());
+                               }
+                               else if(isTopLevel)
+                               {
+                                       //event.fld_local_uid = g_strdup("ring/tel/ring");
+                               }
+                       }
+                       else if(lineData.startsWith("BEGIN:"))
+                       {
+                               iReader* reader = Factory::Instantiate(lineData, this);
+                               bool valid(NULL != reader && reader->Read(lineData, stream, event));
+                               delete reader;
+
+                               // Quit processing if the nested content is not valid
+                               if(!valid)
+                                       return valid;
+                       }
+                       else if(lineData.startsWith("END:"))
+                       {
+                               if(lineData != QString("END:") + getTagName())
+                               {
+                                       qDebug() << getTagName() << " parser mismatch error" << lineData;
+                                       break;
+                               }
+                               else
+                               {
+                                       hasEnded = true;
+                                       break;
+                               }
+                       }
+               }
+
+               lineData = stream.readLine();
+       }while(!hasEnded && !stream.atEnd());
+
+       if(hasEnded)
+       {
+
+       }
+
+       return true;
+}
diff --git a/EventParsers/VMGEntities/VCard.h b/EventParsers/VMGEntities/VCard.h
new file mode 100644 (file)
index 0000000..29d3960
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_VCARDWRITER_H
+#define EVENTPARSERS_VMGEntities_VCARDWRITER_H
+
+#include "SMSEntity.h"
+#include "iReader.h"
+#include "iWriter.h"
+
+class QString;
+
+namespace EventTypes { class SMS; }
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class VCard : public SMSEntity, public iWriter, public iReader
+               {
+               public:
+                       enum eTarget
+                       {
+                               VCARD_LOCAL,
+                               VCARD_REMOTE
+                       };
+
+                       VCard(const SMSEntity *parent);
+                       //VCard(QTextStream& stream);
+                       VCard(const SMSEntity *parent, float version, eTarget target);
+                       ~VCard();
+
+                       virtual bool Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event);
+                       virtual void Write(QTextStream &stream, const EventTypes::SMS &event);
+
+               protected:
+                       virtual const char *getTagName() const { return "VCARD"; }
+
+               private:
+                       float m_Version;
+                       eTarget m_Target;
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_VCARDWRITER_H
diff --git a/EventParsers/VMGEntities/VEnvelope.cpp b/EventParsers/VMGEntities/VEnvelope.cpp
new file mode 100644 (file)
index 0000000..54b8f41
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "VEnvelope.h"
+
+#include "Factory.h"
+#include "VBody.h"
+
+#include <QTextStream>
+
+#include <QDebug>
+
+using namespace EventParsers::VMGEntities;
+
+VEnvelope::VEnvelope(const SMSEntity* parent) :
+       SMSEntity(parent)
+{
+}
+
+//VEnvelope::VEnvelope(QTextStream& stream)
+//{
+//}
+
+VEnvelope::~VEnvelope()
+{
+       foreach(iWriter *contentWriter, m_ContentWriters)
+               delete contentWriter;
+
+       m_ContentWriters.empty();
+}
+
+void VEnvelope::Write(QTextStream &stream, const EventTypes::SMS &event)
+{
+       stream << "BEGIN:" << getTagName() << "\n";
+
+       foreach(iWriter *contentWriter, m_ContentWriters)
+               contentWriter->Write(stream, event);
+
+       stream << "END:" << getTagName() << "\n";
+}
+
+bool VEnvelope::Read(const QString &initialLine, QTextStream &stream, EventTypes::SMS &event)
+{
+       bool hasEnded(false);
+
+       // Stream may or may not have a 'BEGIN' present. Swallow it if it's ours.
+       QString lineData(initialLine.length() > 0 ? initialLine : stream.readLine());
+       if(lineData.startsWith("BEGIN:"))
+       {
+               if(lineData != QString("BEGIN:") + getTagName())
+               {
+                       qDebug() << "Invalid stream";
+                       return false;
+               }
+               else // ...discard this line
+                       lineData = stream.readLine();
+       }
+
+       do
+       {
+               if(lineData.startsWith("BEGIN:"))
+               {
+                       iReader* reader = Factory::Instantiate(lineData, this);
+                       bool valid(NULL != reader && reader->Read(lineData, stream, event));
+                       delete reader;
+
+                       // Quit processing if the nested content is not valid
+                       if(!valid)
+                               return valid;
+               }
+               else if(lineData.startsWith("END:"))
+               {
+                       if(lineData != QString("END:") + getTagName())
+                       {
+                               qDebug() << getTagName() << " parser mismatch error" << lineData;
+                               return false;
+                       }
+                       else
+                       {
+                               hasEnded = true;
+                               break;
+                       }
+               }
+
+               lineData = stream.readLine();
+       }while(!hasEnded && !stream.atEnd());
+
+       if(hasEnded)
+       {
+               //event.fld_is_read = isRead;
+               //event.fld_outgoing = isOutgoing;
+               //event.fld_start_time = timestamp.toUTC().toTime_t();
+       }
+
+       return true;
+}
diff --git a/EventParsers/VMGEntities/VEnvelope.h b/EventParsers/VMGEntities/VEnvelope.h
new file mode 100644 (file)
index 0000000..d399a90
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_VENVELOPEWRITER_H
+#define EVENTPARSERS_VMGEntities_VENVELOPEWRITER_H
+
+#include "SMSEntity.h"
+#include "iReader.h"
+#include "iWriter.h"
+
+#include <QList>
+
+class QString;
+
+class SMS;
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class VBodyWriter;
+
+               class VEnvelope : public SMSEntity, public iWriter, public iReader
+               {
+               public:
+                       VEnvelope(const SMSEntity* parent);
+                       //VEnvelope(QTextStream& stream);
+                       ~VEnvelope();
+
+                       virtual bool Read(const QString & initialLine, QTextStream & stream, EventTypes::SMS & event);
+                       virtual void Write(QTextStream & stream, const EventTypes::SMS & event);
+
+                       QList<iWriter*> & getContentWriters() { return m_ContentWriters; }
+
+               protected:
+                       virtual const char* getTagName() const { return "VENV"; }
+
+               private:
+                       QList<iWriter*> m_ContentWriters;
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_VENVELOPEWRITER_H
diff --git a/EventParsers/VMGEntities/VMGFactory.cpp b/EventParsers/VMGEntities/VMGFactory.cpp
new file mode 100644 (file)
index 0000000..1959d89
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Factory.h"
+
+#include "VBody.h"
+#include "VCard.h"
+#include "VEnvelope.h"
+#include "VMessage.h"
+#include "VCalendar.h"
+
+#include <QDebug>
+
+using namespace EventParsers::VMGEntities;
+
+iReader *Factory::Instantiate(QString& lineData, const SMSEntity *parent)
+{
+       if(lineData.startsWith("BEGIN:"))
+       {
+               QString item = lineData.mid(lineData.indexOf(":")+1);
+
+               if(item == "VMSG")
+                       return new VMessage(parent);
+               else if(item == "VCARD")
+                       return new VCard(parent);
+               else if(item == "VENV")
+                       return new VEnvelope(parent);
+               else if(item == "VBODY")
+                       return new VBody(parent);
+               else if(item == "VCALENDAR")
+                       return new VCalendar(parent);
+       }
+
+       qDebug() << "Unrecognised entity '" << lineData <<"'";
+       return NULL;
+}
diff --git a/EventParsers/VMGEntities/VMessage.cpp b/EventParsers/VMGEntities/VMessage.cpp
new file mode 100644 (file)
index 0000000..59097d7
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "VMessage.h"
+
+#include "EventTypes/SMS.h"
+#include "Factory.h"
+#include "VCard.h"
+#include "VEnvelope.h"
+#include "VBody.h"
+
+#include <QDateTime>
+#include <QTextStream>
+
+#include <QDebug>
+
+using namespace EventParsers::VMGEntities;
+
+VMessage::VMessage(const SMSEntity* parent) :
+       SMSEntity(parent), m_Version(1.1)
+{
+}
+
+//VMessage::VMessage(QTextStream& stream)
+//{
+//}
+
+VMessage::VMessage(const SMSEntity* parent, float version) :
+       SMSEntity(parent), m_Version(version)
+{
+}
+
+VMessage::~VMessage()
+{
+}
+
+bool VMessage::Read(const QString & initialLine, QTextStream & stream, EventTypes::SMS & event)
+{
+       if(getParent() != NULL)
+       {
+               qDebug() << "Messages cannot be nested.";
+               return false;
+       }
+
+       bool hasEnded(false);
+       float version(0);
+
+       // Stream may or may not have a 'BEGIN' present. Swallow it if it's ours.
+       QString lineData(initialLine.length() > 0 ? initialLine : stream.readLine());
+       if(lineData.startsWith("BEGIN:"))
+       {
+               if(lineData != QString("BEGIN:") + getTagName())
+               {
+                       qDebug() << "Invalid stream";
+                       return false;
+               }
+               else // ...discard this line
+                       lineData = stream.readLine();
+       }
+
+       do
+       {
+               if(lineData.startsWith("VERSION:"))
+               {
+                       version = lineData.mid(lineData.indexOf(":")+1).toFloat();
+               }
+               else if(lineData.startsWith("X-IRMC-STATUS:"))
+               {
+                       bool isRead(lineData.mid(lineData.indexOf(":") + 1) == "READ");
+                       event.setIsRead(isRead);
+               }
+               else if(lineData.startsWith("X-IRMC-BOX:"))
+               {
+                       QString box = lineData.mid(lineData.indexOf(":") + 1);
+                       bool isOutgoing(box == "SENT");
+                       if (isOutgoing == false && box != "INBOX")
+                       {
+                               qDebug() << "Unexpected box: " << box;
+                               return false;
+                       }
+                       event.setDestination(isOutgoing ? EventTypes::SMS::SENT : EventTypes::SMS::INBOX);
+               }
+               else if(lineData.startsWith("X-NOK-DT:"))
+               {
+                       QDateTime timestamp(QDateTime::fromString(
+                               lineData.mid(lineData.indexOf(":") + 1),
+                               "yyyyMMddThhmmssZ"));
+                       timestamp.setTimeSpec(Qt::UTC);
+                       event.setTimestamp(timestamp);
+               }
+               else if(lineData.startsWith("BEGIN:"))
+               {
+                       iReader* reader = Factory::Instantiate(lineData, this);
+                       bool valid(NULL != reader && reader->Read(lineData, stream, event));
+                       delete reader;
+
+                       // Quit processing if the nested content is not valid
+                       if(!valid)
+                               return valid;
+               }
+               else if(lineData.startsWith("END:"))
+               {
+                       if(lineData != "END:VMSG")
+                       {
+                               qDebug() << getTagName() << " parser mismatch error" << lineData;
+                               return false;
+                       }
+                       else
+                       {
+                               hasEnded = true;
+                               break;
+                       }
+               }
+
+               lineData = stream.readLine();
+       }while(!hasEnded && !stream.atEnd());
+
+       return true;
+}
+
+void VMessage::Write(QTextStream &stream, const EventTypes::SMS &event)
+{
+       stream << "BEGIN:VMSG\n";
+       stream << "VERSION:" << m_Version << "\n";
+       stream << "X-IRMC-STATUS:" << ( event.IsRead() ? "READ" : "") << "\n";
+       stream << "X-IRMC-BOX:" << ( event.Destination() == EventTypes::SMS::SENT ? "SENT" : "INBOX") << "\n";
+       stream << "X-NOK-DT:" << event.Timestamp().toUTC().toString("yyyyMMddThhmmssZ") << "\n";
+
+       VEnvelope msgEnvelope(this);
+
+       // Add in the empty vcard for outgoing messages
+       if(event.Destination() == EventTypes::SMS::SENT)
+       {
+               VCard(this, 2.1, VCard::VCARD_LOCAL).Write(stream, event);
+
+               msgEnvelope.getContentWriters().append(new VCard(&msgEnvelope, 2.1, VCard::VCARD_REMOTE));
+
+               VEnvelope *bodyEnvelope = new VEnvelope(this);
+               bodyEnvelope->getContentWriters().append(new VBody(bodyEnvelope));
+               msgEnvelope.getContentWriters().append(bodyEnvelope);
+       }
+       else
+       {
+               VCard(this, 2.1, VCard::VCARD_REMOTE).Write(stream, event);
+
+               msgEnvelope.getContentWriters().append(new VBody(&msgEnvelope));
+       }
+
+       msgEnvelope.Write(stream, event);
+
+       stream << "END:VMSG\n";
+}
diff --git a/EventParsers/VMGEntities/VMessage.h b/EventParsers/VMGEntities/VMessage.h
new file mode 100644 (file)
index 0000000..725b175
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_VMESSAGEWRITER_H
+#define EVENTPARSERS_VMGEntities_VMESSAGEWRITER_H
+
+#include "SMSEntity.h"
+#include "iReader.h"
+#include "iWriter.h"
+
+class QString;
+class QTextStream;
+
+namespace EventTypes { class SMS; }
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class VCard;
+               class VEnvelope;
+
+               class VMessage : public SMSEntity, public iWriter, public iReader
+               {
+               public:
+                       VMessage(const SMSEntity* parent);
+                       //VMessage(QTextStream& stream);
+                       VMessage(const SMSEntity* parent, float version);
+                       ~VMessage();
+
+                       virtual bool Read(const QString & initialLine, QTextStream& stream, EventTypes::SMS & event);
+                       virtual void Write(QTextStream & stream, const EventTypes::SMS & event);
+
+               protected:
+                       virtual const char * getTagName() const { return "VMSG"; }
+
+               private:
+                       float m_Version;
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_VMESSAGEWRITER_H
diff --git a/EventParsers/VMGEntities/iReader.h b/EventParsers/VMGEntities/iReader.h
new file mode 100644 (file)
index 0000000..57f9b7a
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_IREADER_H
+#define EVENTPARSERS_VMGEntities_IREADER_H
+
+namespace EventTypes { class SMS; }
+
+class QString;
+class QTextStream;
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class iReader
+               {
+               public:
+                       virtual ~iReader() {};
+                       virtual bool Read(const QString& initialLine, QTextStream& stream, EventTypes::SMS& event) = 0;
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_IREADER_H
diff --git a/EventParsers/VMGEntities/iWriter.h b/EventParsers/VMGEntities/iWriter.h
new file mode 100644 (file)
index 0000000..45184a5
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGEntities_IWRITER_H
+#define EVENTPARSERS_VMGEntities_IWRITER_H
+
+namespace EventTypes { class SMS; }
+
+class QTextStream;
+
+namespace EventParsers
+{
+       namespace VMGEntities
+       {
+               class iWriter
+               {
+               public:
+                       virtual ~iWriter() {};
+                       virtual void Write(QTextStream& stream, const EventTypes::SMS& event) = 0;
+               };
+       }
+}
+
+#endif // EVENTPARSERS_VMGEntities_IWRITER_H
diff --git a/EventParsers/VMGParser.cpp b/EventParsers/VMGParser.cpp
new file mode 100644 (file)
index 0000000..dbb82f3
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "VMGParser.h"
+
+#include "EventParsers/VMGEntities/Factory.h"
+#include "EventParsers/VMGEntities/iReader.h"
+#include "EventTypes/SMS.h"
+
+#include <QDebug>
+
+#include <QFile>
+#include <QHash>
+#include <QList>
+#include <QString>
+#include <QStringList>
+
+#include <stdexcept>
+
+using namespace EventParsers;
+
+iEventParser *VMGParser::IsValid(const Settings &settings, QFile &eventFile)
+{
+       qDebug() << "Checking if a VMG file...";
+
+       char fileIDBuf[0x16];
+       qint64 bytesRead(eventFile.read(fileIDBuf, sizeof(fileIDBuf) - 1));
+       eventFile.seek(0);
+       if(bytesRead == sizeof(fileIDBuf) - 1)
+       {
+               // This is the string BEGIN:VMSG<LF> in little-endian UTF16.
+               char signatureVMG[] = { 0x42, 0x00, 0x45, 0x00, 0x47, 0x00,
+                                                               0x49, 0x00, 0x4E, 0x00, 0x3A, 0x00,
+                                                               0x56, 0x00, 0x4D, 0x00, 0x53, 0x00,
+                                                               0x47, 0x00, 0x0A, 0x00 };
+
+               if(memcmp(fileIDBuf, signatureVMG, sizeof(fileIDBuf) - 1) == 0)
+               {
+                       qDebug() << eventFile.fileName() << " is a VMG file.";
+                       return new VMGParser(settings, eventFile.fileName());
+               }
+               else
+               {
+                       QString hexs;
+                       for(int i(0); i<0x16; ++i)
+                               hexs.append(QString::number(fileIDBuf[i], 16).rightJustified(2, '0'));
+                       qDebug() << eventFile.fileName() << " has bad signature: " << hexs;
+               }
+       }
+       else
+               qDebug() << eventFile.fileName() << " has size mismatch.";
+
+       return false;
+}
+
+VMGParser::VMGParser(const Settings &settings, const QString &filename) : m_Settings(settings)
+{
+}
+
+EventTypes::EventFromFileList VMGParser::ParseFile(QFile &eventFile, const QList<uint> &recordsToReturn)
+{
+       // VMG files are stored in Little-Endian UTF16, with no BOM.
+       QTextStream eventStream(&eventFile);
+       eventStream.setCodec("UTF-16LE");
+
+       // Parse the event
+       EventTypes::SMS *event(new EventTypes::SMS(CurrentSettings()));
+       QString lineData = eventStream.readLine();
+       EventParsers::VMGEntities::iReader* reader = EventParsers::VMGEntities::Factory::Instantiate(lineData, NULL);
+       bool valid(NULL != reader && reader->Read(QString(""), eventStream, *event));
+       delete reader;
+       if (!valid)
+               throw std::runtime_error(QString("Unsupported format. Unable to open: %1").arg(eventFile.fileName()).toStdString());
+
+       qDebug() << "\nParsed event:";
+       qDebug() << event;
+
+       // VMGs only support single events per file, so just create the list
+       EventTypes::EventFromFileList retList;
+       retList.append(EventTypes::EventFromFile(event, 0));
+       return retList;
+}
diff --git a/EventParsers/VMGParser.h b/EventParsers/VMGParser.h
new file mode 100644 (file)
index 0000000..2910924
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_VMGPARSER_H
+#define EVENTPARSERS_VMGPARSER_H
+
+#include "iEventParser.h"
+
+class Settings;
+
+class QFile;
+class QString;
+
+namespace EventParsers
+{
+       class VMGParser : public iEventParser
+       {
+       public:
+               static iEventParser *IsValid(const Settings &settings, QFile &eventFile);
+
+               VMGParser(const Settings &settings, const QString &filename);
+               virtual EventTypes::EventFromFileList ParseFile(QFile &eventFile, const QList<uint> &recordsToReturn);
+
+       protected:
+               const Settings &CurrentSettings() const { return m_Settings; }
+
+       private:
+               const Settings &m_Settings;
+       };
+}
+
+#endif // EVENTPARSERS_VMGPARSER_H
diff --git a/EventParsers/iEventParser.h b/EventParsers/iEventParser.h
new file mode 100644 (file)
index 0000000..fa97cb2
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPARSERS_IPARSER_H
+#define EVENTPARSERS_IPARSER_H
+
+#include "EventTypes/EventFromFileList.h"
+
+class QFile;
+template <typename T1> class QList;
+typedef unsigned int uint;
+
+namespace EventParsers
+{
+       class iEventParser
+       {
+       public:
+               virtual ~iEventParser() {}
+
+               virtual EventTypes::EventFromFileList ParseFile(QFile &eventFile, const QList<uint> &recordsToReturn) = 0;
+       };
+}
+
+#endif // EVENTPARSERS_IPARSER_H
diff --git a/EventPreventer.cpp b/EventPreventer.cpp
new file mode 100644 (file)
index 0000000..e6d5a75
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "EventPreventer.h"
+
+#include "CellularRadio.h"
+#include "Settings.h"
+
+#include <QDebug>
+
+#include <QtCore/QCoreApplication>
+#include <QtDBus/QtDBus>
+
+const char * TP_ACCOUNT_PHONE("/org/freedesktop/Telepathy/Account/ring/tel/ring");
+const char * TP_IFACE_ACCOUNT("org.freedesktop.Telepathy.Account");
+const char * TP_IFACE_ACCOUNT_MANAGER("org.freedesktop.Telepathy.AccountManager");
+const char * TP_PATH_ACCOUNT_MANAGER("/org/freedesktop/Telepathy/AccountManager");
+const char * TP_IFACE_DBUS_PROPERTIES("org.freedesktop.DBus.Properties");
+
+EventPreventer::EventPreventer(const Settings & settings) : m_Settings(settings)
+{
+       StoreAccountStates();
+       DisableAccounts();
+}
+
+EventPreventer::~EventPreventer()
+{
+       RestoreAccounts();
+}
+
+void EventPreventer::StoreAccountStates()
+{
+       QDBusInterface tpAccountManager(TP_IFACE_ACCOUNT_MANAGER, TP_PATH_ACCOUNT_MANAGER, TP_IFACE_DBUS_PROPERTIES);
+       if (tpAccountManager.isValid())
+       {
+               // Grab state
+               QDBusMessage accountList = tpAccountManager.call("Get", TP_IFACE_ACCOUNT_MANAGER, "ValidAccounts");
+               foreach (QVariant arg, accountList.arguments())
+               {
+                       const QDBusArgument argument(qvariant_cast<QDBusVariant>(arg).variant().value<QDBusArgument>());
+                       argument.beginArray();
+                       while (!argument.atEnd())
+                       {
+                               // Grab the account path
+                               QDBusObjectPath accountPath;
+                               argument >> accountPath;
+
+                               if(accountPath.path() == TP_ACCOUNT_PHONE)
+                               {
+                                       // ...as we're not allowed to disable the telephone account,
+                                       // track the state of the cellular radio. Heavy-handed, but only known way.
+                                       OriginalAccountStates().insert(accountPath.path(), CellularRadio::CurrentState());
+
+                               }
+                               else
+                               {
+                                       // Grab the enabled property of each account
+                                       QDBusInterface tpAccount(TP_IFACE_ACCOUNT_MANAGER, accountPath.path(), TP_IFACE_DBUS_PROPERTIES);
+                                       if (tpAccount.isValid())
+                                       {
+                                               QDBusReply<QVariant> isEnabledProp = tpAccount.call("Get", TP_IFACE_ACCOUNT, "Enabled");
+
+                                               bool isEnabled(isEnabledProp.value().toBool());
+                                               qDebug() << (isEnabled ? "Enabled:\t\t" : "Not enabled:\t") << accountPath.path();
+                                               OriginalAccountStates().insert(accountPath.path(), isEnabled);
+                                       }
+                               }
+                       }
+                       argument.endArray();
+               }
+       }
+}
+
+void EventPreventer::DisableAccounts()
+{
+       SetAccountsToSameState(false);
+}
+
+void EventPreventer::EnableAccounts()
+{
+       SetAccountsToSameState(true);
+}
+
+void EventPreventer::SetAccountsToSameState(const bool state)
+{
+       // Set all stored accounts to requested state
+       foreach (QString accountPath, OriginalAccountStates().keys())
+               SetAccountToState(accountPath, state);
+}
+
+void EventPreventer::RestoreAccounts()
+{
+       // Set all stored accounts to stored state
+       foreach (QString accountPath, OriginalAccountStates().keys())
+               SetAccountToState(accountPath, OriginalAccountStates().value(accountPath));
+}
+
+void EventPreventer::SetAccountToState(const QString &accountPath, const bool desiredState)
+{
+       if(accountPath == TP_ACCOUNT_PHONE)
+       {
+               if(CurrentSettings().DisableCellular())
+               {
+                       // ...as we're not allowed to disable the telephone account,
+                       // disable the whole cellular radio. Heavy-handed, but only known way.
+                       CellularRadio::SetState(desiredState);
+               }
+       }
+       else
+       {
+               // Set each account to offline
+               QDBusInterface tpAccountManager(TP_IFACE_ACCOUNT_MANAGER, accountPath, TP_IFACE_DBUS_PROPERTIES);
+               if (tpAccountManager.isValid())
+               {
+                       QDBusReply<void> isEnabledProp = tpAccountManager.call("Set", TP_IFACE_ACCOUNT, "Enabled",
+                               QVariant::fromValue(QDBusVariant(QVariant::fromValue(desiredState))));
+
+                       if(!isEnabledProp.isValid())
+                               qDebug() << isEnabledProp.error().message();
+               }
+               else
+                       qDebug() << tpAccountManager.lastError().message();
+       }
+}
+
+
+
diff --git a/EventPreventer.h b/EventPreventer.h
new file mode 100644 (file)
index 0000000..1577d16
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPREVENTER_H
+#define EVENTPREVENTER_H
+
+class Settings;
+
+class QString;
+#include <QHash>
+
+class EventPreventer
+{
+public:
+       EventPreventer(const Settings &settings);
+       ~EventPreventer();
+
+public:
+       void StoreAccountStates();
+       void DisableAccounts();
+       void EnableAccounts();
+       void RestoreAccounts();
+
+private:
+       void SetAccountsToSameState(const bool desiredState);
+       void SetAccountToState(const QString &accountPath, const bool desiredState);
+
+public:
+       const QHash<QString, bool> & OriginalAccountStates() const { return m_OriginalAccountStates; }
+       QHash<QString, bool> & OriginalAccountStates() { return m_OriginalAccountStates; }
+       void setOriginalAccountStates(const QHash<QString, bool> originalAccountStates) { m_OriginalAccountStates = originalAccountStates; }
+
+protected:
+       const Settings & CurrentSettings() const { return m_Settings; }
+
+private:
+       const Settings & m_Settings;
+       QHash<QString, bool> m_OriginalAccountStates;
+};
+
+#endif // EVENTPREVENTER_H
diff --git a/EventProcessors/Hasher.cpp b/EventProcessors/Hasher.cpp
new file mode 100644 (file)
index 0000000..19ad9f7
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include <QSet>
+
+#include "EventProcessors/Hasher.h"
+
+#include "EventTypes/iEvent.h"
+
+#include <QDateTime>
+#include <QHash>
+
+#include <QDebug>
+
+using namespace EventProcessors;
+
+void Hasher::Process(EventTypes::iEvent &event)
+{
+       uint hash(event.HashCode());
+       m_Hashes.insert(hash);
+       qDebug() << "DB Event hash: " << hash << " @ " << event.Timestamp();
+}
+
+void Hasher::EmitEventProcessed(int eventsProcessed, int totalEvents)
+{
+       emit EventProcessed(eventsProcessed, totalEvents);
+}
diff --git a/EventProcessors/Hasher.h b/EventProcessors/Hasher.h
new file mode 100644 (file)
index 0000000..0c1a630
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPROCESSORS_HASHER_H
+#define EVENTPROCESSORS_HASHER_H
+
+#include "iEventProcessor.h"
+#include "iHashable.h"
+
+#include <QObject>
+#include <QSet>
+
+namespace EventProcessors
+{
+       class Hasher : public QObject, public iEventProcessor
+       {
+               Q_OBJECT
+
+       public:
+               QSet<iHashable::Hash> m_Hashes;
+
+               virtual void Process(EventTypes::iEvent &event);
+               virtual void EmitEventProcessed(int eventsProcessed, int totalEvents);
+
+       signals:
+               void EventProcessed(int current, int total);
+       };
+}
+
+#endif // EVENTPROCESSORS_HASHER_H
diff --git a/EventProcessors/Writer.cpp b/EventProcessors/Writer.cpp
new file mode 100644 (file)
index 0000000..4f3f4ba
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Writer.h"
+
+#include "EventTypes/iEvent.h"
+#include "Settings.h"
+
+using namespace EventProcessors;
+
+void Writer::Process(EventTypes::iEvent &event)
+{
+       event.Export(CurrentSettings().Directory());
+}
+
+void Writer::EmitEventProcessed(int eventsProcessed, int totalEvents)
+{
+       emit EventProcessed(eventsProcessed, totalEvents);
+}
diff --git a/EventProcessors/Writer.h b/EventProcessors/Writer.h
new file mode 100644 (file)
index 0000000..eb78417
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPROCESSORS_WRITER_H
+#define EVENTPROCESSORS_WRITER_H
+
+#include "iEventProcessor.h"
+
+class Settings;
+
+#include <QObject>
+
+namespace EventProcessors
+{
+       class Writer : public QObject, public iEventProcessor
+       {
+               Q_OBJECT
+
+       public:
+               Writer(Settings &settings)
+                       : m_Settings(settings)
+               {}
+
+               const Settings & CurrentSettings() { return m_Settings; }
+
+               virtual void Process(EventTypes::iEvent &event);
+               virtual void EmitEventProcessed(int eventsProcessed, int totalEvents);
+
+       private:
+               const Settings & m_Settings;
+
+       signals:
+               void EventProcessed(int current, int total);
+       };
+}
+
+#endif // EVENTPROCESSORS_WRITER_H
diff --git a/EventProcessors/iEventProcessor.h b/EventProcessors/iEventProcessor.h
new file mode 100644 (file)
index 0000000..38f345e
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTPROCESSORS_IEVENTPROCESSOR_H
+#define EVENTPROCESSORS_IEVENTPROCESSOR_H
+
+namespace EventTypes { class iEvent; }
+
+namespace EventProcessors
+{
+       class iEventProcessor
+       {
+       public:
+               virtual ~iEventProcessor() {}
+               virtual void Process(EventTypes::iEvent &event) =0;
+               virtual void EmitEventProcessed(int eventsProcessed, int totalEvents) =0;
+       };
+}
+
+#endif // EVENTPROCESSORS_IEVENTPROCESSOR_H
diff --git a/EventTypes/EventFromFile.h b/EventTypes/EventFromFile.h
new file mode 100644 (file)
index 0000000..ed3ed39
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTTYPES_EVENTFROMFILE_H
+#define EVENTTYPES_EVENTFROMFILE_H
+
+template <typename T1> class QList;
+template <typename T1, typename T2> class QPair;
+
+namespace EventTypes
+{
+       class iEvent;
+
+       typedef QPair<iEvent *, unsigned int> EventFromFile;
+}
+
+#endif // EVENTTYPES_EVENTFROMFILE_H
diff --git a/EventTypes/EventFromFileList.h b/EventTypes/EventFromFileList.h
new file mode 100644 (file)
index 0000000..46aaa74
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTTYPES_EVENTFROMFILELIST_H
+#define EVENTTYPES_EVENTFROMFILELIST_H
+
+#include "EventFromFile.h"
+
+namespace EventTypes
+{
+       typedef QList<EventFromFile> EventFromFileList;
+}
+
+
+#endif // EVENTTYPES_EVENTFROMFILELIST_H
diff --git a/EventTypes/EventList.h b/EventTypes/EventList.h
new file mode 100644 (file)
index 0000000..15bed38
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTTYPES_EVENTLIST_H
+#define EVENTTYPES_EVENTLIST_H
+
+template <typename T1> class QList;
+
+namespace EventTypes
+{
+       class iEvent;
+
+       typedef QList<iEvent *> EventList;
+}
+
+#endif // EVENTTYPES_EVENTLIST_H
diff --git a/EventTypes/PhoneCall.cpp b/EventTypes/PhoneCall.cpp
new file mode 100644 (file)
index 0000000..9901cfc
--- /dev/null
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "PhoneCall.h"
+
+#include "Attachment.h"
+#include "DBBackends/RtcomEventLogger.h"
+#include "EventParsers/CSVSymbianEventLogParser.h"
+#include "NumberToNameLookup.h"
+#include "Settings.h"
+
+#include <QDateTime>
+#include <QDir>
+#include <QFile>
+#include <QList>
+#include <QRegExp>
+#include <QString>
+#include <QTextStream>
+
+#include <utime.h>
+
+#include <rtcom-eventlogger/event.h>
+#include <rtcom-eventlogger/eventlogger-attach-iter.h>
+
+using namespace EventTypes;
+
+const DBBackends::iDBBackend &PhoneCall::DB() const
+{
+       return DBBackends::RtcomEventLogger(CurrentSettings(), *this);
+}
+
+PhoneCall::PhoneCall(const Settings &settings) :
+       m_Settings(settings)
+{
+}
+
+PhoneCall::~PhoneCall()
+{
+       foreach(QSharedPointer<Attachment> attachment, m_Attachments)
+       {
+               attachment.clear();
+       }
+}
+
+PhoneCall::PhoneCall(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
+       m_Settings(settings)
+{
+       setDestination(event.fld_outgoing ? OUTGOING : INCOMING);
+       setTimestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
+       setDurationInSeconds(QDateTime::fromTime_t(event.fld_start_time).toUTC().secsTo(QDateTime::fromTime_t(event.fld_end_time).toUTC()));
+       setTel(event.fld_remote_uid);
+       if(Tel().indexOf("0") == 0)
+               setTel(QString(Tel()).replace(QRegExp("^0"), "+44"));
+
+       // We directly access the m_Attachments member variable here rather than the
+       // accessor as the accessor is const
+       if(attachments.count() > 0)
+               foreach(RTComElAttachment *attachment, attachments)
+                       Attachments().append(new Attachment(*attachment));
+}
+#include <QDebug>
+const uint PhoneCall::HashCode() const
+{
+//     qDebug() << Timestamp().toUTC().toTime_t() << ", " << qHash(Tel()) << ", " << qHash(Destination()) << ", " << qHash(Contents()) << ", " << Attachments().HashCode();
+
+//     foreach(QChar c, Contents().toUtf8())
+//     {
+//             qDebug() << c.unicode();
+//     }
+
+       return
+               Timestamp().toUTC().toTime_t() ^
+               DurationInSeconds() ^
+               qHash(Tel()) ^
+               qHash(Destination()) ^
+               Attachments().HashCode();
+}
+
+RTComElEvent * PhoneCall::toRTComEvent(const NumberToNameLookup &numberToNameLookup) const
+{
+       QList<QString> voiceMailList;
+
+       QString groupId((Tel().length() < 7 || Tel().indexOf(QRegExp("[:alpha:]+")) > -1)
+               ? Tel()
+               : Tel().right(7));
+
+       RTComElEvent *event(rtcom_el_event_new());
+       memset(event, 0, sizeof(RTComElEvent));
+
+       RTCOM_EL_EVENT_SET_FIELD (event, service, g_strdup("RTCOM_EL_SERVICE_CALL"));
+       if(voiceMailList.contains(Tel()))
+               RTCOM_EL_EVENT_SET_FIELD (event, event_type, g_strdup("RTCOM_EL_EVENTTYPE_CALL_VOICEMAIL"));
+       else
+               RTCOM_EL_EVENT_SET_FIELD (event, event_type, g_strdup("RTCOM_EL_EVENTTYPE_CALL"));
+       RTCOM_EL_EVENT_SET_FIELD (event, storage_time, Timestamp().toUTC().toTime_t());
+       RTCOM_EL_EVENT_SET_FIELD (event, start_time, Timestamp().toUTC().toTime_t());
+       RTCOM_EL_EVENT_SET_FIELD (event, end_time, Timestamp().toUTC().toTime_t());
+       //RTCOM_EL_EVENT_SET_FIELD (event, is_read, 0);
+       RTCOM_EL_EVENT_SET_FIELD (event, outgoing, Destination() == PhoneCall::OUTGOING ? 1 : 0);
+       RTCOM_EL_EVENT_SET_FIELD (event, local_uid, g_strdup("ring/tel/ring"));
+       //RTCOM_EL_EVENT_SET_FIELD (&event, local_name, g_strdup("<SelfHandle>"));
+       RTCOM_EL_EVENT_SET_FIELD (event, remote_uid, g_strdup(Tel().toUtf8()));
+       //RTCOM_EL_EVENT_SET_FIELD (&event, remote_name, g_strdup(QString::number(numberToNameLookup.ContactDetails().value(Tel()).second).toUtf8()));
+       RTCOM_EL_EVENT_SET_FIELD (event, remote_ebook_uid, g_strdup(QString::number(numberToNameLookup.ContactDetails().value(Tel()).first).toUtf8()));
+       RTCOM_EL_EVENT_SET_FIELD (event, group_uid, g_strdup(groupId.toUtf8()));
+       //RTCOM_EL_EVENT_SET_FIELD (event, free_text, g_strdup(Contents().replace(0x2029, "\n").toUtf8()));
+       //RTCOM_EL_EVENT_SET_FIELD (event, free_text, g_strdup(Contents().toUtf8()));
+
+       return event;
+}
+
+void PhoneCall::Export(const QString &baseDirectory) const
+{
+//     // Build the path and ensure it exists...
+//     QString eventFilename(baseDirectory);
+//     eventFilename += Destination() == EventTypes::PhoneCall::OUTGOING ? "/Sent/" : "/Inbox/";
+//     eventFilename += QString::number(Timestamp().toUTC().date().year()) + "/";
+//     QDir().mkpath(eventFilename);
+
+//     // ...then build the filename and open it.
+//     eventFilename += QString::number(Timestamp().toUTC().toTime_t()) + ".vmg";
+//     QFile data(eventFilename);
+//     if (data.open(QFile::WriteOnly | QFile::Truncate))
+//     {
+//             QTextStream stream(&data);
+
+//             QTextCodec *oldCodec = stream.codec();
+//             stream.setAutoDetectUnicode(false);
+//             stream.setCodec("UTF-16LE");
+
+//             EventParsers::VMGEntities::VMessage writer(NULL, 1.1);
+//             writer.Write(stream, *this);
+////stream << "Test";
+//             //stream.setCodec(oldCodec);
+//             stream.flush();
+//             data.close();
+
+//             utimbuf fileTimes;
+//             fileTimes.modtime = Timestamp().toUTC().toTime_t();
+//             utime(eventFilename.toAscii(), &fileTimes);
+//     }
+}
+
+QDebug operator<<(QDebug dbg, PhoneCall& event)
+{
+       dbg.nospace() << "\tFolder:\t\t" << (event.Destination() == PhoneCall::OUTGOING ? "Sent" : "Inbox") << "\n";
+       dbg.nospace() << "\tTimestamp:\t" << event.Timestamp().toUTC() << "\n";
+       dbg.nospace() << "\tDuration:\t" << event.DurationInSeconds() << "\n";
+       dbg.nospace() << "\tRemote-Tel:\t" << event.Tel() << "\n";
+       //dbg.nospace() << "\tremote-name:\t" << event.fld_remote_name << "\n";
+
+       return dbg;
+}
diff --git a/EventTypes/PhoneCall.h b/EventTypes/PhoneCall.h
new file mode 100644 (file)
index 0000000..88f8b2a
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTTYPES_PHONECALL_H
+#define EVENTTYPES_PHONECALL_H
+
+#include <QDateTime>
+#include <QDebug>
+#include <QList>
+#include <QString>
+
+#include "RtcomEvent.h"
+
+#include "AttachmentCollection.h"
+
+class Settings;
+
+namespace EventTypes
+{
+       class PhoneCall : public RtcomEvent
+       {
+       public:
+               enum eDestination
+               {
+                       INCOMING,
+                       OUTGOING
+               };
+
+       public:
+               virtual const DBBackends::iDBBackend &DB() const;
+
+               PhoneCall(const Settings &settings);
+               ~PhoneCall();
+
+               virtual const uint HashCode() const;
+
+               const eDestination Destination() const { return m_Destination; }
+               void setDestination(const eDestination destination) { m_Destination = destination; }
+
+               virtual const QDateTime Timestamp() const { return m_Timestamp; }
+               void setTimestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
+
+               const QString Tel() const { return m_Tel; }
+               void setTel(const QString tel) { m_Tel = tel; }
+
+               virtual const int DurationInSeconds() const { return m_DurationInSeconds; }
+               void setDurationInSeconds(const int durationInSeconds) { m_DurationInSeconds = durationInSeconds; }
+
+               virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
+               virtual AttachmentCollection & Attachments() { return m_Attachments; }
+
+       public:
+               virtual void Export(const QString &baseDirectory) const;
+               PhoneCall(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
+               virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const;
+
+       protected:
+               const Settings &CurrentSettings() const { return m_Settings; }
+
+       private:
+               const Settings &m_Settings;
+               eDestination m_Destination;
+               QDateTime m_Timestamp;
+               QString m_Tel;
+               int m_DurationInSeconds;
+               AttachmentCollection m_Attachments;
+       };
+}
+
+QDebug operator<<(QDebug dbg, EventTypes::PhoneCall & event);
+
+#endif // EVENTTYPES_PHONECALL_H
diff --git a/EventTypes/RtcomEvent.cpp b/EventTypes/RtcomEvent.cpp
new file mode 100644 (file)
index 0000000..cb0942f
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include <rtcom-eventlogger/event.h>
+
+#include "RtcomEvent.h"
+
+using namespace EventTypes;
+
+RtcomEvent::RtcomEvent()
+{
+}
+
+void RtcomEvent::freeRTComContents(RTComElEvent &event)
+{
+       rtcom_el_event_free_contents(&event);
+}
diff --git a/EventTypes/RtcomEvent.h b/EventTypes/RtcomEvent.h
new file mode 100644 (file)
index 0000000..27e44fb
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENT_H
+#define EVENT_H
+
+#include "iEvent.h"
+
+#include <QList> // Needed for default value
+
+class _RTComElAttachment;
+typedef _RTComElAttachment RTComElAttachment;
+class _RTComElEvent;
+typedef _RTComElEvent RTComElEvent;
+
+class Attachment;
+class NumberToNameLookup;
+
+#include "iHashable.h"
+
+namespace EventTypes
+{
+       class RtcomEvent : public iEvent
+       {
+       public:
+               RtcomEvent();
+
+               RtcomEvent(const RTComElEvent &event, const QList<RTComElAttachment *> attachments = QList<RTComElAttachment *>());
+
+               virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const = 0;
+               static void freeRTComContents(RTComElEvent &event);
+       };
+}
+
+#endif // EVENT_H
diff --git a/EventTypes/SMS.cpp b/EventTypes/SMS.cpp
new file mode 100644 (file)
index 0000000..19d4df5
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "SMS.h"
+
+#include "Attachment.h"
+#include "DBBackends/RtcomEventLogger.h"
+#include "EventParsers/VMGEntities/VMessage.h"
+#include "NumberToNameLookup.h"
+#include "Settings.h"
+
+#include <QDateTime>
+#include <QDir>
+#include <QFile>
+#include <QList>
+#include <QRegExp>
+#include <QString>
+#include <QTextStream>
+
+#include <utime.h>
+
+#include <rtcom-eventlogger/event.h>
+#include <rtcom-eventlogger/eventlogger-attach-iter.h>
+
+using namespace EventTypes;
+
+const DBBackends::iDBBackend &SMS::DB() const
+{
+       return DBBackends::RtcomEventLogger(CurrentSettings(), *this);
+}
+
+SMS::SMS(const Settings &settings) :
+       m_Settings(settings)
+{
+}
+
+SMS::~SMS()
+{
+       foreach(QSharedPointer<Attachment> attachment, m_Attachments)
+       {
+               attachment.clear();
+       }
+}
+
+SMS::SMS(const Settings &settings, const RTComElEvent &event, const QList<RTComElAttachment*> attachments) :
+       m_Settings(settings)
+{
+       setVersion(2.1);
+       setIsRead(event.fld_is_read);
+       setDestination(event.fld_outgoing ? SENT : INBOX);
+       setTimestamp(QDateTime::fromTime_t(event.fld_start_time).toUTC());
+       setTel(event.fld_remote_uid);
+       if(Tel().indexOf("0") == 0)
+               setTel(QString(Tel()).replace(QRegExp("^0"), "+44"));
+       //setContents(QString(event.fld_free_text).replace("\n", QChar(0x2029)));
+       setContents(QString::fromUtf8(event.fld_free_text));
+
+       // We directly access the m_Attachments member variable here rather than the
+       // accessor as the accessor is const
+       if(attachments.count() > 0)
+               foreach(RTComElAttachment *attachment, attachments)
+                       m_Attachments.append(new Attachment(*attachment));
+}
+#include <QDebug>
+const uint SMS::HashCode() const
+{
+//     qDebug() << Timestamp().toUTC().toTime_t() << ", " << qHash(Tel()) << ", " << qHash(Destination()) << ", " << qHash(Contents()) << ", " << Attachments().HashCode();
+
+//     foreach(QChar c, Contents().toUtf8())
+//     {
+//             qDebug() << c.unicode();
+//     }
+
+       return
+               Timestamp().toUTC().toTime_t() ^
+               qHash(Tel()) ^
+               qHash(Destination()) ^
+               qHash(Contents()) ^
+               Attachments().HashCode();
+}
+
+RTComElEvent * SMS::toRTComEvent(const NumberToNameLookup &numberToNameLookup) const
+{
+       QString groupId((Tel().length() < 7 || Tel().indexOf(QRegExp("[:alpha:]+")) > -1)
+               ? Tel()
+               : Tel().right(7));
+
+       RTComElEvent *event(rtcom_el_event_new());
+       memset(event, 0, sizeof(RTComElEvent));
+
+       RTCOM_EL_EVENT_SET_FIELD (event, service, g_strdup("RTCOM_EL_SERVICE_SMS"));
+       RTCOM_EL_EVENT_SET_FIELD (event, event_type, g_strdup("RTCOM_EL_EVENTTYPE_SMS_MESSAGE"));
+       RTCOM_EL_EVENT_SET_FIELD (event, storage_time, Timestamp().toUTC().toTime_t());
+       RTCOM_EL_EVENT_SET_FIELD (event, start_time, Timestamp().toUTC().toTime_t());
+       RTCOM_EL_EVENT_SET_FIELD (event, end_time, Timestamp().toUTC().toTime_t());
+       RTCOM_EL_EVENT_SET_FIELD (event, is_read, IsRead() ? 1 : 0);
+       RTCOM_EL_EVENT_SET_FIELD (event, outgoing, Destination() == SMS::SENT ? 1 : 0);
+       RTCOM_EL_EVENT_SET_FIELD (event, local_uid, g_strdup("ring/tel/ring"));
+       //RTCOM_EL_EVENT_SET_FIELD (&event, local_name, g_strdup("<SelfHandle>"));
+       RTCOM_EL_EVENT_SET_FIELD (event, remote_uid, g_strdup(Tel().toUtf8()));
+       //RTCOM_EL_EVENT_SET_FIELD (&event, remote_name, g_strdup(QString::number(numberToNameLookup.ContactDetails().value(Tel()).second).toUtf8()));
+       RTCOM_EL_EVENT_SET_FIELD (event, remote_ebook_uid, g_strdup(QString::number(numberToNameLookup.ContactDetails().value(Tel()).first).toUtf8()));
+       RTCOM_EL_EVENT_SET_FIELD (event, group_uid, g_strdup(groupId.toUtf8()));
+       //RTCOM_EL_EVENT_SET_FIELD (event, free_text, g_strdup(Contents().replace(0x2029, "\n").toUtf8()));
+       RTCOM_EL_EVENT_SET_FIELD (event, free_text, g_strdup(Contents().toUtf8()));
+
+       return event;
+}
+
+void SMS::Export(const QString &baseDirectory) const
+{
+       // Build the path and ensure it exists...
+       QString eventFilename(baseDirectory);
+       eventFilename += Destination() == EventTypes::SMS::SENT ? "/Sent/" : "/Inbox/";
+       eventFilename += QString::number(Timestamp().toUTC().date().year()) + "/";
+       QDir().mkpath(eventFilename);
+
+       // ...then build the filename and open it.
+       eventFilename += QString::number(Timestamp().toUTC().toTime_t()) + ".vmg";
+       QFile data(eventFilename);
+       if (data.open(QFile::WriteOnly | QFile::Truncate))
+       {
+               QTextStream stream(&data);
+
+               QTextCodec *oldCodec = stream.codec();
+               stream.setAutoDetectUnicode(false);
+               stream.setCodec("UTF-16LE");
+
+               EventParsers::VMGEntities::VMessage writer(NULL, 1.1);
+               writer.Write(stream, *this);
+//stream << "Test";
+               //stream.setCodec(oldCodec);
+               stream.flush();
+               data.close();
+
+               utimbuf fileTimes;
+               fileTimes.modtime = Timestamp().toUTC().toTime_t();
+               utime(eventFilename.toAscii(), &fileTimes);
+       }
+}
+
+QDebug operator<<(QDebug dbg, SMS& event)
+{
+       dbg.nospace() << "\tFolder:\t\t" << (event.Destination() == SMS::SENT ? "Sent" : "Inbox") << "\n";
+       dbg.nospace() << "\tTimestamp:\t" << event.Timestamp().toUTC() << "\n";
+       dbg.nospace() << "\tRemote-Tel:\t" << event.Tel() << "\n";
+       //dbg.nospace() << "\tremote-name:\t" << event.fld_remote_name << "\n";
+       dbg.nospace() << "\tIs-read:\t\t" << (event.IsRead() ? "true" : "false") << "\n";
+       dbg.nospace() << "\tContents:\t" << event.Contents() << "\n";
+
+       return dbg;
+}
diff --git a/EventTypes/SMS.h b/EventTypes/SMS.h
new file mode 100644 (file)
index 0000000..696003a
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 EVENTTYPES_SMS_H
+#define EVENTTYPES_SMS_H
+
+#include <QDateTime>
+#include <QDebug>
+#include <QList>
+#include <QString>
+
+#include "RtcomEvent.h"
+
+#include "AttachmentCollection.h"
+
+class Settings;
+
+namespace EventTypes
+{
+       class SMS : public RtcomEvent
+       {
+       public:
+               enum eDestination
+               {
+                       INBOX,
+                       SENT
+               };
+
+       public:
+               virtual const DBBackends::iDBBackend &DB() const;
+
+               SMS(const Settings &settings);
+               ~SMS();
+
+               virtual const uint HashCode() const;
+
+               const float Version() const { return m_Version; }
+               void setVersion(const float version) { m_Version = version; }
+
+               const bool IsRead() const { return m_Read; }
+               void setIsRead(const bool isRead) { m_Read = isRead; }
+
+               const eDestination Destination() const { return m_Destination; }
+               void setDestination(const eDestination destination) { m_Destination = destination; }
+
+               virtual const QDateTime Timestamp() const { return m_Timestamp; }
+               void setTimestamp(const QDateTime timestamp) { m_Timestamp = timestamp; }
+
+               const QString Tel() const { return m_Tel; }
+               void setTel(const QString tel) { m_Tel = tel; }
+
+               QString Contents() const { return m_Contents; }
+               void setContents(const QString contents) { m_Contents = contents; }
+
+               virtual const AttachmentCollection & Attachments() const { return m_Attachments; }
+               virtual AttachmentCollection & Attachments() { return m_Attachments; }
+
+       public:
+               virtual void Export(const QString &baseDirectory) const;
+               SMS(const Settings &settings, const RTComElEvent& event, const QList<RTComElAttachment*> attachments = QList<RTComElAttachment*>());
+               virtual RTComElEvent * toRTComEvent(const NumberToNameLookup &numberToNameLookup) const;
+
+       protected:
+               const Settings &CurrentSettings() const { return m_Settings; }
+
+       private:
+               const Settings &m_Settings;
+               float m_Version;
+               bool m_Read;
+               eDestination m_Destination;
+               QDateTime m_Timestamp;
+               QString m_Tel;
+               QString m_Contents;
+               AttachmentCollection m_Attachments;
+       };
+}
+
+QDebug operator<<(QDebug dbg, EventTypes::SMS & event);
+
+#endif // EVENTTYPES_SMS_H
diff --git a/EventTypes/iEvent.h b/EventTypes/iEvent.h
new file mode 100644 (file)
index 0000000..0891e81
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 IEVENT_H
+#define IEVENT_H
+
+#include "iHashable.h"
+
+namespace DBBackends { class iDBBackend; }
+
+class AttachmentCollection;
+
+class QDateTime;
+class QString;
+
+namespace EventTypes
+{
+       class iEvent : public iHashable
+       {
+               public:
+                       virtual ~iEvent() {}
+
+                       virtual const DBBackends::iDBBackend &DB() const =0;
+
+                       virtual void Export(const QString &baseDirectory) const =0;
+
+                       virtual const QDateTime Timestamp() const =0;
+                       virtual const AttachmentCollection & Attachments() const =0;
+                       virtual AttachmentCollection & Attachments() =0;
+       };
+}
+
+#endif // IEVENT_H
diff --git a/NumberToNameLookup.cpp b/NumberToNameLookup.cpp
new file mode 100644 (file)
index 0000000..96eb7f9
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include <glib.h>
+#include <glib/glist.h>
+#include <libosso.h>
+#include <libosso-abook/osso-abook.h>
+#include <libebook/e-book.h>
+#include <evolution-data-server-1.4/libebook/e-vcard.h>
+#include <evolution-data-server-1.4/libebook/e-contact.h>
+
+#include "NumberToNameLookup.h"
+
+#include <stdexcept>
+
+#include <QDebug>
+
+NumberToNameLookup::NumberToNameLookup()
+{
+       GError *gError(NULL);
+
+       // Initialize osso
+       osso_context_t *osso_context(osso_initialize ("qwerkisync", "0.1", true, NULL));
+       if (NULL == osso_context)
+               throw std::runtime_error("Error initializing osso");
+
+       try
+       {
+               // Init abook
+               if (!osso_abook_init_with_name("qwerkisync", osso_context))
+                       throw std::runtime_error("Error initializing libosso-abook");
+
+               EBook *ebook(e_book_new_system_addressbook (&gError));
+               if (NULL == ebook)
+               {
+                       QString error(QString("Error opening system address book: %1").arg(gError->message));
+                       g_error_free(gError);
+                       throw std::runtime_error(error.toStdString());
+               }
+
+               if (!e_book_open (ebook, true, &gError))
+               {
+                       QString error(QString("Error opening system address book: %1").arg(gError->message));
+                       g_error_free(gError);
+                       throw std::runtime_error(error.toStdString());
+               }
+
+               EBookQuery *query(e_book_query_any_field_contains (""));
+
+               try
+               {
+                       GList *contacts(NULL);
+                       if (!e_book_get_contacts (ebook, query, &contacts, &gError))
+                       {
+                               QString error(QString("Error getting contacts: %1").arg(gError->message));
+                               g_error_free(gError);
+                               throw std::runtime_error(error.toStdString());
+                       }
+
+                       m_ContactDetails.reserve(g_list_length(contacts));
+
+                       qDebug() << g_list_length(contacts) << " contacts.";
+
+                       // Loop over each contact...
+                       for (GList *currentContact(contacts); NULL != currentContact; currentContact = currentContact->next)
+                       {
+                               // Now work out the current name for the contact and add it to the lookup
+                               EContactName *contactName = (EContactName*)e_contact_get((EContact*)currentContact->data, E_CONTACT_NAME);
+                               char *completeName(e_contact_name_to_string(contactName));
+                               qDebug() << completeName;
+
+                               // Looking at each number they have...
+                               GList * attrs(e_contact_get_attributes(E_CONTACT(currentContact->data), E_CONTACT_FIRST_PHONE_ID));
+                               for (GList *attr(attrs); NULL != attr; attr = attr->next)
+                               {
+                                       for(GList *val(e_vcard_attribute_get_values((EVCardAttribute *)attr->data)); NULL != val; val = val->next)
+                                       {
+                                               const gchar *number((char*)val->data);
+                                               if (NULL == number)
+                                                       continue; // Ignore missing numbers
+
+                                               const char *remote_ebook_uid_string((const char *)e_contact_get_const (E_CONTACT (currentContact->data), E_CONTACT_UID));
+                                               if (NULL != remote_ebook_uid_string)
+                                               {
+                                                       // This is what we really need for new events
+                                                       uint remote_ebook_uid(QString(remote_ebook_uid_string).toUInt());
+
+                                                       m_ContactDetails.insert(QString(number), QPair<uint, QString>(remote_ebook_uid, QString(completeName)));
+
+                                                       qDebug() << "Number: " << number << ", ID: " << remote_ebook_uid << ", completeName: " << completeName;
+                                               }
+                                       }
+                               }
+                               g_list_free(attrs);
+
+                               g_free(completeName);
+                               e_contact_name_free(contactName);
+
+                               // I hate C-style APIs.
+                               g_object_unref(currentContact);
+                       }
+
+                       // I *really* hate C-style APIs.
+                       g_list_free(contacts);
+               }
+               catch(...)
+               {
+                       e_book_query_unref(query);
+                       throw;
+               }
+
+               // Will wrap e_book_* in a class some other time (oh for 'finally' in C++).
+               e_book_query_unref(query);
+       }
+       catch(...)
+       {
+               osso_deinitialize (osso_context);
+               throw;
+       }
+
+       // Will wrap osso_* in a class some other time (oh for 'finally' in C++).
+       osso_deinitialize (osso_context);
+
+//     foreach(QString key, ContactDetails.keys())
+//     {
+//             qDebug() << key << ", " << ContactDetails.value(key).first << ", " << ContactDetails.value(key).second << endl;
+//     }
+}
diff --git a/NumberToNameLookup.h b/NumberToNameLookup.h
new file mode 100644 (file)
index 0000000..ff31669
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 NUMBERTONAMELOOKUP_H
+#define NUMBERTONAMELOOKUP_H
+
+#include <QHash>
+#include <QPair>
+#include <QString>
+
+class NumberToNameLookup
+{
+public:
+       typedef QHash<QString, QPair<uint, QString> > TelToNameHash;
+
+       NumberToNameLookup();
+
+       const TelToNameHash & ContactDetails() const
+       {
+               return m_ContactDetails;
+       }
+
+private:
+       TelToNameHash m_ContactDetails;
+};
+
+#endif // NUMBERTONAMELOOKUP_H
diff --git a/Resources1.qrc b/Resources1.qrc
new file mode 100644 (file)
index 0000000..113e031
--- /dev/null
@@ -0,0 +1,6 @@
+<RCC>
+    <qresource prefix="/">
+        <file>resources/phone.png</file>
+        <file>resources/sphone.png</file>
+    </qresource>
+</RCC>
diff --git a/Settings.cpp b/Settings.cpp
new file mode 100644 (file)
index 0000000..dc462c6
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Settings.h"
+
+Settings::Settings()
+{
+       // Default to console
+       setAppMode(APPMODE_CONSOLE);
+
+       // Not confirmed by default
+       setConfirmed(false);
+
+       // Default to export mode so we can't overwrite any device data
+       setMode(MODE_EXPORT);
+
+       // We don't process anything by default
+       setShouldProcess(TYPE_SENT, EVENTTYPE_SMS, false);
+       setShouldProcess(TYPE_SENT, EVENTTYPE_MMS, false);
+       setShouldProcess(TYPE_SENT, EVENTTYPE_CHAT, false);
+
+       // We still don't process anything by default
+       setShouldProcess(TYPE_RECIEVED, EVENTTYPE_SMS, false);
+       setShouldProcess(TYPE_RECIEVED, EVENTTYPE_MMS, false);
+       setShouldProcess(TYPE_RECIEVED, EVENTTYPE_CHAT, false);
+
+       // Default to the UK :)
+       setCountryCode(44);
+
+       // It's OK to disable the radio by default
+       setDisableCellular(true);
+}
diff --git a/Settings.h b/Settings.h
new file mode 100644 (file)
index 0000000..da1d08c
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 SETTINGS_H
+#define SETTINGS_H
+
+#include <QString>
+
+class Settings
+{
+public:
+       enum eAppMode
+       {
+               APPMODE_CONSOLE,
+               APPMODE_GUI
+       };
+
+       // Options for main mode - importing or exporting content
+       enum eMode
+       {
+               MODE_IMPORT,
+               MODE_EXPORT,
+       };
+       static const int kNumModes = MODE_EXPORT + 1;
+
+       // Options for targets - sent or recieved
+       enum eTargets
+       {
+               TYPE_SENT,
+               TYPE_RECIEVED,
+       };
+       static const int kNumTargets = TYPE_RECIEVED + 1;
+
+       // Options for supported event types
+       enum eEventTypes
+       {
+               EVENTTYPE_SMS,
+               EVENTTYPE_MMS,
+               EVENTTYPE_CHAT,
+       };
+       static const int kNumEventTypes = EVENTTYPE_CHAT + 1;
+
+private:
+       // The current UI mode of the application (Console/GUI)
+       eAppMode m_AppMode;
+
+       // Have the settings been confirmed by the user?
+       bool m_Confirmed;
+
+       // The current operation mode of the application (Import/Export)
+       eMode m_Mode;
+
+       // The current targets & event types being processed
+       bool m_ShouldProcess[kNumTargets][kNumEventTypes];
+
+       // The root directory to import or export from
+       QString m_Directory;
+
+       // The ITU code for this country
+       uint m_CountryCode;
+
+       // Is it OK to disable the cellular radio to prevent calls and messages?
+       bool m_DisableCellular;
+
+public:
+       Settings();
+
+       eAppMode const AppMode() const { return m_AppMode; }
+       eAppMode const setAppMode(const eAppMode appMode) { return m_AppMode = appMode; }
+
+       bool const IsConfirmed() const { return m_Confirmed; }
+       bool const setConfirmed(const bool confirmed) { return m_Confirmed = confirmed; }
+
+       eMode const Mode() const { return m_Mode; }
+       eMode const setMode(const eMode mode) { return m_Mode = mode; }
+
+       bool const ShouldProcess(const eTargets target, const eEventTypes eventType) const { return m_ShouldProcess[target][eventType]; }
+       bool const setShouldProcess(const eTargets target, const eEventTypes eventType, const bool shouldProcess = true){ return m_ShouldProcess[target][eventType] = shouldProcess; }
+       bool const anyToProcess()
+       {
+               for(int targetIndex = 0; targetIndex < kNumTargets; ++targetIndex)
+                       for(int eventTypeIndex = 0; eventTypeIndex < kNumEventTypes; ++eventTypeIndex)
+                               if (m_ShouldProcess[targetIndex][eventTypeIndex])
+                                       return true;
+               return false;
+       }
+
+       QString const Directory() const{ return m_Directory; }
+       QString const setDirectory(const QString& directory){ return m_Directory = directory; }
+
+       uint const CountryCode() const { return m_CountryCode; }
+       uint const setCountryCode(const uint countryCode) { return m_CountryCode = countryCode; }
+
+       bool const DisableCellular() const { return m_DisableCellular; }
+       bool const setDisableCellular(const bool disableCellular) { return m_DisableCellular = disableCellular; }
+};
+
+#endif // SETTINGS_H
diff --git a/SyncerThread.cpp b/SyncerThread.cpp
new file mode 100644 (file)
index 0000000..55fce3c
--- /dev/null
@@ -0,0 +1,294 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "SyncerThread.h"
+
+#include "DBBackends/AllBackends.h"
+#include "EventProcessors/Hasher.h"
+#include "EventProcessors/Writer.h"
+
+#include "Attachment.h"
+#include "EventPreventer.h"
+#include "Settings.h"
+#include "EventTypes/EventFromFileList.h"
+#include "EventTypes/iEvent.h"
+#include "EventLogBackupManager.h"
+#include "EventLogReindexer.h"
+#include "EventParsers/Factory.h"
+#include "EventParsers/iEventParser.h"
+
+#include <QDebug>
+#include <QDir>
+#include <QFile>
+#include <QFileInfo>
+#include <QProcess>
+
+#include <stdexcept>
+
+typedef QPair<QFileInfo, uint> EventFileInfo;
+
+QDebug operator<<(QDebug, QList<Attachment*> &);
+QFileInfoList FindEvents(QFileInfoList);
+
+SyncerThread::SyncerThread(Settings &settings) :
+       QThread(), m_Settings(settings)
+{
+//     m_Restart = false;
+       m_Abort = false;
+}
+
+SyncerThread::~SyncerThread()
+{
+       m_Mutex.lock();
+       m_Abort = true;
+       m_Condition.wakeOne();
+       m_Mutex.unlock();
+
+       wait();
+}
+
+void SyncerThread::Sync()
+{
+       if (!isRunning())
+       {
+               start(LowPriority);
+       }
+       else
+       {
+               m_Restart = true;
+               m_Condition.wakeOne();
+       }
+}
+
+#include "NumberToNameLookup.h"
+
+void SyncerThread::run()
+{
+       try
+       {
+               EventPreventer preventEvents(CurrentSettings());
+               EventLogBackupManager backupManager(CurrentSettings());
+
+               if(CurrentSettings().Mode() == Settings::MODE_EXPORT)
+               {
+                       qDebug() << "Exporting events";
+
+                       // Temp - Remove directory first so it's always just this export for now
+                       QDir().rmpath(CurrentSettings().Directory());
+
+                       DBBackends::AllBackends allBackends(CurrentSettings());
+                       EventProcessors::Writer eventWriter(CurrentSettings());
+                       QObject::connect(&eventWriter, SIGNAL(EventProcessed(int,int)), this, SIGNAL(EventProcessed(int,int)));
+                       allBackends.Process(eventWriter);
+               }
+               else
+               {
+                       qDebug() << "Importing events";
+
+                       backupManager.CreateBackup();
+
+                       qDebug() << "Scanning filesystem";
+
+                       // Open chosen directory and grab *all* files within (we filter at
+                       // parsing stage)
+                       QFileInfoList candidates(FindEvents(
+                               QDir(CurrentSettings().Directory()).entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot)));
+
+                       // We're going to be storing hashes to match up events on disk to
+                       // those in the DB. Assuming 1 event per file is a good starting point.
+                       // Each file can provide multiple events, so sotre the hash of the
+                       // event, the file information, and the record index.
+                       uint totalEvents(candidates.count());
+                       QHash<QPair<QString, uint>, iHashable::Hash> hashesByPath;
+                       hashesByPath.reserve(totalEvents);
+                       QHash<iHashable::Hash, QPair<QString, uint> > pathsByHashes;
+                       pathsByHashes.reserve(totalEvents);
+
+                       qDebug() << "Hashing events";
+                       {
+                               // Work our way through the candidates...
+                               int idx = 0;
+                               foreach(QFileInfo fileInfo, candidates)
+                               {
+                                       ++idx;
+                                       try
+                                       {
+                                               EventTypes::EventFromFileList fileEvents(ProcessFile(fileInfo.absoluteFilePath()));
+
+                                               foreach(EventTypes::EventFromFile eventFromFile, fileEvents)
+                                               {
+                                                       const uint hash(eventFromFile.first->HashCode());
+                                                       pathsByHashes.insert(hash, QPair<QString, iHashable::Hash>(fileInfo.absoluteFilePath(), eventFromFile.second));
+                                                       hashesByPath.insert(QPair<QString, iHashable::Hash>(fileInfo.absoluteFilePath(), eventFromFile.second), hash);
+
+                                                       qDebug() << hash;
+                                               }
+                                       }
+                                       catch(std::runtime_error& exception)
+                                       {
+                                               qDebug() << exception.what() << endl;
+                                       }
+
+                                       emit EventProcessed(idx, candidates.count());
+                               }
+                       }
+
+                       qDebug() << "Determining new events";
+
+                       // Calculate the new events by removing the hashes of events already
+                       // found in the DB
+                       QSet<iHashable::Hash> newHashes(QSet<iHashable::Hash>::fromList( pathsByHashes.keys()));
+
+                       //EventHasher eventHasher;
+                       //ProcessDBEvents(eventHasher);
+                       DBBackends::AllBackends allBackends(CurrentSettings());
+                       EventProcessors::Hasher eventHasher;
+                       allBackends.Process(eventHasher);
+
+                       foreach(iHashable::Hash hash, eventHasher.m_Hashes)
+                               newHashes.remove(hash);
+
+                       qDebug() << QString("%1 new hashes").arg(newHashes.size()) << endl;
+                       foreach(iHashable::Hash hash, newHashes)
+                               qDebug() << hash << endl;
+
+                       // Now an optimisation: group the new hases by the files they come
+                       // from. This enables each file to only be parsed once and return
+                       // all the required events from it.
+                       QHash<QString, QList<iHashable::Hash> > newHashesByPath;
+                       foreach(iHashable::Hash newHash, newHashes)
+                       {
+                               const QString &currentPath(pathsByHashes.value(newHash).first);
+                               if(newHashesByPath.contains(currentPath))
+                                       newHashesByPath[currentPath].append(newHash);
+                               else
+                                       newHashesByPath[currentPath] = QList<iHashable::Hash>() << newHash;
+                       }
+
+                       qDebug() << "Scanning addressbook";
+
+                       // Prepare the telephone-address book ID lookup.
+                       NumberToNameLookup lookup;
+
+                       qDebug() << "Importing new events";
+
+                       // Re-parse the new events
+                       {
+                               int idx = 0;
+                               foreach(QString filename, newHashesByPath.keys())
+                               {
+                                       QList<uint> recordsToReturn;
+                                       foreach(iHashable::Hash newHash, newHashesByPath.value(filename))
+                                               recordsToReturn.append(pathsByHashes.value(newHash).second);
+
+                                       ++idx;
+
+                                       // Repeating an action that caused an exception last time
+                                       // shouldn't happen again, but just in case...
+                                       try
+                                       {
+                                               foreach(EventTypes::EventFromFile newEventFromFile, ProcessFile(filename, recordsToReturn))
+                                               {
+                                                       // ...and insert it into the DB
+                                                       try
+                                                       {
+                                                               allBackends.Insert(*newEventFromFile.first, lookup);
+                                                       }
+                                                       catch(const std::runtime_error &exception)
+                                                       {
+                                                               qDebug() << "Unable to insert event: " << exception.what();
+                                                       }
+                                               }
+                                       }
+                                       catch(const std::runtime_error &exception)
+                                       {
+                                               qDebug() << exception.what() << endl;
+                                       }
+
+                                       emit EventProcessed(idx, newHashes.count());
+                               }
+                       }
+
+                       // Reorder the DB IDs as Nokia are guilty of both premature
+                       // optimisation as well as closed source UIs...
+                       EventLogReindexer reindexer;
+                       reindexer.Reindex();
+
+                       // Need to find a better way of refreshing the conversations view...
+                       QProcess::execute("pkill rtcom");
+
+                       // Signal we completed successfully.
+                       backupManager.UnlockCurrentBackup();
+               }
+
+               // May as well call this explicitly despite it being called by the
+               // destructor - it's harmless.
+               preventEvents.RestoreAccounts();
+       }
+       catch(std::runtime_error exception)
+       {
+               qDebug() << exception.what();
+       }
+}
+
+EventTypes::EventFromFileList SyncerThread::ProcessFile(const QString &path, const QList<uint> &recordsToReturn) const
+{
+       qDebug() << path << endl;
+       QFile eventFile(path);
+
+       // If the file's ok, process it...
+       if (eventFile.open(QFile::ReadOnly))
+       {
+               // Identify type of file...
+               EventParsers::iEventParser * parser(EventParsers::Factory::CreateParser(CurrentSettings(), path));
+
+               // ...and grab the events from it (if it's a supported format)
+               if(NULL != parser)
+                       return parser->ParseFile(eventFile, recordsToReturn);
+               else
+                       return EventTypes::EventFromFileList();
+       }
+       else
+               throw std::runtime_error(QString("Unable to open: %1").arg(path).toStdString());
+}
+
+QFileInfoList FindEvents(QFileInfoList currentCandidate)
+{
+       QFileInfoList foundEvents;
+       foreach(QFileInfo fileInfo, currentCandidate)
+       {
+               if(fileInfo.isDir())
+                       foundEvents.append(FindEvents(QDir(fileInfo.absoluteFilePath()).entryInfoList(QDir::AllEntries | QDir::NoDotAndDotDot)));
+               else
+                       foundEvents.append(fileInfo);
+       }
+
+       return foundEvents;
+}
+
+QDebug operator<<(QDebug dbg, QList<Attachment*> &attachments)
+{
+       dbg.nospace() << "Attachments" << "\n";
+
+       foreach(Attachment* attachment, attachments)
+               dbg.nospace() << *attachment << "\n";
+
+       dbg.nospace() << "\n";
+
+       return dbg;
+}
diff --git a/SyncerThread.h b/SyncerThread.h
new file mode 100644 (file)
index 0000000..c08f5a9
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 SYNCERTHREAD_H
+#define SYNCERTHREAD_H
+
+#include "EventTypes/EventFromFileList.h"
+
+class Settings;
+
+#include <QThread>
+#include <QWaitCondition>
+#include <QMutex>
+
+class NumberToNameLookup;
+
+class SyncerThread : public QThread
+{
+       Q_OBJECT
+
+private:
+       QMutex m_Mutex;
+       QWaitCondition m_Condition;
+       bool m_Restart;
+       bool m_Abort;
+
+       Settings& m_Settings;
+
+protected:
+       virtual void run();
+
+signals:
+       void EventProcessed(int current, int total);
+
+public:
+       explicit SyncerThread(Settings& settings);
+       ~SyncerThread();
+
+       void Sync();
+       EventTypes::EventFromFileList ProcessFile(const QString &path, const QList<uint> &recordsToReturn = QList<uint>()) const;
+       uint InsertNewEvent(const EventTypes::iEvent &event, const NumberToNameLookup &numberToNameLookup);
+
+       Settings &CurrentSettings() const { return m_Settings; }
+};
+
+#endif // SYNCERTHREAD_H
diff --git a/Windows/BaseWindow.cpp b/Windows/BaseWindow.cpp
new file mode 100644 (file)
index 0000000..cbc4797
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "BaseWindow.h"
+
+#include <QtGui>
+
+using namespace Windows;
+
+BaseWindow::BaseWindow(Settings& settings, QWidget *parent) :
+       QMainWindow(parent),
+       m_Settings(settings),
+       m_Parent(parent)
+{
+       setWindowIcon(QIcon(":/resources/sphone.png"));
+
+#ifdef Q_WS_MAEMO_5
+       this->setAttribute(Qt::WA_Maemo5StackedWindow, true);
+       this->setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+#endif
+       this->setAttribute(Qt::WA_DeleteOnClose);
+       this->setWindowTitle("QwerkiSync");
+       this->setWindowIcon(QIcon(":/resources/sphone.png"));
+
+       CreateActions();
+       CreateMenus();
+       CreateContents();
+}
+
+BaseWindow::~BaseWindow()
+{
+}
+
+void BaseWindow::closeEvent(QCloseEvent *)
+{
+       if(Parent() != NULL && CurrentSettings().IsConfirmed())
+               Parent()->close();
+}
+
+void BaseWindow::CreateMenus()
+{
+       m_HelpMenu = menuBar()->addMenu(tr("&Help"));
+       m_HelpMenu->addAction(m_AboutAct);
+       m_HelpMenu->addAction(m_AboutQtAct);
+}
+
+void BaseWindow::CreateActions()
+{
+       m_AboutAct = new QAction(QIcon(":/resources/sphone.png"), tr("&About"), this);
+       m_AboutAct->setStatusTip(tr("Show the application's About box"));
+       m_AboutAct->setIconVisibleInMenu(true);
+       connect(m_AboutAct, SIGNAL(triggered()), this, SLOT(About()));
+
+       m_AboutQtAct = new QAction(tr("&About Qt"), this);
+       m_AboutQtAct->setStatusTip(tr("Qt"));
+       connect(m_AboutQtAct, SIGNAL(triggered()), this, SLOT(AboutQt()));
+}
+
+void BaseWindow::CreateContents()
+{
+       QWidget *central = new QWidget(this);
+       setCentralWidget(central);
+}
+
+void BaseWindow::About()
+{
+       QMessageBox::about(this, "about", "about me");
+}
+
+void BaseWindow::AboutQt()
+{
+       QMessageBox::aboutQt(this, tr("About Qt"));
+}
diff --git a/Windows/BaseWindow.h b/Windows/BaseWindow.h
new file mode 100644 (file)
index 0000000..375e0f7
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 BASEWINDOW_H
+#define BASEWINDOW_H
+
+#include <QMainWindow>
+
+#include "Settings.h"
+
+namespace Windows
+{
+       class BaseWindow : public QMainWindow
+       {
+               Q_OBJECT
+
+       private:
+               Settings& m_Settings;
+               QWidget* m_Parent;
+
+       protected:
+               Settings& CurrentSettings() const { return m_Settings; }
+               const Settings& setCurrentSettings(Settings& settings) { return m_Settings = settings; }
+               QWidget* Parent() const { return m_Parent; }
+
+       public:
+               explicit BaseWindow(Settings& settings, QWidget *parent = 0);
+               virtual ~BaseWindow();
+
+       protected slots:
+               void About();
+               void AboutQt();
+
+       protected:
+               virtual void closeEvent(QCloseEvent *);
+
+       private:
+               QMenu *m_HelpMenu;
+               void CreateMenus();
+
+               QAction *m_AboutAct;
+               QAction *m_AboutQtAct;
+               void CreateActions();
+
+               void CreateContents();
+       };
+}
+#endif // BASEWINDOW_H
diff --git a/Windows/DirectoryWindow.cpp b/Windows/DirectoryWindow.cpp
new file mode 100644 (file)
index 0000000..79f7f62
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "DirectoryWindow.h"
+
+#include <QtGui>
+
+using namespace Windows;
+
+DirectoryWindow::DirectoryWindow(Settings& settings, QWidget *parent) :
+               BaseWindow(settings, parent)
+{
+       CreateContents();
+}
+
+void DirectoryWindow::CreateContents()
+{
+       switch(CurrentSettings().AppMode())
+       {
+               case Settings::APPMODE_GUI:
+               {
+                       QVBoxLayout *layout = new QVBoxLayout();
+                       {
+               //              QLabel* lblTest = new QLabel(CurrentSettings().Directory());
+               //              layout->addWidget(lblTest);
+               //              //layout->setAlignment(lblTest, Qt::AlignHCenter | Qt::AlignTop);
+
+                               QPushButton* btnChoose = new QPushButton(QIcon(":/resources/sphone.png"), tr("Choose data directory"));
+                               QObject::connect(btnChoose, SIGNAL(clicked()), this, SLOT(Choose()));
+                               layout->addWidget(btnChoose);
+                               layout->setAlignment(btnChoose, Qt::AlignHCenter);
+
+               //              layout->addWidget(new QLabel());
+
+                               centralWidget()->setLayout(layout);
+                       }
+
+                       break;
+               }
+
+               case Settings::APPMODE_CONSOLE:
+               {
+                       // Process args.
+
+                       Advance();
+                       break;
+               }
+       }
+}
+
+void DirectoryWindow::Choose()
+{
+       CurrentSettings().setDirectory(QFileDialog::getExistingDirectory(
+               this,
+               "Data directory",
+               QDir::homePath() + "/MyDocs",
+               QFileDialog::ShowDirsOnly ));
+//     if(CurrentSettings().Mode() == Settings::MODE_IMPORT)
+//             CurrentSettings().setDirectory(QDir::homePath() + "/MyDocs/sms/");
+//     else
+//             CurrentSettings().setDirectory(QDir::homePath() + "/MyDocs/tmp/");
+       Advance();
+}
+
+void DirectoryWindow::Advance()
+{
+       CurrentSettings().setConfirmed(true);
+       close();
+}
diff --git a/Windows/DirectoryWindow.h b/Windows/DirectoryWindow.h
new file mode 100644 (file)
index 0000000..747549d
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 DIRECTORYWINDOW_H
+#define DIRECTORYWINDOW_H
+
+#include "BaseWindow.h"
+
+namespace Windows
+{
+       class DirectoryWindow : public BaseWindow
+       {
+               Q_OBJECT
+
+       public:
+               explicit DirectoryWindow(Settings& settings, QWidget *parent = 0);
+
+       signals:
+
+       protected slots:
+               void Choose();
+
+       private:
+               void CreateContents();
+               void Advance();
+       };
+}
+
+#endif // DIRECTORYWINDOW_H
diff --git a/Windows/ModeWindow.cpp b/Windows/ModeWindow.cpp
new file mode 100644 (file)
index 0000000..b6b7cc0
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Windows/ModeWindow.h"
+#include "Windows/TypesWindow.h"
+#include "Windows/ProgressWindow.h"
+
+#include "SyncerThread.h"
+
+#include <QtGui>
+
+using namespace Windows;
+
+ModeWindow::ModeWindow(Settings& settings, QWidget *parent) :
+       BaseWindow(settings, parent)
+{
+       CreateContents();
+}
+
+void ModeWindow::CreateContents()
+{
+       switch(CurrentSettings().AppMode())
+       {
+               case Settings::APPMODE_GUI:
+               {
+                       QVBoxLayout *layout = new QVBoxLayout();
+                       {
+                               QLabel* lblTest = new QLabel(CurrentSettings().Directory());
+                               layout->addWidget(lblTest);
+                               //layout->setAlignment(lblTest, Qt::AlignHCenter | Qt::AlignTop);
+
+                               QPushButton* btnImport = new QPushButton(QIcon(":/resources/sphone.png"), "Import");
+                               QObject::connect(btnImport, SIGNAL(clicked()), this, SLOT(Import()));
+                               layout->addWidget(btnImport);
+                               layout->setAlignment(btnImport, Qt::AlignHCenter);
+
+                               QPushButton* btnExport = new QPushButton(QIcon(":/resources/sphone.png"), "Export");
+                               QObject::connect(btnExport, SIGNAL(clicked()), this, SLOT(Export()));
+                               layout->addWidget(btnExport);
+                               layout->setAlignment(btnExport, Qt::AlignHCenter);
+
+                               layout->addWidget(new QLabel());
+
+                               centralWidget()->setLayout(layout);
+                       }
+
+                       break;
+               }
+
+               case Settings::APPMODE_CONSOLE:
+               {
+                       // Process args.
+
+                       Advance();
+                       break;
+               }
+       }
+}
+
+void ModeWindow::Import()
+{
+       CurrentSettings().setMode(Settings::MODE_IMPORT);
+       CurrentSettings().setDirectory("IMPORT");
+       Advance();
+}
+
+void ModeWindow::Export()
+{
+       CurrentSettings().setMode(Settings::MODE_EXPORT);
+       CurrentSettings().setDirectory("EXPORT");
+       Advance();
+}
+
+void ModeWindow::Advance()
+{
+       QWidget* next = new TypesWindow(CurrentSettings(), this);
+       next->show();
+}
+
+void ModeWindow::closeEvent(QCloseEvent *)
+{
+       if(CurrentSettings().IsConfirmed())
+       {
+               SyncerThread* tSync = new SyncerThread(CurrentSettings());
+               QWidget* progressWindow = new ProgressWindow(CurrentSettings(), tSync);
+               progressWindow->show();
+
+               tSync->Sync();
+       }
+}
diff --git a/Windows/ModeWindow.h b/Windows/ModeWindow.h
new file mode 100644 (file)
index 0000000..661defc
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 MODEWINDOW_H
+#define MODEWINDOW_H
+
+#include "BaseWindow.h"
+
+namespace Windows
+{
+       class ModeWindow : public BaseWindow
+       {
+               Q_OBJECT
+
+       public:
+               explicit ModeWindow(Settings& settings, QWidget *parent = 0);
+
+       protected slots:
+               void Import();
+               void Export();
+               //void Closed();
+
+       protected:
+               virtual void closeEvent(QCloseEvent *);
+
+       private:
+               void CreateContents();
+               void Advance();
+       };
+}
+#endif // MODEWINDOW_H
diff --git a/Windows/ProgressWindow.cpp b/Windows/ProgressWindow.cpp
new file mode 100644 (file)
index 0000000..82da4dc
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "ProgressWindow.h"
+
+#include "SyncerThread.h"
+
+#include <QProgressBar>
+#include <QVBoxLayout>
+#include <QWidget>
+
+using namespace Windows;
+
+ProgressWindow::ProgressWindow(Settings& settings, SyncerThread* syncThread, QWidget *parent) :
+               BaseWindow(settings, parent)
+{
+       CreateContents(syncThread);
+}
+
+void ProgressWindow::CreateContents(SyncerThread* syncThread)
+{
+       switch(CurrentSettings().AppMode())
+       {
+               case Settings::APPMODE_GUI:
+               {
+                       QVBoxLayout *layout = new QVBoxLayout();
+                       {
+               //              QLabel* lblTest = new QLabel(CurrentSettings().Directory());
+               //              layout->addWidget(lblTest);
+               //              //layout->setAlignment(lblTest, Qt::AlignHCenter | Qt::AlignTop);
+
+                               m_ProgressBar = new QProgressBar(this);
+                               QObject::connect(syncThread, SIGNAL(EventProcessed(int,int)), this, SLOT(UpdateBar(int,int)));
+                               layout->addWidget(m_ProgressBar);
+                               //layout->setAlignment(btnChoose, Qt::AlignHCenter);
+
+               //              layout->addWidget(new QLabel());
+
+                               centralWidget()->setLayout(layout);
+                       }
+
+                       break;
+               }
+
+               case Settings::APPMODE_CONSOLE:
+               {
+                       break;
+               }
+       }
+}
+
+void ProgressWindow::UpdateBar(int message, int total)
+{
+       m_ProgressBar->setMaximum(total);
+       m_ProgressBar->setValue(message);
+}
+
+void ProgressWindow::Advance()
+{
+       close();
+}
diff --git a/Windows/ProgressWindow.h b/Windows/ProgressWindow.h
new file mode 100644 (file)
index 0000000..2d3e752
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 PROGRESSWINDOW_H
+#define PROGRESSWINDOW_H
+
+#include "BaseWindow.h"
+
+class SyncerThread;
+class QProgressBar;
+
+namespace Windows
+{
+       class ProgressWindow : public BaseWindow
+       {
+               Q_OBJECT
+
+       public:
+               explicit ProgressWindow(Settings& settings, SyncerThread* syncThread, QWidget *parent = 0);
+
+       signals:
+
+       protected slots:
+               void UpdateBar(int message, int total);
+
+       private:
+               QProgressBar* m_ProgressBar;
+
+       private:
+               void CreateContents(SyncerThread* syncThread);
+               void Advance();
+       };
+}
+
+#endif // PROGRESSWINDOW_H
diff --git a/Windows/RestoreAccountStateWindow.cpp b/Windows/RestoreAccountStateWindow.cpp
new file mode 100644 (file)
index 0000000..b60e0c2
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "RestoreAccountStateWindow.h"
+
+#include "CellularRadio.h"
+#include "ModeWindow.h"
+
+#include <QtDBus>
+#include <QtGui>
+
+using namespace Windows;
+
+RestoreAccountStateWindow::RestoreAccountStateWindow(Settings &settings, QWidget *parent) :
+       BaseWindow(settings, parent)
+{
+       if(CellularRadio::CurrentState() == false && NumEnabledAccounts() == 0)
+               CreateContents();
+       else
+               Advance();
+}
+
+void RestoreAccountStateWindow::CreateContents()
+{
+       switch(CurrentSettings().AppMode())
+       {
+               case Settings::APPMODE_GUI:
+               {
+                       QVBoxLayout *layout = new QVBoxLayout();
+                       {
+                               layout->setMargin(40);
+
+                               QLabel *lblNotice1 = new QLabel(tr("You have no enabled accounts and the cellular modem is disabled. If this was the result of the last crash of this program, please restore them as you wish."));
+                               lblNotice1->setAlignment(Qt::AlignCenter);
+                               lblNotice1->setWordWrap(true);
+                               layout->addWidget(lblNotice1, 1);
+
+                               QLabel *lblNotice2 = new QLabel(tr("Once you have enabled things as you want them, tap next to proceed."));
+                               lblNotice2->setWordWrap(true);
+                               lblNotice2->setAlignment(Qt::AlignCenter);
+                               layout->addWidget(lblNotice2, 1);
+
+                               QHBoxLayout *layoutButtons = new QHBoxLayout();
+                               {
+                                       QPushButton* btnToggleModem = new QPushButton(tr("Toggle Cellular Modem"));
+                                       QObject::connect(btnToggleModem, SIGNAL(clicked()), this, SLOT(ToggleModem()));
+                                       layoutButtons->addWidget(btnToggleModem);
+                                       layoutButtons->setAlignment(btnToggleModem, Qt::AlignHCenter);
+
+                                       QLabel *lblSpacer = new QLabel();
+                                       layoutButtons->addWidget(lblSpacer);
+                                       layoutButtons->setAlignment(lblSpacer, Qt::AlignHCenter | Qt::AlignVCenter);
+
+                                       QPushButton* btnSetAccountStatus = new QPushButton(tr("Set Account Status"));
+                                       QObject::connect(btnSetAccountStatus, SIGNAL(clicked()), this, SLOT(SetAccountStatus()));
+                                       layoutButtons->addWidget(btnSetAccountStatus);
+                                       layoutButtons->setAlignment(btnSetAccountStatus, Qt::AlignHCenter);
+                               }
+                               layout->addLayout(layoutButtons);
+
+                               QPushButton* btnProceed = new QPushButton(tr("Next"));
+                               QObject::connect(btnProceed, SIGNAL(clicked()), this, SLOT(Proceed()));
+                               layout->addWidget(btnProceed);
+                               layout->setAlignment(btnProceed, Qt::AlignHCenter);
+
+                               centralWidget()->setLayout(layout);
+                       }
+
+                       break;
+               }
+
+               case Settings::APPMODE_CONSOLE:
+               {
+                       // Process args.
+
+                       Advance();
+                       break;
+               }
+       }
+}
+
+void RestoreAccountStateWindow::ToggleModem()
+{
+       CellularRadio::Toggle();
+}
+
+void RestoreAccountStateWindow::SetAccountStatus()
+{
+       const char * NOKIA_SERVICE_ACCOUNTS_UI("com.nokia.AccountsUI");
+       const char * NOKIA_PATH_ACCOUNTS_UI("/com/nokia/AccountsUI");
+       const char * NOKIA_IFACE_ACCOUNTS_UI("com.nokia.Accounts");
+
+       QDBusMessage msg(QDBusMessage::createMethodCall(NOKIA_SERVICE_ACCOUNTS_UI, NOKIA_PATH_ACCOUNTS_UI, NOKIA_IFACE_ACCOUNTS_UI, "OpenAccountsList"));
+       msg << (uint)winId();
+       QDBusConnection::sessionBus().call(msg);
+}
+
+void RestoreAccountStateWindow::Proceed()
+{
+       Advance();
+}
+
+void RestoreAccountStateWindow::Advance()
+{
+       QWidget* next = new Windows::ModeWindow(CurrentSettings());
+       next->show();
+       close();
+}
+
+const uint RestoreAccountStateWindow::NumEnabledAccounts()
+{
+       const char * TP_ACCOUNT_PHONE("/org/freedesktop/Telepathy/Account/ring/tel/ring");
+       const char * TP_IFACE_ACCOUNT("org.freedesktop.Telepathy.Account");
+       const char * TP_IFACE_ACCOUNT_MANAGER("org.freedesktop.Telepathy.AccountManager");
+       const char * TP_PATH_ACCOUNT_MANAGER("/org/freedesktop/Telepathy/AccountManager");
+       const char * TP_IFACE_DBUS_PROPERTIES("org.freedesktop.DBus.Properties");
+
+       uint numEnabledAccounts(0);
+
+       QDBusInterface tpAccountManager(TP_IFACE_ACCOUNT_MANAGER, TP_PATH_ACCOUNT_MANAGER, TP_IFACE_DBUS_PROPERTIES);
+       if (tpAccountManager.isValid())
+       {
+               // Grab state
+               QDBusMessage accountList = tpAccountManager.call("Get", TP_IFACE_ACCOUNT_MANAGER, "ValidAccounts");
+               foreach (QVariant arg, accountList.arguments())
+               {
+                       const QDBusArgument argument(qvariant_cast<QDBusVariant>(arg).variant().value<QDBusArgument>());
+                       argument.beginArray();
+                       while (!argument.atEnd())
+                       {
+                               // Grab the account path
+                               QDBusObjectPath accountPath;
+                               argument >> accountPath;
+
+                               // Ignore the phone account
+                               if(accountPath.path() == TP_ACCOUNT_PHONE)
+                                       continue;
+                               else
+                               {
+                                       // Grab the enabled property of each account
+                                       QDBusInterface tpAccount(TP_IFACE_ACCOUNT_MANAGER, accountPath.path(), TP_IFACE_DBUS_PROPERTIES);
+                                       if (tpAccount.isValid())
+                                       {
+                                               QDBusReply<QVariant> isEnabledProp = tpAccount.call("Get", TP_IFACE_ACCOUNT, "Enabled");
+
+                                               if(isEnabledProp.value().toBool())
+                                                       ++numEnabledAccounts;
+                                       }
+                               }
+                       }
+                       argument.endArray();
+               }
+       }
+
+       return numEnabledAccounts;
+}
diff --git a/Windows/RestoreAccountStateWindow.h b/Windows/RestoreAccountStateWindow.h
new file mode 100644 (file)
index 0000000..0847108
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 RESTOREACCOUNTSTATEWINDOW_H
+#define RESTOREACCOUNTSTATEWINDOW_H
+
+#include "BaseWindow.h"
+
+namespace Windows
+{
+       class RestoreAccountStateWindow : public BaseWindow
+       {
+               Q_OBJECT
+
+       public:
+               explicit RestoreAccountStateWindow(Settings& settings, QWidget *parent = 0);
+
+       protected slots:
+               void ToggleModem();
+               void SetAccountStatus();
+               void Proceed();
+
+       protected:
+
+       private:
+               void CreateContents();
+               void Advance();
+
+               const uint NumEnabledAccounts();
+       };
+}
+#endif // RESTOREACCOUNTSTATEWINDOW_H
diff --git a/Windows/RestoreCrashBackupWindow.cpp b/Windows/RestoreCrashBackupWindow.cpp
new file mode 100644 (file)
index 0000000..fae2124
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "RestoreCrashBackupWindow.h"
+
+#include "EventLogBackupManager.h"
+
+#include "RestoreAccountStateWindow.h"
+
+#include <QtGui>
+
+#include <stdexcept>
+
+using namespace Windows;
+
+RestoreCrashBackupWindow::RestoreCrashBackupWindow(Settings& settings, QWidget *parent) :
+       BaseWindow(settings, parent)
+{
+       if(LockedBackupsPresent())
+               CreateContents();
+       else
+               Advance();
+}
+
+void RestoreCrashBackupWindow::CreateContents()
+{
+       switch(CurrentSettings().AppMode())
+       {
+               case Settings::APPMODE_GUI:
+               {
+                       QVBoxLayout *layout = new QVBoxLayout();
+                       {
+                               layout->setMargin(40);
+
+                               QLabel *lblNotice1 = new QLabel(tr("A backup has been found that suggests this program crashed during an import."));
+                               lblNotice1->setAlignment(Qt::AlignCenter);
+                               lblNotice1->setWordWrap(true);
+                               layout->addWidget(lblNotice1, 1);
+
+                               QLabel *lblNotice2 = new QLabel(tr("It is strongly advised that you restore this backup so the system is operating from a known valid state."));
+                               lblNotice2->setWordWrap(true);
+                               lblNotice2->setAlignment(Qt::AlignCenter);
+                               layout->addWidget(lblNotice2, 1);
+
+                               QLabel *lblNotice3 = new QLabel(tr("However, any events that have occurred since the backup was made will be lost."));
+                               lblNotice3->setWordWrap(true);
+                               lblNotice3->setAlignment(Qt::AlignCenter);
+                               layout->addWidget(lblNotice3, 1);
+
+                               QHBoxLayout *layoutButtons = new QHBoxLayout();
+                               {
+                                       QPushButton* btnRestoreBackup = new QPushButton(tr("Restore backup"));
+                                       QObject::connect(btnRestoreBackup, SIGNAL(clicked()), this, SLOT(RestoreBackup()));
+                                       layoutButtons->addWidget(btnRestoreBackup);
+                                       layoutButtons->setAlignment(btnRestoreBackup, Qt::AlignHCenter);
+
+                                       QPushButton* btnUnlockBackup = new QPushButton(tr("Unlock backup"));
+                                       QObject::connect(btnUnlockBackup, SIGNAL(clicked()), this, SLOT(UnlockBackup()));
+                                       layoutButtons->addWidget(btnUnlockBackup);
+                                       layoutButtons->setAlignment(btnUnlockBackup, Qt::AlignHCenter);
+                               }
+                               layout->addLayout(layoutButtons);
+
+                               centralWidget()->setLayout(layout);
+                       }
+
+                       break;
+               }
+
+               case Settings::APPMODE_CONSOLE:
+               {
+                       // Process args.
+
+                       Advance();
+                       break;
+               }
+       }
+}
+
+void RestoreCrashBackupWindow::RestoreBackup()
+{
+       EventLogBackupManager backupManager(CurrentSettings());
+       QFileInfoList lockedBackupPaths(backupManager.CurrentBackups(true));
+       if(lockedBackupPaths.count() > 1 && QMessageBox::Yes != QMessageBox::question(this,
+               tr("Warning! Multiple locked backups found!"),
+               tr("This should never be possible, and we're very sorry for the problem. Only the most recent backup will be restored and all other locked backups will be unlocked. Is this OK?"),
+               QMessageBox::Cancel | QMessageBox::No | QMessageBox::Yes))
+       {
+               return;
+       }
+
+       try
+       {
+               for(int i = 0; i < lockedBackupPaths.count(); ++i)
+               {
+                       // Only restore the most recent (the list returned from CurrentBackups is ordered by name desc)
+                       if(i == 0)
+                               backupManager.RestoreBackup(lockedBackupPaths.value(i).absoluteFilePath());
+
+                       backupManager.UnlockBackup(lockedBackupPaths.value(i).absoluteFilePath());
+               }
+
+               Advance();
+       }
+       catch(const std::exception &exception)
+       {
+               QMessageBox::critical(this,
+                       tr("Error"),
+                       QString(tr("A serious error has occurred whilst unlocking backups:\n%1\nPlease try again.")).arg(exception.what()));
+       }
+}
+
+void RestoreCrashBackupWindow::UnlockBackup()
+{
+       EventLogBackupManager backupManager(CurrentSettings());
+       QFileInfoList lockedBackupPaths(backupManager.CurrentBackups(true));
+       if(lockedBackupPaths.count() > 1 && QMessageBox::Yes != QMessageBox::question(this,
+               tr("Warning! Multiple locked backups found!"),
+               tr("This should never be possible, and we're very sorry for the problem. All locked backups must be unlocked before you continue. Is this OK?"),
+               QMessageBox::Cancel | QMessageBox::No | QMessageBox::Yes))
+       {
+               return;
+       }
+
+       try
+       {
+               foreach(QFileInfo backupPath, lockedBackupPaths)
+                       backupManager.UnlockBackup(backupPath.absoluteFilePath());
+
+               Advance();
+       }
+       catch(const std::exception &exception)
+       {
+               QMessageBox::critical(this,
+                       tr("Error"),
+                       QString(tr("A serious error has occurred whilst unlocking backups:\n%1\nPlease try again.")).arg(exception.what()));
+       }
+}
+
+void RestoreCrashBackupWindow::Advance()
+{
+       QWidget *next = new RestoreAccountStateWindow(CurrentSettings());
+       next->show();
+       close();
+}
+
+bool RestoreCrashBackupWindow::LockedBackupsPresent()
+{
+       EventLogBackupManager backupManager(CurrentSettings());
+       return backupManager.CurrentBackups(true).count() > 0;
+}
diff --git a/Windows/RestoreCrashBackupWindow.h b/Windows/RestoreCrashBackupWindow.h
new file mode 100644 (file)
index 0000000..990f0a0
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 RESTORECRASHBACKUPWINDOW_H
+#define RESTORECRASHBACKUPWINDOW_H
+
+#include "BaseWindow.h"
+
+namespace Windows
+{
+       class RestoreCrashBackupWindow : public BaseWindow
+       {
+               Q_OBJECT
+
+       public:
+               explicit RestoreCrashBackupWindow(Settings& settings, QWidget *parent = 0);
+
+       protected slots:
+               void RestoreBackup();
+               void UnlockBackup();
+
+       protected:
+
+       private:
+               void CreateContents();
+               void Advance();
+               bool LockedBackupsPresent();
+       };
+}
+#endif // RESTORECRASHBACKUPWINDOW_H
diff --git a/Windows/TypesWindow.cpp b/Windows/TypesWindow.cpp
new file mode 100644 (file)
index 0000000..6e619f2
--- /dev/null
@@ -0,0 +1,256 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "TypesWindow.h"
+#include "DirectoryWindow.h"
+
+#include <QtGui>
+
+using namespace Windows;
+
+TypesWindow::TypesWindow(Settings& settings, QWidget *parent) :
+       BaseWindow(settings, parent)
+{
+       CreateContents();
+}
+
+void TypesWindow::CreateContents()
+{
+       switch(CurrentSettings().AppMode())
+       {
+               case Settings::APPMODE_GUI:
+               {
+                       QWidget *layoutWidget = new QWidget(centralWidget());
+                       layoutWidget->setGeometry(QRect(0, 0, 801, 251));
+
+                       QGridLayout *layout = new QGridLayout(layoutWidget);
+                       {
+                               layout->setSizeConstraint(QLayout::SetMaximumSize);
+                               layout->setContentsMargins(0, 0, 0, 0);
+
+                               // Spacers
+                               {
+                                       // Vertical 1
+                                       layout->addItem(
+                                               new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding),
+                                               6., 2, 1, 1);
+
+                                       // Vertical 2
+                                       layout->addItem(
+                                               new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding),
+                                               0, 2, 1, 1);
+
+                                       // Horzontal 1
+                                       layout->addItem(
+                                               new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum),
+                                               0, 4, 1, 1);
+
+                                       // Horizontal 2
+                                       layout->addItem(
+                                               new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum),
+                                               0, 0, 1, 1);
+                               }
+
+                               // Set up columns
+                               layout->setColumnStretch(0, 3);
+                               layout->setColumnStretch(1, 1);
+                               layout->setColumnStretch(2, 1);
+                               layout->setColumnStretch(3, 1);
+                               layout->setColumnStretch(4, 4);
+
+                               int row = 1;
+
+                               // Begin Headings
+                               {
+                                       QLabel *lblSent = new QLabel();
+                                       lblSent->setText(tr("Sent"));
+                                       lblSent->setAlignment(Qt::AlignCenter);
+                                       layout->addWidget(lblSent, row, 2, 1, 1);
+                               }
+                               {
+                                       QLabel  *lblReceived = new QLabel();
+                                       lblReceived->setText(tr("Recieved"));
+                                       lblReceived->setAlignment(Qt::AlignCenter);
+                                       layout->addWidget(lblReceived, row, 3, 1, 1);
+                               }
+                               ++row;
+                               // End Headings
+
+                               QSizePolicy sizePolicyForCheckBoxes(QSizePolicy::Minimum, QSizePolicy::Minimum);
+                               sizePolicyForCheckBoxes.setHorizontalStretch(0);
+                               sizePolicyForCheckBoxes.setVerticalStretch(0);
+                               sizePolicyForCheckBoxes.setHeightForWidth(false);
+
+                               // Calls
+                               {
+                                       QLabel *lblCalls = new QLabel();
+                                       lblCalls->setText(tr("Calls"));
+                                       lblCalls->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+                                       layout->addWidget(lblCalls, row, 1, 1, 1);
+                               }
+                               {
+                                       cbMadeCalls = new QCheckBox();
+                                       cbMadeCalls->setEnabled(false);
+                                       cbMadeCalls->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbMadeCalls->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbMadeCalls, row, 2, 1, 1);
+                               }
+                               {
+                                       cbRecvCalls = new QCheckBox();
+                                       cbRecvCalls->setEnabled(false);
+                                       cbRecvCalls->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbRecvCalls->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbRecvCalls, row, 3, 1, 1);
+                               }
+                               ++row;
+                               // End Calls
+
+                               // SMS
+                               {
+                                       QLabel *lblSMS = new QLabel();
+                                       lblSMS->setText(tr("SMS"));
+                                       lblSMS->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+                                       layout->addWidget(lblSMS, row, 1, 1, 1);
+                               }
+                               {
+                                       cbSentSMS = new QCheckBox();
+                                       cbSentSMS->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbSentSMS->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbSentSMS, row, 2, 1, 1);
+                               }
+                               {
+                                       cbRecvSMS = new QCheckBox();
+                                       cbRecvSMS->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbRecvSMS->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbRecvSMS, row, 3, 1, 1);
+                               }
+                               ++row;
+                               // End SMS
+
+                               // MMS
+                               {
+                                       QLabel  *lblMMS = new QLabel();
+                                       lblMMS->setText(tr("MMS"));
+                                       lblMMS->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+                                       layout->addWidget(lblMMS, row, 1, 1, 1);
+                               }
+                               {
+                                       cbSentMMS = new QCheckBox();
+                                       cbSentMMS->setEnabled(false);
+                                       cbSentMMS->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbSentMMS->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbSentMMS, row, 2, 1, 1);
+                               }
+                               {
+                                       cbRecvMMS = new QCheckBox();
+                                       cbRecvMMS->setEnabled(false);
+                                       cbRecvMMS->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbRecvMMS->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbRecvMMS, row, 3, 1, 1);
+                               }
+                               ++row;
+                               // End MMS
+
+                               // Chat
+                               {
+                                       QLabel  *lblChat = new QLabel();
+                                       lblChat->setText(tr("Chat"));
+                                       lblChat->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+                                       layout->addWidget(lblChat, row, 1, 1, 1);
+                               }
+                               {
+                                       cbSentChat = new QCheckBox();
+                                       cbSentChat->setEnabled(false);
+                                       cbSentChat->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbSentChat->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbSentChat, row, 2, 1, 1);
+                               }
+                               {
+                                       cbRecvChat = new QCheckBox();
+                                       cbRecvChat->setEnabled(false);
+                                       cbRecvChat->setSizePolicy(sizePolicyForCheckBoxes);
+                                       cbRecvChat->setMaximumSize(QSize(70, 64));
+                                       layout->addWidget(cbRecvChat, row, 3, 1, 1);
+                               }
+                               ++row;
+                               // End Chat
+
+                               // Continue button
+                               {
+                                       btnContinue = new QPushButton(centralWidget());
+                                       btnContinue->setText(tr("Continue..."));
+                                       {
+                                               QSizePolicy sizePolicyForContinueButton(QSizePolicy::Fixed, QSizePolicy::Fixed);
+                                               sizePolicyForContinueButton.setHorizontalStretch(0);
+                                               sizePolicyForContinueButton.setVerticalStretch(0);
+                                               sizePolicyForContinueButton.setHeightForWidth(true);
+                                               btnContinue->setSizePolicy(sizePolicyForContinueButton);
+                                       }
+                                       QObject::connect(btnContinue, SIGNAL(clicked()), this, SLOT(Continue()));
+                               }
+
+                               connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(OrientationChanged()));
+                               OrientationChanged();
+
+                               centralWidget()->setLayout(layout);
+                       }
+
+                       break;
+               }
+
+               case Settings::APPMODE_CONSOLE:
+               {
+                       // Process args.
+
+                       Advance();
+                       break;
+               }
+       }
+}
+
+void TypesWindow::OrientationChanged()
+{
+       QRect screenGeometry = QApplication::desktop()->screenGeometry();
+       // Landscape
+       if (screenGeometry.width() > screenGeometry.height())
+               btnContinue->setGeometry(QRect(610, 340, 184, 80));
+       // Portrait
+       else
+               btnContinue->setGeometry(QRect(290, 655, 184, 80));
+}
+
+void TypesWindow::Continue()
+{
+       CurrentSettings().setShouldProcess(Settings::TYPE_SENT, Settings::EVENTTYPE_SMS, cbSentSMS->checkState() == Qt::Checked);
+       CurrentSettings().setShouldProcess(Settings::TYPE_SENT, Settings::EVENTTYPE_MMS, cbSentMMS->checkState() == Qt::Checked);
+       CurrentSettings().setShouldProcess(Settings::TYPE_SENT, Settings::EVENTTYPE_CHAT, cbSentChat->checkState() == Qt::Checked);
+       CurrentSettings().setShouldProcess(Settings::TYPE_RECIEVED, Settings::EVENTTYPE_SMS, cbRecvSMS->checkState() == Qt::Checked);
+       CurrentSettings().setShouldProcess(Settings::TYPE_RECIEVED, Settings::EVENTTYPE_MMS, cbRecvMMS->checkState() == Qt::Checked);
+       CurrentSettings().setShouldProcess(Settings::TYPE_RECIEVED, Settings::EVENTTYPE_CHAT, cbRecvChat->checkState() == Qt::Checked);
+
+       if(CurrentSettings().anyToProcess())
+               Advance();
+       else
+               QMessageBox::critical(this, tr("Excuse me"), tr("You must select at least one type of data to process."));
+}
+
+void TypesWindow::Advance()
+{
+       QWidget* next = new DirectoryWindow(CurrentSettings(), this);
+       next->show();
+}
diff --git a/Windows/TypesWindow.h b/Windows/TypesWindow.h
new file mode 100644 (file)
index 0000000..47da060
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 TYPESWINDOW_H
+#define TYPESWINDOW_H
+
+#include "BaseWindow.h"
+
+class QCheckBox;
+class QPushButton;
+
+namespace Windows
+{
+       class TypesWindow : public BaseWindow
+       {
+               Q_OBJECT
+
+       public:
+               explicit TypesWindow(Settings& settings, QWidget *parent = 0);
+
+       protected slots:
+               void Continue();
+               void OrientationChanged();
+
+       private:
+               void CreateContents();
+               void Advance();
+
+       private:
+               QCheckBox *cbMadeCalls;
+               QCheckBox *cbRecvCalls;
+               QCheckBox *cbSentSMS;
+               QCheckBox *cbRecvSMS;
+               QCheckBox *cbSentMMS;
+               QCheckBox *cbRecvMMS;
+               QCheckBox *cbSentChat;
+               QCheckBox *cbRecvChat;
+               QPushButton *btnContinue;
+       };
+}
+#endif // TYPESWINDOW_H
diff --git a/dialog.ui b/dialog.ui
new file mode 100644 (file)
index 0000000..27838b2
--- /dev/null
+++ b/dialog.ui
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>569</width>
+    <height>269</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QWidget" name="verticalLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>10</y>
+     <width>471</width>
+     <height>251</height>
+    </rect>
+   </property>
+   <layout class="QVBoxLayout" name="verticalLayout" stretch="3,3,1">
+    <property name="spacing">
+     <number>0</number>
+    </property>
+    <property name="sizeConstraint">
+     <enum>QLayout::SetNoConstraint</enum>
+    </property>
+    <property name="leftMargin">
+     <number>20</number>
+    </property>
+    <property name="rightMargin">
+     <number>20</number>
+    </property>
+    <item>
+     <widget class="QLabel" name="label">
+      <property name="text">
+       <string>A backup has been found that suggests this program crashed during an import.</string>
+      </property>
+      <property name="textFormat">
+       <enum>Qt::PlainText</enum>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+      <property name="wordWrap">
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QLabel" name="label_2">
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Ignored" vsizetype="Ignored">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="text">
+       <string>It is strongly advised that you restore this backup so the system is operating from a known valid state.</string>
+      </property>
+      <property name="scaledContents">
+       <bool>false</bool>
+      </property>
+      <property name="alignment">
+       <set>Qt::AlignCenter</set>
+      </property>
+      <property name="wordWrap">
+       <bool>true</bool>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QPushButton" name="pushButton">
+        <property name="text">
+         <string>PushButton</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>TextLabel</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="pushButton_2">
+        <property name="text">
+         <string>PushButton</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/iHashable.h b/iHashable.h
new file mode 100644 (file)
index 0000000..9c52aee
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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 IHASHABLE_H
+#define IHASHABLE_H
+
+class iHashable
+{
+protected:
+       virtual ~iHashable() {};
+
+public:
+       typedef unsigned int Hash;
+       virtual const Hash HashCode() const =0;
+};
+
+#endif // IHASHABLE_H
diff --git a/main.cpp b/main.cpp
new file mode 100644 (file)
index 0000000..c81212e
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011, Jamie Thompson
+ *
+ * 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 3 of the License, or (at your option) any later version.
+ *
+ * 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/>.
+ */
+
+#include "Settings.h"
+#include "Windows/ModeWindow.h"
+#include "Windows/RestoreCrashBackupWindow.h"
+
+#include "ui_dialog.h"
+
+#include <QtGui>
+#include <QtGui/QApplication>
+#include <QHash>
+
+int main(int argc, char *argv[])
+{
+       QApplication app(argc, argv);
+
+       Settings settings;
+
+       if (app.arguments().count() > 1 || app.arguments().first() != app.applicationFilePath())
+       {
+               settings.setAppMode(Settings::APPMODE_CONSOLE);
+
+//             QHash<QString, QString> argHash;
+//             for(int i = 0; i < argc; ++i)
+//             {
+//                     std::string val(argv[i]);
+//                     QString val2 = QString(val.substr(val.find_first_not_of(" -")).c_str()).trimmed();
+//                     argHash.insert(val2, val2);
+//             }
+       }
+       else
+               settings.setAppMode(Settings::APPMODE_GUI);
+
+       Windows::RestoreCrashBackupWindow* window = new Windows::RestoreCrashBackupWindow(settings);
+       window->show();
+
+
+       //Ui_Dialog * ud = new Ui_Dialog();
+       //QDialog * d = new QDialog();
+       //ud->setupUi(d);
+       //d->show();
+
+       return app.exec();
+}
diff --git a/qtc_packaging/debian_fremantle/README b/qtc_packaging/debian_fremantle/README
new file mode 100644 (file)
index 0000000..824cf65
--- /dev/null
@@ -0,0 +1,33 @@
+The Debian Package qwerkisync
+----------------------------
+
+This package will import and export your communications data to and from files.
+
+It's alpha-quality. Understand this. That said, I use it and haven't had major
+problems with it yet.
+
+It will create backups of your communications database files each time it is
+used. These are located in the usual backups folder should you ever need to
+recover them manually. It will cycle these backups, keeping at most the last 3.
+
+Currently, it supports SMS message import/export to/from VMG files. I plan to
+add call logs, MMS, and chat log support. I also plan to add support for mutiple
+formats for each of these in time (i.e. Android-compatible formats). It also
+currently preserves SMS-transported data such as clender events and
+configuration data. these will show in the rtcom-messaging-ui as contact cards
+as that's the only attachment it expect SMSes to have. They have ot be stored
+however to ensure the export is the same as the import.
+
+The backends it currently supports are Maemo5's rtcom-eventlogger for all event
+types other than MMS and it will (hopefully!) shortly support Fmms on Maemo5 for
+MMSs.
+
+In the long-term, I plan to add MMS support to the normal rtcom-eventlogger (and
+fork Fmms to use this instead) and will add support for this format to the
+program.
+
+...in the long-long future I'd like to reimplement the rtcom-messaging-ui
+component so that's another closed-source package to tick off the freedom list,
+obviously adding support for the new events I'll be adding.
+
+ -- Jamie Thompson <maemo@jamie-thompson.co.uk>  Fri, 05 Aug 2011 11:32:52 +0100
diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog
new file mode 100644 (file)
index 0000000..7c2b2d6
--- /dev/null
@@ -0,0 +1,5 @@
+qwerkisync (0.0.1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Jamie Thompson <maemo@jamie-thompson.co.uk>  Fri, 05 Aug 2011 11:32:52 +0100
diff --git a/qtc_packaging/debian_fremantle/compat b/qtc_packaging/debian_fremantle/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control
new file mode 100644 (file)
index 0000000..4a0c89b
--- /dev/null
@@ -0,0 +1,24 @@
+Source: qwerkisync
+Section: user/hidden
+Priority: optional
+Maintainer: Jamie Thompson <maemo@jamie-thompson.co.uk>
+Build-Depends: debhelper (>= 5), libqt4-dev, librtcom-eventlogger-dev (>= 1.1),
+       libosso-dev, libglib2.0-dev, libosso-abook-dev, libqt4-dbus, uuid-dev
+Standards-Version: 3.7.3
+Homepage: https://garage.maemo.org/projects/qwerkisync/
+
+Package: qwerkisync
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Syncs communications events to and from files
+ This package imports and exports commuications data from the
+ system to and from various common formats. It will attempt to ensure
+ that it does not add events that are already present in the system,
+ so it should be safe to run iteratively.
+ .
+ The aim is for the exports to exactly match the import data. However,
+ this is not always possible due to limitations of the communications
+ database(s).
+XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAByQAAAckBYQ9UXAAADR5JREFUaIHNmnusHNV9xz+/MzP7nN37XD+unxhiwNzrNAQozh8uMi1No5LSujVBrRopqaBNRNqG/pEqVasEVDVNRZMUVdCqAZEqqo1JK1WihARa7PIyxAX8CBEgMGD8uO+9+5rZmfPrH2f3Pux77RvjVP1JRzszO+ec7/f3Or9zdoWLLwLAXi4JKtylWXqIeDlZz31cQgToz2DODyxiHue3s0c5mpsmzdfRXIz2WnRQ0dWKrm+h66qkG0ZprX5GdoePUaFL9oNMfKEdgyflK/4W/lQHNLC+GykLDABFYBDIpiWSVGikAVEUIKkBFaxJyPsJBS9B21ZPj8qJ18b+7ZvJx3b89f8FATH/waeyN/DdNOceZIBSB3iv9pFLlXqUZfLUIO26B22QpoLFte7MBgp9LYJCg/LEmzw3PvYRfnntyz87Av9Kb+ZKec1foyuTcG6AtTjNi+1jYmyAxmQRmopMKsSKxAqxe3n+hKqAURKUvsozHPULyMRbz2k9vYldw7XlQPJ/Gvz562RUV6ifeO4+B/QAZe2j2cozPd6Hfd8gdYs0FInsHGhPkTPUpYBaSGo+U2GD7ZUS+3rWbYPT04C3HExmueDND/iSXa1+19/LwApgEzAxuoqJYxXscYOcsJhJi8QW4ynGsxjfYvzO9bzmeRZjUhKbodpsMdNqcmO5AMU+w57Djy8H13ldyN8ve7Nb2dku6aw2+4GKrTA5XsGOB5i3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wyHNJ0fkDwfFMmSVQlSluapFtCKlVUkph2UqYQ8rwx5WlsqsKHdaqUxUKHEg9YgmRl1tczb4aZC7iZsHqI47AuV+F9QLkMrti+H7qX5m3faM+VK4Ub/aLkhQs8J7sgkzU6DniXupXHU1ftjDUxEugNPE5fOuf9erZw+oOkMmWU/79Rn0yq8Rlu+iUIJSH4yfgKjlxnAxFWH5ELeNvHvBBDriXf0E1/ZcEexL8mkwI4O8/PA/wqZhKITO99MUbOIAnOkqDvgLCP+O791PlPbiyXeAbfiB2+wUym51rk64gq5R6/Z78MyTuQ/yXwVv68MMlLbId5793reqeunVayiWhzCyYYn3J4EnQB9j18jDs093H6oiUpq975JYsc7dV8dhZspZ0tqUXcMLzrI+8J8tLpo88FJAX+5boDtANpMvuoxULLtSo1mHVg2ixvX86qYXut3+/xCYL3v+Zw34XySTX0sms5aeyjVkcnVgnPr0g9zQ+5fdV/8XzXjK12H5YEYAAAAASUVORK5CYII=
+XB-Maemo-Display-Name: QwerkiSync
+XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=7481&group_id=2227&func=browse
diff --git a/qtc_packaging/debian_fremantle/copyright b/qtc_packaging/debian_fremantle/copyright
new file mode 100644 (file)
index 0000000..82338a4
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright:
+       <Copyright (C) 2011 Jamie Thompson>
+
+License:
+       This package 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 3 of the License, or
+       (at your option) any later version.
+
+       This package 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 package; if not, write to the Free Software
+       Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian-based systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2011, Jamie Thompson <maemo@jamie-thompson.co.uk>
+and is licensed under the GPL, see above.
+
+
+
diff --git a/qtc_packaging/debian_fremantle/rules b/qtc_packaging/debian_fremantle/rules
new file mode 100644 (file)
index 0000000..dbb2de2
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+       dh_testdir
+
+       # Add here commands to compile the package.
+       # To fix upload to extras-devel?
+       #/opt/qt4-maemo5/qmake PREFIX=/usr
+       qmake #PREFIX=/usr
+       $(MAKE)
+       #docbook-to-man debian/qwerkisync.sgml > qwerkisync.1
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       -$(MAKE) clean # To fix upload to extras-devel?
+
+       dh_clean
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+
+       # Add here commands to install the package into debian/qwerkisync.
+       $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/qwerkisync install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+       dh_installdocs
+       dh_installexamples
+#      dh_install
+#      dh_installmenu
+#      dh_installdebconf
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       # dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_makeshlibs
+       dh_installdeb
+       dh_shlibdeps                      # Uncomment this line for publishing!
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/qtc_packaging/debian_harmattan/README b/qtc_packaging/debian_harmattan/README
new file mode 100644 (file)
index 0000000..9b6f6dc
--- /dev/null
@@ -0,0 +1,6 @@
+The Debian Package qwerkisync
+----------------------------
+
+Comments regarding the Package
+
+ -- unknown <>  Sat, 02 Jul 2011 01:12:38 +0100
diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog
new file mode 100644 (file)
index 0000000..50d8741
--- /dev/null
@@ -0,0 +1,5 @@
+qwerkisync (0.0.1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- unknown <>  Sat, 02 Jul 2011 01:12:38 +0100
diff --git a/qtc_packaging/debian_harmattan/compat b/qtc_packaging/debian_harmattan/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/qtc_packaging/debian_harmattan/control b/qtc_packaging/debian_harmattan/control
new file mode 100644 (file)
index 0000000..23a8b8f
--- /dev/null
@@ -0,0 +1,15 @@
+Source: qwerkisync
+Section: user/other
+Priority: optional
+Maintainer: unknown <>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: <insert the upstream URL, if relevant>
+
+Package: qwerkisync
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Syncs communications events to and from files
+ <insert long description, indented with spaces>
+XSBC-Maemo-Display-Name: QwerkiSync
+XB-Maemo-Icon-26: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAByQAAAckBYQ9UXAAADR5JREFUaIHNmnusHNV9xz+/MzP7nN37XD+unxhiwNzrNAQozh8uMi1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boDtANpMvuoxULLtSo1mHVg2ixvX86qYXut3+/xCYL3v+Zw34XySTX0sms5aeyjVkcnVgnPr0g9zQ+5fdV/8XzXjK12H5YEYAAAAASUVORK5CYII=
diff --git a/qtc_packaging/debian_harmattan/copyright b/qtc_packaging/debian_harmattan/copyright
new file mode 100644 (file)
index 0000000..af9ec04
--- /dev/null
@@ -0,0 +1,40 @@
+This package was debianized by unknown <> on
+Sat, 02 Jul 2011 01:12:38 +0100.
+
+It was downloaded from <url://example.com>
+
+Upstream Author(s):
+
+    <put author's name and email here>
+    <likewise for another author>
+
+Copyright:
+
+    <Copyright (C) YYYY Name OfAuthor>
+    <likewise for another author>
+
+License:
+
+    This package 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.
+
+    This package 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 package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2011, unknown <> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/qtc_packaging/debian_harmattan/rules b/qtc_packaging/debian_harmattan/rules
new file mode 100644 (file)
index 0000000..2ffcbb7
--- /dev/null
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp  
+       dh_testdir
+
+       # Add here commands to compile the package.
+       # $(MAKE) # Uncomment this line for use without Qt Creator
+       #docbook-to-man debian/qwerkisync.sgml > qwerkisync.1
+
+       touch $@
+
+clean: 
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       $(MAKE) clean
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/qwerkisync.
+       $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/qwerkisync install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs 
+       dh_installdocs
+       dh_installexamples
+#      dh_install
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_makeshlibs
+       dh_installdeb
+       # dh_shlibdeps # Uncomment this line for use without Qt Creator
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/qwerkisync.desktop b/qwerkisync.desktop
new file mode 100644 (file)
index 0000000..cabb166
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=QwerkiSync
+Exec=/opt/usr/bin/qwerkisync
+Icon=qwerkisync
+X-Window-Icon=qwerkisync
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/qwerkisync.png b/qwerkisync.png
new file mode 100644 (file)
index 0000000..8ba79dc
Binary files /dev/null and b/qwerkisync.png differ
diff --git a/qwerkisync.pro b/qwerkisync.pro
new file mode 100644 (file)
index 0000000..12eba92
--- /dev/null
@@ -0,0 +1,158 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-12-23T03:08:33
+#
+#-------------------------------------------------
+
+QT       += core gui sql dbus
+
+TARGET = qwerkisync
+TEMPLATE = app
+
+DESTDIR = ./Build
+OBJECTS_DIR = ./Build
+MOC_DIR = ./Build
+RCC_DIR = ./Build
+UI_HEADERS_DIR = ./Build
+
+#INCLUDEPATH += /usr/include/glib-2.0
+#INCLUDEPATH += /usr/include/gtk-2.0
+#INCLUDEPATH += /usr/lib/glib-2.0/include
+INCLUDEPATH += /usr/include
+INCLUDEPATH += /usr/include/qt
+INCLUDEPATH += /usr/include/qtcore
+INCLUDEPATH += /usr/include/c++/4.2
+LIBS += -lrtcom-eventlogger -luuid
+# libosso-abook-1.0 libosso
+
+SOURCES += main.cpp\
+       Attachment.cpp \
+       AttachmentCollection.cpp \
+       CellularRadio.cpp \
+       EventLogBackupManager.cpp \
+       EventLogReindexer.cpp \
+       EventParsers/CSVSymbianEventLogParser.cpp \
+       EventParsers/Factory.cpp \
+       EventParsers/MMSParser.cpp \
+       EventParsers/VMGParser.cpp \
+       EventParsers/VMGEntities/SMSEntity.cpp \
+       EventParsers/VMGEntities/VBody.cpp \
+       EventParsers/VMGEntities/VCard.cpp \
+       EventParsers/VMGEntities/VCalendar.cpp \
+       EventParsers/VMGEntities/VEnvelope.cpp \
+       EventParsers/VMGEntities/VMessage.cpp \
+       EventPreventer.cpp \
+       EventTypes/RtcomEvent.cpp \
+       EventTypes/SMS.cpp \
+       NumberToNameLookup.cpp \
+       Settings.cpp \
+       SyncerThread.cpp \
+       Windows/BaseWindow.cpp \
+       Windows/DirectoryWindow.cpp \
+       Windows/ModeWindow.cpp \
+       Windows/ProgressWindow.cpp \
+       Windows/RestoreAccountStateWindow.cpp \
+       Windows/RestoreCrashBackupWindow.cpp \
+       Windows/TypesWindow.cpp \
+       EventParsers/VMGEntities/VMGFactory.cpp \
+       DBBackends/RtcomEventLogger.cpp \
+       DBBackends/Fmms.cpp \
+       EventProcessors/Hasher.cpp \
+       EventProcessors/Writer.cpp \
+       DBBackends/DBBackends.cpp \
+       EventTypes/PhoneCall.cpp
+
+HEADERS  += \
+       Windows/ModeWindow.h \
+       Settings.h \
+       Windows/BaseWindow.h \
+       Windows/TypesWindow.h \
+       Windows/DirectoryWindow.h \
+       Windows/ProgressWindow.h \
+       SyncerThread.h \
+       EventParsers/VMGEntities/VMessage.h \
+       EventParsers/VMGEntities/VEnvelope.h \
+       EventParsers/VMGEntities/VCard.h \
+       EventParsers/VMGEntities/VBody.h \
+       EventParsers/VMGEntities/iWriter.h \
+       EventParsers/VMGEntities/Factory.h \
+       EventParsers/VMGEntities/iReader.h \
+       EventParsers/VMGEntities/SMSEntity.h \
+       Attachment.h \
+       EventTypes/SMS.h \
+       AttachmentCollection.h \
+       iHashable.h \
+       NumberToNameLookup.h \
+       EventLogReindexer.h \
+       EventParsers/VMGEntities/VCalendar.h \
+       EventPreventer.h \
+       EventLogBackupManager.h \
+       Windows/RestoreCrashBackupWindow.h \
+       Windows/RestoreAccountStateWindow.h \
+       CellularRadio.h \
+       EventParsers/Factory.h \
+       EventParsers/VMGParser.h \
+       EventParsers/iEventParser.h \
+       EventParsers/CSVSymbianEventLogParser.h \
+       EventParsers/MMSParser.h \
+       EventTypes/iEvent.h \
+       EventTypes/EventList.h \
+       EventTypes/EventFromFile.h \
+       EventTypes/EventFromFileList.h \
+       DBBackends/iDBBackend.h \
+       DBBackends/RtcomEventLogger.h \
+       DBBackends/Fmms.h \
+       EventProcessors/Hasher.h \
+       EventProcessors/Writer.h \
+       EventProcessors/iEventProcessor.h \
+       DBBackends/AllBackends.h \
+       EventTypes/PhoneCall.h \
+    EventTypes/RtcomEvent.h
+
+FORMS    += \
+       dialog.ui
+
+CONFIG += link_pkgconfig
+CONFIG += object_with_source
+PKGCONFIG += libosso glib-2.0 libosso-abook-1.0
+QT += maemo5
+
+RESOURCES += \
+       Resources1.qrc
+
+unix:!symbian {
+       maemo5 {
+               target.path = /opt/usr/bin
+       } else {
+               target.path = /usr/local/bin
+       }
+       INSTALLS += target
+}
+
+OTHER_FILES += \
+       qtc_packaging/debian_harmattan/rules \
+       qtc_packaging/debian_harmattan/README \
+       qtc_packaging/debian_harmattan/copyright \
+       qtc_packaging/debian_harmattan/control \
+       qtc_packaging/debian_harmattan/compat \
+       qtc_packaging/debian_harmattan/changelog \
+       debian/qwerkisync/usr/share/icons/qwerkisync.png \
+       qtc_packaging/debian_fremantle/changelog \
+       qtc_packaging/debian_fremantle/rules \
+       qtc_packaging/debian_fremantle/control \
+       qtc_packaging/debian_fremantle/README \
+       qtc_packaging/debian_fremantle/copyright \
+       qtc_packaging/debian_fremantle/compat \
+       qtc_packaging/debian_fremantle/usr/share/hildon/qwerkisync.desktop \
+       qwerkisync.png \
+       COPYING
+
+maemo5 {
+       desktopfile.files = $${TARGET}.desktop
+       desktopfile.path = /usr/share/applications/hildon
+       INSTALLS += desktopfile
+
+       icon.files = qwerkisync.png
+       icon.path = /usr/share/icons/hicolor/64x64/apps
+       INSTALLS += icon
+}
diff --git a/qwerkisync.svg b/qwerkisync.svg
new file mode 100644 (file)
index 0000000..3cb58c1
--- /dev/null
@@ -0,0 +1,1550 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="512"
+   height="512"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="sync.svg"
+   inkscape:export-filename="D:\CODING\Projects\Maemo\qwerkisync\qtc_packaging\debian_fremantle\qwerkisync.png"
+   inkscape:export-xdpi="11.602699"
+   inkscape:export-ydpi="11.602699">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 256 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="512 : 256 : 1"
+       inkscape:persp3d-origin="256 : 170.66667 : 1"
+       id="perspective188" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient10369">
+      <stop
+         style="stop-color:#666666;stop-opacity:1"
+         offset="0"
+         id="stop10371" />
+      <stop
+         style="stop-color:#999999;stop-opacity:0"
+         offset="1"
+         id="stop10373" />
+    </linearGradient>
+    <inkscape:path-effect
+       effect="skeletal"
+       id="path-effect10367"
+       is_visible="true"
+       pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 z"
+       copytype="single_stretched"
+       prop_scale="1"
+       scale_y_rel="false"
+       spacing="0"
+       normal_offset="0"
+       tang_offset="0"
+       prop_units="false"
+       vertical_pattern="false"
+       fuse_tolerance="0" />
+    <linearGradient
+       id="linearGradient11572"
+       inkscape:collect="always">
+      <stop
+         id="stop11574"
+         offset="0"
+         style="stop-color:#666666;stop-opacity:1" />
+      <stop
+         id="stop11576"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient11560">
+      <stop
+         style="stop-color:#004455;stop-opacity:1;"
+         offset="0"
+         id="stop11562" />
+      <stop
+         id="stop11578"
+         offset="0.44968382"
+         style="stop-color:#004455;stop-opacity:0.22352941;" />
+      <stop
+         style="stop-color:#004455;stop-opacity:0;"
+         offset="1"
+         id="stop11564" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11552"
+       inkscape:collect="always">
+      <stop
+         id="stop11554"
+         offset="0"
+         style="stop-color:#aaeeff;stop-opacity:1" />
+      <stop
+         id="stop11556"
+         offset="1"
+         style="stop-color:#d5f6ff;stop-opacity:0" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11540">
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1"
+         offset="0"
+         id="stop11542" />
+      <stop
+         id="stop11544"
+         offset="0.84279335"
+         style="stop-color:#00aad4;stop-opacity:1" />
+      <stop
+         style="stop-color:#45d3ff;stop-opacity:1;"
+         offset="0.9396137"
+         id="stop11546" />
+      <stop
+         id="stop11548"
+         offset="0.94147432"
+         style="stop-color:#00ccff;stop-opacity:1" />
+      <stop
+         style="stop-color:#00aad4;stop-opacity:1"
+         offset="1"
+         id="stop11550" />
+    </linearGradient>
+    <inkscape:path-effect
+       effect="skeletal"
+       id="path-effect11359"
+       is_visible="true"
+       pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 z"
+       copytype="single_stretched"
+       prop_scale="1"
+       scale_y_rel="false"
+       spacing="0"
+       normal_offset="0"
+       tang_offset="0"
+       prop_units="false"
+       vertical_pattern="false"
+       fuse_tolerance="0" />
+    <inkscape:path-effect
+       effect="skeletal"
+       id="path-effect11309"
+       is_visible="true"
+       pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 z"
+       copytype="single_stretched"
+       prop_scale="1"
+       scale_y_rel="false"
+       spacing="0"
+       normal_offset="0"
+       tang_offset="0"
+       prop_units="false"
+       vertical_pattern="false"
+       fuse_tolerance="0" />
+    <linearGradient
+       id="linearGradient11299">
+      <stop
+         style="stop-color:#02ff00;stop-opacity:1;"
+         offset="0"
+         id="stop11301" />
+      <stop
+         id="stop11303"
+         offset="0.78636628"
+         style="stop-color:#08ff00;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00aa13;stop-opacity:1;"
+         offset="1"
+         id="stop11305" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient11291">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0"
+         offset="0"
+         id="stop11293" />
+      <stop
+         id="stop11295"
+         offset="0.66876221"
+         style="stop-color:#ffcc00;stop-opacity:0" />
+      <stop
+         style="stop-color:#ffcc00;stop-opacity:1"
+         offset="1"
+         id="stop11297" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11285">
+      <stop
+         id="stop11287"
+         offset="0"
+         style="stop-color:#1cff00;stop-opacity:1;" />
+      <stop
+         id="stop11289"
+         offset="1"
+         style="stop-color:#1bff00;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11277">
+      <stop
+         id="stop11279"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:0" />
+      <stop
+         style="stop-color:#19ff00;stop-opacity:0;"
+         offset="0.5659169"
+         id="stop11281" />
+      <stop
+         id="stop11283"
+         offset="1"
+         style="stop-color:#0dff00;stop-opacity:1;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11263">
+      <stop
+         id="stop11265"
+         offset="0"
+         style="stop-color:#0aff00;stop-opacity:1;" />
+      <stop
+         id="stop11267"
+         offset="1"
+         style="stop-color:#999999;stop-opacity:0;" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11257">
+      <stop
+         style="stop-color:#00aa19;stop-opacity:1;"
+         offset="0"
+         id="stop11259" />
+      <stop
+         style="stop-color:#00aa0a;stop-opacity:0;"
+         offset="1"
+         id="stop11261" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11243">
+      <stop
+         style="stop-color:#54ff00;stop-opacity:1;"
+         offset="0"
+         id="stop11245" />
+      <stop
+         id="stop11247"
+         offset="0.84279335"
+         style="stop-color:#1dac2b;stop-opacity:1;" />
+      <stop
+         style="stop-color:#19ff32;stop-opacity:1;"
+         offset="0.9396137"
+         id="stop11249" />
+      <stop
+         id="stop11251"
+         offset="0.94147432"
+         style="stop-color:#62ff00;stop-opacity:1;" />
+      <stop
+         style="stop-color:#04ff00;stop-opacity:1;"
+         offset="1"
+         id="stop11253" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient11046">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0"
+         offset="0"
+         id="stop11048" />
+      <stop
+         id="stop11050"
+         offset="0.46093053"
+         style="stop-color:#aaeeff;stop-opacity:0" />
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1"
+         offset="1"
+         id="stop11052" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11036">
+      <stop
+         id="stop11038"
+         offset="0"
+         style="stop-color:#00ccff;stop-opacity:1" />
+      <stop
+         style="stop-color:#d5f6ff;stop-opacity:1"
+         offset="0.78636628"
+         id="stop11040" />
+      <stop
+         id="stop11042"
+         offset="1"
+         style="stop-color:#80e5ff;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient11022"
+       inkscape:collect="always">
+      <stop
+         id="stop11024"
+         offset="0"
+         style="stop-color:#2ad4ff;stop-opacity:1" />
+      <stop
+         id="stop11026"
+         offset="1"
+         style="stop-color:#0088aa;stop-opacity:0" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10217">
+      <stop
+         id="stop10219"
+         offset="0"
+         style="stop-color:#b3b3b3;stop-opacity:1" />
+      <stop
+         style="stop-color:#b3b3b3;stop-opacity:1"
+         offset="0.84279335"
+         id="stop10221" />
+      <stop
+         id="stop10240"
+         offset="0.9396137"
+         style="stop-color:#b7c4c8;stop-opacity:1" />
+      <stop
+         style="stop-color:#d9d9d9;stop-opacity:1;"
+         offset="0.94147432"
+         id="stop10244" />
+      <stop
+         id="stop10223"
+         offset="1"
+         style="stop-color:#e6e6e6;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient10205">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1"
+         offset="0"
+         id="stop10207" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0"
+         offset="1"
+         id="stop10209" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10172"
+       inkscape:collect="always">
+      <stop
+         id="stop10174"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:0" />
+      <stop
+         style="stop-color:#80e5ff;stop-opacity:0"
+         offset="0.66876221"
+         id="stop10178" />
+      <stop
+         id="stop10176"
+         offset="1"
+         style="stop-color:#00ccff;stop-opacity:1" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient10160">
+      <stop
+         style="stop-color:#aaeeff;stop-opacity:1"
+         offset="0"
+         id="stop10162" />
+      <stop
+         style="stop-color:#999999;stop-opacity:0;"
+         offset="1"
+         id="stop10164" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient10150">
+      <stop
+         style="stop-color:#b3b3b3;stop-opacity:1"
+         offset="0"
+         id="stop10152" />
+      <stop
+         id="stop10215"
+         offset="0.5"
+         style="stop-color:#cccccc;stop-opacity:1;" />
+      <stop
+         style="stop-color:#e6e6e6;stop-opacity:1"
+         offset="1"
+         id="stop10154" />
+    </linearGradient>
+    <filter
+       inkscape:collect="always"
+       id="filter11066">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.2951562"
+         id="feGaussianBlur11068" />
+    </filter>
+    <filter
+       inkscape:collect="always"
+       id="filter11079">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="1.9599219"
+         id="feGaussianBlur11081" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath11085">
+      <path
+         id="path11087"
+         d="M 182.84375,22.34375 C 118.92001,34.825325 50.069669,80.196677 3.4375,128.15625 c 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 47.84272,0 92.20452,-14.80913 128.8125,-40.0625 -27.22251,11.67174 -57.22351,18.15625 -88.71875,18.15625 -124.42563,0 -225.28125,-100.85562 -225.28125,-225.28125 0,-83.13392 45.03314,-155.770903 112.03125,-194.8125 z"
+         style="opacity:0.5;color:#000000;fill:url(#linearGradient11089);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:connector-curvature="0" />
+    </clipPath>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10205"
+       id="linearGradient11089"
+       gradientUnits="userSpaceOnUse"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075" />
+    <filter
+       inkscape:collect="always"
+       id="filter11100">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="2.7767188"
+         id="feGaussianBlur11102" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath11106">
+      <path
+         id="path11108"
+         d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 c 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 111.53132,0 204.2712,-80.35995 223.5,-186.34375 -29.82408,20.71204 -65.59915,34.16424 -104.4375,37.59375 C 349.56271,354.24343 305.77142,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 6.536,-48.83936 18,-69.375 17.82545,9.08173 34.57354,19.83139 50.34375,32.78125 -17.57396,-62.36603 -8.87497,-137.44556 1.125,-178.25 z"
+         style="color:#000000;fill:url(#radialGradient11110);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         inkscape:connector-curvature="0" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10217"
+       id="radialGradient11110"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0539825,0.04944828,-0.04887783,1.0418233,-6.8249552,-20.903789)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11540"
+       id="radialGradient11154"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0539825,0.04944828,-0.04887783,1.0418233,-6.8249552,-20.903789)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11036"
+       id="radialGradient11156"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.92070578,-0.58609608,0.71627384,1.1252505,-270.04555,52.475869)"
+       cx="270.7897"
+       cy="337.78555"
+       fx="270.7897"
+       fy="337.78555"
+       r="190.6875" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10160"
+       id="radialGradient11158"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-1.0195859,-0.01372469,0.02691627,-1.9995846,238.68685,1925.0142)"
+       cx="65.484375"
+       cy="620.87714"
+       fx="65.484375"
+       fy="620.87714"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10172"
+       id="radialGradient11160"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.34197539,-0.46605113,1.6415175,-1.2045,-865.97886,1037.5759)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11552"
+       id="linearGradient11162"
+       gradientUnits="userSpaceOnUse"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11046"
+       id="radialGradient11164"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.43576637,-0.45811907,1.3694099,-1.3025932,-659.45508,1099.7445)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11022"
+       id="radialGradient11166"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.3876607,0.09270157,-0.21036368,-0.87970167,338.66383,1249.943)"
+       cx="23.988123"
+       cy="615.37561"
+       fx="23.988123"
+       fy="615.37561"
+       r="89.73735" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11257"
+       id="radialGradient11199"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.37456033,0.08956887,-0.20325478,-0.84997358,335.92281,1234.7876)"
+       cx="23.988123"
+       cy="615.37561"
+       fx="23.988123"
+       fy="615.37561"
+       r="89.73735" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11277"
+       id="radialGradient11202"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.38055535,-0.42239478,1.3567002,-1.2223151,-662.97134,1581.9439)"
+       cx="298.09671"
+       cy="657.69263"
+       fx="298.09671"
+       fy="657.69263"
+       r="89.737352" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11285"
+       id="linearGradient11206"
+       gradientUnits="userSpaceOnUse"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075"
+       gradientTransform="matrix(0.96620662,0,0,0.96620662,8.7035799,549.18593)" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11291"
+       id="radialGradient11209"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.33041889,-0.45030169,1.5860451,-1.1637959,-828.01093,1551.6986)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11263"
+       id="radialGradient11212"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.66086731,0.15436751,-0.27025338,-1.1569895,402.03131,1394.8751)"
+       cx="61.432056"
+       cy="615.10303"
+       fx="61.432056"
+       fy="615.10303"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11299"
+       id="radialGradient11215"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.88959202,-0.56628991,0.69206853,1.0872245,-252.21622,599.88846)"
+       cx="270.7897"
+       cy="337.78555"
+       fx="270.7897"
+       fy="337.78555"
+       r="190.6875" />
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath11228">
+      <path
+         style="opacity:0.74891776;color:#000000;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+         d="m 291.9442,1057.4935 11.3314,-50.7824 c -13.61251,0.3634 -26.59113,0.3209 -38.45433,4e-4 18.64637,-37.64727 43.48743,-109.03025 39.9174,-173.72662 9.23724,11.81045 19.26933,22.57518 30.04707,32.51152 l 33.0346,-148.04665 C 349.30546,680.39963 314.8971,651.68944 271.31811,641.96538 l 18.42288,-82.56331 c 36.36317,8.11395 72.66037,20.59096 105.0161,37.32896 L 402.22288,563.2726 2.7958114,474.14587 -107.48287,968.36672 291.9442,1057.4935 z"
+         id="path11230"
+         inkscape:connector-curvature="0" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11243"
+       id="radialGradient11255"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0183649,0.04777726,-0.04722608,1.0066166,2.109263,528.98855)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <filter
+       inkscape:collect="always"
+       id="filter11347"
+       x="-0.19514074"
+       width="1.3902815"
+       y="-0.074660229"
+       height="1.1493205">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="4.0610632"
+         id="feGaussianBlur11349" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath11353">
+      <path
+         sodipodi:nodetypes="cccc"
+         inkscape:connector-curvature="0"
+         id="path11355"
+         d="m 354.2149,446.91405 c 0,0 -59.37966,-31.57957 -48.54026,-75.82864 40.57041,-16.61633 52.02777,-32.36296 70.2526,-61.94714 47.51126,-13.44573 46.08048,150.89697 -21.71234,137.77578 z"
+         style="fill:#803300;fill-rule:evenodd;stroke:none" />
+    </clipPath>
+    <filter
+       inkscape:collect="always"
+       id="filter11473"
+       x="-0.31862783"
+       width="1.6372557"
+       y="-0.11187138"
+       height="1.2237428">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="4.4280733"
+         id="feGaussianBlur11475" />
+    </filter>
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath11477">
+      <path
+         sodipodi:nodetypes="cccssc"
+         inkscape:connector-curvature="0"
+         id="path11479"
+         d="m 182.37642,24.69351 c -3.98227,15.31395 -11.76628,63.445884 -10.69055,95.96928 7.51563,-4.29215 16.31315,-8.46549 26.13875,-11.59647 19.05716,-6.00202 34.27769,-8.49592 54.00462,-7.29732 23.68441,1.43905 11.95109,-84.244619 1.43616,-84.527391 -27.68335,-0.74447 -41.2952,0.473082 -70.88898,7.451901 z"
+         style="opacity:0.5;fill:#000000;fill-rule:evenodd;stroke:none" />
+    </clipPath>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11560"
+       id="radialGradient11566"
+       cx="255.68666"
+       cy="464.99878"
+       fx="255.68666"
+       fy="464.99878"
+       r="106.53611"
+       gradientTransform="matrix(0.94183808,0,0,0.15882353,14.871228,391.14603)"
+       gradientUnits="userSpaceOnUse" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11572"
+       id="radialGradient11570"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.15882353,0,391.14603)"
+       cx="255.68666"
+       cy="464.99878"
+       fx="255.68666"
+       fy="464.99878"
+       r="106.53611" />
+    <filter
+       inkscape:collect="always"
+       id="filter11604"
+       x="-0.041717647"
+       width="1.0834353"
+       y="-0.26266667"
+       height="1.5253333">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="3.7036965"
+         id="feGaussianBlur11606" />
+    </filter>
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10369"
+       id="radialGradient11665"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.15882353,0,391.14603)"
+       cx="255.68666"
+       cy="464.99878"
+       fx="255.68666"
+       fy="464.99878"
+       r="106.53611" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11560"
+       id="radialGradient11667"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.94183808,0,0,0.15882353,14.871228,391.14603)"
+       cx="255.68666"
+       cy="464.99878"
+       fx="255.68666"
+       fy="464.99878"
+       r="106.53611" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11243"
+       id="radialGradient11669"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0183649,0.04777726,-0.04722608,1.0066166,2.109263,528.98855)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11299"
+       id="radialGradient11671"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.88959202,-0.56628991,0.69206853,1.0872245,-252.21622,599.88846)"
+       cx="270.7897"
+       cy="337.78555"
+       fx="270.7897"
+       fy="337.78555"
+       r="190.6875" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11263"
+       id="radialGradient11673"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.66086731,0.15436751,-0.27025338,-1.1569895,402.03131,1394.8751)"
+       cx="61.432056"
+       cy="615.10303"
+       fx="61.432056"
+       fy="615.10303"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11291"
+       id="radialGradient11675"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.33041889,-0.45030169,1.5860451,-1.1637959,-828.01093,1551.6986)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11285"
+       id="linearGradient11677"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.96620662,0,0,0.96620662,8.7035799,549.18593)"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11277"
+       id="radialGradient11679"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.38055535,-0.42239478,1.3567002,-1.2223151,-662.97134,1581.9439)"
+       cx="298.09671"
+       cy="657.69263"
+       fx="298.09671"
+       fy="657.69263"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11257"
+       id="radialGradient11681"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.37456033,0.08956887,-0.20325478,-0.84997358,335.92281,1234.7876)"
+       cx="23.988123"
+       cy="615.37561"
+       fx="23.988123"
+       fy="615.37561"
+       r="89.73735" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11540"
+       id="radialGradient11683"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0539825,0.04944828,-0.04887783,1.0418233,-6.8249552,-20.903789)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11036"
+       id="radialGradient11685"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.92070578,-0.58609608,0.71627384,1.1252505,-270.04555,52.475869)"
+       cx="270.7897"
+       cy="337.78555"
+       fx="270.7897"
+       fy="337.78555"
+       r="190.6875" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10160"
+       id="radialGradient11687"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-1.0195859,-0.01372469,0.02691627,-1.9995846,238.68685,1925.0142)"
+       cx="65.484375"
+       cy="620.87714"
+       fx="65.484375"
+       fy="620.87714"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10172"
+       id="radialGradient11689"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.34197539,-0.46605113,1.6415175,-1.2045,-865.97886,1037.5759)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11552"
+       id="linearGradient11691"
+       gradientUnits="userSpaceOnUse"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11046"
+       id="radialGradient11693"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.43576637,-0.45811907,1.3694099,-1.3025932,-659.45508,1099.7445)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11022"
+       id="radialGradient11695"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.3876607,0.09270157,-0.21036368,-0.87970167,338.66383,1249.943)"
+       cx="23.988123"
+       cy="615.37561"
+       fx="23.988123"
+       fy="615.37561"
+       r="89.73735" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11257"
+       id="radialGradient10326"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.37456033,-0.08956887,-0.20325478,0.84997358,334.37,-216.92469)"
+       cx="23.988123"
+       cy="615.37561"
+       fx="23.988123"
+       fy="615.37561"
+       r="89.73735" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11277"
+       id="radialGradient10329"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.38055535,0.42239478,1.3567002,1.2223151,-664.52415,-564.08102)"
+       cx="298.09671"
+       cy="657.69263"
+       fx="298.09671"
+       fy="657.69263"
+       r="89.737352" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11285"
+       id="linearGradient10333"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.96620662,0,0,-0.96620662,7.1507669,468.67698)"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11291"
+       id="radialGradient10336"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.33041889,0.45030169,1.5860451,1.1637959,-829.56374,-533.83572)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11263"
+       id="radialGradient10339"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.66086731,-0.15436751,-0.27025338,1.1569895,400.4785,-377.01219)"
+       cx="61.432056"
+       cy="615.10303"
+       fx="61.432056"
+       fy="615.10303"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11299"
+       id="radialGradient10342"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.88959202,0.56628991,0.69206853,-1.0872245,-253.76903,417.97445)"
+       cx="270.7897"
+       cy="337.78555"
+       fx="270.7897"
+       fy="337.78555"
+       r="190.6875" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11243"
+       id="radialGradient10345"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0183649,-0.04777726,-0.04722608,-1.0066166,0.55645,488.87436)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11540"
+       id="radialGradient10351"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0539825,0.04944828,-0.04887783,1.0418233,-6.8249552,-20.903789)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11036"
+       id="radialGradient10353"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.92070578,-0.58609608,0.71627384,1.1252505,-270.04555,52.475869)"
+       cx="270.7897"
+       cy="337.78555"
+       fx="270.7897"
+       fy="337.78555"
+       r="190.6875" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10160"
+       id="radialGradient10355"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-1.0195859,-0.01372469,0.02691627,-1.9995846,238.68685,1925.0142)"
+       cx="65.484375"
+       cy="620.87714"
+       fx="65.484375"
+       fy="620.87714"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient10172"
+       id="radialGradient10357"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.34197539,-0.46605113,1.6415175,-1.2045,-865.97886,1037.5759)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11552"
+       id="linearGradient10359"
+       gradientUnits="userSpaceOnUse"
+       x1="119.69645"
+       y1="60.161564"
+       x2="73.948593"
+       y2="285.14075" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11046"
+       id="radialGradient10361"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.43576637,-0.45811907,1.3694099,-1.3025932,-659.45508,1099.7445)"
+       cx="294.22839"
+       cy="657.56274"
+       fx="294.22839"
+       fy="657.56274"
+       r="89.737352" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11022"
+       id="radialGradient10363"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(-0.3876607,0.09270157,-0.21036368,-0.87970167,338.66383,1249.943)"
+       cx="23.988123"
+       cy="615.37561"
+       fx="23.988123"
+       fy="615.37561"
+       r="89.73735" />
+    <inkscape:perspective
+       id="perspective3795"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <clipPath
+       clipPathUnits="userSpaceOnUse"
+       id="clipPath11477-1">
+      <path
+         sodipodi:nodetypes="cccssc"
+         inkscape:connector-curvature="0"
+         id="path11479-7"
+         d="m 182.37642,24.69351 c -3.98227,15.31395 -11.76628,63.445884 -10.69055,95.96928 7.51563,-4.29215 16.31315,-8.46549 26.13875,-11.59647 19.05716,-6.00202 34.27769,-8.49592 54.00462,-7.29732 23.68441,1.43905 11.95109,-84.244619 1.43616,-84.527391 -27.68335,-0.74447 -41.2952,0.473082 -70.88898,7.451901 z"
+         style="opacity:0.5;fill:#000000;fill-rule:evenodd;stroke:none" />
+    </clipPath>
+    <filter
+       color-interpolation-filters="sRGB"
+       inkscape:collect="always"
+       id="filter11473-4"
+       x="-0.31862783"
+       width="1.6372557"
+       y="-0.11187138"
+       height="1.2237428">
+      <feGaussianBlur
+         inkscape:collect="always"
+         stdDeviation="4.4280733"
+         id="feGaussianBlur11475-0" />
+    </filter>
+    <inkscape:perspective
+       id="perspective3846"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <radialGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient11540-4"
+       id="radialGradient10351-9"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.0539825,0.04944828,-0.04887783,1.0418233,-6.8249552,-20.903789)"
+       cx="308.59799"
+       cy="215.53297"
+       fx="308.59799"
+       fy="215.53297"
+       r="238.03125" />
+    <linearGradient
+       id="linearGradient11540-4">
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1"
+         offset="0"
+         id="stop11542-8" />
+      <stop
+         id="stop11544-8"
+         offset="0.84279335"
+         style="stop-color:#00aad4;stop-opacity:1" />
+      <stop
+         style="stop-color:#45d3ff;stop-opacity:1;"
+         offset="0.9396137"
+         id="stop11546-2" />
+      <stop
+         id="stop11548-4"
+         offset="0.94147432"
+         style="stop-color:#00ccff;stop-opacity:1" />
+      <stop
+         style="stop-color:#00aad4;stop-opacity:1"
+         offset="1"
+         id="stop11550-5" />
+    </linearGradient>
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(-1.001849,-0.17663729,-0.17270197,1.0011721,541.59655,41.254064)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient3858"
+       xlink:href="#linearGradient11540-4"
+       inkscape:collect="always" />
+    <inkscape:perspective
+       id="perspective3893"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(-1.001849,-0.17663729,-0.17270197,1.0011721,541.59655,41.254064)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient3858-1"
+       xlink:href="#linearGradient11540-4-7"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient11540-4-7">
+      <stop
+         style="stop-color:#3fbce1;stop-opacity:1;"
+         offset="0"
+         id="stop11546-2-5" />
+      <stop
+         id="stop3979"
+         offset="0.91666669"
+         style="stop-color:#13a2ca;stop-opacity:1;" />
+      <stop
+         style="stop-color:#04ccff;stop-opacity:1;"
+         offset="1"
+         id="stop11550-5-7" />
+    </linearGradient>
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(0.72354006,-0.31819573,-0.32549831,-0.71009667,393.18468,543.05984)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient3905"
+       xlink:href="#linearGradient11540-4-7"
+       inkscape:collect="always"
+       spreadMethod="reflect" />
+    <inkscape:perspective
+       id="perspective3940"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(0.72354006,-0.31819573,-0.32549831,-0.71009667,381.87279,551.39491)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient3905-1"
+       xlink:href="#linearGradient11540-4-7-4"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient11540-4-7-4">
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1"
+         offset="0"
+         id="stop11542-8-1-2" />
+      <stop
+         id="stop11544-8-1-3"
+         offset="0.82216197"
+         style="stop-color:#00aad4;stop-opacity:1" />
+      <stop
+         style="stop-color:#45d3ff;stop-opacity:1;"
+         offset="0.9396137"
+         id="stop11546-2-5-2" />
+      <stop
+         id="stop11548-4-2-2"
+         offset="0.94147432"
+         style="stop-color:#00ccff;stop-opacity:1" />
+      <stop
+         style="stop-color:#00aad4;stop-opacity:1"
+         offset="1"
+         id="stop11550-5-7-1" />
+    </linearGradient>
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(-0.72354006,0.31819573,0.32549831,0.71009667,348.71375,151.24442)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient3952"
+       xlink:href="#linearGradient11540-4-7-4"
+       inkscape:collect="always" />
+    <inkscape:perspective
+       id="perspective4001"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(-0.72354006,0.31819573,0.32549831,0.71009667,348.71375,151.24442)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient3952-1"
+       xlink:href="#linearGradient11540-4-7-4-4"
+       inkscape:collect="always" />
+    <linearGradient
+       id="linearGradient11540-4-7-4-4">
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1;"
+         offset="0"
+         id="stop11546-2-5-2-2" />
+      <stop
+         id="stop4040"
+         offset="0.71084106"
+         style="stop-color:#00aad4;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00aad4;stop-opacity:1;"
+         offset="0.87765551"
+         id="stop4042" />
+      <stop
+         id="stop4046"
+         offset="0.9510954"
+         style="stop-color:#00bbe9;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1;"
+         offset="0.98340893"
+         id="stop4048" />
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1;"
+         offset="1"
+         id="stop11550-5-7-1-5" />
+    </linearGradient>
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(0.63073279,-0.29544468,-0.28374719,-0.65932464,373.27281,541.87397)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient4013"
+       xlink:href="#linearGradient11540-4-7-4-4"
+       inkscape:collect="always"
+       spreadMethod="reflect" />
+    <inkscape:perspective
+       id="perspective4058"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       gradientTransform="matrix(0.72354006,-0.31819573,-0.32549831,-0.71009667,391.99395,546.632)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient4013-9"
+       xlink:href="#linearGradient11540-4-7-4-4-9"
+       inkscape:collect="always"
+       spreadMethod="reflect" />
+    <linearGradient
+       id="linearGradient11540-4-7-4-4-9">
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1;"
+         offset="0"
+         id="stop11546-2-5-2-2-8" />
+      <stop
+         id="stop4040-3"
+         offset="0.71084106"
+         style="stop-color:#00aad4;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00aad4;stop-opacity:1;"
+         offset="0.87765551"
+         id="stop4042-8" />
+      <stop
+         id="stop4046-6"
+         offset="0.9510954"
+         style="stop-color:#00bbe9;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1;"
+         offset="0.98340893"
+         id="stop4048-9" />
+      <stop
+         style="stop-color:#00ccff;stop-opacity:1;"
+         offset="1"
+         id="stop11550-5-7-1-5-8" />
+    </linearGradient>
+    <radialGradient
+       r="238.03125"
+       fy="215.53297"
+       fx="308.59799"
+       cy="215.53297"
+       cx="308.59799"
+       spreadMethod="reflect"
+       gradientTransform="matrix(-0.63073279,0.29544468,0.28374719,0.65932464,325.16415,178.62621)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient4071"
+       xlink:href="#linearGradient11540-4-7-4-4-9"
+       inkscape:collect="always" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.125"
+     inkscape:cx="353.69718"
+     inkscape:cy="223.5496"
+     inkscape:document-units="px"
+     inkscape:current-layer="svg2"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="998"
+     inkscape:window-x="1276"
+     inkscape:window-y="-4"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="Shadow"
+     inkscape:label="#g3767"
+     style="display:none"
+     sodipodi:insensitive="true">
+    <path
+       transform="matrix(1.7164377,0,0,1.7164377,-184.67329,-345.14151)"
+       sodipodi:type="arc"
+       style="color:#000000;fill:url(#radialGradient11665);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter11604);enable-background:accumulate"
+       id="path11568"
+       sodipodi:cx="255.68666"
+       sodipodi:cy="464.99878"
+       sodipodi:rx="106.53611"
+       sodipodi:ry="16.920441"
+       d="m 362.22277,464.99878 a 106.53611,16.920441 0 1 1 -213.07222,0 106.53611,16.920441 0 1 1 213.07222,0 z" />
+    <path
+       transform="matrix(0.96620662,0,0,0.96620662,7.1507669,3.7149953)"
+       d="m 362.22277,464.99878 a 106.53611,16.920441 0 1 1 -213.07222,0 106.53611,16.920441 0 1 1 213.07222,0 z"
+       sodipodi:ry="16.920441"
+       sodipodi:rx="106.53611"
+       sodipodi:cy="464.99878"
+       sodipodi:cx="255.68666"
+       id="path11558"
+       style="color:#000000;fill:url(#radialGradient11667);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       sodipodi:type="arc" />
+  </g>
+  <g
+     id="Green"
+     inkscape:label="#g3771"
+     sodipodi:insensitive="true">
+    <path
+       inkscape:connector-curvature="0"
+       id="path11056"
+       transform="matrix(0.96620662,0,0,-0.96620662,7.1507669,468.67698)"
+       d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 c 16.606387,3.04169 30.547285,7.35013 45.875,11.28125 -14.411103,29.84122 -20.5,62.393 -20.5,97.75 0,125.46395 101.72355,227.15625 227.1875,227.15625 72.11313,0 136.35833,-33.6054 177.96875,-86 -34.06357,-5.58513 -60.45606,-27.08129 -65.3125,-53.875 C 342.58026,358.08659 301.84355,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 13.32233,-57.73551 19.46875,-64.3125 18.49014,7.75233 33.10479,14.76889 48.875,27.71875 -17.57396,-62.36603 -8.87497,-137.44556 1.125,-178.25 z"
+       style="opacity:0.66233766;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter11066);enable-background:accumulate" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path11054"
+       d="M 183.876,447.0883 C 122.09616,435.0446 55.542474,391.20488 10.472102,344.85157 c 5.555358,-1.86851 37.241124,-9.67095 45.200354,-13.25515 -13.924103,-28.83279 -20.682861,-57.9294 -20.682861,-92.09157 0,-121.2241 98.285975,-219.479868 219.510065,-219.479868 69.67619,0 131.75033,32.46976 171.95459,83.093768 -32.91245,5.39639 -58.41305,26.16612 -63.10537,52.05438 -25.19479,-32.48178 -64.55487,-53.41311 -108.84922,-53.41311 -76.07856,0 -137.74483,61.66626 -137.74483,137.74483 0,24.33763 12.87213,55.78443 18.81084,62.13916 17.86529,-7.49035 31.98607,-14.2698 47.22335,-26.78204 -16.98008,60.25848 -8.57506,132.80081 1.08698,172.22633 z"
+       style="color:#000000;fill:#01aa00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    <path
+       inkscape:connector-curvature="0"
+       id="path10140"
+       d="M 183.876,447.0883 C 122.09616,435.0446 55.542474,391.20488 10.472102,344.85157 c 16.045201,-2.93891 31.447402,-6.22612 46.257142,-10.0244 -13.924103,-28.83278 -21.739649,-61.16015 -21.739649,-95.32232 0,-121.2241 98.285975,-219.479868 219.510065,-219.479868 69.67619,0 131.75033,32.46976 171.95459,83.093768 -32.91245,5.39639 -58.41305,26.16612 -63.10537,52.05438 -25.19479,-32.48178 -64.55487,-53.41311 -108.84922,-53.41311 -76.07856,0 -137.74483,61.66626 -137.74483,137.74483 0,24.33763 6.31513,47.18891 17.39172,67.03058 17.22307,-8.77482 33.40519,-19.16122 48.64247,-31.67346 -16.98008,60.25848 -8.57506,132.80081 1.08698,172.22633 z"
+       style="color:#000000;fill:url(#radialGradient10345);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    <path
+       style="opacity:0.5;color:#000000;fill:url(#radialGradient10342);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       d="M 183.81561,447.0883 C 122.05207,435.02853 55.528413,391.19042 10.472102,344.85157 c 16.045201,-2.93891 31.447402,-6.22612 46.257142,-10.0244 -13.924103,-28.83278 -21.739649,-61.16015 -21.739649,-95.32232 0,-121.2241 98.285975,-219.479838 219.510065,-219.479838 46.22596,0 89.08862,14.30865 124.4595,38.70862 -26.30257,-11.27731 -55.28974,-17.54269 -85.72065,-17.54269 -120.22087,0 -217.668237,97.447368 -217.668237,217.668238 0,80.32454 43.511317,150.50687 108.245337,188.22912 z"
+       id="path11030"
+       inkscape:connector-curvature="0" />
+    <path
+       style="color:#000000;fill:url(#radialGradient10339);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       inkscape:transform-center-x="19.223103"
+       inkscape:transform-center-y="-4.330731"
+       d="M 182.8041,274.85881 C 135.35035,313.82593 78.602047,332.36006 10.469344,344.83951 55.539715,391.19283 122.09915,435.05303 183.87899,447.09674 174.21696,407.67122 165.82402,335.11729 182.8041,274.85881 z"
+       id="path10158"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccc" />
+    <path
+       id="path10168"
+       d="M 183.876,447.0883 C 122.09616,435.0446 55.542474,391.20488 10.472102,344.85157 c 19.607316,-3.59136 38.268528,-7.68417 56.039984,-12.62108 18.900289,37.29456 60.322354,63.16576 108.366114,63.16576 0.111,0 0.2212,2.8e-4 0.33213,0 2.03691,19.99739 5.27983,37.87627 8.66567,51.69205 z"
+       style="color:#000000;fill:url(#radialGradient10336);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       inkscape:connector-curvature="0" />
+    <path
+       id="path10200"
+       d="M 183.81561,447.0883 C 122.05207,435.02853 55.528413,391.19042 10.472102,344.85157 c 16.045201,-2.93891 31.447402,-6.22612 46.257142,-10.0244 -13.924103,-28.83278 -21.739649,-61.16015 -21.739649,-95.32232 0,-121.2241 98.285975,-219.479838 219.510065,-219.479838 46.22596,0 89.08862,14.30865 124.4595,38.70862 -26.30257,-11.27731 -55.28974,-17.54269 -85.72065,-17.54269 -120.22087,0 -217.668237,97.447368 -217.668237,217.668238 0,80.32454 43.511317,150.50687 108.245337,188.22912 z"
+       style="opacity:0.5;color:#000000;fill:url(#linearGradient10333);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       inkscape:connector-curvature="0" />
+    <path
+       id="path10225"
+       d="m 184.78182,447.0883 c -0.49217,-0.0961 -0.98675,-0.20182 -1.47951,-0.30194 C 118.85263,408.99254 75.570273,338.97053 75.570273,258.85918 75.570273,140.19362 170.51705,43.727762 288.58864,41.251332 170.96473,44.231032 76.53648,140.51676 76.53648,258.85918 c 0,80.32454 43.51132,150.50687 108.24534,188.22912 z M 379.92536,58.733632 c -0.83051,-0.35609 -1.67027,-0.68055 -2.5061,-1.02659 -33.96346,-23.01235 -74.68589,-36.80221 -118.60186,-37.65189 44.94305,0.6749 86.59509,14.87039 121.10796,38.67848 z"
+       style="opacity:0.5;color:#000000;fill:#14ff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       inkscape:connector-curvature="0" />
+    <path
+       style="color:#000000;fill:url(#radialGradient10329);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+       d="M 183.876,447.0883 C 122.09616,435.0446 55.542474,391.20488 10.472102,344.85157 c 19.607316,-3.59136 38.268528,-7.68417 56.039984,-12.62108 18.900289,37.29456 60.322354,63.16576 108.366114,63.16576 0.111,0 0.2212,2.8e-4 0.33213,0 2.03691,19.99739 5.27983,37.87627 8.66567,51.69205 z"
+       id="path10246"
+       inkscape:connector-curvature="0" />
+    <path
+       sodipodi:nodetypes="cccc"
+       inkscape:connector-curvature="0"
+       id="path10250"
+       d="M 182.8041,274.85881 C 135.35035,313.82593 78.602047,332.36006 10.469344,344.83951 55.539715,391.19283 122.09915,435.05303 183.87899,447.09674 174.21696,407.67122 165.82402,335.11729 182.8041,274.85881 z"
+       inkscape:transform-center-y="-4.330731"
+       inkscape:transform-center-x="19.223103"
+       style="color:#000000;fill:url(#radialGradient10326);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+    <path
+       clip-path="url(#clipPath11085)"
+       id="path11070"
+       transform="matrix(0.96620662,0,0,-0.96620662,7.1507669,468.67698)"
+       d="m 136.25,36.65625 c -49.157565,20.163866 -97.395255,55.074588 -132.8125,91.5 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 37.37712,0 72.62827,-9.03504 103.71875,-25.03125 -30.10043,14.74172 -63.93635,23.03125 -99.71875,23.03125 -125.46395,0 -227.1875,-101.6923 -227.1875,-227.15625 0,-35.357 8.088897,-68.81503 22.5,-98.65625 -15.327715,-3.93112 -26.893613,-7.33331 -43.5,-10.375 34.27238,-35.247955 78.194865,-69.07743 124.4375,-89.5 z"
+       style="opacity:0.52813852;color:#000000;fill:#19d400;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter11079);enable-background:accumulate"
+       inkscape:connector-curvature="0" />
+    <path
+       clip-path="url(#clipPath11106)"
+       sodipodi:nodetypes="cccsscssccc"
+       inkscape:connector-curvature="0"
+       id="path11091"
+       transform="matrix(0.96620662,0,0,-0.96620662,7.1507669,468.67698)"
+       d="M 180.15625,34.75 C 170.77322,76.071022 161.12355,136.87681 177,193.21875 c -15.77021,-12.94986 -29.86205,-20.60577 -47.6875,-29.6875 -11.464,20.53564 -19.875,50.4674 -19.875,75.65625 0,78.73944 63.82306,142.5625 142.5625,142.5625 23.7341,0 46.10189,-5.8029 65.78125,-16.0625 C 299.09472,374.68981 278.13509,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 6.536,-48.83936 18,-69.375 17.82545,9.08173 34.57354,19.83139 50.34375,32.78125 -15.919,-56.49296 -10.26071,-123.411843 -1.625,-165.84375 z"
+       style="opacity:0.74891776;color:#000000;fill:#60ff55;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter11100);enable-background:accumulate" />
+    <path
+       clip-path="url(#clipPath11353)"
+       sodipodi:nodetypes="ccsc"
+       transform="matrix(0.96620662,0,0,-0.96620662,7.1507669,468.67698)"
+       inkscape:connector-curvature="0"
+       id="path11307"
+       d="m 359.08935,438.05141 c 0,0 0,-60.16157 -32.58752,-75.82864 28.82742,-21.93391 47.62791,-31.33415 54.52143,-52.64137 6.89351,-21.30723 -21.93391,128.47001 -21.93391,128.47001 z"
+       style="fill:#008005;fill-opacity:1;fill-rule:evenodd;stroke:none;display:inline;filter:url(#filter11347)" />
+    <path
+       sodipodi:nodetypes="ccccc"
+       inkscape:connector-curvature="0"
+       id="path10365"
+       d="M 91.395932,176.75108 C 125.13409,88.337822 216.74497,21.528562 327.91681,32.593372 c 9.45331,3.33841 16.7459,6.55685 26.11779,11.27356 l 0,5.92689 C 236.03354,16.023042 129.38165,84.216422 91.395932,176.75108 z"
+       style="opacity:0.5;fill:#7eff00;fill-opacity:1;fill-rule:evenodd;stroke:none" />
+  </g>
+  <g
+     id="Blue"
+     transform="matrix(-0.94068899,-0.2122083,-0.20990201,0.95102481,644.21175,-454.21207)"
+     clip-path="url(#clipPath11228)"
+     inkscape:label="#g11128">
+    <path
+       sodipodi:nodetypes="cccssccssccc"
+       inkscape:connector-curvature="0"
+       style="opacity:0.66233766;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;filter:url(#filter11066);enable-background:accumulate"
+       d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 20.043887,131.19794 33.997214,135.51788 49.324929,139.449 34.913826,169.29022 28.8125,201.8305 28.8125,237.1875 28.8125,362.65145 130.53605,464.34375 256,464.34375 367.53132,464.34375 460.2712,383.9838 479.5,278 449.67592,298.71204 413.90085,312.16424 375.0625,315.59375 349.56271,354.24343 305.77142,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 13.32852,-57.74653 19.47494,-64.32352 18.49014,7.75233 33.0986,14.77991 48.86881,27.72977 -17.57396,-62.36603 -8.87497,-137.44556 1.125,-178.25 z"
+       transform="translate(0,540.36218)"
+       id="path11130" />
+    <path
+       id="path11132"
+       transform="translate(0,540.36218)"
+       d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 9.1871582,130.09011 41.973586,138.17667 50.211192,141.88623 35.800089,171.72745 28.8125,201.8305 28.8125,237.1875 28.8125,362.65145 130.53605,464.34375 256,464.34375 367.53132,464.34375 460.2712,383.9838 479.5,278 449.67592,298.71204 413.90085,312.16424 375.0625,315.59375 349.56271,354.24343 305.77142,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 13.32852,-57.74653 19.47494,-64.32352 18.49014,7.75233 33.0986,14.77991 48.86881,27.72977 -17.57396,-62.36603 -8.87497,-137.44556 1.125,-178.25 z"
+       style="color:#000000;fill:#0088aa;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccssccssccc" />
+    <path
+       style="color:#000000;fill:url(#radialGradient10351);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;overflow:visible;enable-background:accumulate"
+       d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 c 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 111.53132,0 204.2712,-80.35995 223.5,-186.34375 -29.82408,20.71204 -65.59915,34.16424 -104.4375,37.59375 C 349.56271,354.24343 305.77142,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 6.536,-48.83936 18,-69.375 17.82545,9.08173 34.57354,19.83139 50.34375,32.78125 -17.57396,-62.36603 -8.87497,-137.44556 1.125,-178.25 z"
+       transform="translate(0,540.36218)"
+       id="path11134"
+       inkscape:connector-curvature="0" />
+    <path
+       id="path11136"
+       transform="translate(0,540.36218)"
+       d="M 182.84375,22.34375 C 118.92001,34.825325 50.069669,80.196677 3.4375,128.15625 c 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 47.84272,0 92.20452,-14.80913 128.8125,-40.0625 -27.22251,11.67174 -57.22351,18.15625 -88.71875,18.15625 -124.42563,0 -225.28125,-100.85562 -225.28125,-225.28125 0,-83.13392 45.03314,-155.770903 112.03125,-194.8125 z"
+       style="opacity:0.5;color:#000000;fill:url(#radialGradient10353);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       inkscape:connector-curvature="0" />
+    <path
+       sodipodi:nodetypes="cccc"
+       inkscape:connector-curvature="0"
+       id="path11138"
+       d="M 181.79686,740.9592 C 132.6834,700.6292 73.950311,681.44683 3.4346452,668.53091 50.081367,620.55637 118.96874,575.16214 182.90935,562.6972 c -9.99997,40.80444 -18.68645,115.89597 -1.11249,178.262 z"
+       inkscape:transform-center-y="4.4821961"
+       inkscape:transform-center-x="19.895435"
+       style="color:#000000;fill:url(#radialGradient10355);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate" />
+    <path
+       style="color:#000000;fill:url(#radialGradient10357);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 c 20.293088,3.71696 39.606982,7.95292 58,13.0625 19.561332,-38.59895 62.43214,-65.375 112.15625,-65.375 0.11488,0 0.22894,-2.86e-4 0.34375,0 2.10815,-20.696809 5.46449,-39.201002 8.96875,-53.5 z"
+       transform="translate(0,540.36218)"
+       id="path11140"
+       inkscape:connector-curvature="0" />
+    <path
+       style="opacity:0.5;color:#000000;fill:url(#linearGradient10359);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       d="M 182.84375,22.34375 C 118.92001,34.825325 50.069669,80.196677 3.4375,128.15625 c 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 47.84272,0 92.20452,-14.80913 128.8125,-40.0625 -27.22251,11.67174 -57.22351,18.15625 -88.71875,18.15625 -124.42563,0 -225.28125,-100.85562 -225.28125,-225.28125 0,-83.13392 45.03314,-155.770903 112.03125,-194.8125 z"
+       transform="translate(0,540.36218)"
+       id="path11142"
+       inkscape:connector-curvature="0" />
+    <path
+       style="color:#000000;fill:#d5f6ff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       d="m 183.84375,22.34375 c -0.50938,0.09946 -1.02126,0.208879 -1.53125,0.3125 -66.70383,39.115678 -111.5,111.58673 -111.5,194.5 0,122.81592 98.26757,222.65571 220.46875,225.21875 C 169.5434,439.29108 71.8125,339.63773 71.8125,217.15625 c 0,-83.13392 45.03314,-155.7709 112.03125,-194.8125 z m 201.96875,401.9375 c -0.85956,0.36854 -1.72869,0.70435 -2.59375,1.0625 -35.15135,23.81721 -77.29806,38.08941 -122.75,38.96875 46.51495,-0.69852 89.62378,-15.39046 125.34375,-40.03125 z"
+       transform="translate(0,540.36218)"
+       id="path11144"
+       inkscape:connector-curvature="0" />
+    <path
+       id="path11146"
+       transform="translate(0,540.36218)"
+       d="M 182.90625,22.34375 C 118.96564,34.80869 50.084222,80.18171 3.4375,128.15625 c 20.293088,3.71696 39.606982,7.95292 58,13.0625 19.561332,-38.59895 62.43214,-65.375 112.15625,-65.375 0.11488,0 0.22894,-2.86e-4 0.34375,0 2.10815,-20.696809 5.46449,-39.201002 8.96875,-53.5 z"
+       style="color:#000000;fill:url(#radialGradient10361);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       inkscape:connector-curvature="0" />
+    <path
+       style="color:#000000;fill:url(#radialGradient10363);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;enable-background:accumulate"
+       inkscape:transform-center-x="19.895435"
+       inkscape:transform-center-y="4.4821961"
+       d="M 181.79686,740.9592 C 132.6834,700.6292 73.950311,681.44683 3.4346452,668.53091 50.081367,620.55637 118.96874,575.16214 182.90935,562.6972 c -9.99997,40.80444 -18.68645,115.89597 -1.11249,178.262 z"
+       id="path11148"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccc" />
+    <path
+       style="opacity:0.0822511;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;filter:url(#filter11079);enable-background:accumulate"
+       d="m 136.25,36.65625 c -49.157565,20.163866 -97.395255,55.074588 -132.8125,91.5 16.606387,3.04169 32.547285,6.44388 47.875,10.375 -14.411103,29.84122 -22.5,63.29925 -22.5,98.65625 0,125.46395 101.72355,227.15625 227.1875,227.15625 37.37712,0 72.62827,-9.03504 103.71875,-25.03125 -30.10043,14.74172 -63.93635,23.03125 -99.71875,23.03125 -125.46395,0 -227.1875,-101.6923 -227.1875,-227.15625 0,-35.357 8.088897,-68.81503 22.5,-98.65625 -15.327715,-3.93112 -26.893613,-7.33331 -43.5,-10.375 34.27238,-35.247955 78.194865,-69.07743 124.4375,-89.5 z"
+       transform="translate(0,540.36218)"
+       id="path11150"
+       clip-path="url(#clipPath11085)"
+       inkscape:connector-curvature="0" />
+    <path
+       style="opacity:0.74891776;color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:none;overflow:visible;filter:url(#filter11100);enable-background:accumulate"
+       d="M 180.15625,34.75 C 170.77322,76.071022 161.12355,136.87681 177,193.21875 c -15.77021,-12.94986 -29.86205,-20.60577 -47.6875,-29.6875 -11.464,20.53564 -19.875,50.4674 -19.875,75.65625 0,78.73944 63.82306,142.5625 142.5625,142.5625 23.7341,0 46.10189,-5.8029 65.78125,-16.0625 C 299.09472,374.68981 278.13509,379.75 256,379.75 c -78.73944,0 -142.5625,-63.82306 -142.5625,-142.5625 0,-25.18885 6.536,-48.83936 18,-69.375 17.82545,9.08173 34.57354,19.83139 50.34375,32.78125 -15.919,-56.49296 -10.26071,-123.411843 -1.625,-165.84375 z"
+       transform="translate(0,540.36218)"
+       id="path11152"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccsscssccc"
+       clip-path="url(#clipPath11106)" />
+    <path
+       style="fill:#004455;fill-rule:evenodd;stroke:none;filter:url(#filter11473-4)"
+       d="m 183.70582,15.387742 c -13.7082,4.093485 -43.00332,73.705282 -15.565,110.949128 10.94244,-5.01293 20.39885,-9.73143 31.65623,-13.0447 -23.4382,-35.564298 -18.20219,-66.31138 -16.09123,-97.904428 z"
+       id="path11357"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccc"
+       clip-path="url(#clipPath11477-1)"
+       transform="matrix(-1.4436129,-0.11724954,0.19006078,-1.031266,521.80461,1054.618)" />
+  </g>
+  <path
+     style="color:#000000;fill:url(#radialGradient3858);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;overflow:visible;enable-background:accumulate"
+     d="m 354.04075,42.12101 c 57.53181,25.423195 112.80391,83.19127 146.61402,138.71507 -16.25991,-0.63129 -31.96946,-0.77851 -47.21322,-0.29259 7.29263,31.4379 7.87886,64.97385 0.45735,98.59923 l -79.6058,-17.95813 c 5.28719,-23.95522 4.10314,-47.83443 -2.37045,-69.79709 -18.67448,4.85424 -36.6856,11.52335 -54.23866,20.49242 29.62238,-55.5823 37.19868,-128.830799 36.35676,-169.75891 z"
+     id="path11134-5"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cccccccc" />
+  <path
+     style="color:#000000;fill:url(#radialGradient4013);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;overflow:visible;enable-background:accumulate"
+     d="m 468.58069,469.86749 c -42.03331,7.95496 -95.10098,-4.0667 -135.24264,-23.32554 9.38625,-6.11342 18.27875,-12.2928 26.66838,-18.65977 -16.06243,-15.63152 -29.15075,-35.17539 -37.76881,-57.9661 l 51.6097,-21.1623 c 6.13963,16.23645 15.89037,29.84683 27.8873,40.21706 8.65747,-10.31162 16.25135,-21.42895 22.71257,-33.71996 4.48364,44.59518 28.08905,90.81524 44.1335,114.61661 z"
+     id="path11134-5-6-6-2"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cccccccc" />
+  <path
+     style="color:#000000;fill:url(#radialGradient4071);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;overflow:visible;enable-background:accumulate"
+     d="m 229.85627,250.63268 c 42.03331,-7.95496 95.10097,4.06671 135.24263,23.32554 -9.38625,6.11343 -18.27875,12.2928 -26.66837,18.65977 16.06242,15.63152 29.15075,35.17539 37.76881,57.96611 l -51.60971,21.16229 c -6.13963,-16.23644 -15.89036,-29.84683 -27.88729,-40.21706 -8.65748,10.31162 -16.25136,21.42895 -22.71257,33.71996 -4.48365,-44.59518 -28.08905,-90.81524 -44.1335,-114.61661 z"
+     id="path11134-5-6-6-2-6"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="cccccccc" />
+</svg>
diff --git a/rcc/qrc_Resources1.cpp b/rcc/qrc_Resources1.cpp
new file mode 100644 (file)
index 0000000..1f14045
--- /dev/null
@@ -0,0 +1,1131 @@
+/****************************************************************************
+** Resource object code
+**
+** Created: Sat 6. Aug 22:47:58 2011
+**      by: The Resource Compiler for Qt version 4.7.0
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <QtCore/qglobal.h>
+
+static const unsigned char qt_resource_data[] = {
+  // D:/CODING/Projects/Maemo/qwerkisync/resources/sphone.png
+  0x0,0x0,0x6,0x5c,
+  0x89,
+  0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
+  0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x8,0x6,0x0,0x0,0x0,0x73,0x7a,0x7a,0xf4,
+  0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xda,0xc,0x17,0x14,0x30,0x19,0xd7,
+  0x4d,0x82,0x51,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xa,0xf0,0x0,
+  0x0,0xa,0xf0,0x1,0x42,0xac,0x34,0x98,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,
+  0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x5,0xeb,0x49,0x44,0x41,0x54,
+  0x78,0xda,0xed,0x57,0x4d,0x68,0x5c,0x55,0x14,0x3e,0xef,0xbe,0xf7,0xe6,0x27,0x33,
+  0x93,0x99,0x49,0x34,0x69,0x9a,0xa6,0xa6,0x16,0x51,0x4c,0x8c,0x52,0x23,0xe2,0xa2,
+  0x16,0x77,0x52,0x84,0x4a,0x5b,0x45,0x97,0xda,0x90,0x95,0x50,0xba,0x10,0x41,0x5a,
+  0x62,0x77,0x22,0x88,0x74,0x63,0xb5,0x60,0xc1,0xea,0xc2,0x45,0x4a,0x5d,0xa8,0x48,
+  0xab,0x84,0xaa,0x60,0x17,0x5a,0xad,0x54,0x10,0x91,0xb6,0x36,0xda,0x64,0xa6,0xc9,
+  0x64,0x32,0xf3,0xe6,0xfd,0xbf,0x77,0xfd,0xce,0x9d,0x4c,0x9a,0x46,0xdb,0xa4,0xa1,
+  0xb,0x41,0xf,0x9c,0x79,0xef,0xfe,0x9c,0x7b,0xbe,0xf3,0x7b,0xdf,0x10,0xfd,0x4f,
+  0xff,0x75,0xd2,0x96,0x8f,0x77,0xef,0xde,0xbd,0xb7,0xa3,0xd0,0xb1,0x2d,0xa6,0x18,
+  0x43,0x1,0x8e,0x17,0x1f,0x4b,0x49,0x8,0x41,0x95,0x4a,0xe5,0xf4,0xf8,0xf8,0xf8,
+  0x21,0xc,0xe5,0x5a,0x1,0x18,0xcb,0xc6,0xd9,0xce,0xce,0xce,0x37,0xb6,0x6c,0xd9,
+  0x62,0x6,0x41,0x40,0xd9,0x6c,0x56,0x29,0x2a,0x95,0x4a,0xa4,0x69,0x1a,0xa5,0x52,
+  0xa9,0x6b,0x82,0x86,0x41,0x67,0xcf,0xfe,0xf0,0x14,0x5e,0xdf,0x3,0xd7,0x6f,0x17,
+  0x80,0x8d,0x85,0x42,0x41,0xcb,0xe5,0x72,0xf4,0x8b,0x95,0xa2,0xa8,0xad,0x5d,0x4d,
+  0x36,0x8a,0x79,0x28,0xd4,0x69,0xb2,0xda,0xd4,0x63,0x8,0x8d,0x86,0xf3,0x92,0xf2,
+  0x79,0xb5,0xbe,0x11,0xfc,0xf3,0x6d,0x1,0xa0,0xeb,0xfa,0xfa,0x42,0xbe,0xa0,0xf9,
+  0xb1,0x46,0xe5,0xee,0x47,0xa9,0x66,0xea,0x54,0x71,0x22,0xca,0x74,0x9,0xba,0x3c,
+  0x1f,0x50,0x50,0x90,0x2a,0x6a,0x32,0xe,0x69,0x28,0x3a,0x43,0xc5,0x62,0x41,0x63,
+  0x99,0x28,0x8a,0xd6,0xc,0x40,0x2c,0x1d,0xc,0xc,0xc,0xf4,0x48,0x92,0x3a,0x99,
+  0x69,0xd2,0xa0,0xcb,0xf3,0x63,0x72,0xbc,0x98,0x2c,0x37,0x22,0x17,0xef,0x51,0x24,
+  0xc1,0xc8,0x8e,0x8,0x5e,0x9,0x59,0x54,0xd3,0x59,0x46,0x9,0xbf,0x2b,0x4d,0x3a,
+  0x2c,0xb7,0xd3,0x9b,0x32,0xbd,0x66,0x0,0xeb,0x41,0x71,0x1c,0x93,0x4,0x80,0xc0,
+  0x8f,0x68,0xba,0xea,0x51,0x56,0x97,0xea,0x19,0xf9,0xe1,0x22,0x87,0x41,0x48,0x36,
+  0x0,0x84,0x61,0xa8,0x64,0xa0,0xfc,0x9,0x88,0x1f,0xc7,0x69,0x7b,0x29,0x45,0xf7,
+  0xac,0x35,0x4,0x5a,0x5b,0x5b,0xdb,0x6,0x4e,0x2e,0x37,0xd2,0xa9,0xe1,0x4,0xe4,
+  0xc3,0xfa,0x1a,0xcc,0x75,0x9c,0xf0,0x3a,0x21,0x29,0x25,0xd9,0xc8,0x9,0x4e,0xd0,
+  0x99,0xfb,0x76,0xee,0x6b,0x4e,0xd2,0x55,0x44,0x67,0x1a,0xfc,0x20,0x1d,0x91,0x75,
+  0x80,0x1,0x6a,0xf2,0x49,0xc7,0x73,0x92,0x2,0x1a,0x0,0x3f,0xab,0x45,0x37,0x3,
+  0x20,0x12,0x89,0xc4,0x3a,0xc4,0x94,0x1a,0x81,0x46,0xa5,0x39,0x97,0xee,0xc8,0x98,
+  0x74,0x65,0xce,0xa3,0x10,0xae,0xbf,0xae,0xce,0x30,0x68,0x20,0x3f,0xf2,0x0,0x90,
+  0xd2,0xa3,0x4e,0xcc,0xcc,0x29,0x6f,0x4a,0xa8,0xd3,0xe9,0x49,0x94,0xec,0x20,0xf8,
+  0xf,0xcc,0xfd,0x49,0x21,0x4d,0x51,0x37,0x95,0xb0,0x63,0x16,0xc8,0x6b,0x28,0x27,
+  0x79,0x23,0x0,0x5a,0x14,0xc7,0x1b,0x94,0x55,0xd,0xc4,0x19,0xae,0x9e,0x97,0xc8,
+  0x81,0x46,0x48,0x4b,0xcb,0x5c,0xaa,0xd6,0x21,0xa9,0x91,0x14,0x54,0x40,0x69,0x26,
+  0xad,0x12,0xb2,0x52,0x85,0x52,0x57,0x1c,0x83,0x5,0x98,0xc1,0x68,0x6a,0x2c,0x14,
+  0x23,0xad,0xe8,0xb5,0x5,0xe1,0x1b,0x0,0xd0,0x4d,0xc3,0xe8,0x4e,0x24,0x4c,0x2a,
+  0x23,0xe3,0x53,0x0,0x5a,0xae,0x38,0x14,0x44,0x72,0x51,0x6a,0xa9,0xb4,0x95,0xd4,
+  0xc8,0x34,0x4d,0xca,0x85,0xa5,0x96,0x5b,0x5,0x36,0x30,0x10,0x1f,0x7c,0x58,0x85,
+  0x80,0xdd,0x1f,0x62,0x6c,0x83,0xaf,0x22,0x4,0x7,0xb5,0x65,0xed,0xec,0x7a,0x0,
+  0x6,0x92,0x6a,0x9d,0x10,0x3a,0x94,0x6a,0x34,0x6f,0xb9,0x64,0xc3,0xfa,0x56,0xab,
+  0x5c,0xde,0xea,0xea,0x0,0x90,0xec,0x48,0x52,0xa2,0x7e,0x25,0xa2,0x4b,0xdf,0x6f,
+  0xa7,0xfe,0x87,0x47,0xb1,0xe9,0x7e,0x8,0x64,0xb0,0x3c,0x45,0xa3,0x9a,0x7d,0xab,
+  0x49,0xd8,0x9d,0x4e,0xa7,0x4d,0xee,0x7e,0xfd,0x26,0x8c,0xd1,0x1d,0x8a,0x72,0x2d,
+  0xb5,0xcb,0x61,0x68,0x74,0xa7,0x19,0x13,0x37,0x2c,0x74,0x47,0x93,0x5e,0x1f,0xbe,
+  0x8a,0xc9,0x3d,0x48,0xbe,0x87,0xb0,0x65,0x17,0x6c,0xe5,0xe,0x75,0xcb,0x0,0x7a,
+  0xe1,0x52,0xe9,0xba,0x2e,0xdd,0x9d,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,0x82,0x65,
+  0x1c,0xdf,0x1f,0x76,0x2,0xef,0xd3,0x1d,0x67,0x87,0xbf,0x9d,0xb5,0x6a,0x7,0xbe,
+  0x79,0xfc,0xd7,0x2f,0x6f,0x8,0x0,0xae,0x5d,0xe7,0x38,0xe,0xf9,0xb0,0x60,0x76,
+  0x76,0xb6,0xb9,0x88,0xa6,0x54,0xad,0x56,0x55,0xb2,0x31,0xd5,0xeb,0x75,0xe5,0x15,
+  0x5c,0x3e,0x6a,0x1c,0xe2,0xca,0x66,0x36,0xf3,0x62,0xab,0xeb,0xf9,0x5b,0x2d,0xdd,
+  0x25,0x6e,0x59,0x9,0x74,0x53,0xc6,0xec,0xe1,0x2c,0xb,0x61,0xb3,0x5c,0xef,0x31,
+  0xdb,0xd,0xbe,0xd8,0x74,0xa2,0xeb,0xf4,0x9c,0x5b,0x3b,0x50,0x7d,0xde,0xfd,0x7a,
+  0x39,0x0,0xe1,0xda,0x76,0x6f,0x88,0x83,0x4d,0xc3,0x54,0xbd,0x5e,0xe5,0xbc,0x94,
+  0x4a,0x99,0x1a,0x6b,0xb,0xef,0xe8,0xff,0x51,0x18,0xaa,0x78,0x18,0xe8,0x3,0x61,
+  0x84,0x71,0x39,0x24,0x7,0xde,0x43,0x23,0x63,0xab,0xc9,0xd4,0x75,0x55,0x2f,0x3e,
+  0xf6,0x39,0x9e,0x47,0x75,0x5,0x2,0x65,0xed,0xfb,0xdb,0x2,0x4f,0x7e,0x25,0x8e,
+  0xd0,0x48,0x3c,0xaa,0xbe,0x23,0xae,0x1,0xd0,0x84,0xe8,0x9,0xb1,0x19,0xf7,0x1,
+  0xd9,0x4e,0xb3,0x82,0x38,0xe1,0x98,0x5a,0x63,0xee,0x92,0x3e,0x14,0x78,0xd8,0xc7,
+  0xc4,0x7b,0x19,0x90,0x59,0x87,0xa7,0x90,0x3f,0xac,0x30,0x9,0xeb,0xb9,0x9d,0xb3,
+  0xb,0x2,0x0,0x76,0xe1,0x21,0x1b,0xfb,0x1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aa,0x48,0xd2,0x63,0x54,0xa3,0x57,0xe9,0x65,0x6a,0xdc,0xec,0x8c,0x16,0x80,
+  0xb,0xa8,0xf7,0xf,0x66,0x66,0x66,0xf6,0x0,0xb5,0xc6,0x8d,0x28,0x9b,0xcb,0x52,
+  0x36,0x93,0x55,0x56,0xf3,0xad,0xa7,0xe,0x47,0x2c,0x39,0x2c,0x56,0xc3,0x22,0xab,
+  0x6e,0x11,0x37,0x2e,0xe4,0x7,0x44,0xe4,0x31,0x3e,0x43,0x6d,0x62,0x37,0x8f,0x51,
+  0x27,0x1d,0xa4,0x98,0x56,0x41,0xda,0x92,0xe7,0xc6,0xc1,0xc1,0xc1,0xa3,0x8,0xc3,
+  0x36,0x43,0x37,0xf4,0x44,0x32,0xa1,0x1a,0x91,0xd1,0xca,0x6a,0x95,0x54,0xcd,0x32,
+  0xe4,0x4a,0xf0,0x7d,0xce,0x87,0x28,0xc2,0xe5,0x75,0xfa,0xfc,0xf9,0xf3,0x2f,0x62,
+  0xf9,0x32,0xad,0xe1,0xff,0xc1,0xd2,0x3f,0x26,0xac,0xa5,0x3,0xdc,0xb9,0xf0,0xbe,
+  0x1a,0x62,0xd7,0x73,0xd7,0xaa,0x2c,0xbc,0xdf,0x32,0x69,0xab,0x9c,0xbb,0x19,0xad,
+  0xf9,0x5f,0xd1,0xbf,0x82,0xfe,0x2,0x92,0x85,0x12,0x9,0xe1,0x19,0x84,0x3a,0x0,
+  0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82,
+    // D:/CODING/Projects/Maemo/qwerkisync/resources/phone.png
+  0x0,0x0,0x3b,0x35,
+  0x89,
+  0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,
+  0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x8,0x6,0x0,0x0,0x0,0xc3,0x3e,0x61,0xcb,
+  0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,
+  0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0xa,0x4d,0x69,0x43,0x43,0x50,0x50,0x68,0x6f,
+  0x74,0x6f,0x73,0x68,0x6f,0x70,0x20,0x49,0x43,0x43,0x20,0x70,0x72,0x6f,0x66,0x69,
+  0x6c,0x65,0x0,0x0,0x78,0xda,0x9d,0x53,0x77,0x58,0x93,0xf7,0x16,0x3e,0xdf,0xf7,
+  0x65,0xf,0x56,0x42,0xd8,0xf0,0xb1,0x97,0x6c,0x81,0x0,0x22,0x23,0xac,0x8,0xc8,
+  0x10,0x59,0xa2,0x10,0x92,0x0,0x61,0x84,0x10,0x12,0x40,0xc5,0x85,0x88,0xa,0x56,
+  0x14,0x15,0x11,0x9c,0x48,0x55,0xc4,0x82,0xd5,0xa,0x48,0x9d,0x88,0xe2,0xa0,0x28,
+  0xb8,0x67,0x41,0x8a,0x88,0x5a,0x8b,0x55,0x5c,0x38,0xee,0x1f,0xdc,0xa7,0xb5,0x7d,
+  0x7a,0xef,0xed,0xed,0xfb,0xd7,0xfb,0xbc,0xe7,0x9c,0xe7,0xfc,0xce,0x79,0xcf,0xf,
+  0x80,0x11,0x12,0x26,0x91,0xe6,0xa2,0x6a,0x0,0x39,0x52,0x85,0x3c,0x3a,0xd8,0x1f,
+  0x8f,0x4f,0x48,0xc4,0xc9,0xbd,0x80,0x2,0x15,0x48,0xe0,0x4,0x20,0x10,0xe6,0xcb,
+  0xc2,0x67,0x5,0xc5,0x0,0x0,0xf0,0x3,0x79,0x78,0x7e,0x74,0xb0,0x3f,0xfc,0x1,
+  0xaf,0x6f,0x0,0x2,0x0,0x70,0xd5,0x2e,0x24,0x12,0xc7,0xe1,0xff,0x83,0xba,0x50,
+  0x26,0x57,0x0,0x20,0x91,0x0,0xe0,0x22,0x12,0xe7,0xb,0x1,0x90,0x52,0x0,0xc8,
+  0x2e,0x54,0xc8,0x14,0x0,0xc8,0x18,0x0,0xb0,0x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a1,0x18,0x96,0x41,0x19,0x54,0xc0,0x3a,0xd8,0x4,0xb5,0xb0,0x3,0x1a,0xa0,0x11,
+  0x9a,0xe1,0x10,0xb4,0xc1,0x31,0x38,0xd,0xe7,0xe0,0x12,0x5c,0x81,0xeb,0x70,0x17,
+  0x6,0x60,0x18,0x9e,0xc2,0x18,0xbc,0x86,0x9,0x4,0x41,0xc8,0x8,0x13,0x61,0x21,
+  0x3a,0x88,0x11,0x62,0x8e,0xd8,0x22,0xce,0x8,0x17,0x99,0x8e,0x4,0x22,0x61,0x48,
+  0x34,0x92,0x80,0xa4,0x20,0xe9,0x88,0x14,0x51,0x22,0xc5,0xc8,0x72,0xa4,0x2,0xa9,
+  0x42,0x6a,0x91,0x5d,0x48,0x23,0xf2,0x2d,0x72,0x14,0x39,0x8d,0x5c,0x40,0xfa,0x90,
+  0xdb,0xc8,0x20,0x32,0x8a,0xfc,0x8a,0xbc,0x47,0x31,0x94,0x81,0xb2,0x51,0x3,0xd4,
+  0x2,0x75,0x40,0xb9,0xa8,0x1f,0x1a,0x8a,0xc6,0xa0,0x73,0xd1,0x74,0x34,0xf,0x5d,
+  0x80,0x96,0xa2,0x6b,0xd1,0x1a,0xb4,0x1e,0x3d,0x80,0xb6,0xa2,0xa7,0xd1,0x4b,0xe8,
+  0x75,0x74,0x0,0x7d,0x8a,0x8e,0x63,0x80,0xd1,0x31,0xe,0x66,0x8c,0xd9,0x61,0x5c,
+  0x8c,0x87,0x45,0x60,0x89,0x58,0x1a,0x26,0xc7,0x16,0x63,0xe5,0x58,0x35,0x56,0x8f,
+  0x35,0x63,0x1d,0x58,0x37,0x76,0x15,0x1b,0xc0,0x9e,0x61,0xef,0x8,0x24,0x2,0x8b,
+  0x80,0x13,0xec,0x8,0x5e,0x84,0x10,0xc2,0x6c,0x82,0x90,0x90,0x47,0x58,0x4c,0x58,
+  0x43,0xa8,0x25,0xec,0x23,0xb4,0x12,0xba,0x8,0x57,0x9,0x83,0x84,0x31,0xc2,0x27,
+  0x22,0x93,0xa8,0x4f,0xb4,0x25,0x7a,0x12,0xf9,0xc4,0x78,0x62,0x3a,0xb1,0x90,0x58,
+  0x46,0xac,0x26,0xee,0x21,0x1e,0x21,0x9e,0x25,0x5e,0x27,0xe,0x13,0x5f,0x93,0x48,
+  0x24,0xe,0xc9,0x92,0xe4,0x4e,0xa,0x21,0x25,0x90,0x32,0x49,0xb,0x49,0x6b,0x48,
+  0xdb,0x48,0x2d,0xa4,0x53,0xa4,0x3e,0xd2,0x10,0x69,0x9c,0x4c,0x26,0xeb,0x90,0x6d,
+  0xc9,0xde,0xe4,0x8,0xb2,0x80,0xac,0x20,0x97,0x91,0xb7,0x90,0xf,0x90,0x4f,0x92,
+  0xfb,0xc9,0xc3,0xe4,0xb7,0x14,0x3a,0xc5,0x88,0xe2,0x4c,0x9,0xa2,0x24,0x52,0xa4,
+  0x94,0x12,0x4a,0x35,0x65,0x3f,0xe5,0x4,0xa5,0x9f,0x32,0x42,0x99,0xa0,0xaa,0x51,
+  0xcd,0xa9,0x9e,0xd4,0x8,0xaa,0x88,0x3a,0x9f,0x5a,0x49,0x6d,0xa0,0x76,0x50,0x2f,
+  0x53,0x87,0xa9,0x13,0x34,0x75,0x9a,0x25,0xcd,0x9b,0x16,0x43,0xcb,0xa4,0x2d,0xa3,
+  0xd5,0xd0,0x9a,0x69,0x67,0x69,0xf7,0x68,0x2f,0xe9,0x74,0xba,0x9,0xdd,0x83,0x1e,
+  0x45,0x97,0xd0,0x97,0xd2,0x6b,0xe8,0x7,0xe9,0xe7,0xe9,0x83,0xf4,0x77,0xc,0xd,
+  0x86,0xd,0x83,0xc7,0x48,0x62,0x28,0x19,0x6b,0x19,0x7b,0x19,0xa7,0x18,0xb7,0x19,
+  0x2f,0x99,0x4c,0xa6,0x5,0xd3,0x97,0x99,0xc8,0x54,0x30,0xd7,0x32,0x1b,0x99,0x67,
+  0x98,0xf,0x98,0x6f,0x55,0x58,0x2a,0xf6,0x2a,0x7c,0x15,0x91,0xca,0x12,0x95,0x3a,
+  0x95,0x56,0x95,0x7e,0x95,0xe7,0xaa,0x54,0x55,0x73,0x55,0x3f,0xd5,0x79,0xaa,0xb,
+  0x54,0xab,0x55,0xf,0xab,0x5e,0x56,0x7d,0xa6,0x46,0x55,0xb3,0x50,0xe3,0xa9,0x9,
+  0xd4,0x16,0xab,0xd5,0xa9,0x1d,0x55,0xbb,0xa9,0x36,0xae,0xce,0x52,0x77,0x52,0x8f,
+  0x50,0xcf,0x51,0x5f,0xa3,0xbe,0x5f,0xfd,0x82,0xfa,0x63,0xd,0xb2,0x86,0x85,0x46,
+  0xa0,0x86,0x48,0xa3,0x54,0x63,0xb7,0xc6,0x19,0x8d,0x21,0x16,0xc6,0x32,0x65,0xf1,
+  0x58,0x42,0xd6,0x72,0x56,0x3,0xeb,0x2c,0x6b,0x98,0x4d,0x62,0x5b,0xb2,0xf9,0xec,
+  0x4c,0x76,0x5,0xfb,0x1b,0x76,0x2f,0x7b,0x4c,0x53,0x43,0x73,0xaa,0x66,0xac,0x66,
+  0x91,0x66,0x9d,0xe6,0x71,0xcd,0x1,0xe,0xc6,0xb1,0xe0,0xf0,0x39,0xd9,0x9c,0x4a,
+  0xce,0x21,0xce,0xd,0xce,0x7b,0x2d,0x3,0x2d,0x3f,0x2d,0xb1,0xd6,0x6a,0xad,0x66,
+  0xad,0x7e,0xad,0x37,0xda,0x7a,0xda,0xbe,0xda,0x62,0xed,0x72,0xed,0x16,0xed,0xeb,
+  0xda,0xef,0x75,0x70,0x9d,0x40,0x9d,0x2c,0x9d,0xf5,0x3a,0x6d,0x3a,0xf7,0x75,0x9,
+  0xba,0x36,0xba,0x51,0xba,0x85,0xba,0xdb,0x75,0xcf,0xea,0x3e,0xd3,0x63,0xeb,0x79,
+  0xe9,0x9,0xf5,0xca,0xf5,0xe,0xe9,0xdd,0xd1,0x47,0xf5,0x6d,0xf4,0xa3,0xf5,0x17,
+  0xea,0xef,0xd6,0xef,0xd1,0x1f,0x37,0x30,0x34,0x8,0x36,0x90,0x19,0x6c,0x31,0x38,
+  0x63,0xf0,0xcc,0x90,0x63,0xe8,0x6b,0x98,0x69,0xb8,0xd1,0xf0,0x84,0xe1,0xa8,0x11,
+  0xcb,0x68,0xba,0x91,0xc4,0x68,0xa3,0xd1,0x49,0xa3,0x27,0xb8,0x26,0xee,0x87,0x67,
+  0xe3,0x35,0x78,0x17,0x3e,0x66,0xac,0x6f,0x1c,0x62,0xac,0x34,0xde,0x65,0xdc,0x6b,
+  0x3c,0x61,0x62,0x69,0x32,0xdb,0xa4,0xc4,0xa4,0xc5,0xe4,0xbe,0x29,0xcd,0x94,0x6b,
+  0x9a,0x66,0xba,0xd1,0xb4,0xd3,0x74,0xcc,0xcc,0xc8,0x2c,0xdc,0xac,0xd8,0xac,0xc9,
+  0xec,0x8e,0x39,0xd5,0x9c,0x6b,0x9e,0x61,0xbe,0xd9,0xbc,0xdb,0xfc,0x8d,0x85,0xa5,
+  0x45,0x9c,0xc5,0x4a,0x8b,0x36,0x8b,0xc7,0x96,0xda,0x96,0x7c,0xcb,0x5,0x96,0x4d,
+  0x96,0xf7,0xac,0x98,0x56,0x3e,0x56,0x79,0x56,0xf5,0x56,0xd7,0xac,0x49,0xd6,0x5c,
+  0xeb,0x2c,0xeb,0x6d,0xd6,0x57,0x6c,0x50,0x1b,0x57,0x9b,0xc,0x9b,0x3a,0x9b,0xcb,
+  0xb6,0xa8,0xad,0x9b,0xad,0xc4,0x76,0x9b,0x6d,0xdf,0x14,0xe2,0x14,0x8f,0x29,0xd2,
+  0x29,0xf5,0x53,0x6e,0xda,0x31,0xec,0xfc,0xec,0xa,0xec,0x9a,0xec,0x6,0xed,0x39,
+  0xf6,0x61,0xf6,0x25,0xf6,0x6d,0xf6,0xcf,0x1d,0xcc,0x1c,0x12,0x1d,0xd6,0x3b,0x74,
+  0x3b,0x7c,0x72,0x74,0x75,0xcc,0x76,0x6c,0x70,0xbc,0xeb,0xa4,0xe1,0x34,0xc3,0xa9,
+  0xc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x5a,0x1b,0xfa,0x30,0xcc,0x26,0x4c,0x1e,0xd6,0x11,0x8e,0x86,
+  0xcf,0x8,0xdf,0x10,0x7e,0x6f,0xa6,0xf9,0x4c,0xe9,0xcc,0xb6,0x8,0x88,0xe0,0x47,
+  0x6c,0x88,0xb8,0x1f,0x69,0x19,0x99,0x17,0xf9,0x7d,0x14,0x29,0x2a,0x32,0xaa,0x2e,
+  0xea,0x51,0xb4,0x53,0x74,0x71,0x74,0xf7,0x2c,0xd6,0xac,0xe4,0x59,0xfb,0x67,0xbd,
+  0x8e,0xf1,0x8f,0xa9,0x8c,0xb9,0x3b,0xdb,0x6a,0xb6,0x72,0x76,0x67,0xac,0x6a,0x6c,
+  0x52,0x6c,0x63,0xec,0x9b,0xb8,0x80,0xb8,0xaa,0xb8,0x81,0x78,0x87,0xf8,0x45,0xf1,
+  0x97,0x12,0x74,0x13,0x24,0x9,0xed,0x89,0xe4,0xc4,0xd8,0xc4,0x3d,0x89,0xe3,0x73,
+  0x2,0xe7,0x6c,0x9a,0x33,0x9c,0xe4,0x9a,0x54,0x96,0x74,0x63,0xae,0xe5,0xdc,0xa2,
+  0xb9,0x17,0xe6,0xe9,0xce,0xcb,0x9e,0x77,0x3c,0x59,0x35,0x59,0x90,0x7c,0x38,0x85,
+  0x98,0x12,0x97,0xb2,0x3f,0xe5,0x83,0x20,0x42,0x50,0x2f,0x18,0x4f,0xe5,0xa7,0x6e,
+  0x4d,0x1d,0x13,0xf2,0x84,0x9b,0x85,0x4f,0x45,0xbe,0xa2,0x8d,0xa2,0x51,0xb1,0xb7,
+  0xb8,0x4a,0x3c,0x92,0xe6,0x9d,0x56,0x95,0xf6,0x38,0xdd,0x3b,0x7d,0x43,0xfa,0x68,
+  0x86,0x4f,0x46,0x75,0xc6,0x33,0x9,0x4f,0x52,0x2b,0x79,0x91,0x19,0x92,0xb9,0x23,
+  0xf3,0x4d,0x56,0x44,0xd6,0xde,0xac,0xcf,0xd9,0x71,0xd9,0x2d,0x39,0x94,0x9c,0x94,
+  0x9c,0xa3,0x52,0xd,0x69,0x96,0xb4,0x2b,0xd7,0x30,0xb7,0x28,0xb7,0x4f,0x66,0x2b,
+  0x2b,0x93,0xd,0xe4,0x79,0xe6,0x6d,0xca,0x1b,0x93,0x87,0xca,0xf7,0xe4,0x23,0xf9,
+  0x73,0xf3,0xdb,0x15,0x6c,0x85,0x4c,0xd1,0xa3,0xb4,0x52,0xae,0x50,0xe,0x16,0x4c,
+  0x2f,0xa8,0x2b,0x78,0x5b,0x18,0x5b,0x78,0xb8,0x48,0xbd,0x48,0x5a,0xd4,0x33,0xdf,
+  0x66,0xfe,0xea,0xf9,0x23,0xb,0x82,0x16,0x7c,0xbd,0x90,0xb0,0x50,0xb8,0xb0,0xb3,
+  0xd8,0xb8,0x78,0x59,0xf1,0xe0,0x22,0xbf,0x45,0xbb,0x16,0x23,0x8b,0x53,0x17,0x77,
+  0x2e,0x31,0x5d,0x52,0xba,0x64,0x78,0x69,0xf0,0xd2,0x7d,0xcb,0x68,0xcb,0xb2,0x96,
+  0xfd,0x50,0xe2,0x58,0x52,0x55,0xf2,0x6a,0x79,0xdc,0xf2,0x8e,0x52,0x83,0xd2,0xa5,
+  0xa5,0x43,0x2b,0x82,0x57,0x34,0x95,0xa9,0x94,0xc9,0xcb,0x6e,0xae,0xf4,0x5a,0xb9,
+  0x63,0x15,0x61,0x95,0x64,0x55,0xef,0x6a,0x97,0xd5,0x5b,0x56,0x7f,0x2a,0x17,0x95,
+  0x5f,0xac,0x70,0xac,0xa8,0xae,0xf8,0xb0,0x46,0xb8,0xe6,0xe2,0x57,0x4e,0x5f,0xd5,
+  0x7c,0xf5,0x79,0x6d,0xda,0xda,0xde,0x4a,0xb7,0xca,0xed,0xeb,0x48,0xeb,0xa4,0xeb,
+  0x6e,0xac,0xf7,0x59,0xbf,0xaf,0x4a,0xbd,0x6a,0x41,0xd5,0xd0,0x86,0xf0,0xd,0xad,
+  0x1b,0xf1,0x8d,0xe5,0x1b,0x5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f,0xbc,0xce,
+  0x79,0x3d,0xf1,0xa6,0xfc,0xad,0xce,0xdb,0x7d,0xef,0xb8,0xef,0xba,0xdf,0xc7,0xbd,
+  0x1f,0x99,0x28,0xfc,0x40,0xfe,0x50,0xf3,0xd1,0xfa,0x63,0xc7,0xa7,0xd0,0x4f,0xf7,
+  0x3e,0xe7,0x7c,0xfe,0xfc,0x2f,0xf7,0x84,0xf3,0xfb,0x25,0xd2,0x9f,0x33,0x0,0x0,
+  0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x25,0x0,0x0,0x80,0x83,0x0,0x0,
+  0xf9,0xff,0x0,0x0,0x80,0xe9,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,0x0,0x0,
+  0x3a,0x98,0x0,0x0,0x17,0x6f,0x92,0x5f,0xc5,0x46,0x0,0x0,0x30,0x62,0x49,0x44,
+  0x41,0x54,0x78,0xda,0xec,0x7d,0x79,0x90,0x65,0x57,0x79,0xdf,0xef,0x9c,0x7b,0xef,
+  0x5b,0x7b,0x7f,0xdd,0xaf,0xb7,0x11,0x2,0xb4,0x8c,0x91,0x20,0xc6,0x44,0x98,0x18,
+  0x3,0xae,0x48,0x36,0x56,0xaa,0x12,0x1c,0x6f,0xc2,0x2c,0x5e,0xa8,0xd8,0x26,0x2c,
+  0x65,0x6c,0x1c,0xa5,0x48,0x9,0xca,0x71,0x90,0x5c,0xb6,0x9c,0x10,0x3,0x4e,0x2a,
+  0x96,0x8b,0x80,0xe3,0x2,0x2c,0x33,0x36,0x65,0xca,0x6,0x59,0x96,0x48,0x4,0x16,
+  0x60,0x1,0x65,0x4b,0xa3,0x85,0x91,0xe4,0x19,0x4f,0x8b,0x61,0x96,0x9e,0xe9,0xee,
+  0xe9,0xee,0xf7,0xee,0x7a,0xbe,0x2f,0x7f,0x9c,0xe5,0x9e,0xfb,0x5e,0x4f,0x4f,0xf7,
+  0x68,0x0,0x69,0xd4,0x67,0xea,0x4e,0xbf,0xed,0xbe,0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0xe4,0x79,0x8e,0xa9,0xa9,0x29,0x65,0x4,0x40,0x54,
+  0x1,0xa,0xf,0x61,0x2,0xe3,0x52,0x2e,0x9e,0x7b,0xba,0x1a,0x60,0x76,0x7c,0x7c,
+  0x9c,0x57,0x57,0x57,0xa1,0xa,0x85,0x91,0x91,0x91,0x8a,0x0,0x28,0x48,0xc8,0xd1,
+  0x69,0xec,0x1b,0x6f,0xa2,0xdd,0xa,0x87,0xd6,0x91,0x1c,0x0,0x5d,0xd6,0x39,0x45,
+  0x6b,0x9e,0xb1,0x30,0x1a,0xa2,0xd9,0x8e,0x1c,0x70,0x74,0x96,0x12,0xb4,0xe6,0x2d,
+  0x30,0xc3,0x15,0x21,0x62,0x8,0xf7,0xbf,0xaf,0xb2,0x99,0x19,0x44,0x19,0xe0,0x9,
+  0x0,0x11,0x61,0x64,0x64,0x4,0x6b,0x6b,0x6b,0xc8,0xd2,0x14,0x93,0x93,0x93,0xc,
+  0x60,0xb6,0xaa,0x1,0xd8,0xcb,0x18,0x78,0xd0,0xe5,0x9e,0x0,0xc,0x9,0x80,0x0,
+  0x30,0x3b,0x3a,0x3a,0x12,0x9d,0x3c,0x79,0x12,0x85,0x2a,0xd0,0x6e,0xb7,0x2b,0x26,
+  0xa0,0xc7,0x35,0xb4,0xa2,0x10,0xe3,0xed,0x1a,0x84,0x90,0xbe,0x56,0xad,0x38,0x56,
+  0x2,0xc0,0xe9,0xbe,0x42,0x86,0x8,0x51,0x24,0xd0,0x19,0x89,0x4c,0x74,0xc0,0x58,
+  0x4d,0x8,0x39,0x42,0xc8,0x50,0x7b,0xe6,0xc2,0x88,0x5,0x50,0xcd,0x3e,0xb9,0xc9,
+  0x17,0xc,0xc1,0x2,0x42,0x15,0x50,0xcc,0x48,0x38,0x42,0x43,0xe4,0x4e,0x3,0xb4,
+  0xdb,0x6d,0x14,0x45,0x81,0x34,0xcf,0xd0,0x1e,0x19,0x89,0x8c,0x0,0x94,0xbf,0x89,
+  0xd8,0x84,0x82,0x2,0x10,0x4,0x10,0xf6,0x34,0xc0,0x36,0x40,0xd0,0x6c,0xbd,0xd6,
+  0x90,0x45,0x9e,0x83,0x88,0x50,0xab,0xd5,0x2a,0x1a,0x20,0xe3,0x10,0xb3,0x23,0x11,
+  0x98,0x18,0x90,0x3e,0xc8,0x22,0x9c,0xa7,0x2d,0x5,0x90,0x11,0x70,0xaa,0x57,0x0,
+  0xc,0xcc,0xb4,0x3,0x8,0x0,0x44,0xfa,0xf9,0x53,0x1b,0x85,0x3e,0xc7,0x3a,0x8a,
+  0x6,0xae,0x65,0xbb,0x50,0x9d,0x40,0xf9,0xf,0x1a,0x0,0x9a,0x81,0x14,0x21,0x1a,
+  0xc8,0x2b,0x26,0x40,0x29,0x85,0x22,0x2f,0xd0,0x68,0x34,0x5a,0x0,0x1a,0x9e,0x6,
+  0x0,0x41,0xb,0x10,0x83,0x75,0x86,0xc0,0x28,0x82,0x4b,0x75,0xc8,0xa7,0xa1,0x1,
+  0x66,0x26,0x26,0x26,0x82,0x82,0x8a,0x48,0x11,0xa1,0x28,0xa,0x13,0x62,0x95,0x2,
+  0x20,0x1a,0xa3,0xa8,0x5,0xfa,0x62,0x32,0xb1,0x99,0x20,0x7d,0x58,0xad,0xaa,0x18,
+  0x58,0xde,0x54,0x20,0x5,0x44,0x12,0x98,0xaa,0x4b,0x30,0xe9,0x29,0x5c,0x8d,0xb,
+  0xa4,0x5,0x19,0x95,0xae,0x55,0x3b,0x31,0xf4,0x7b,0x59,0x69,0x22,0xe3,0xb9,0x13,
+  0x3b,0x41,0x71,0x2,0xc3,0x8c,0x84,0x6b,0x15,0x1f,0xa0,0xd1,0x68,0x40,0x29,0xa5,
+  0x85,0xa0,0x28,0xa2,0x89,0x89,0x89,0x0,0xc0,0x8c,0xfb,0x5d,0xe6,0x73,0x74,0x34,
+  0xa0,0xff,0x9,0xde,0xd3,0x0,0x83,0x20,0x90,0x4,0x30,0xdb,0xe9,0x74,0x8a,0x3c,
+  0xcb,0x43,0x62,0x86,0x52,0xa,0xf5,0x7a,0x1d,0x69,0x9a,0xba,0x90,0xae,0xde,0x6a,
+  0xeb,0xc9,0x23,0x6b,0x4e,0x4b,0x70,0xc5,0x1a,0xff,0xa4,0x20,0xac,0xf6,0x73,0x30,
+  0x4,0x66,0x5a,0xa1,0x59,0xc4,0x5a,0xef,0x2e,0x6f,0x9a,0xd5,0x5f,0x49,0xc9,0x18,
+  0xd8,0x9e,0xcb,0x74,0x8d,0x46,0xeb,0xc8,0x93,0x4f,0x72,0xca,0x20,0xe6,0xb0,0xe2,
+  0x3,0xd4,0xeb,0x75,0x28,0x45,0x20,0x62,0x64,0x59,0x86,0x4e,0xa7,0x53,0xac,0xad,
+  0xad,0xcd,0x2,0xf8,0x27,0x0,0xe2,0xf6,0xdb,0x6f,0x17,0x37,0xdf,0xfc,0x1f,0xb9,
+  0x9a,0x4,0x62,0xe0,0xf,0xaa,0x52,0x20,0xee,0x78,0x66,0x4c,0x20,0xff,0xf2,0x77,
+  0x5e,0x3,0xd8,0xab,0xbc,0xb8,0xb8,0xb8,0xa8,0xd2,0x34,0x5,0x88,0x41,0x44,0x88,
+  0xa2,0xc8,0xf9,0x0,0xed,0x76,0x1b,0x39,0x42,0x93,0x66,0xe3,0xea,0x2a,0x26,0x76,
+  0xab,0xf9,0xe4,0x66,0x1,0x22,0xa0,0x2e,0x18,0x63,0x75,0x9,0x66,0x3d,0x79,0xab,
+  0xb1,0x42,0x52,0x90,0x59,0xd9,0xec,0x56,0xa5,0x30,0xcf,0x97,0xab,0xdd,0x78,0xea,
+  0xf6,0x33,0x88,0x2a,0x9f,0xd7,0xe7,0xa8,0xa2,0x1,0xf4,0x77,0xd4,0x19,0xe0,0x2c,
+  0xcb,0xb0,0xb8,0xb8,0xa8,0x0,0x2c,0x56,0xdc,0x9,0xae,0xf2,0x45,0xce,0xa1,0x0,
+  0x6a,0xcf,0x75,0x27,0x70,0x7e,0x6e,0x6e,0x8e,0xb2,0x2c,0x5,0x83,0xdd,0xc5,0x55,
+  0x4a,0x21,0x8,0x2,0xd4,0xeb,0x75,0xc4,0xb9,0x16,0x0,0x22,0x40,0x48,0xbb,0x52,
+  0x85,0x5b,0xc4,0x9b,0x99,0xc2,0x46,0xaa,0x5,0xa6,0x63,0x7c,0x5,0x36,0x78,0xdc,
+  0xb2,0xb1,0xfd,0xc2,0x2c,0x65,0x36,0x19,0x3a,0xf2,0x75,0x81,0x9f,0xb3,0xb5,0x21,
+  0xa5,0x67,0x69,0x0,0x20,0xa1,0xa0,0x22,0x0,0x5a,0x3,0x28,0x30,0x69,0x38,0x78,
+  0x66,0x66,0x86,0x0,0x74,0x7d,0x9f,0xd2,0x45,0x2,0x26,0x11,0x30,0x20,0x0,0x63,
+  0x0,0x7e,0x11,0xc0,0xf5,0x0,0x8e,0x1,0xf8,0x6d,0x0,0x47,0x9e,0x2b,0x3e,0x40,
+  0x5,0x4,0xd2,0x2,0x90,0x9b,0x55,0xad,0xd5,0x2b,0x11,0xa1,0xdd,0x6e,0x6b,0x27,
+  0x90,0x2,0xb7,0xda,0x99,0x8c,0xc9,0x76,0xab,0x9f,0x71,0x62,0x23,0x7,0x88,0x51,
+  0xf,0x80,0xd1,0x48,0x98,0xd7,0x31,0xce,0x7a,0xab,0x9f,0xcc,0x6b,0x99,0x8c,0xe6,
+  0xb0,0xbe,0x84,0x79,0x1f,0xb8,0xf7,0x67,0xe7,0x3b,0x38,0x1b,0x4e,0x40,0x32,0xa0,
+  0x1,0xac,0xa3,0xca,0x60,0xab,0x1,0xc8,0x68,0x80,0x32,0x14,0xb4,0x1a,0x4,0xa5,
+  0x3f,0x60,0x9e,0xff,0x9,0x0,0x7f,0x2,0xe0,0x5f,0x59,0x3f,0x8,0xc0,0x8f,0x3d,
+  0x17,0x35,0x80,0x4,0x30,0x37,0x39,0x39,0xa9,0xd2,0x34,0x5,0x11,0x41,0x8,0x1,
+  0x29,0x25,0xc2,0x30,0x44,0x18,0x86,0x60,0x66,0xa4,0x2c,0xc1,0xd0,0x13,0x28,0x98,
+  0x21,0x24,0xdc,0x2a,0x3e,0x1b,0x2b,0x64,0x85,0xc6,0xda,0x3b,0xcd,0x10,0xc4,0xc,
+  0xc9,0x2,0x2c,0x18,0xcb,0x9b,0x5a,0xa8,0x7c,0xbe,0x88,0x5,0xe5,0xd9,0xa4,0xec,
+  0x5c,0xe,0xc1,0xa7,0x9c,0x30,0x83,0x84,0xaf,0xc5,0x9,0xb1,0xa,0x2a,0x3e,0x40,
+  0x18,0x86,0xda,0x4c,0x31,0x5b,0x2c,0x40,0xd,0xa0,0x81,0xee,0xb3,0xed,0xca,0xff,
+  0xc0,0xfe,0xff,0xf6,0xbd,0x0,0xde,0x3,0xe0,0x5,0x0,0x32,0x73,0xd8,0x6b,0xf1,
+  0xfc,0xe7,0x92,0x0,0x8,0xef,0x42,0x2d,0x4c,0x4e,0x4e,0xd2,0xda,0xea,0x6a,0x25,
+  0xbc,0x6a,0xb5,0x5a,0xee,0xc5,0x29,0x5,0x20,0x30,0x24,0x18,0x2c,0x18,0xd2,0xc4,
+  0xd4,0x8a,0x59,0x3b,0x78,0xc4,0x68,0x44,0x12,0xed,0x9a,0x70,0x61,0xdf,0x7a,0xa2,
+  0x10,0xe7,0x5a,0x60,0x48,0x94,0x2a,0x1d,0x26,0x49,0xc3,0x70,0x70,0x8d,0xa1,0x93,
+  0x31,0x78,0xc0,0x5f,0x73,0xf8,0x3d,0x31,0x62,0x11,0x56,0x0,0x22,0x21,0x84,0x36,
+  0x55,0x44,0x48,0xb3,0xc,0xe3,0xe3,0xe3,0x34,0x80,0x6,0xa,0x9b,0xf,0xf8,0xc0,
+  0xf7,0x7c,0x60,0x6,0xc0,0xaf,0x3,0xf8,0x37,0xde,0xc4,0x8b,0x1,0x6d,0x38,0x6b,
+  0xae,0x63,0xf1,0x5c,0xd3,0x0,0x33,0xcd,0x66,0x53,0xda,0xc,0xdd,0xe8,0xe8,0x28,
+  0x82,0x20,0xa8,0xe4,0xf9,0xfb,0x24,0xf5,0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1,0x9f,0x4c,0x88,0x76,0x72,0x3d,0x37,0x8e,0x20,0x30,0xd5,0xc,0xb4,
+  0x53,0x67,0xc2,0xc8,0xd3,0x9b,0x39,0xa0,0x18,0xc4,0x64,0x9c,0x2f,0x2,0x2b,0x13,
+  0x3e,0x12,0x99,0x10,0xd1,0xb,0x23,0xbd,0xc7,0xdc,0xa1,0x50,0x9e,0x3,0x81,0x94,
+  0x24,0xc8,0x8b,0xf0,0x2c,0x1c,0x4c,0x85,0x42,0xa1,0x14,0x98,0xa9,0x51,0xaf,0xd7,
+  0x5b,0xb8,0xfe,0x57,0x2e,0xc7,0xef,0xc7,0xff,0x3,0xf5,0x91,0xbf,0x0,0xf0,0x3d,
+  0x3,0xbf,0xf9,0x5c,0x13,0xef,0x9b,0x81,0x4b,0xdb,0x7,0xf0,0x8a,0x40,0x4,0x80,
+  0x7d,0x73,0x73,0x73,0x79,0x9c,0xc4,0x75,0x62,0x82,0x52,0x84,0x76,0xab,0x6d,0x26,
+  0x84,0xd,0xc,0x1c,0x38,0xaf,0xdf,0x6,0x52,0x49,0x4e,0xd8,0x4c,0x14,0x4,0x80,
+  0x76,0x4d,0xa0,0x16,0x0,0x64,0x8c,0xf9,0x66,0x46,0x48,0x32,0xaa,0xda,0x71,0x4b,
+  0x16,0x36,0x2c,0x60,0xe1,0x70,0x7a,0x7d,0x9e,0x33,0xb,0x9e,0x19,0x10,0xa2,0xa4,
+  0x71,0xd9,0x88,0xa1,0xa7,0x22,0x8c,0x6,0x59,0x25,0x21,0x74,0xea,0xd4,0x29,0x30,
+  0x11,0x92,0x24,0xc5,0xec,0xc2,0x22,0x2d,0xbd,0xe6,0x97,0x3f,0x8b,0xb0,0x1e,0x99,
+  0x55,0xf,0x6c,0x5d,0xe8,0x72,0xae,0xc7,0xf6,0x3d,0x97,0xc2,0x40,0x9,0x60,0xa1,
+  0xdb,0xed,0xaa,0x2c,0x4d,0x41,0x5c,0xda,0x55,0x1f,0x6,0x8e,0x95,0xe,0x1,0xc9,
+  0x86,0x72,0x54,0xda,0x77,0x30,0xbb,0xd5,0x4f,0xa4,0x51,0xb9,0xe5,0x8d,0xdc,0x69,
+  0x89,0x32,0xac,0x63,0x7,0xf3,0x42,0x11,0x88,0x19,0x50,0xe5,0xe3,0xc4,0x65,0x8,
+  0x68,0x43,0x44,0x52,0xde,0x39,0xc4,0x20,0x2,0x12,0xe,0x86,0x4c,0x80,0x15,0xd6,
+  0x34,0x4d,0x31,0x33,0x7f,0x59,0x88,0xb5,0xe3,0xed,0x2d,0x56,0x3d,0xb6,0x58,0xf5,
+  0x5b,0x69,0x83,0x7d,0x97,0xbc,0x6,0xd8,0x2,0x4,0x52,0x59,0x96,0x3,0x4c,0x20,
+  0x22,0x34,0x9b,0xcd,0x8a,0x9,0x88,0x49,0x82,0x0,0x48,0x33,0x69,0x9b,0xa9,0x42,
+  0x9c,0x11,0x4,0x3,0xed,0x46,0x80,0xc8,0xac,0x7e,0xc1,0xc0,0x46,0xaa,0x90,0xe6,
+  0x66,0xe2,0x85,0xcd,0xfa,0x79,0x45,0x23,0x16,0xa4,0x27,0xa1,0x23,0x3,0xcb,0xde,
+  0xe4,0xad,0x93,0x35,0x36,0x55,0x0,0x13,0xee,0xf5,0x55,0x4,0x84,0xb1,0xd3,0x0,
+  0x36,0x62,0x61,0x66,0x64,0x59,0x8a,0xee,0xdc,0x3c,0xb0,0x76,0xc,0xdb,0xd8,0xfa,
+  0xed,0x4c,0x0,0x4c,0x28,0xf8,0x31,0x0,0xe9,0xe,0x8e,0x6c,0x8b,0xdb,0x99,0x77,
+  0xe4,0xde,0x5f,0x7b,0x14,0x5b,0x1c,0xdf,0x71,0x1,0x18,0x4,0x81,0x38,0x4d,0x53,
+  0xa3,0xe6,0xa9,0x44,0xd8,0x4c,0xa8,0x15,0xab,0x10,0x4c,0x4,0x82,0x4,0x4,0xe3,
+  0xcc,0x66,0x61,0xf5,0x3d,0xa6,0x9a,0x91,0x31,0xd,0xda,0xf3,0x3f,0xbd,0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,0x24,0x4a,0xbb,0x60,0x23,0x83,
+  0x5e,0x71,0xe,0xd,0x60,0xe0,0xe0,0xb1,0x89,0x39,0x60,0xed,0xeb,0x30,0x6a,0x43,
+  0x42,0x88,0xed,0x84,0xe1,0x7c,0x93,0x88,0x1d,0xa,0x6,0x76,0x20,0x60,0xe2,0x99,
+  0xaa,0x1,0x16,0x46,0x47,0x47,0xe5,0xf2,0xf2,0xb2,0xb,0xc7,0x6a,0xb5,0x1a,0x36,
+  0x37,0x37,0x4b,0x14,0x50,0x49,0x80,0x18,0x67,0xe2,0x1c,0xaa,0xd0,0xdf,0x75,0xac,
+  0x19,0x20,0x14,0x26,0x32,0x10,0xc0,0x66,0xea,0xad,0x7e,0x58,0x1c,0x7f,0xd0,0x90,
+  0xf,0xfe,0x5c,0x57,0x4d,0xa,0xd,0x30,0xa0,0x9a,0xb5,0x13,0x1e,0x12,0x68,0xfc,
+  0x8f,0x94,0xe4,0x96,0x70,0xb0,0x73,0x2,0x5b,0x2d,0x60,0xed,0xd8,0xf9,0x26,0x7d,
+  0xa7,0xe6,0x40,0xec,0x50,0x85,0xef,0xf4,0xfc,0xf3,0x69,0xa3,0xef,0x8a,0x6,0xe8,
+  0x36,0x9b,0xcd,0x5a,0x96,0x65,0xce,0x93,0xaf,0xd7,0xeb,0x58,0x5f,0x5f,0x77,0x61,
+  0x60,0xaf,0x10,0x48,0x32,0x85,0xcd,0x98,0x0,0x21,0x21,0x5,0x30,0xd6,0x90,0x50,
+  0xc6,0xf,0x10,0x2c,0x70,0xa6,0xa7,0x57,0xbf,0x57,0x87,0xe1,0x21,0x7c,0x62,0x80,
+  0x88,0x61,0x42,0x41,0x94,0xa6,0xa2,0x8c,0xf7,0xbc,0x73,0xa9,0x5a,0x7a,0xcc,0xcc,
+  0xd8,0xc8,0xaa,0x1a,0xa0,0xd1,0x68,0x38,0x13,0x90,0xa4,0x29,0x46,0x9b,0x11,0xb0,
+  0xf2,0xd4,0x85,0xaa,0xe4,0x8b,0xe5,0x3,0x6c,0x87,0x3b,0x3c,0x63,0xa2,0x0,0x9,
+  0xa0,0x1e,0x45,0x51,0x7,0x0,0x67,0x59,0xae,0x29,0x54,0x42,0x38,0x13,0x60,0xb5,
+  0x67,0x5c,0x48,0x9c,0xd9,0x2c,0xcc,0x22,0x15,0x18,0x69,0x6,0x10,0x64,0xed,0x39,
+  0xa3,0x97,0x15,0x7a,0xf5,0x43,0xb8,0x60,0xde,0x92,0x3f,0x4,0xf4,0xea,0x66,0x93,
+  0xec,0x11,0xa6,0xca,0x97,0x5,0xd,0x93,0x40,0x69,0x90,0x1a,0x66,0xb3,0x81,0x46,
+  0x48,0x48,0x9b,0x23,0x5f,0x0,0xa2,0x28,0x32,0xd9,0x3e,0x46,0x91,0xe5,0xa8,0xb,
+  0x5,0xd9,0x5b,0xd6,0x3c,0x1,0x19,0x60,0x1b,0x47,0x6c,0xb7,0xe,0xdd,0x4e,0x7d,
+  0x0,0x9c,0x67,0x85,0x6f,0xa7,0x51,0xbe,0x63,0x38,0x80,0x43,0xbd,0xa6,0xa6,0xa6,
+  0xf2,0x2c,0xcb,0x24,0x91,0x2,0x29,0xaa,0x50,0xc1,0xac,0x6,0x58,0xe9,0x11,0x92,
+  0x54,0x93,0x3d,0x4,0x8,0xa3,0xd,0x9d,0x19,0x54,0xa4,0x8f,0x15,0x93,0xc,0xb2,
+  0x68,0x1e,0x11,0xe9,0xb0,0xcd,0x62,0x3,0x86,0xfa,0xc5,0x4a,0x63,0x3,0xc4,0xfa,
+  0x39,0x28,0x32,0x58,0x0,0xcc,0xa1,0xcf,0xd7,0x69,0x61,0x2a,0xcf,0x31,0x44,0x4,
+  0x22,0x46,0xaf,0x90,0x43,0x9,0x21,0x6b,0x6,0xa,0x52,0xc8,0xd3,0x14,0x33,0x73,
+  0xb,0xc0,0xda,0x37,0x77,0x32,0x29,0x3b,0x79,0x6c,0x37,0x42,0x80,0xb,0x14,0x10,
+  0xf1,0x1d,0xd3,0x0,0x3,0xdd,0x40,0xe6,0x67,0x67,0x67,0x55,0x92,0xa6,0x6,0xe0,
+  0x19,0x2e,0x8,0x29,0x8,0x38,0xb1,0x49,0x60,0x84,0x0,0x31,0xda,0x8d,0xd0,0x4c,
+  0x90,0x5e,0x95,0x7d,0xb3,0xfa,0x19,0x55,0x34,0x8f,0x7c,0x6b,0xce,0x65,0xb1,0x3f,
+  0x79,0x54,0xfd,0x32,0x58,0xe0,0x8a,0xf1,0xe7,0xc1,0x4a,0x7e,0x8f,0x81,0xd4,0xcf,
+  0xe4,0x96,0x9,0x21,0x52,0x4,0x19,0x8,0x24,0x69,0x82,0xce,0xcc,0x2c,0x4e,0x9e,
+  0x3d,0x21,0x30,0x75,0xf9,0x85,0x82,0x41,0x3b,0x9d,0x14,0xb1,0x3,0x9f,0x61,0x3b,
+  0x3f,0xe2,0xbb,0xaa,0x1,0xa4,0x15,0x80,0x2c,0x49,0x34,0x1a,0x47,0x84,0xd1,0xd1,
+  0x51,0x14,0x45,0x89,0x4d,0xac,0xc7,0x5,0xf2,0x5c,0x19,0x67,0x4f,0x60,0xa4,0x2e,
+  0x8c,0xb0,0xe8,0x95,0xbe,0xba,0x59,0x94,0xc8,0x1d,0x69,0xbc,0xdf,0xda,0x64,0x77,
+  0x78,0xaf,0x2f,0x1f,0x27,0x77,0x9e,0xbd,0xcf,0x6a,0xe0,0x3c,0xa3,0x31,0x98,0xc8,
+  0x9,0x40,0xc1,0x40,0xe2,0x39,0x82,0x2e,0x7d,0xed,0x39,0x82,0x73,0xb,0xfb,0x80,
+  0x95,0xa5,0x9d,0xae,0xc2,0x9d,0xac,0xe2,0xdd,0xf8,0x0,0xbb,0xd1,0x2c,0xdf,0xf5,
+  0x30,0x70,0x7e,0x6e,0x6e,0x8e,0xd2,0xb4,0x74,0x0,0x7d,0x68,0x15,0x0,0xce,0xf4,
+  0x95,0xe3,0xec,0x8d,0xd4,0x84,0x56,0xeb,0x60,0x8,0x21,0xf5,0xea,0xcf,0x55,0xa5,
+  0xf3,0x7,0x8b,0xd2,0x66,0x8b,0x8a,0x1b,0x58,0xa5,0x83,0x96,0xbe,0x81,0xad,0x26,
+  0xe2,0x4a,0x31,0xa7,0xef,0x1f,0x9a,0x98,0xce,0x8,0x81,0x40,0x3f,0xf,0xd0,0xa8,
+  0x53,0x5,0xd,0x5c,0x5d,0x5b,0x3,0x91,0x44,0x9a,0x64,0xe8,0xce,0xce,0xd,0x46,
+  0x2,0x17,0x2,0x6,0x7d,0xe,0xc0,0x9d,0x97,0x22,0x14,0xec,0x47,0x0,0x8b,0xda,
+  0x4,0x24,0x26,0x6b,0x47,0x15,0x13,0x90,0xa6,0x29,0xfa,0x99,0x56,0xf9,0x32,0x0,
+  0xda,0x91,0x8e,0xfb,0x35,0x70,0x43,0x38,0xdb,0xcb,0x35,0x5e,0x2f,0x7c,0xa2,0x87,
+  0x99,0x70,0x16,0xe,0xe1,0xd5,0x84,0x10,0x31,0x10,0x5,0x96,0x89,0x1e,0xaa,0x90,
+  0x36,0xfd,0x36,0x34,0x3,0xad,0xc0,0x98,0xc1,0x8a,0xd0,0x2f,0x24,0xa6,0xea,0x55,
+  0xd,0xc0,0x44,0x40,0xc0,0xc8,0xb2,0x4,0xdd,0xee,0x8c,0xc2,0xd2,0x53,0x4f,0x17,
+  0xc,0xba,0xec,0x52,0x4e,0x6,0xb9,0x7a,0x80,0xd1,0xd1,0x51,0x4a,0xd3,0xd4,0x10,
+  0x3e,0x19,0xed,0x76,0xdb,0x71,0xed,0xf3,0x3c,0x47,0x2f,0x97,0xfa,0xf1,0x48,0xb3,
+  0x7c,0xad,0xe3,0xd7,0x4b,0x72,0xa4,0xa9,0x32,0x4e,0x9b,0x51,0xd3,0x36,0x91,0xa3,
+  0xca,0xa4,0x91,0x76,0xfa,0x4a,0x55,0x6e,0xcd,0x0,0x29,0x2f,0xd,0x6c,0x4d,0x80,
+  0xe5,0x2,0x2a,0x2a,0x4d,0x84,0xe2,0x8a,0x59,0x0,0x33,0x36,0x7,0xc0,0xa0,0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x97,0x5f,0xe,0xe0,0x43,0x0,0xfa,0xbb,0x0,
+  0x83,0x2,0x68,0x7e,0xe1,0x25,0x6d,0x2,0xe6,0xc3,0x30,0x6c,0xeb,0xd5,0xce,0x90,
+  0x52,0xa2,0x5e,0x6f,0xb8,0x8a,0x20,0x0,0x48,0xa,0x89,0x66,0x28,0x5d,0xae,0x9f,
+  0x89,0x70,0xb6,0x5f,0x68,0x9b,0xab,0x7c,0xb5,0xae,0xef,0x93,0x8d,0xfd,0x15,0x9b,
+  0xe7,0xfd,0x49,0xaf,0xa,0x7,0x19,0xcf,0xdf,0xff,0x4b,0x46,0x13,0x69,0x41,0xa0,
+  0xaa,0x76,0x50,0x5a,0xa3,0x6c,0x64,0x72,0x28,0x21,0x24,0x8d,0x5f,0x92,0xe6,0x29,
+  0xc2,0x30,0x6c,0x1b,0x15,0xae,0x7f,0xe7,0xef,0xbc,0x72,0xfd,0xcd,0x7f,0xfb,0xb3,
+  0xb7,0x2,0xf8,0x41,0x0,0x7f,0xec,0xa5,0x60,0xcf,0xe7,0xd5,0xcf,0x5d,0xca,0x1a,
+  0x60,0x66,0x62,0x62,0x42,0x64,0x59,0x16,0x16,0x85,0xe,0xf3,0xea,0xf5,0x3a,0x9a,
+  0xcd,0x46,0xb5,0x2f,0x90,0xac,0x3b,0x5b,0xac,0x88,0x10,0xa7,0x84,0x34,0x2b,0xca,
+  0x15,0xaa,0xca,0x83,0xd8,0xbb,0xcf,0x64,0x56,0xbc,0xa5,0x7a,0x95,0x13,0xa9,0x27,
+  0xd8,0xab,0x14,0xf2,0x7c,0x87,0x6a,0xf8,0xc7,0x15,0xa2,0x89,0x4b,0x8,0x65,0x62,
+  0x8,0xe,0xae,0xd5,0x6b,0x3a,0x4c,0xcc,0xb,0x64,0x59,0x16,0x4e,0x4c,0x4c,0x58,
+  0xae,0xbf,0xae,0xf,0x20,0xc6,0x9b,0xbe,0xf0,0xe6,0x53,0x6f,0xfe,0xc2,0x9b,0xdf,
+  0xb,0xe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,0xb8,0x39,0xc4,0x37,
+  0x0,0xfc,0xa,0x80,0xef,0x5,0xf0,0x36,0x0,0x2f,0x1c,0xd0,0x2,0x8b,0x97,0x2a,
+  0xe,0x20,0x1,0xec,0x5b,0x58,0x58,0x50,0xd6,0x1,0x4,0x74,0x77,0xcf,0x20,0xd0,
+  0xb9,0x7f,0x29,0x25,0x82,0x20,0xc0,0x75,0x33,0x6b,0xf8,0x66,0x3e,0x7,0x84,0x75,
+  0xf4,0x52,0x85,0xc9,0x56,0x88,0xa1,0x1e,0xac,0x43,0xd8,0xae,0x9f,0xfa,0xb5,0xf4,
+  0x6e,0x31,0x9c,0xf5,0x76,0x93,0x3e,0xc0,0x7,0x13,0x3,0x79,0x61,0xfb,0x71,0xc4,
+  0x10,0x45,0x1f,0x2f,0xa8,0xad,0x54,0x4c,0x40,0x18,0x86,0x98,0x9c,0x9c,0xc4,0xd1,
+  0xa3,0x47,0xb5,0xdf,0x92,0x24,0xb6,0x69,0x54,0x49,0x11,0x87,0x57,0x8a,0x3e,0x3c,
+  0x1e,0x4,0xf0,0xef,0x1,0xfc,0x0,0x80,0x9f,0xf3,0x56,0xbe,0xb8,0xd4,0x4,0xc0,
+  0x57,0x6f,0x33,0xd3,0xd3,0xd3,0x9c,0x24,0x31,0x98,0x18,0x61,0x14,0x61,0x66,0x66,
+  0xc6,0xd9,0xd9,0x5a,0x4d,0xdb,0xd4,0xb9,0xfa,0x26,0xe6,0x1b,0xff,0x8,0xa5,0x14,
+  0x52,0x4e,0x9f,0x71,0x3f,0xda,0xa,0xef,0xf4,0xf4,0xb4,0x96,0x31,0xa5,0x23,0x81,
+  0xd9,0xd9,0xd9,0xa1,0x2a,0x21,0x2e,0xbb,0x4e,0x9c,0x6b,0x7c,0xd9,0x1c,0xaf,0x84,
+  0xae,0x25,0xb8,0xe7,0x52,0xd6,0x0,0x8b,0x93,0x93,0x93,0xc5,0xfa,0xfa,0x3a,0x88,
+  0x19,0x61,0x28,0x31,0x3e,0x3e,0x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x3,
+  0x19,0x1c,0xb,0x3,0xf9,0x89,0x40,0xca,0x25,0x29,0x24,0x2,0x29,0x20,0x84,0x74,
+  0xfc,0x46,0x2,0x1b,0x7e,0xa4,0xe,0x8b,0x15,0x29,0xe4,0x8a,0xf4,0x6a,0x35,0x47,
+  0xae,0x14,0xf2,0x42,0x21,0x57,0x5,0x72,0xa5,0x90,0x15,0x5,0x72,0x55,0x20,0x2b,
+  0x14,0xf2,0xc2,0x7f,0xcc,0xbe,0x56,0xdf,0x2e,0xa,0x63,0xab,0x84,0x75,0x86,0x79,
+  0x57,0x5e,0xc8,0x6e,0x7c,0x0,0x9,0x60,0x36,0x8,0x82,0x30,0xc9,0x32,0x83,0xa2,
+  0x11,0x8e,0x2e,0x2d,0xe1,0xe8,0xd2,0x51,0x8,0xae,0x72,0xf2,0x84,0xdf,0x6e,0xaf,
+  0x22,0x9f,0xa5,0x8f,0x5f,0xd9,0xd5,0xa1,0x92,0x1d,0x32,0xaf,0x65,0xd3,0x30,0x82,
+  0xab,0x89,0x1e,0x1d,0x41,0x58,0x22,0xa8,0xf0,0xb2,0x89,0x25,0x5d,0x50,0x78,0xe,
+  0xa6,0xdb,0x81,0x40,0xf0,0x70,0xc7,0x37,0xa1,0xb3,0x85,0x69,0x92,0x20,0x8,0x82,
+  0xe6,0x80,0x0,0x8,0x62,0x32,0xef,0x25,0x20,0x4,0x20,0x21,0x20,0xf5,0xaa,0xb,
+  0xa4,0x10,0xf7,0xa,0x81,0x45,0x29,0x5,0xa4,0x10,0xbf,0x29,0x85,0xf8,0x48,0x20,
+  0xc5,0x6d,0x52,0xca,0x63,0xfa,0x35,0xb2,0xe4,0x26,0xa,0xc3,0x68,0x12,0x2,0x4a,
+  0x6f,0x5e,0x1,0x29,0x4c,0xc3,0xc,0xfb,0x7b,0xfd,0xd5,0x6c,0x66,0xd4,0x3e,0x56,
+  0x1e,0xe5,0x24,0xbb,0x15,0x6f,0x24,0x40,0xff,0x46,0xb1,0x2b,0x4f,0x54,0xee,0x42,
+  0x0,0x46,0x9a,0xcd,0x66,0xab,0x28,0x8a,0x46,0x9e,0x9b,0xfa,0x3e,0xb0,0x63,0xe3,
+  0x10,0x97,0x54,0xac,0x4a,0x63,0x7,0xf6,0x5e,0x7,0xdd,0x16,0x86,0x8c,0xf0,0x54,
+  0x1a,0x3c,0x19,0xcc,0x1e,0xae,0xce,0xcf,0x26,0x84,0x4a,0x82,0x27,0x99,0xc7,0x2d,
+  0x40,0x4,0x66,0x10,0xa8,0x6c,0x13,0x63,0xbb,0xfb,0x92,0xf9,0x1c,0xf2,0x9b,0x4b,
+  0x79,0x30,0xb3,0xeb,0x22,0x52,0x7e,0x56,0x9e,0xe7,0x28,0x8a,0xa2,0xd1,0x6c,0x36,
+  0x5b,0x0,0x46,0xe0,0x35,0x8b,0xb0,0x6e,0x80,0x9e,0x2c,0x37,0x51,0x4d,0x1,0xb1,
+  0x28,0xca,0xa5,0x57,0x93,0x42,0xbc,0x4d,0x8,0xf1,0x84,0x14,0xe2,0xc3,0x81,0x94,
+  0x33,0xd2,0xf4,0x4c,0x8,0xbc,0x9,0x84,0x10,0x90,0x52,0x40,0x9a,0xcb,0x6a,0xa6,
+  0xcd,0x4d,0x6e,0x39,0xf9,0x70,0xcf,0x55,0xa6,0x93,0xcd,0x79,0xec,0xaf,0x34,0x51,
+  0x49,0x89,0x8b,0x5d,0x48,0x80,0xdc,0x1,0x8,0xe4,0x30,0x80,0x6e,0xb7,0x9b,0x27,
+  0x49,0x2,0x22,0xe5,0xa1,0x74,0x66,0x62,0xac,0x9a,0x2b,0xa,0x90,0x52,0xd5,0xa3,
+  0xd0,0x7f,0xf5,0x73,0xf6,0x50,0x50,0xaa,0x80,0x52,0x85,0x81,0x81,0x15,0x48,0x15,
+  0x50,0x4a,0x81,0x8a,0xc2,0x9d,0x63,0x5f,0xaf,0xfc,0xf3,0xa,0xa5,0x3f,0xcb,0xbe,
+  0x77,0x61,0x1e,0xb3,0xb7,0xdd,0x79,0xca,0x9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xf8,0x25,0x56,0x8e,0x56,0xab,0x85,0xf5,0xf5,
+  0xd,0x14,0x4a,0xe9,0x5c,0xbb,0x51,0xb9,0xa4,0xbc,0xdb,0x44,0x50,0x86,0xf,0x10,
+  0x86,0x11,0xe2,0x38,0x76,0x34,0x6d,0x45,0xba,0xd4,0x5c,0x93,0x4b,0xc8,0xa9,0x79,
+  0x65,0xd8,0xc7,0xf6,0x3d,0x1,0xa0,0x56,0xaf,0x23,0x4e,0x62,0x44,0x51,0xd,0x6c,
+  0x5e,0xa3,0x88,0x40,0xe4,0x99,0x7,0xf3,0xb9,0x8a,0x15,0x8a,0x42,0x61,0x7d,0x7d,
+  0x1d,0x2d,0xd3,0xc0,0x6a,0xa8,0xaf,0x0,0xb3,0xd5,0x0,0xc,0xdd,0x35,0xcc,0x6b,
+  0x1a,0x45,0x25,0xd5,0x9c,0x50,0x9a,0x3c,0xf0,0x91,0x72,0x22,0xad,0xdf,0xa3,0xbd,
+  0xfd,0x82,0x48,0x7f,0xae,0xf5,0xfe,0x99,0xc7,0x89,0xf9,0x56,0x62,0x3e,0x4a,0xc4,
+  0x37,0x33,0x68,0x64,0xf0,0x1a,0x92,0xf5,0x75,0x9c,0xda,0x61,0xd7,0xbe,0xde,0x35,
+  0xbf,0xf2,0x9b,0x99,0x3,0x26,0xd7,0xe1,0x79,0xbf,0x3,0xae,0xf7,0x5,0x6b,0x0,
+  0xf,0x2,0x75,0x1a,0xa0,0xd3,0xe9,0x14,0x67,0xcf,0x9e,0xdd,0xba,0x7f,0xbe,0x10,
+  0x8,0x82,0x0,0xad,0x56,0x6b,0x68,0x53,0x88,0xed,0xc6,0xfa,0xfa,0x3a,0x82,0x30,
+  0xd4,0x94,0x31,0x62,0x94,0x45,0x21,0x5b,0x84,0x33,0x9e,0xba,0xe,0xcd,0xae,0x22,
+  0xa3,0xa3,0xa3,0x98,0x9d,0xdb,0x59,0x6,0xb6,0xa,0x54,0xd,0x5f,0xa8,0x34,0x4d,
+  0xd1,0xe9,0x74,0x8a,0x61,0xd,0x60,0x42,0x39,0xe8,0x62,0x57,0xc7,0x33,0x10,0x7c,
+  0x44,0x41,0x77,0x34,0xf1,0xbb,0xe4,0xb3,0x2c,0xed,0xbc,0x65,0x3b,0x13,0x11,0x94,
+  0x16,0xf2,0x29,0x62,0xba,0x9d,0x88,0x6f,0x66,0xe6,0xdb,0x88,0xf9,0xe,0xc5,0x1c,
+  0x5b,0xe7,0xd4,0x3a,0xce,0x84,0xea,0x7d,0xf6,0x7b,0x1f,0x59,0x47,0xda,0x5b,0xf3,
+  0xcc,0x4e,0x37,0xd,0xb3,0xa6,0x2f,0x48,0x0,0xca,0xa0,0xce,0xf5,0x4,0x6a,0xb5,
+  0x5a,0x74,0xf2,0xe4,0x49,0x27,0x89,0xfe,0xc,0x49,0x29,0xf1,0xb5,0xaf,0x7d,0x6d,
+  0x57,0xe0,0x8f,0x30,0xf6,0xbc,0x66,0x6c,0x3f,0x9b,0xc8,0xc2,0x5e,0x3d,0x66,0xe1,
+  0x88,0x9d,0xbe,0x4e,0x67,0xd6,0xdb,0xd3,0x3c,0xf9,0xc4,0x13,0x38,0x7d,0xfa,0xf4,
+  0x8e,0x37,0x74,0x10,0x80,0xae,0x7,0x70,0xd,0x26,0xab,0x9,0x89,0x24,0x89,0x31,
+  0x3f,0x3f,0x4f,0x26,0x25,0xec,0x85,0x82,0xba,0xcf,0x0,0x9,0x6,0x9,0x82,0x92,
+  0x2,0x92,0x24,0x48,0xf2,0x11,0x22,0x2d,0x18,0xca,0x70,0xb,0xac,0x86,0x10,0x9e,
+  0x63,0x48,0x3e,0x39,0x85,0x49,0x6b,0x3a,0xe6,0x19,0xc5,0xf4,0x7b,0xc4,0x7c,0x33,
+  0x31,0xdd,0x46,0x44,0x1f,0x21,0x70,0x56,0x46,0x2c,0x28,0x23,0x28,0x32,0xfa,0xc6,
+  0x98,0x18,0x82,0x6d,0xb8,0x59,0x15,0xa,0x37,0xef,0xcc,0x4f,0xdf,0x7,0xd8,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x81,0x94,0x5e,0x86,0xb1,0x4,0x98,0xca,
+  0x46,0x53,0x70,0x5f,0xa4,0x28,0x72,0x7c,0xe8,0x83,0x1f,0x42,0xdf,0x8,0xb2,0x8b,
+  0x6,0x4c,0x9d,0x60,0x10,0x4,0xb5,0x61,0x1f,0x40,0x4f,0x9c,0x14,0x2,0x4a,0x58,
+  0x10,0x47,0x0,0xc0,0x92,0xdb,0x4d,0x44,0x5a,0x87,0x53,0x40,0xa,0x7f,0x43,0xac,
+  0x52,0x95,0x6b,0xd,0xa0,0xb4,0x20,0x18,0x9f,0x48,0x11,0x19,0x3f,0x81,0x9e,0xa7,
+  0x8,0x7f,0xa0,0x88,0x6e,0x56,0xc4,0xb7,0x11,0xd1,0xc7,0x18,0xe4,0x28,0x6d,0xa,
+  0x70,0xbd,0x93,0x1c,0xb6,0x1,0xae,0x60,0x1d,0x83,0x6d,0x73,0x9f,0x66,0x14,0xc0,
+  0xbe,0xa3,0x58,0x8f,0xa2,0xa8,0x43,0x4c,0x22,0x4d,0x73,0xf0,0x40,0x6d,0x9e,0x8,
+  0x80,0x5a,0xad,0x86,0x7e,0x3f,0xc6,0x57,0xbe,0xf2,0x95,0x73,0xeb,0xdf,0x81,0xef,
+  0x74,0xed,0x35,0xd7,0x60,0x63,0x63,0x3,0x61,0x10,0x40,0xc0,0xda,0xd1,0x81,0x20,
+  0x86,0xab,0x9d,0xc1,0x4,0x3,0x59,0x96,0x42,0x86,0x21,0x7a,0x9b,0x9b,0xd8,0xd8,
+  0xd8,0xc0,0x57,0xbf,0xfa,0x55,0xb8,0x1e,0xf2,0xe7,0xac,0x9c,0xd6,0x8f,0xbf,0xe2,
+  0x15,0xaf,0x30,0xe1,0xa6,0xd0,0x84,0x51,0x2f,0x4b,0x9d,0xa5,0x19,0x54,0xa1,0x5a,
+  0x51,0x14,0xb5,0xf3,0x3c,0xaf,0xdb,0x69,0xb5,0x93,0xa7,0x24,0x41,0x90,0xf0,0x11,
+  0xbb,0x4d,0x0,0xcb,0xc,0xcc,0x58,0xd5,0x2d,0x4d,0x21,0x6c,0xe9,0x93,0x9,0xb7,
+  0x52,0xc9,0x3a,0xba,0xcc,0x50,0x4c,0xfa,0x30,0xce,0xab,0x32,0x65,0x6a,0x8a,0xe8,
+  0x4a,0x22,0xfa,0x28,0x81,0xdf,0xa3,0x88,0xff,0xb,0x31,0x7d,0x42,0x79,0xad,0x73,
+  0xc8,0x4e,0x3c,0x7b,0xda,0xa1,0xe2,0x27,0xf0,0xae,0xf6,0x39,0x39,0xa7,0x0,0xdc,
+  0x75,0xd7,0x5d,0x15,0x96,0xcb,0xd4,0xd4,0x54,0xde,0xef,0xf5,0x6b,0x6c,0xc,0xf,
+  0xf9,0x40,0x14,0x4b,0xb4,0x47,0x46,0x2a,0x5f,0x44,0xb8,0x70,0xcc,0x28,0x73,0x2a,
+  0x61,0x57,0x3b,0x1f,0x61,0x14,0x21,0x49,0x12,0xd4,0xea,0x75,0xa7,0xda,0xac,0xa6,
+  0xa8,0x6e,0x20,0x5b,0xfe,0x30,0x1,0x81,0x2c,0xcb,0x50,0xb,0x23,0xac,0x9a,0x2e,
+  0xa5,0xda,0xf6,0xa,0x77,0x1e,0x7c,0x9f,0x41,0x94,0xe4,0x12,0xab,0x1f,0xdb,0xed,
+  0x36,0x4,0x0,0xc5,0xe4,0x34,0x95,0x96,0x65,0x85,0x24,0x89,0x65,0x67,0xb6,0x83,
+  0x2b,0x3e,0x3c,0x71,0x78,0x64,0xa1,0x81,0x5a,0x10,0x20,0xc,0x57,0x50,0x70,0x8,
+  0xa1,0x7c,0xec,0xae,0x6a,0x6b,0x99,0x5,0x2,0xd6,0xa6,0x41,0xa,0x31,0x18,0xd6,
+  0x57,0xd0,0x48,0x65,0xd8,0xcd,0x85,0x8d,0x7a,0x5c,0x4,0x43,0xee,0x79,0x45,0xb4,
+  0x9f,0x88,0x3e,0x4e,0xc4,0xef,0x21,0x52,0xff,0x45,0x31,0x1f,0x20,0xf6,0xa8,0x71,
+  0x83,0x91,0x98,0x45,0x42,0x1d,0xda,0x79,0x71,0x92,0x41,0x8e,0xe7,0x36,0x3f,0x3f,
+  0x5f,0x24,0x69,0x52,0xb3,0xab,0xd1,0x56,0xed,0x6a,0xa7,0x2d,0x40,0x20,0x25,0x4e,
+  0x9e,0x3c,0x85,0x7d,0x8b,0x8b,0x3,0xf8,0x3f,0x9f,0xe3,0xa6,0xc0,0xca,0xea,0xa,
+  0xd6,0xd7,0xcf,0x22,0x8a,0x6a,0x38,0x71,0xe2,0x4,0x16,0x17,0x17,0x7,0x16,0xb0,
+  0x9e,0x54,0x31,0x90,0x91,0xdf,0xdc,0xdc,0x44,0x51,0xe4,0xd8,0xdc,0xdc,0xc4,0xf2,
+  0xf2,0x32,0xf6,0x2d,0xee,0x43,0xb5,0xb9,0xeb,0x80,0x16,0xf0,0xee,0x9e,0x3c,0x79,
+  0x12,0x61,0x18,0xba,0xc7,0xc8,0x3b,0x53,0x0,0x48,0xd2,0x14,0xdd,0xb9,0x19,0xc4,
+  0x27,0x37,0xd1,0x9a,0xab,0xa1,0x90,0x2,0x42,0x9,0x8,0xa1,0xc,0xc4,0x2a,0x2a,
+  0x28,0x9d,0xf5,0xb8,0xa5,0x14,0xc6,0xf9,0x33,0x22,0x62,0x20,0x63,0xab,0x8a,0x4b,
+  0x47,0xd0,0x46,0x3,0xac,0x27,0x5e,0x69,0x41,0x28,0x9c,0x29,0x30,0x21,0xb0,0xb2,
+  0xce,0x22,0xbd,0x44,0x31,0x7f,0x8a,0x14,0x7d,0x9d,0x88,0x7f,0x83,0x98,0xff,0x4a,
+  0x99,0x70,0xb3,0xa4,0xd3,0x99,0xa4,0x95,0x11,0x48,0xeb,0x2b,0x5c,0x2c,0x1,0x90,
+  0x0,0x66,0x67,0x66,0x66,0x28,0x89,0x93,0xd2,0xfe,0x33,0x40,0x42,0xaf,0x20,0xa5,
+  0x14,0x8e,0x1f,0x3f,0x8e,0xfb,0xfe,0xdf,0xff,0x1d,0xda,0x35,0xec,0x7c,0xa9,0xcc,
+  0x95,0x95,0x15,0x84,0x61,0x88,0x8d,0xf5,0xf5,0x1d,0x9f,0x2b,0xa4,0x44,0xbf,0xd7,
+  0xc3,0xe6,0xe6,0x26,0xbe,0x70,0xdf,0x7d,0xbb,0xda,0xd6,0x4d,0x4a,0x89,0xb5,0xb5,
+  0x35,0x28,0x55,0x68,0x1f,0xc3,0xf5,0x32,0x34,0x1b,0x58,0xc6,0x9,0xba,0xb3,0x5d,
+  0x1c,0x5b,0x5e,0xd5,0x76,0x5f,0x49,0x14,0x20,0x2d,0x4,0x55,0x98,0xaa,0xa2,0x7e,
+  0x25,0x49,0x48,0xc9,0x3a,0x51,0x64,0x5,0xc4,0xd7,0x0,0xc6,0x93,0xd7,0x2b,0x9c,
+  0x3d,0x47,0x90,0x51,0xd8,0xc9,0x56,0xce,0x1f,0x40,0xc1,0xe5,0xf3,0x9a,0xf5,0xcc,
+  0xff,0x5c,0x11,0xfd,0xa5,0x22,0x7e,0x80,0x89,0xde,0xab,0x18,0x7f,0x53,0x46,0x6,
+  0xe4,0xcc,0x82,0x16,0x2,0x2,0x40,0x4f,0x5b,0x0,0xc4,0x0,0xa,0x48,0x71,0x92,
+  0x94,0xd,0x1d,0x8c,0xf7,0x4c,0x60,0x4,0x22,0xc0,0xfc,0xc2,0x3c,0x16,0x17,0x77,
+  0x47,0x88,0x25,0xa5,0xf0,0xd0,0xc1,0x83,0x98,0x9a,0x9c,0xc4,0x65,0xcf,0x7b,0xde,
+  0xae,0xbc,0xf9,0xd3,0xcb,0xcb,0x78,0xf2,0xc9,0x27,0x71,0xe5,0x55,0x57,0x21,0x8,
+  0x82,0x5d,0x45,0x1e,0x4f,0x3d,0xf5,0x14,0x8e,0x1f,0x3f,0xee,0x50,0x3b,0x57,0x85,
+  0x6c,0xe0,0xe0,0xb9,0x85,0x39,0x3c,0x79,0xe2,0x20,0xa,0x22,0x48,0xa1,0x20,0x4,
+  0x50,0xc,0x24,0x66,0x9c,0xfa,0x95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  0x6b,0x90,0x52,0x9a,0x8d,0x2c,0x34,0x53,0xc7,0xaa,0x8f,0x34,0x4d,0x10,0xca,0x10,
+  0xd9,0xe9,0x2,0xca,0x6c,0x84,0x61,0xd3,0xdf,0x56,0xd4,0x74,0x7,0x54,0x6d,0xd7,
+  0x95,0xc,0x10,0x8,0x86,0x90,0x2,0xd2,0x34,0xbb,0xd4,0xdd,0xec,0x14,0x30,0x10,
+  0x2e,0xb2,0x47,0x6a,0x51,0x34,0x0,0xd,0x93,0x36,0x3,0xd6,0x37,0xc8,0xed,0xa,
+  0xb7,0xd1,0x82,0x87,0x17,0x90,0x37,0xf9,0xce,0xf6,0x97,0x7f,0x5f,0xcf,0xe0,0x80,
+  0x99,0x7f,0xfa,0x62,0x86,0x81,0x5d,0x8,0x88,0x34,0x49,0x2b,0xb9,0x71,0x18,0x84,
+  0xab,0xd7,0xef,0xe1,0xc0,0xa7,0x3e,0x75,0x41,0x84,0x84,0x34,0x4b,0xf1,0x37,0x77,
+  0xdf,0xbd,0x2b,0x7,0xb0,0x4c,0xde,0x64,0xf8,0xb3,0x3,0x7,0x2e,0xf0,0x73,0xb3,
+  0x32,0x8e,0xe7,0x32,0x95,0x9a,0x26,0x29,0x42,0x8a,0x90,0x9f,0xd6,0x36,0x59,0x6b,
+  0x9f,0xa0,0xc2,0x56,0xd2,0x2c,0x1f,0x9,0xa,0x74,0xec,0xaf,0x84,0x40,0x40,0x2,
+  0x42,0xa,0x9f,0x18,0x52,0x81,0xd4,0x4a,0x56,0x53,0xe9,0x7,0x10,0xfb,0xf0,0xb0,
+  0x51,0xf3,0x5e,0x24,0xa0,0x94,0x42,0xc1,0xde,0x7d,0x53,0x3f,0xa9,0x3c,0xe1,0x20,
+  0x1e,0x38,0x74,0x34,0xf0,0xe3,0xac,0xab,0x94,0xb3,0x8b,0xa1,0x1,0x66,0x26,0x26,
+  0x26,0x44,0x1c,0xc7,0x61,0xe1,0xb3,0x7e,0xed,0x1b,0x84,0x21,0x2e,0x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f,0x44,0x89,0x84,0x89,0x1,0x58,0x54,0x0,0x78,
+  0xf5,0x6b,0x5e,0x83,0x30,0x8a,0x2a,0x40,0x8d,0xff,0x7c,0xbf,0xdf,0xc7,0xec,0xe2,
+  0x1c,0xfa,0x27,0x4e,0x23,0x18,0x97,0x60,0x69,0x54,0xb8,0xd0,0xdf,0x8b,0x84,0x9e,
+  0x0,0x29,0x24,0x2,0x13,0xfe,0xd9,0x4,0x90,0xf0,0x71,0x80,0x4a,0xa,0x9b,0x4b,
+  0x21,0x22,0x72,0x29,0x62,0xa7,0xc6,0x89,0x9c,0x93,0xe7,0xab,0x7b,0xad,0x11,0x78,
+  0x30,0x81,0x54,0xae,0x78,0xcb,0x7f,0x2c,0xcd,0xcb,0xd7,0x1,0xbc,0xe9,0x62,0x51,
+  0xc2,0x4,0x80,0xee,0xf4,0xf4,0x34,0xa5,0x71,0xea,0x54,0x66,0x59,0x87,0xa7,0x7f,
+  0x70,0xb3,0xd5,0xd2,0x52,0xad,0x68,0xeb,0x94,0xc2,0x16,0x9c,0xb7,0x30,0xc,0x51,
+  0xe4,0xb9,0x8b,0xe1,0x95,0x2a,0x30,0x98,0x33,0x3a,0x67,0x8a,0x42,0x94,0x29,0xe1,
+  0x38,0x8e,0x51,0xaf,0xd5,0xb1,0x41,0x1b,0xe7,0xf8,0xcc,0xaa,0xc6,0xb2,0xf,0x37,
+  0x9b,0x4d,0x4f,0x0,0xca,0xde,0x83,0x2c,0x4,0xd2,0x24,0x45,0x67,0xba,0x83,0xb5,
+  0x95,0x13,0xa8,0x2b,0x5,0x66,0xbd,0xad,0xd,0x5,0xda,0x61,0x94,0x82,0x11,0x18,
+  0xe0,0x47,0x9,0x1,0x49,0x2,0x52,0xd0,0x0,0xa3,0xd7,0xab,0x6e,0xf3,0x72,0xf8,
+  0xa8,0x84,0x83,0x54,0xc2,0xc3,0x16,0xf4,0xe1,0xea,0x44,0xfb,0x2,0x61,0x35,0x85,
+  0xcb,0x14,0x56,0x7c,0x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3,
+  0x1b,0xa6,0x42,0xa7,0xca,0x30,0x82,0xcf,0xa,0xf2,0x4a,0x81,0x5,0x80,0xc7,0x1e,
+  0x7b,0x14,0x79,0x91,0xe3,0xf0,0x91,0x23,0x18,0x1b,0x1d,0x35,0x1d,0x62,0xcb,0xcd,
+  0xa6,0x86,0xb,0x13,0x5c,0xe6,0x2,0x8f,0x1c,0x3c,0x8,0x57,0xe0,0x6a,0x40,0x13,
+  0x9f,0x24,0x9a,0xc4,0x31,0xa6,0xa6,0xa6,0x90,0x1f,0x57,0x50,0x5,0x81,0x25,0xc0,
+  0x1,0x83,0x4,0x43,0x9a,0x7d,0xd0,0x4,0xb,0x3,0x0,0x11,0x24,0x9,0xbd,0x75,
+  0xad,0xf0,0x28,0xde,0x28,0xeb,0x24,0xec,0xa6,0x58,0xec,0xc1,0xb5,0x64,0x71,0x7b,
+  0x6b,0x6,0x98,0x2b,0xa6,0x80,0x68,0xd8,0x41,0xb4,0x9a,0xc2,0xbd,0x9e,0x39,0x26,
+  0xe2,0xf7,0x12,0xf3,0x7,0x69,0x17,0xab,0x7e,0xa7,0x1a,0xc0,0xee,0xa2,0x35,0x37,
+  0x36,0x36,0x56,0x2c,0x2f,0x9f,0x72,0x7c,0x35,0xe1,0x71,0xd6,0x88,0x19,0x27,0x8e,
+  0x1f,0xc7,0xea,0xca,0xca,0xee,0xda,0x57,0x33,0xa3,0x28,0xa,0xe4,0x79,0x8e,0x87,
+  0x1e,0x7a,0x70,0xf7,0xb4,0x66,0x66,0xc4,0xfd,0x3e,0x8e,0x1c,0x3e,0x8c,0x7a,0xbd,
+  0xbe,0xeb,0xf3,0xb3,0x34,0x75,0x1b,0x48,0x5a,0x8d,0x61,0x9d,0xb5,0x24,0x49,0xd0,
+  0x19,0xef,0xa0,0x78,0x48,0xa1,0x60,0x85,0x80,0xf4,0x8e,0x67,0x81,0x64,0xcb,0x4,
+  0x32,0xb0,0xaf,0x9f,0x1e,0x6,0xa4,0x90,0x15,0xd5,0x6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5e,0xef,0x25,0x48,0xae,0xbe,0xfa,0x6a,0x6c,0x6e,0x6e,0x0,
+  0xcc,0x38,0xbb,0xb6,0x86,0x7b,0x3f,0x7f,0xef,0x40,0xa7,0xbf,0x1,0x6a,0xf8,0x80,
+  0x43,0xf7,0xc3,0x37,0xdc,0x0,0x66,0xc6,0xca,0xca,0xa,0x8e,0x1e,0x3d,0x8a,0xaf,
+  0x7e,0xf5,0xab,0x5b,0x27,0x83,0x7d,0x14,0xd9,0xf8,0x2d,0xf3,0xb,0xf3,0x98,0x9c,
+  0x9c,0xd4,0x13,0xc7,0x3e,0x95,0xda,0x6c,0x6e,0x95,0x26,0xa8,0x85,0x11,0xd4,0x8a,
+  0x86,0x66,0x59,0x18,0x9c,0x5f,0x10,0x58,0x48,0x8,0x36,0x59,0x3f,0x72,0x65,0x62,
+  0x5a,0x65,0x7a,0xb7,0x7,0x85,0xbd,0x34,0x2,0x1a,0x1,0x75,0x42,0x80,0xea,0x2e,
+  0x68,0x6e,0xf2,0xc1,0xae,0x93,0xa9,0x76,0xfe,0x18,0xc4,0x7c,0x1f,0x31,0xde,0xc2,
+  0x4c,0x9a,0x8d,0x6c,0x76,0x49,0x7f,0x3a,0x63,0x27,0x61,0xe0,0x34,0x33,0x85,0xa9,
+  0x69,0xd,0xeb,0x58,0x0,0xc6,0x3e,0x4b,0x29,0x31,0x32,0x3a,0x8a,0xc7,0x9f,0x78,
+  0x42,0x23,0x6b,0x6e,0xf,0x8f,0x72,0xd3,0xe7,0xd2,0x62,0xb0,0x73,0xf2,0x6a,0x51,
+  0x84,0x3c,0xcf,0x5d,0x31,0x8,0x93,0x4f,0x45,0x1d,0xe0,0x0,0x38,0xc7,0xd0,0xdf,
+  0x19,0x44,0x13,0x4a,0x52,0x5d,0xd4,0xa9,0x9b,0x49,0x7b,0x96,0xde,0xaf,0x45,0xb0,
+  0x1a,0xd2,0x8a,0xef,0xe6,0x66,0xf,0xfb,0x16,0x17,0x21,0xa5,0xac,0xec,0x53,0x64,
+  0x43,0xce,0x24,0x4e,0x21,0x55,0x8,0x5a,0xd5,0xa9,0xda,0x40,0x5a,0xa2,0x87,0x2e,
+  0xf8,0xc,0x20,0x40,0x90,0x66,0x2b,0x5c,0xbf,0x66,0xaf,0xc4,0x1,0xca,0x9a,0x4,
+  0xf3,0xfe,0x1e,0x9d,0xdb,0x22,0x77,0x36,0x37,0xe0,0x97,0xd1,0xb9,0x96,0xba,0xce,
+  0x3f,0x60,0x30,0xd1,0x26,0x31,0x7e,0x9d,0x98,0xee,0x20,0xbf,0x44,0xe,0x4f,0x7f,
+  0x9c,0x4f,0x0,0xc6,0xdb,0xed,0x76,0x33,0x49,0xd2,0x20,0x2f,0x8a,0xea,0xce,0xdd,
+  0xd0,0xe4,0xc7,0x30,0xc,0x91,0xe7,0x39,0x9e,0xf7,0xbc,0xcb,0xaa,0x3d,0x5b,0x7c,
+  0x18,0x44,0x94,0x5d,0x40,0x6d,0x88,0x97,0x66,0x19,0x36,0x37,0x7b,0x80,0x10,0x58,
+  0x5f,0x5f,0xc7,0xfe,0xfd,0x57,0xbb,0x6d,0x60,0x2a,0x6b,0xdd,0xf3,0x29,0xad,0x57,
+  0x2d,0x20,0xb0,0x7c,0x5a,0x6f,0x56,0x11,0xf7,0xfb,0xe8,0xf5,0x7a,0xf8,0x9e,0xfd,
+  0xfb,0x3d,0x7,0xb0,0xfc,0x9e,0x83,0x1a,0x48,0xf3,0x9,0xb4,0x7a,0x2e,0x89,0x21,
+  0x5e,0xc1,0xa,0x31,0x8a,0x22,0x87,0x4a,0xa,0xb4,0x44,0x4b,0x9d,0xfd,0xd9,0xde,
+  0x4b,0xa0,0x37,0x85,0x8c,0x27,0x3f,0xde,0xce,0x25,0x4,0x68,0xb,0xfb,0x2f,0x20,
+  0x6f,0x81,0xc0,0xad,0x55,0xfb,0xef,0xc7,0xcc,0x55,0x54,0x90,0xb9,0x2a,0x0,0x65,
+  0xd,0xe3,0x10,0xc2,0x77,0x17,0x13,0xbf,0x95,0xc0,0x4b,0x44,0x25,0x33,0xf8,0x62,
+  0x8d,0xf0,0x1c,0x93,0xef,0x30,0x80,0x4e,0xa7,0x53,0xc4,0x71,0x1c,0xf8,0x64,0xd,
+  0xbf,0xcf,0x8f,0x94,0x12,0x7,0xf,0x1e,0x1c,0x42,0xd4,0x76,0x32,0x96,0x4f,0x9d,
+  0x42,0x9e,0xe7,0x38,0x78,0xf0,0xe0,0xae,0x88,0x24,0x96,0xd8,0xb1,0x72,0xe6,0xc,
+  0x92,0x24,0xc1,0xc3,0xf,0x3f,0xbc,0x2b,0x52,0x8,0xa0,0x9b,0x44,0xb8,0x7d,0x87,
+  0x6,0x18,0xc7,0x6c,0x22,0x9b,0x4e,0xa7,0x53,0xf4,0x7a,0xbd,0x59,0x0,0xdf,0x2,
+  0x80,0xd5,0x37,0xf5,0xc4,0xf8,0x1f,0xb7,0xd9,0x99,0x0,0xf,0xf8,0x11,0x82,0x8e,
+  0xc0,0x2b,0xf4,0x1c,0xec,0x84,0x63,0x25,0x9b,0x9c,0x46,0x2a,0x91,0xc5,0x6a,0x81,
+  0x8,0xc,0x3e,0x80,0xb3,0xcc,0xf4,0xab,0xc,0xfe,0x18,0xd,0x14,0x8e,0x5c,0xcc,
+  0x11,0xee,0x0,0x3,0x28,0x92,0x38,0xae,0x6b,0x15,0x56,0x85,0x1,0x85,0x14,0x68,
+  0x34,0x1a,0x18,0x69,0xb7,0x21,0xb7,0x21,0x65,0x6c,0x45,0xd3,0x24,0xa5,0x70,0xe6,
+  0xf4,0x69,0x34,0x9b,0x4d,0x8c,0x8f,0x8d,0x6d,0xeb,0xc5,0x6f,0x49,0xf6,0x32,0x94,
+  0xf2,0x24,0x4d,0xdd,0xbe,0xc5,0xbb,0xd9,0x48,0x87,0x4c,0xab,0x38,0x21,0x5,0xa8,
+  0xa8,0x6e,0x3f,0x29,0xc,0x31,0x64,0x7e,0x7e,0xbe,0x58,0x5a,0x5a,0xda,0x7,0xaf,
+  0x4e,0x50,0x29,0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5,0xfa,0x5,0x58,0x88,0x23,0x82,0xf9,0x1a,0xc1,0x3e,0x19,0x8e,0x7d,
+  0x5a,0x40,0x79,0x25,0xca,0x32,0xb7,0x65,0x66,0xbc,0x9d,0x81,0x3,0x0,0x99,0xd,
+  0xb7,0xbf,0xfd,0x13,0xbf,0x53,0xd,0x30,0xd7,0x6c,0x36,0x39,0x4e,0x4a,0xb6,0x8e,
+  0xaf,0x8e,0x92,0x24,0xc1,0xb1,0x6f,0x7e,0x13,0x4b,0x4b,0x4b,0x78,0xe1,0x15,0x2f,
+  0x84,0x94,0x81,0x17,0x78,0xfb,0x76,0x50,0xc,0xa5,0x3,0x8f,0x1f,0x3f,0x81,0xcd,
+  0x5e,0xf,0xbd,0x7e,0x1f,0xcd,0x56,0xb,0x57,0x5d,0x79,0x65,0x65,0xf3,0xa7,0xed,
+  0x7d,0x1,0x81,0x20,0x10,0xd8,0xec,0x6d,0x22,0x49,0x12,0x9c,0x3c,0x79,0x12,0x57,
+  0x5d,0x75,0x65,0x25,0x9e,0xaf,0x7c,0xee,0xc0,0xd9,0x44,0x84,0xa5,0xa7,0x96,0x70,
+  0xe2,0xf8,0x71,0x63,0xba,0xca,0x50,0xd5,0xca,0x4a,0x9c,0xc4,0x68,0x36,0x9b,0x8c,
+  0x6a,0xd7,0x30,0x51,0x98,0x5a,0x2,0x4d,0x15,0xb7,0x30,0xb7,0x7b,0xef,0x25,0x1,
+  0x71,0x8d,0x5f,0x35,0xe3,0x64,0x92,0x4b,0x8a,0x30,0x95,0x31,0xee,0x27,0x0,0xfc,
+  0x2a,0x33,0x2f,0x6b,0xf9,0xfd,0x4e,0x4e,0xfd,0xce,0x34,0x40,0x57,0x6,0x72,0x24,
+  0x71,0x18,0x80,0x89,0xb4,0x45,0x49,0xe6,0x38,0xf6,0xad,0x6f,0xe1,0xf3,0xf7,0xde,
+  0xab,0x43,0xaa,0x5d,0xc,0x21,0x25,0x92,0x38,0xc6,0x43,0xf,0x3e,0x78,0x41,0x64,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c3,0x6f,
+  0x9e,0xc4,0x5b,0xda,0x5c,0xdf,0x50,0xcd,0xce,0xce,0x62,0x75,0x75,0x6d,0xf3,0x89,
+  0x27,0x9e,0xf8,0x4b,0x33,0xa9,0xa,0x3b,0xab,0xb5,0x3a,0x1,0xe0,0xa7,0x1,0xd8,
+  0xce,0xd4,0x87,0x0,0xbc,0x16,0xc0,0x5b,0x9f,0x29,0x2a,0x7f,0x27,0x26,0xc0,0xc4,
+  0x39,0x28,0xa0,0x89,0x85,0x77,0xde,0x71,0xc7,0x1d,0x3f,0x7e,0xcb,0x2d,0xb7,0x20,
+  0x49,0x12,0x9c,0x5d,0x5b,0x83,0xc,0x43,0x84,0x41,0x80,0x20,0x8,0x11,0x45,0x21,
+  0xc2,0x30,0x42,0x14,0x5,0x88,0xa2,0x1a,0xc2,0x48,0xf7,0xd,0xae,0x45,0x35,0xd4,
+  0xa2,0x8,0x61,0x14,0x21,0x8a,0x6a,0x88,0x6a,0x21,0x6a,0x51,0xcd,0xbc,0x36,0x44,
+  0x14,0x86,0x8,0xa3,0x8,0x41,0x18,0x20,0xc,0x42,0x4,0x41,0x8,0x19,0x48,0x4,
+  0x52,0x6a,0x76,0x8d,0x63,0xd8,0x7a,0x94,0x6a,0xc7,0x88,0xd1,0xad,0xe0,0x54,0xae,
+  0x50,0xa8,0x2,0x79,0x51,0x40,0xe5,0xb9,0xee,0x9e,0x99,0x67,0xc8,0xf3,0x1c,0x59,
+  0x96,0x23,0x2f,0x72,0xe4,0x59,0x8e,0x2c,0xcf,0x51,0x64,0x39,0xb2,0x22,0x47,0x91,
+  0xe7,0xc8,0xcd,0x51,0x14,0x45,0x79,0x98,0x96,0x76,0x13,0x13,0x13,0x78,0xd9,0xcb,
+  0x5e,0x86,0xdf,0xfa,0xad,0xdf,0x6a,0x1,0xf8,0x3f,0x0,0x72,0x73,0x2d,0x68,0x87,
+  0x5a,0xe0,0xaf,0x0,0x74,0x0,0x5c,0xe9,0x9b,0x84,0x67,0xea,0x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,0x1b,0x7b,0x2,0xb0,0x37,0xf6,0x4,
+  0x60,0x6f,0xec,0x9,0xc0,0xde,0xd8,0x13,0x80,0xbd,0x71,0xa9,0x8e,0xff,0x3f,0x0,
+  0xda,0x6e,0xc6,0x3c,0x75,0xcb,0x54,0xe4,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,
+  0xae,0x42,0x60,0x82,
+  
+};
+
+static const unsigned char qt_resource_name[] = {
+  // resources
+  0x0,0x9,
+  0xa,0x6c,0x78,0x43,
+  0x0,0x72,
+  0x0,0x65,0x0,0x73,0x0,0x6f,0x0,0x75,0x0,0x72,0x0,0x63,0x0,0x65,0x0,0x73,
+    // sphone.png
+  0x0,0xa,
+  0x6,0x4b,0x1a,0xa7,
+  0x0,0x73,
+  0x0,0x70,0x0,0x68,0x0,0x6f,0x0,0x6e,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
+    // phone.png
+  0x0,0x9,
+  0x6,0x48,0xba,0xa7,
+  0x0,0x70,
+  0x0,0x68,0x0,0x6f,0x0,0x6e,0x0,0x65,0x0,0x2e,0x0,0x70,0x0,0x6e,0x0,0x67,
+  
+};
+
+static const unsigned char qt_resource_struct[] = {
+  // :
+  0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+  // :/resources
+  0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x2,
+  // :/resources/phone.png
+  0x0,0x0,0x0,0x32,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x6,0x60,
+  // :/resources/sphone.png
+  0x0,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+
+};
+
+QT_BEGIN_NAMESPACE
+
+extern Q_CORE_EXPORT bool qRegisterResourceData
+    (int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+extern Q_CORE_EXPORT bool qUnregisterResourceData
+    (int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+QT_END_NAMESPACE
+
+
+int QT_MANGLE_NAMESPACE(qInitResources_Resources1)()
+{
+    QT_PREPEND_NAMESPACE(qRegisterResourceData)
+        (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
+    return 1;
+}
+
+Q_CONSTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qInitResources_Resources1))
+
+int QT_MANGLE_NAMESPACE(qCleanupResources_Resources1)()
+{
+    QT_PREPEND_NAMESPACE(qUnregisterResourceData)
+       (0x01, qt_resource_struct, qt_resource_name, qt_resource_data);
+    return 1;
+}
+
+Q_DESTRUCTOR_FUNCTION(QT_MANGLE_NAMESPACE(qCleanupResources_Resources1))
+
diff --git a/resources/phone.png b/resources/phone.png
new file mode 100644 (file)
index 0000000..e7f503b
Binary files /dev/null and b/resources/phone.png differ
diff --git a/resources/sphone.png b/resources/sphone.png
new file mode 100644 (file)
index 0000000..7251d3d
Binary files /dev/null and b/resources/sphone.png differ
diff --git a/ui_dialog.h b/ui_dialog.h
new file mode 100644 (file)
index 0000000..94d9695
--- /dev/null
@@ -0,0 +1,203 @@
+/********************************************************************************
+** Form generated from reading UI file 'dialog.ui'
+**
+** Created: Sun 20. Feb 02:23:25 2011
+**      by: Qt User Interface Compiler version 4.7.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_DIALOG_H
+#define UI_DIALOG_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QCheckBox>
+#include <QtGui/QDialog>
+#include <QtGui/QGridLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QPushButton>
+#include <QtGui/QSpacerItem>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Dialog
+{
+public:
+    QWidget *gridLayoutWidget;
+    QGridLayout *gridLayout;
+    QLabel *label_2;
+    QLabel *label_3;
+    QCheckBox *checkBox;
+    QLabel *label;
+    QCheckBox *checkBox_2;
+    QCheckBox *checkBox_3;
+    QLabel *label_4;
+    QLabel *label_5;
+    QCheckBox *checkBox_5;
+    QCheckBox *checkBox_6;
+    QSpacerItem *verticalSpacer;
+    QSpacerItem *verticalSpacer_2;
+    QCheckBox *checkBox_4;
+    QSpacerItem *horizontalSpacer_2;
+    QSpacerItem *horizontalSpacer;
+    QPushButton *pushButton;
+
+    void setupUi(QDialog *Dialog)
+    {
+        if (Dialog->objectName().isEmpty())
+            Dialog->setObjectName(QString::fromUtf8("Dialog"));
+        Dialog->resize(800, 350);
+        gridLayoutWidget = new QWidget(Dialog);
+        gridLayoutWidget->setObjectName(QString::fromUtf8("gridLayoutWidget"));
+        gridLayoutWidget->setGeometry(QRect(0, 0, 801, 251));
+        gridLayout = new QGridLayout(gridLayoutWidget);
+        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+        gridLayout->setSizeConstraint(QLayout::SetDefaultConstraint);
+        gridLayout->setContentsMargins(0, 0, 0, 0);
+        label_2 = new QLabel(gridLayoutWidget);
+        label_2->setObjectName(QString::fromUtf8("label_2"));
+        label_2->setAlignment(Qt::AlignCenter);
+
+        gridLayout->addWidget(label_2, 1, 2, 1, 1);
+
+        label_3 = new QLabel(gridLayoutWidget);
+        label_3->setObjectName(QString::fromUtf8("label_3"));
+        label_3->setAlignment(Qt::AlignCenter);
+
+        gridLayout->addWidget(label_3, 1, 3, 1, 1);
+
+        checkBox = new QCheckBox(gridLayoutWidget);
+        checkBox->setObjectName(QString::fromUtf8("checkBox"));
+        QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+        sizePolicy.setHorizontalStretch(0);
+        sizePolicy.setVerticalStretch(0);
+        sizePolicy.setHeightForWidth(checkBox->sizePolicy().hasHeightForWidth());
+        checkBox->setSizePolicy(sizePolicy);
+        checkBox->setMaximumSize(QSize(70, 64));
+
+        gridLayout->addWidget(checkBox, 3, 2, 1, 1);
+
+        label = new QLabel(gridLayoutWidget);
+        label->setObjectName(QString::fromUtf8("label"));
+        label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+
+        gridLayout->addWidget(label, 3, 1, 1, 1);
+
+        checkBox_2 = new QCheckBox(gridLayoutWidget);
+        checkBox_2->setObjectName(QString::fromUtf8("checkBox_2"));
+        sizePolicy.setHeightForWidth(checkBox_2->sizePolicy().hasHeightForWidth());
+        checkBox_2->setSizePolicy(sizePolicy);
+        checkBox_2->setMaximumSize(QSize(70, 64));
+
+        gridLayout->addWidget(checkBox_2, 3, 3, 1, 1);
+
+        checkBox_3 = new QCheckBox(gridLayoutWidget);
+        checkBox_3->setObjectName(QString::fromUtf8("checkBox_3"));
+        sizePolicy.setHeightForWidth(checkBox_3->sizePolicy().hasHeightForWidth());
+        checkBox_3->setSizePolicy(sizePolicy);
+        checkBox_3->setMaximumSize(QSize(70, 64));
+
+        gridLayout->addWidget(checkBox_3, 2, 3, 1, 1);
+
+        label_4 = new QLabel(gridLayoutWidget);
+        label_4->setObjectName(QString::fromUtf8("label_4"));
+        label_4->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+
+        gridLayout->addWidget(label_4, 2, 1, 1, 1);
+
+        label_5 = new QLabel(gridLayoutWidget);
+        label_5->setObjectName(QString::fromUtf8("label_5"));
+        label_5->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+
+        gridLayout->addWidget(label_5, 4, 1, 1, 1);
+
+        checkBox_5 = new QCheckBox(gridLayoutWidget);
+        checkBox_5->setObjectName(QString::fromUtf8("checkBox_5"));
+        sizePolicy.setHeightForWidth(checkBox_5->sizePolicy().hasHeightForWidth());
+        checkBox_5->setSizePolicy(sizePolicy);
+        checkBox_5->setMaximumSize(QSize(70, 64));
+
+        gridLayout->addWidget(checkBox_5, 4, 2, 1, 1);
+
+        checkBox_6 = new QCheckBox(gridLayoutWidget);
+        checkBox_6->setObjectName(QString::fromUtf8("checkBox_6"));
+        sizePolicy.setHeightForWidth(checkBox_6->sizePolicy().hasHeightForWidth());
+        checkBox_6->setSizePolicy(sizePolicy);
+        checkBox_6->setMaximumSize(QSize(70, 64));
+
+        gridLayout->addWidget(checkBox_6, 4, 3, 1, 1);
+
+        verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
+
+        gridLayout->addItem(verticalSpacer, 5, 2, 1, 1);
+
+        verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
+
+        gridLayout->addItem(verticalSpacer_2, 0, 2, 1, 1);
+
+        checkBox_4 = new QCheckBox(gridLayoutWidget);
+        checkBox_4->setObjectName(QString::fromUtf8("checkBox_4"));
+        sizePolicy.setHeightForWidth(checkBox_4->sizePolicy().hasHeightForWidth());
+        checkBox_4->setSizePolicy(sizePolicy);
+        checkBox_4->setMaximumSize(QSize(70, 64));
+
+        gridLayout->addWidget(checkBox_4, 2, 2, 1, 1);
+
+        horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+        gridLayout->addItem(horizontalSpacer_2, 0, 0, 1, 1);
+
+        horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
+
+        gridLayout->addItem(horizontalSpacer, 0, 4, 1, 1);
+
+        gridLayout->setColumnStretch(0, 3);
+        gridLayout->setColumnStretch(1, 1);
+        gridLayout->setColumnStretch(2, 1);
+        gridLayout->setColumnStretch(3, 1);
+        gridLayout->setColumnStretch(4, 4);
+        pushButton = new QPushButton(Dialog);
+        pushButton->setObjectName(QString::fromUtf8("pushButton"));
+        pushButton->setGeometry(QRect(610, 260, 184, 80));
+        QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed);
+        sizePolicy1.setHorizontalStretch(0);
+        sizePolicy1.setVerticalStretch(0);
+        sizePolicy1.setHeightForWidth(pushButton->sizePolicy().hasHeightForWidth());
+        pushButton->setSizePolicy(sizePolicy1);
+
+        retranslateUi(Dialog);
+
+        QMetaObject::connectSlotsByName(Dialog);
+    } // setupUi
+
+    void retranslateUi(QDialog *Dialog)
+    {
+        Dialog->setWindowTitle(QApplication::translate("Dialog", "Dialog", 0, QApplication::UnicodeUTF8));
+        label_2->setText(QApplication::translate("Dialog", "Sent", 0, QApplication::UnicodeUTF8));
+        label_3->setText(QApplication::translate("Dialog", "Recieved", 0, QApplication::UnicodeUTF8));
+        checkBox->setText(QString());
+        label->setText(QApplication::translate("Dialog", "MMS", 0, QApplication::UnicodeUTF8));
+        checkBox_2->setText(QString());
+        checkBox_3->setText(QString());
+        label_4->setText(QApplication::translate("Dialog", "SMS", 0, QApplication::UnicodeUTF8));
+        label_5->setText(QApplication::translate("Dialog", "Chat", 0, QApplication::UnicodeUTF8));
+        checkBox_5->setText(QString());
+        checkBox_6->setText(QString());
+        checkBox_4->setText(QString());
+        pushButton->setText(QApplication::translate("Dialog", "Continue...", 0, QApplication::UnicodeUTF8));
+    } // retranslateUi
+
+};
+
+namespace Ui {
+    class Dialog: public Ui_Dialog {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // UI_DIALOG_H
diff --git a/welcome b/welcome
deleted file mode 100644 (file)
index e69de29..0000000