Blame src/reflist.h

Packit Service 50c9f2
/******************************************************************************
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Permission to use, copy, modify, and distribute this software and its
Packit Service 50c9f2
 * documentation under the terms of the GNU General Public License is hereby 
Packit Service 50c9f2
 * granted. No representations are made about the suitability of this software 
Packit Service 50c9f2
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit Service 50c9f2
 * See the GNU General Public License for more details.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Documents produced by Doxygen are derivative works derived from the
Packit Service 50c9f2
 * input used in their production; they are not affected by this license.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 */
Packit Service 50c9f2
Packit Service 50c9f2
#ifndef _REFLIST_H
Packit Service 50c9f2
#define _REFLIST_H
Packit Service 50c9f2
Packit Service 50c9f2
#include <qintdict.h>
Packit Service 50c9f2
#include <qlist.h>
Packit Service 50c9f2
#include "sortdict.h"
Packit Service 50c9f2
Packit Service 50c9f2
class Definition;
Packit Service 50c9f2
Packit Service 50c9f2
/** This struct represents an item in the list of references. */
Packit Service 50c9f2
struct RefItem
Packit Service 50c9f2
{
Packit Service 50c9f2
  RefItem() : scope(0) {}
Packit Service 50c9f2
  QCString text;           //!< text of the item.
Packit Service 50c9f2
  QCString listAnchor;     //!< anchor in the list
Packit Service 50c9f2
Packit Service 50c9f2
  QCString prefix;         //!< type prefix for the name
Packit Service 50c9f2
  Definition *scope;       //!< scope to use for references.
Packit Service 50c9f2
  QCString name;           //!< name of the entity containing the reference
Packit Service 50c9f2
  QCString title;          //!< display name of the entity
Packit Service 50c9f2
  QCString args;           //!< optional arguments for the entity (if function)
Packit Service 50c9f2
  //bool written;
Packit Service 50c9f2
  QList<RefItem> extraItems; //!< more items belonging to the same entity
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** List of items sorted by title */
Packit Service 50c9f2
class SortedRefItems : public SDict<RefItem>
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    SortedRefItems(int size=17) : SDict<RefItem>(size) {}
Packit Service 50c9f2
    virtual ~SortedRefItems() {}
Packit Service 50c9f2
  private:
Packit Service 50c9f2
    int compareValues(const RefItem *r1,const RefItem *r2) const
Packit Service 50c9f2
    {
Packit Service 50c9f2
      return qstricmp(r1->title,r2->title);
Packit Service 50c9f2
    }
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/** List of cross-referenced items 
Packit Service 50c9f2
 * 
Packit Service 50c9f2
 *  This class represents a list of items that are put
Packit Service 50c9f2
 *  at a certain point in the documentation by some special command 
Packit Service 50c9f2
 *  and are collected in a list. The items cross-reference the 
Packit Service 50c9f2
 *  documentation and the list.
Packit Service 50c9f2
 *
Packit Service 50c9f2
 *  Examples are the todo list, the test list and the bug list,
Packit Service 50c9f2
 *  introduced by the \\todo, \\test, and \\bug commands respectively.
Packit Service 50c9f2
 */
Packit Service 50c9f2
class RefList
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    int      addRefItem();
Packit Service 50c9f2
    RefItem *getRefItem(int todoItemId);
Packit Service 50c9f2
    RefItem *getFirstRefItem();
Packit Service 50c9f2
    RefItem *getNextRefItem();
Packit Service 50c9f2
    QCString listName() const;
Packit Service 50c9f2
    QCString fileName() const;
Packit Service 50c9f2
    QCString pageTitle() const;
Packit Service 50c9f2
    QCString sectionTitle() const;
Packit Service 50c9f2
Packit Service 50c9f2
    RefList(const char *listName,
Packit Service 50c9f2
            const char *pageTitle,const char *secTitle
Packit Service 50c9f2
           );
Packit Service 50c9f2
   ~RefList();
Packit Service 50c9f2
    void insertIntoList(const char *key,RefItem *item);
Packit Service 50c9f2
    void generatePage();
Packit Service 50c9f2
Packit Service 50c9f2
  private:
Packit Service 50c9f2
    int m_id;
Packit Service 50c9f2
    QCString m_listName;
Packit Service 50c9f2
    QCString m_fileName;
Packit Service 50c9f2
    QCString m_pageTitle;
Packit Service 50c9f2
    QCString m_secTitle;
Packit Service 50c9f2
    SortedRefItems *m_itemList;
Packit Service 50c9f2
    QIntDict<RefItem> *m_dict;
Packit Service 50c9f2
    QIntDictIterator<RefItem> *m_dictIterator;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
#endif