xmlreaders.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright 2009 Andrew Stromme <astromme@chatonka.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU Library General Public License as
  6. * published by the Free Software Foundation; either version 2, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this program; if not, write to the
  16. * Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef XMLREADERS_H
  20. #define XMLREADERS_H
  21. namespace RTM {
  22. class Request;
  23. class Session;
  24. class Task;
  25. }
  26. #include <QXmlStreamReader>
  27. #include "rtm.h"
  28. #include "list.h"
  29. class TempProps;
  30. namespace RTM {
  31. class RTM_EXPORT TasksReader : public QXmlStreamReader
  32. {
  33. public:
  34. TasksReader(RTM::Request *request, RTM::Session *session);
  35. bool read();
  36. QList<RTM::List*> readLists() const;
  37. QList<RTM::Task*> readTasks() const;
  38. private:
  39. Session * const session;
  40. Request * const request;
  41. QDateTime parseDateTime(const QString &datetime);
  42. QDateTime localizedTime(const QDateTime &datetime);
  43. void readUnknownElement();
  44. bool readResponse();
  45. void readTransaction();
  46. void readTasksHeader();
  47. void readTasksList();
  48. void readTaskSeries(RTM::ListId listId);
  49. void readTags(TempProps* props);
  50. void readParticipants(TempProps* props);
  51. void readNotes(TempProps* props);
  52. void readTask(TempProps* props);
  53. void readListsHeader();
  54. void readList();
  55. void readFilter(RTM::List* list);
  56. QList<RTM::Task*> changedTasks;
  57. QList<RTM::List*> changedLists;
  58. };
  59. } // Namespace RTM
  60. #endif // TASKSREADER_H