~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/xpinstall/wizard/unix/src2/nsComponentList.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/*
 
3
 * The contents of this file are subject to the Netscape Public
 
4
 * License Version 1.1 (the "License"); you may not use this file
 
5
 * except in compliance with the License. You may obtain a copy of
 
6
 * the License at http://www.mozilla.org/NPL/
 
7
 *
 
8
 * Software distributed under the License is distributed on an "AS
 
9
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
10
 * implied. See the License for the specific language governing
 
11
 * rights and limitations under the License.
 
12
 *
 
13
 * The Original Code is Mozilla Communicator client code, 
 
14
 * released March 31, 1998. 
 
15
 *
 
16
 * The Initial Developer of the Original Code is Netscape Communications 
 
17
 * Corporation.  Portions created by Netscape are
 
18
 * Copyright (C) 1998 Netscape Communications Corporation. All
 
19
 * Rights Reserved.
 
20
 *
 
21
 * Contributor(s): 
 
22
 *     Samir Gehani <sgehani@netscape.com>
 
23
 */
 
24
 
 
25
#ifndef _NS_COMPONENTLIST_H_
 
26
#define _NS_COMPONENTLIST_H_
 
27
 
 
28
#include "XIErrors.h"
 
29
 
 
30
class nsComponent;
 
31
 
 
32
class nsComponentList
 
33
{
 
34
public:
 
35
    nsComponentList();
 
36
    ~nsComponentList();
 
37
 
 
38
    /**     
 
39
     * GetHead
 
40
     *
 
41
     * Initializes the next ptr to the second item and 
 
42
     * returns the head item.
 
43
     *
 
44
     * @return mHead    the head of the singly-linked list
 
45
     */
 
46
    nsComponent *   GetHead();
 
47
 
 
48
    /**
 
49
     * GetNext
 
50
     * 
 
51
     * Returns the next available item. GetHead() has to have 
 
52
     * been called prior calling this and after the last time
 
53
     * the entire list was iterated over.
 
54
     *
 
55
     * @return mNext    the next available component
 
56
     */
 
57
    nsComponent *   GetNext(); 
 
58
 
 
59
    /**
 
60
     * GetTail
 
61
     *
 
62
     * Returns the tail item of the list.
 
63
     *
 
64
     * @return mTail    the tail item of the list
 
65
     */
 
66
    nsComponent *   GetTail();
 
67
    
 
68
    /**
 
69
     * GetLength
 
70
     *
 
71
     * Returns the number of components held by this list.
 
72
     *
 
73
     * @return mLength  the size of this list
 
74
     */
 
75
    int             GetLength();
 
76
 
 
77
    /**
 
78
     * GetLengthVisible
 
79
     * 
 
80
     * Returns the number of visible components held by this list.
 
81
     *
 
82
     * @return numVisible   the number of visible components
 
83
     */
 
84
    int             GetLengthVisible();
 
85
 
 
86
    /**
 
87
     * GetLengthSelected
 
88
     *
 
89
     * Returns the number of selected components held by this list.
 
90
     *
 
91
     * @return numSleected  the number of selected components
 
92
     */
 
93
    int             GetLengthSelected();
 
94
 
 
95
    /**
 
96
     * AddComponent
 
97
     *
 
98
     * Adds the supplied component to the list's tail.
 
99
     *
 
100
     * @param aComponent    the component to add
 
101
     * @return err          integer err code (zero means OK)
 
102
     */
 
103
    int             AddComponent(nsComponent *aComponent);
 
104
 
 
105
    /**
 
106
     * RemoveComponent
 
107
     *
 
108
     * Searches the list and removes the first component that
 
109
     * matches the supplied component.
 
110
     *
 
111
     * @param aComponent    the component to remove
 
112
     * @return err          integer error code (zero means OK)
 
113
     */
 
114
    int             RemoveComponent(nsComponent *aComponent);
 
115
 
 
116
    /**
 
117
     * GetCompByIndex
 
118
     *
 
119
     * Searches the list and returns the first component that
 
120
     * matches the supplied index.
 
121
     *
 
122
     * @param aIndex        the index of the component being sought
 
123
     * @return comp         the component matching the index
 
124
     */
 
125
    nsComponent     *GetCompByIndex(int aIndex);
 
126
 
 
127
    /**
 
128
     * GetCompByArchive
 
129
     * 
 
130
     * Searches the list and returns the first component that matches
 
131
     * the archive name supplied.
 
132
     * 
 
133
     * @param aArchive      the archive name of the component
 
134
     * @return comp         the component matching the archive
 
135
     */
 
136
    nsComponent     *GetCompByArchive(char *aArchive);
 
137
 
 
138
    /**
 
139
     * GetCompByShortDesc
 
140
     *
 
141
     * Searches the list and returns the first component that matches
 
142
     * the short description supplied.
 
143
     *
 
144
     * @param aShortDesc    the short description of the component
 
145
     * @return comp         the component matching the short description
 
146
     */
 
147
    nsComponent     *GetCompByShortDesc(char *aShortDesc);
 
148
 
 
149
    /**
 
150
     * GetFirstVisible
 
151
     *
 
152
     * Returns the first component that doesn't have the invisible
 
153
     * attribute set.
 
154
     *
 
155
     * @return comp     the first visible component in this list
 
156
     */
 
157
    nsComponent     *GetFirstVisible();
 
158
 
 
159
private:
 
160
    nsComponent     *mHead; 
 
161
    nsComponent     *mTail;
 
162
    nsComponent     *mNext;
 
163
    int             mLength;
 
164
};
 
165
 
 
166
#endif /* _NS_COMPONENTLIST_H_ */