michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef _NSSASNTREE_H_ michael@0: #define _NSSASNTREE_H_ michael@0: michael@0: #include "nscore.h" michael@0: #include "nsIX509Cert.h" michael@0: #include "nsIASN1Tree.h" michael@0: #include "nsIASN1Object.h" michael@0: #include "nsIASN1Sequence.h" michael@0: #include "nsITreeView.h" michael@0: #include "nsITreeBoxObject.h" michael@0: #include "nsITreeSelection.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: //4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606 michael@0: #define NS_NSSASN1OUTINER_CID { \ michael@0: 0x4bfaa9f0, \ michael@0: 0x1dd2, \ michael@0: 0x11b2, \ michael@0: {0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \ michael@0: } michael@0: michael@0: michael@0: class nsNSSASN1Tree : public nsIASN1Tree michael@0: { michael@0: public: michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: NS_DECL_NSIASN1TREE michael@0: NS_DECL_NSITREEVIEW michael@0: michael@0: nsNSSASN1Tree(); michael@0: virtual ~nsNSSASN1Tree(); michael@0: protected: michael@0: michael@0: class myNode michael@0: { michael@0: public: michael@0: nsCOMPtr obj; michael@0: nsCOMPtr seq; michael@0: myNode *child; michael@0: myNode *next; michael@0: myNode *parent; michael@0: michael@0: myNode() { michael@0: child = next = parent = nullptr; michael@0: } michael@0: }; michael@0: michael@0: myNode *mTopNode; michael@0: michael@0: nsCOMPtr mASN1Object; michael@0: nsCOMPtr mSelection; michael@0: nsCOMPtr mTree; michael@0: michael@0: void InitNodes(); michael@0: void InitChildsRecursively(myNode *n); michael@0: michael@0: void ClearNodes(); michael@0: void ClearNodesRecursively(myNode *n); michael@0: michael@0: int32_t CountVisibleNodes(myNode *n); michael@0: myNode *FindNodeFromIndex(myNode *n, int32_t wantedIndex, michael@0: int32_t &index_counter, int32_t &level_counter, michael@0: int32_t *optionalOutParentIndex, int32_t *optionalOutLevel); michael@0: myNode *FindNodeFromIndex(int32_t wantedIndex, michael@0: int32_t *optionalOutParentIndex = nullptr, michael@0: int32_t *optionalOutLevel = nullptr); michael@0: michael@0: }; michael@0: #endif //_NSSASNTREE_H_