1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/manager/pki/src/nsASN1Tree.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,72 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 +#ifndef _NSSASNTREE_H_ 1.8 +#define _NSSASNTREE_H_ 1.9 + 1.10 +#include "nscore.h" 1.11 +#include "nsIX509Cert.h" 1.12 +#include "nsIASN1Tree.h" 1.13 +#include "nsIASN1Object.h" 1.14 +#include "nsIASN1Sequence.h" 1.15 +#include "nsITreeView.h" 1.16 +#include "nsITreeBoxObject.h" 1.17 +#include "nsITreeSelection.h" 1.18 +#include "nsCOMPtr.h" 1.19 + 1.20 +//4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606 1.21 +#define NS_NSSASN1OUTINER_CID { \ 1.22 + 0x4bfaa9f0, \ 1.23 + 0x1dd2, \ 1.24 + 0x11b2, \ 1.25 + {0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \ 1.26 + } 1.27 + 1.28 + 1.29 +class nsNSSASN1Tree : public nsIASN1Tree 1.30 +{ 1.31 +public: 1.32 + NS_DECL_THREADSAFE_ISUPPORTS 1.33 + NS_DECL_NSIASN1TREE 1.34 + NS_DECL_NSITREEVIEW 1.35 + 1.36 + nsNSSASN1Tree(); 1.37 + virtual ~nsNSSASN1Tree(); 1.38 +protected: 1.39 + 1.40 + class myNode 1.41 + { 1.42 + public: 1.43 + nsCOMPtr<nsIASN1Object> obj; 1.44 + nsCOMPtr<nsIASN1Sequence> seq; 1.45 + myNode *child; 1.46 + myNode *next; 1.47 + myNode *parent; 1.48 + 1.49 + myNode() { 1.50 + child = next = parent = nullptr; 1.51 + } 1.52 + }; 1.53 + 1.54 + myNode *mTopNode; 1.55 + 1.56 + nsCOMPtr<nsIASN1Object> mASN1Object; 1.57 + nsCOMPtr<nsITreeSelection> mSelection; 1.58 + nsCOMPtr<nsITreeBoxObject> mTree; 1.59 + 1.60 + void InitNodes(); 1.61 + void InitChildsRecursively(myNode *n); 1.62 + 1.63 + void ClearNodes(); 1.64 + void ClearNodesRecursively(myNode *n); 1.65 + 1.66 + int32_t CountVisibleNodes(myNode *n); 1.67 + myNode *FindNodeFromIndex(myNode *n, int32_t wantedIndex, 1.68 + int32_t &index_counter, int32_t &level_counter, 1.69 + int32_t *optionalOutParentIndex, int32_t *optionalOutLevel); 1.70 + myNode *FindNodeFromIndex(int32_t wantedIndex, 1.71 + int32_t *optionalOutParentIndex = nullptr, 1.72 + int32_t *optionalOutLevel = nullptr); 1.73 + 1.74 +}; 1.75 +#endif //_NSSASNTREE_H_