/src/3rdparty/webkit/Source/WebCore/dom/MutationEvent.h

https://bitbucket.org/ultra_iter/qt-vtl · C Header · 80 lines · 44 code · 14 blank · 22 comment · 0 complexity · 6d0f2a4e1414b2fec275d704c20f5ec3 MD5 · raw file

  1. /*
  2. * Copyright (C) 2001 Peter Kelly (pmk@post.com)
  3. * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
  4. * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
  5. * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Library General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Library General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Library General Public License
  18. * along with this library; see the file COPYING.LIB. If not, write to
  19. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. * Boston, MA 02110-1301, USA.
  21. *
  22. */
  23. #ifndef MutationEvent_h
  24. #define MutationEvent_h
  25. #include "Event.h"
  26. #include "Node.h"
  27. namespace WebCore {
  28. class MutationEvent : public Event {
  29. public:
  30. virtual ~MutationEvent();
  31. enum attrChangeType {
  32. MODIFICATION = 1,
  33. ADDITION = 2,
  34. REMOVAL = 3
  35. };
  36. static PassRefPtr<MutationEvent> create()
  37. {
  38. return adoptRef(new MutationEvent);
  39. }
  40. static PassRefPtr<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = 0,
  41. const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0)
  42. {
  43. return adoptRef(new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
  44. }
  45. void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
  46. const String& prevValue, const String& newValue,
  47. const String& attrName, unsigned short attrChange);
  48. Node* relatedNode() const { return m_relatedNode.get(); }
  49. String prevValue() const { return m_prevValue; }
  50. String newValue() const { return m_newValue; }
  51. String attrName() const { return m_attrName; }
  52. unsigned short attrChange() const { return m_attrChange; }
  53. virtual bool isMutationEvent() const;
  54. private:
  55. MutationEvent();
  56. MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
  57. const String& prevValue, const String& newValue,
  58. const String& attrName, unsigned short attrChange);
  59. RefPtr<Node> m_relatedNode;
  60. String m_prevValue;
  61. String m_newValue;
  62. String m_attrName;
  63. unsigned short m_attrChange;
  64. };
  65. } // namespace WebCore
  66. #endif // MutationEvent_h