• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

objectnamelist.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           objectnamelist.h  -  description
00003                              -------------------
00004     begin                : Mon Feb 18 2002
00005     copyright            : (C) 2002 by Thomas Kabelmann
00006     email                : tk78@gmx.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef OBJECTNAMELIST_H
00019 #define OBJECTNAMELIST_H
00020 
00021 
00032 #include <qglobal.h>
00033 #include <qptrlist.h>
00034 #include <qstring.h>
00035 
00036 class SkyObject;
00037 class SkyObjectName;
00038 
00040 template <class T> class SortedList : public QPtrList <T> {
00041  protected:
00042   int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) {
00043     if ( *((T*)item1) == *((T*)item2) ) return 0;
00044     return ( *((T*)item1) < *((T*)item2) ) ? -1 : 1;
00045   }
00046 };
00047 
00048 class ObjectNameList {
00049 
00050     public:
00052         ObjectNameList();
00053 
00055         ~ObjectNameList();
00056 
00062         void append(SkyObject *object, bool useLongName=false);
00063 
00074         SkyObjectName* first(const QString &name = QString::null);
00075 
00082         SkyObjectName* next();
00083 
00090         SkyObjectName* find(const QString &name = QString::null);
00091 
00096         void remove( const QString &name = QString::null );
00097 
00100         enum Language { local = 0, latin = 1 };
00101 
00105         void setLanguage( Language lang );
00106 
00112         void setLanguage( bool lang );
00113 
00116         uint count() const { return amount; }
00117 
00118     private:
00119 
00123         void sort();
00124 
00125 
00131         int getIndex( const QString &name = QString::null );
00132 
00138         enum Mode { allLists, oneList } mode;
00139 
00143         void setMode( Mode m );
00144 
00150         SortedList <SkyObjectName> list[2][27];
00151 
00153         bool unsorted[27];
00154 
00161         QPtrList <SkyObjectName> constellations;
00162 
00166         int currentIndex;
00167         
00168         Language language;
00169 
00170         unsigned int amount;
00171 };
00172 
00173 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal