security/manager/pki/src/nsASN1Tree.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     4 #ifndef _NSSASNTREE_H_
     5 #define _NSSASNTREE_H_
     7 #include "nscore.h"
     8 #include "nsIX509Cert.h"
     9 #include "nsIASN1Tree.h"
    10 #include "nsIASN1Object.h"
    11 #include "nsIASN1Sequence.h"
    12 #include "nsITreeView.h"
    13 #include "nsITreeBoxObject.h"
    14 #include "nsITreeSelection.h"
    15 #include "nsCOMPtr.h"
    17 //4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606
    18 #define NS_NSSASN1OUTINER_CID  {             \
    19    0x4bfaa9f0,                               \
    20    0x1dd2,                                   \
    21    0x11b2,                                   \
    22    {0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \
    23   }
    26 class nsNSSASN1Tree : public nsIASN1Tree
    27 {
    28 public:
    29   NS_DECL_THREADSAFE_ISUPPORTS
    30   NS_DECL_NSIASN1TREE
    31   NS_DECL_NSITREEVIEW
    33   nsNSSASN1Tree();
    34   virtual ~nsNSSASN1Tree();
    35 protected:
    37   class myNode
    38   {
    39   public:
    40     nsCOMPtr<nsIASN1Object> obj;
    41     nsCOMPtr<nsIASN1Sequence> seq;
    42     myNode *child;
    43     myNode *next;
    44     myNode *parent;
    46     myNode() {
    47       child = next = parent = nullptr;
    48     }
    49   };
    51   myNode *mTopNode;
    53   nsCOMPtr<nsIASN1Object> mASN1Object;
    54   nsCOMPtr<nsITreeSelection> mSelection;
    55   nsCOMPtr<nsITreeBoxObject> mTree;
    57   void InitNodes();
    58   void InitChildsRecursively(myNode *n);
    60   void ClearNodes();
    61   void ClearNodesRecursively(myNode *n);
    63   int32_t CountVisibleNodes(myNode *n);
    64   myNode *FindNodeFromIndex(myNode *n, int32_t wantedIndex,
    65                             int32_t &index_counter, int32_t &level_counter,
    66                             int32_t *optionalOutParentIndex, int32_t *optionalOutLevel);
    67   myNode *FindNodeFromIndex(int32_t wantedIndex, 
    68                             int32_t *optionalOutParentIndex = nullptr, 
    69                             int32_t *optionalOutLevel = nullptr);
    71 };
    72 #endif //_NSSASNTREE_H_

mercurial