qwebhistory_p.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef QWEBHISTORY_P_H
  17. #define QWEBHISTORY_P_H
  18. #include "BackForwardListImpl.h"
  19. #include "HistoryItem.h"
  20. #include "qwebkitglobal.h"
  21. #include <QtCore/qglobal.h>
  22. #include <QtCore/qshareddata.h>
  23. class QWebPageAdapter;
  24. class QWEBKIT_EXPORT QWebHistoryItemPrivate : public QSharedData {
  25. public:
  26. static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem* q)
  27. {
  28. return q->d;
  29. }
  30. QWebHistoryItemPrivate(WebCore::HistoryItem* i)
  31. {
  32. if (i)
  33. i->ref();
  34. item = i;
  35. }
  36. ~QWebHistoryItemPrivate()
  37. {
  38. if (item)
  39. item->deref();
  40. }
  41. static WebCore::HistoryItem* core(const QWebHistoryItem* q);
  42. WebCore::HistoryItem* item;
  43. };
  44. class QWebHistoryPrivate : public QSharedData {
  45. public:
  46. QWebHistoryPrivate(WebCore::BackForwardListImpl* l)
  47. {
  48. l->ref();
  49. lst = l;
  50. }
  51. ~QWebHistoryPrivate()
  52. {
  53. lst->deref();
  54. }
  55. QWebPageAdapter* page();
  56. WebCore::BackForwardListImpl* lst;
  57. };
  58. #endif