Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/security/manager/pki/nsASN1Tree.h
Line
Count
Source (jump to first uncovered line)
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_
6
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"
16
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
  }
24
25
26
class nsNSSASN1Tree : public nsIASN1Tree
27
{
28
public:
29
  NS_DECL_THREADSAFE_ISUPPORTS
30
  NS_DECL_NSIASN1TREE
31
  NS_DECL_NSITREEVIEW
32
33
  nsNSSASN1Tree();
34
protected:
35
  virtual ~nsNSSASN1Tree();
36
37
  class myNode
38
  {
39
  public:
40
    nsCOMPtr<nsIASN1Object> obj;
41
    nsCOMPtr<nsIASN1Sequence> seq;
42
    myNode *child;
43
    myNode *next;
44
    myNode *parent;
45
46
0
    myNode() {
47
0
      child = next = parent = nullptr;
48
0
    }
49
  };
50
51
  myNode *mTopNode;
52
53
  nsCOMPtr<nsIASN1Object> mASN1Object;
54
  nsCOMPtr<nsITreeSelection> mSelection;
55
  nsCOMPtr<nsITreeBoxObject> mTree;
56
57
  void InitNodes();
58
  void InitChildsRecursively(myNode *n);
59
60
  void ClearNodes();
61
  void ClearNodesRecursively(myNode *n);
62
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);
70
71
};
72
#endif //_NSSASNTREE_H_