list.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. #include "list.h"
  20. namespace RTM {
  21. class ListPrivate {
  22. ListPrivate(List *parent)
  23. : q(parent)
  24. {}
  25. friend class List;
  26. List *q;
  27. QString name;
  28. RTM::ListId listId;
  29. bool smart;
  30. QString filter;
  31. // none of the following are used yet. However, they exsist in the
  32. // list example and so I thought that they should be included.
  33. bool deleted;
  34. bool locked;
  35. bool archived;
  36. int position;
  37. };
  38. List::List(Session* session)
  39. : QObject(session),
  40. d(new ListPrivate(this))
  41. { }
  42. List::~List()
  43. {
  44. delete d;
  45. }
  46. QString List::name() const {
  47. return d->name;
  48. }
  49. ListId List::id() const {
  50. return d->listId;
  51. }
  52. bool List::isSmart() const {
  53. return d->smart;
  54. }
  55. QString List::filter() const {
  56. return d->filter;
  57. }
  58. void List::setName(const QString& name) {
  59. d->name = name;
  60. }
  61. void List::setId(qulonglong id) {
  62. d->listId = id;
  63. }
  64. void List::setSmart(bool smart) {
  65. d->smart = smart;
  66. }
  67. void List::setFilter(const QString& filter) {
  68. d->filter = filter;
  69. }
  70. }
  71. #include "list.moc"