kstars
ObjectNameList Class Reference
This class provides an interface like a QPtrList, but sorts objects internally in 27 lists. More...
#include <objectnamelist.h>
Public Types | |
enum | Language { local = 0, latin = 1 } |
Public Member Functions | |
void | append (SkyObject *object, bool useLongName=false) |
uint | count () const |
SkyObjectName * | find (const QString &name=QString::null) |
SkyObjectName * | first (const QString &name=QString::null) |
SkyObjectName * | next () |
ObjectNameList () | |
void | remove (const QString &name=QString::null) |
void | setLanguage (bool lang) |
void | setLanguage (Language lang) |
~ObjectNameList () |
Detailed Description
This class provides an interface like a QPtrList, but sorts objects internally in 27 lists.The objects are sorted alphabetically. List 0 contains all objects beginning not with a letter. List 1 - 26 contains objects beginning with a letter. The number of the list is similar to positon of letter in alphabet. (A = 1 .. Z = 26 )
- Version:
- 1.0
Definition at line 48 of file objectnamelist.h.
Member Enumeration Documentation
Define the language which should be used for constellation names.
Definition at line 100 of file objectnamelist.h.
Constructor & Destructor Documentation
ObjectNameList::ObjectNameList | ( | ) |
ObjectNameList::~ObjectNameList | ( | ) |
Member Function Documentation
void ObjectNameList::append | ( | SkyObject * | object, | |
bool | useLongName = false | |||
) |
Appends a skyobject to the list.
- Parameters:
-
object pointer to the SkyObject to be appended to the list. useLongName if TRUE, use the longname of the object, rather than the primary name
Definition at line 55 of file objectnamelist.cpp.
uint ObjectNameList::count | ( | ) | const [inline] |
- Returns:
- the total count of the number of named objects.
Definition at line 116 of file objectnamelist.h.
SkyObjectName * ObjectNameList::find | ( | const QString & | name = QString::null |
) |
- Returns:
- pointer to the object, if it is in one of the lists; otherwise return the NULL pointer.
- Note:
- This function is case sensitive.
- Parameters:
-
name name of object to find.
- Returns:
- pointer to object with the given name
Definition at line 191 of file objectnamelist.cpp.
SkyObjectName * ObjectNameList::first | ( | const QString & | name = QString::null |
) |
Select the list which contains objects whose names begin with the same letter as the argument.
The selected list ID is recorded in an internal variable, so it is persistent.
- Note:
- This function is case insensitive.
if no string is given, then the first list is selected, and also a flag is set so that all lists will be traversed by the next() function.
- Returns:
- pointer to the first object in the selected list.
- Parameters:
-
name the name to use in selecting a list.
Definition at line 97 of file objectnamelist.cpp.
SkyObjectName * ObjectNameList::next | ( | ) |
Returns next object in the currently selected list.
- Returns:
- pointer to the next object in the current list, or NULL if the end of the list was reached.
- Note:
- if the "all lists" flag is set, then it will traverse all lists before returning NULL.
Definition at line 123 of file objectnamelist.cpp.
void ObjectNameList::remove | ( | const QString & | name = QString::null |
) |
remove the named object from the list.
- Parameters:
-
name the name of the object to be removed.
- Note:
- If the object is not found, then nothing happens.
Definition at line 182 of file objectnamelist.cpp.
void ObjectNameList::setLanguage | ( | bool | lang | ) |
Change constellation-name language option.
This function behaves just like the above function; it differs only in the data type of its argument.
- Parameters:
-
lang the language to use (0=local; 1=latin)
Definition at line 47 of file objectnamelist.cpp.
void ObjectNameList::setLanguage | ( | Language | lang | ) |
Change constellation-name language option.
- Parameters:
-
lang the language to use (0=local; 1=latin)
Definition at line 43 of file objectnamelist.cpp.
The documentation for this class was generated from the following files: