]> Git trees. - libqmvoc.git/commitdiff
adding API documentation
authorMartin Pfeiffer <hubipete@gmx.net>
Thu, 20 Oct 2005 22:14:50 +0000 (22:14 +0000)
committerMartin Pfeiffer <hubipete@gmx.net>
Thu, 20 Oct 2005 22:14:50 +0000 (22:14 +0000)
svn path=/trunk/KDE/kdeedu/kwordquiz/src/leitnersystem.cpp; revision=472496

kwordquiz/leitnersystem.cpp
kwordquiz/leitnersystem.h

index 80955202c4326e0fa365243ff592854d4dfd1ec1..f7d662712ebbf1be0587e920f109df6c78579516 100644 (file)
@@ -50,7 +50,7 @@ LeitnerBox* LeitnerSystem::boxWithNumber( int number )
        return &m_boxes[ number ];
 }
 
-LeitnerBox* LeitnerSystem::boxWithName( const QString& name )
+LeitnerBox* LeitnerSystem::boxWithName( const QString& name ) const
 {
        foreach( LeitnerBox box, m_boxes )
        {
@@ -61,7 +61,7 @@ LeitnerBox* LeitnerSystem::boxWithName( const QString& name )
        return 0;
 }
 
-QString& LeitnerSystem::systemName() 
+QString& LeitnerSystem::systemName()
 {
        return m_systemName;
 }
@@ -145,7 +145,7 @@ void LeitnerSystem::setSystemName( const QString& name )
        m_systemName = name;
 }
 
-int LeitnerSystem::number( LeitnerBox* box )
+int LeitnerSystem::number( LeitnerBox* box ) const
 {
        if( box == 0 )
                return -1;
@@ -199,9 +199,9 @@ void LeitnerSystem::setWrongBox( const QString& box, const QString& wrongWordBox
        boxWithName( box )->setWrongWordBox( boxWithName( wrongWordBox ) );
 }
 
-const QString& LeitnerSystem::box( int i )
+const QString& LeitnerSystem::box( int i ) const
 {
-       return boxWithNumber( i )->boxName();
+       return m_boxes[ i ].boxName();
 }
 
 void LeitnerSystem::setBoxVocabCount( QString& box, int vocabCount )
index d3eede2d2416a642479ca431cc757975fca773f5..c7ed88217643ff5376c8f650d72e6ae2178266d8 100644 (file)
 class LeitnerSystem
 {
 public:
+       /**Constructor without arguments*/
        LeitnerSystem();
+
+       /**Constructor with arguments
+        * @param boxes reference to a QList of LeitnerBox
+        * @param name the new LeitnerSystems name
+        */
        LeitnerSystem( QList<LeitnerBox>& boxes, QString name );
 
+       /**Destructor*/
        ~LeitnerSystem();
 
-       int getNumberOfBoxes() const;                   //returns the number of boxes in the system
-       QStringList getBoxNameList();                   //returns a list with the boxes names
-
-       QString& systemName();                  //returns the systems name
-       void setSystemName( const QString& name );      //sets the systems name
-
-       LeitnerBox* boxWithNumber( int number );        //returns box by number
-       LeitnerBox* boxWithName( const QString& name ); //returns box by name
-       int number( LeitnerBox* box );
-       const QString& box( int i );
-
-       const QString& nextBox( QString& previousBox ); //returns the next box for the next question
+       /**Returns the number of LeitnerBoxes contained by this LeitnerSystem
+        * @return the number of LeitnerBoxes as integer
+        */
+       int getNumberOfBoxes() const;
+
+       /**Returns a QStringList with all the LeitnerBoxes' names
+        * @return a QStringList with all names
+        */
+       QStringList getBoxNameList();
+
+       /**Returns the LeitnerSystem's name
+        * @return the LeitnerSystem's name as reference to QString
+        */
+       QString& systemName();
+
+       /**Sets the LeitnerSystem's name
+        * @param the new name as QString
+        */
+       void setSystemName( const QString& name );
+
+       /**Returns a LeitnerBox by number
+        * @param the number of the LeitnerBox to be returned
+        * @return a pointer to the LeitnerBox with the number
+        */
+       LeitnerBox* boxWithNumber( int number );
+
+       /**Returns a LeitnerBox by name
+        * @param the name of the LeitnerBox to be returned
+        * @return a pointer to the LeitnerBox with the name
+        */
+       LeitnerBox* boxWithName( const QString& name ) const;
+
+       /**Returns the number of the given LeitnerBox
+        * @param a pointer to the LeitnerBox
+        * @return the number of the given LeitnerBox
+        */
+       int number( LeitnerBox* box ) const;
+
+       /**Returns the name of the LeitnerBox with number @param i
+        * @param the LeitnerBox's number
+        * @return the name of the LeitnerBox with number @param i
+        */
+       const QString& box( int i ) const;
+
+       /**Returns the LeitnerBox following @param previousBox
+        * @param the name of the LeitnerBox
+        * @return the name of the LeitnerBox following previousBox
+        */
+       const QString& nextBox( QString& previousBox );
 
        const QString& correctBox( int box );   //returns the correct word box of "int box"
        const QString& wrongBox( int box );             //returns the wrong word box of "int box"