diff -r 000000000000 -r 6474c204b198 security/manager/pki/src/nsASN1Tree.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/security/manager/pki/src/nsASN1Tree.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,72 @@ +/* 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/. */ +#ifndef _NSSASNTREE_H_ +#define _NSSASNTREE_H_ + +#include "nscore.h" +#include "nsIX509Cert.h" +#include "nsIASN1Tree.h" +#include "nsIASN1Object.h" +#include "nsIASN1Sequence.h" +#include "nsITreeView.h" +#include "nsITreeBoxObject.h" +#include "nsITreeSelection.h" +#include "nsCOMPtr.h" + +//4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606 +#define NS_NSSASN1OUTINER_CID { \ + 0x4bfaa9f0, \ + 0x1dd2, \ + 0x11b2, \ + {0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \ + } + + +class nsNSSASN1Tree : public nsIASN1Tree +{ +public: + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_NSIASN1TREE + NS_DECL_NSITREEVIEW + + nsNSSASN1Tree(); + virtual ~nsNSSASN1Tree(); +protected: + + class myNode + { + public: + nsCOMPtr obj; + nsCOMPtr seq; + myNode *child; + myNode *next; + myNode *parent; + + myNode() { + child = next = parent = nullptr; + } + }; + + myNode *mTopNode; + + nsCOMPtr mASN1Object; + nsCOMPtr mSelection; + nsCOMPtr mTree; + + void InitNodes(); + void InitChildsRecursively(myNode *n); + + void ClearNodes(); + void ClearNodesRecursively(myNode *n); + + int32_t CountVisibleNodes(myNode *n); + myNode *FindNodeFromIndex(myNode *n, int32_t wantedIndex, + int32_t &index_counter, int32_t &level_counter, + int32_t *optionalOutParentIndex, int32_t *optionalOutLevel); + myNode *FindNodeFromIndex(int32_t wantedIndex, + int32_t *optionalOutParentIndex = nullptr, + int32_t *optionalOutLevel = nullptr); + +}; +#endif //_NSSASNTREE_H_