2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-05-17 06:33:42 +04:00
|
|
|
|
|
|
|
#ifndef __inDOMView_h__
|
|
|
|
#define __inDOMView_h__
|
|
|
|
|
|
|
|
#include "inIDOMView.h"
|
2006-05-17 06:37:41 +04:00
|
|
|
#include "inIDOMUtils.h"
|
2006-05-17 06:33:42 +04:00
|
|
|
|
2006-05-17 06:34:33 +04:00
|
|
|
#include "nsITreeView.h"
|
|
|
|
#include "nsITreeSelection.h"
|
2007-03-10 16:49:43 +03:00
|
|
|
#include "nsStubMutationObserver.h"
|
2006-05-17 06:33:42 +04:00
|
|
|
#include "nsIDOMNode.h"
|
|
|
|
#include "nsIDOMDocument.h"
|
2009-02-03 17:42:18 +03:00
|
|
|
#include "nsTArray.h"
|
2006-05-17 06:38:00 +04:00
|
|
|
#include "nsCOMArray.h"
|
2013-01-07 04:54:42 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2006-05-17 06:33:42 +04:00
|
|
|
|
|
|
|
class inDOMViewNode;
|
2013-03-10 12:00:33 +04:00
|
|
|
class nsIDOMMozNamedAttrMap;
|
2006-05-17 06:33:42 +04:00
|
|
|
|
|
|
|
class inDOMView : public inIDOMView,
|
2006-05-17 06:34:33 +04:00
|
|
|
public nsITreeView,
|
2007-03-10 16:49:43 +03:00
|
|
|
public nsStubMutationObserver
|
2006-05-17 06:33:42 +04:00
|
|
|
{
|
|
|
|
public:
|
2006-05-17 06:38:00 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_INIDOMVIEW
|
|
|
|
NS_DECL_NSITREEVIEW
|
|
|
|
|
|
|
|
inDOMView();
|
2006-05-17 06:33:42 +04:00
|
|
|
|
2006-07-02 11:23:10 +04:00
|
|
|
// nsIMutationObserver
|
2007-03-10 16:49:43 +03:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
|
2006-05-17 06:33:42 +04:00
|
|
|
|
|
|
|
protected:
|
2014-06-24 02:40:01 +04:00
|
|
|
virtual ~inDOMView();
|
|
|
|
|
2006-05-17 06:34:33 +04:00
|
|
|
nsCOMPtr<nsITreeBoxObject> mTree;
|
|
|
|
nsCOMPtr<nsITreeSelection> mSelection;
|
2006-05-17 06:37:41 +04:00
|
|
|
nsCOMPtr<inIDOMUtils> mDOMUtils;
|
2006-05-17 06:33:42 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mShowAnonymous;
|
|
|
|
bool mShowSubDocuments;
|
|
|
|
bool mShowWhitespaceNodes;
|
|
|
|
bool mShowAccessibleNodes;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mWhatToShow;
|
2006-05-17 06:33:42 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMNode> mRootNode;
|
|
|
|
nsCOMPtr<nsIDOMDocument> mRootDocument;
|
|
|
|
|
2009-02-03 17:42:18 +03:00
|
|
|
nsTArray<inDOMViewNode*> mNodes;
|
2006-05-17 06:33:42 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
inDOMViewNode* GetNodeAt(int32_t aIndex);
|
|
|
|
int32_t GetRowCount();
|
|
|
|
int32_t NodeToRow(inDOMViewNode* aNode);
|
|
|
|
bool RowOutOfBounds(int32_t aRow, int32_t aCount);
|
2006-05-17 06:33:42 +04:00
|
|
|
inDOMViewNode* CreateNode(nsIDOMNode* aNode, inDOMViewNode* aParent);
|
|
|
|
void AppendNode(inDOMViewNode* aNode);
|
2012-08-22 19:56:38 +04:00
|
|
|
void InsertNode(inDOMViewNode* aNode, int32_t aIndex);
|
|
|
|
void RemoveNode(int32_t aIndex);
|
|
|
|
void ReplaceNode(inDOMViewNode* aNode, int32_t aIndex);
|
|
|
|
void InsertNodes(nsTArray<inDOMViewNode*>& aNodes, int32_t aIndex);
|
|
|
|
void RemoveNodes(int32_t aIndex, int32_t aCount);
|
2006-05-17 06:33:42 +04:00
|
|
|
void RemoveAllNodes();
|
2012-08-22 19:56:38 +04:00
|
|
|
void ExpandNode(int32_t aRow);
|
|
|
|
void CollapseNode(int32_t aRow);
|
2006-05-17 06:33:42 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult RowToNode(int32_t aRow, inDOMViewNode** aNode);
|
|
|
|
nsresult NodeToRow(nsIDOMNode* aNode, int32_t* aRow);
|
2006-05-17 06:33:42 +04:00
|
|
|
|
|
|
|
void InsertLinkAfter(inDOMViewNode* aNode, inDOMViewNode* aInsertAfter);
|
|
|
|
void InsertLinkBefore(inDOMViewNode* aNode, inDOMViewNode* aInsertBefore);
|
|
|
|
void RemoveLink(inDOMViewNode* aNode);
|
|
|
|
void ReplaceLink(inDOMViewNode* aNewNode, inDOMViewNode* aOldNode);
|
|
|
|
|
2006-05-17 06:38:00 +04:00
|
|
|
nsresult GetChildNodesFor(nsIDOMNode* aNode, nsCOMArray<nsIDOMNode>& aResult);
|
|
|
|
nsresult AppendKidsToArray(nsIDOMNodeList* aKids, nsCOMArray<nsIDOMNode>& aArray);
|
2013-03-10 12:00:33 +04:00
|
|
|
nsresult AppendAttrsToArray(nsIDOMMozNamedAttrMap* aKids, nsCOMArray<nsIDOMNode>& aArray);
|
2012-08-22 19:56:38 +04:00
|
|
|
nsresult GetFirstDescendantOf(inDOMViewNode* aNode, int32_t aRow, int32_t* aResult);
|
|
|
|
nsresult GetLastDescendantOf(inDOMViewNode* aNode, int32_t aRow, int32_t* aResult);
|
2006-05-17 06:33:42 +04:00
|
|
|
nsresult GetRealPreviousSibling(nsIDOMNode* aNode, nsIDOMNode* aRealParent, nsIDOMNode** aSibling);
|
|
|
|
};
|
|
|
|
|
2006-05-19 22:59:39 +04:00
|
|
|
// {FB5C1775-1BBD-4b9c-ABB0-AE7ACD29E87E}
|
|
|
|
#define IN_DOMVIEW_CID \
|
|
|
|
{ 0xfb5c1775, 0x1bbd, 0x4b9c, { 0xab, 0xb0, 0xae, 0x7a, 0xcd, 0x29, 0xe8, 0x7e } }
|
|
|
|
|
2006-05-17 06:33:42 +04:00
|
|
|
#endif // __inDOMView_h__
|
|
|
|
|
|
|
|
|