1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 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/
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.
13
* The Original Code is Mozilla Communicator client code,
14
* released March 31, 1998.
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
22
* Samir Gehani <sgehani@netscape.com>
25
#ifndef _NS_COMPONENTLIST_H_
26
#define _NS_COMPONENTLIST_H_
41
* Initializes the next ptr to the second item and
42
* returns the head item.
44
* @return mHead the head of the singly-linked list
46
nsComponent * GetHead();
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.
55
* @return mNext the next available component
57
nsComponent * GetNext();
62
* Returns the tail item of the list.
64
* @return mTail the tail item of the list
66
nsComponent * GetTail();
71
* Returns the number of components held by this list.
73
* @return mLength the size of this list
80
* Returns the number of visible components held by this list.
82
* @return numVisible the number of visible components
84
int GetLengthVisible();
89
* Returns the number of selected components held by this list.
91
* @return numSleected the number of selected components
93
int GetLengthSelected();
98
* Adds the supplied component to the list's tail.
100
* @param aComponent the component to add
101
* @return err integer err code (zero means OK)
103
int AddComponent(nsComponent *aComponent);
108
* Searches the list and removes the first component that
109
* matches the supplied component.
111
* @param aComponent the component to remove
112
* @return err integer error code (zero means OK)
114
int RemoveComponent(nsComponent *aComponent);
119
* Searches the list and returns the first component that
120
* matches the supplied index.
122
* @param aIndex the index of the component being sought
123
* @return comp the component matching the index
125
nsComponent *GetCompByIndex(int aIndex);
130
* Searches the list and returns the first component that matches
131
* the archive name supplied.
133
* @param aArchive the archive name of the component
134
* @return comp the component matching the archive
136
nsComponent *GetCompByArchive(char *aArchive);
141
* Searches the list and returns the first component that matches
142
* the short description supplied.
144
* @param aShortDesc the short description of the component
145
* @return comp the component matching the short description
147
nsComponent *GetCompByShortDesc(char *aShortDesc);
152
* Returns the first component that doesn't have the invisible
155
* @return comp the first visible component in this list
157
nsComponent *GetFirstVisible();
166
#endif /* _NS_COMPONENTLIST_H_ */