reflist.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef _REFLIST_H
20 #define _REFLIST_H
21 
22 #include <qintdict.h>
23 #include <qlist.h>
24 #include "sortdict.h"
25 
26 class Definition;
27 
28 /** This struct represents an item in the list of references. */
29 struct RefItem
30 {
31  RefItem() : scope(0) {}
32  QCString text; //!< text of the item.
33  QCString listAnchor; //!< anchor in the list
34 
35  QCString prefix; //!< type prefix for the name
36  Definition *scope; //!< scope to use for references.
37  QCString name; //!< name of the entity containing the reference
38  QCString title; //!< display name of the entity
39  QCString args; //!< optional arguments for the entity (if function)
40  //bool written;
41  QList<RefItem> extraItems; //!< more items belonging to the same entity
42 };
43 
44 /** List of items sorted by title */
45 class SortedRefItems : public SDict<RefItem>
46 {
47  public:
49  virtual ~SortedRefItems() {}
50  private:
51  int compareValues(const RefItem *r1,const RefItem *r2) const
52  {
53  return qstricmp(r1->title,r2->title);
54  }
55 };
56 
57 /** List of cross-referenced items
58  *
59  * This class represents a list of items that are put
60  * at a certain point in the documentation by some special command
61  * and are collected in a list. The items cross-reference the
62  * documentation and the list.
63  *
64  * Examples are the todo list, the test list and the bug list,
65  * introduced by the \\todo, \\test, and \\bug commands respectively.
66  */
67 class RefList
68 {
69  public:
70  int addRefItem();
71  RefItem *getRefItem(int todoItemId);
72  RefItem *getFirstRefItem();
73  RefItem *getNextRefItem();
74  QCString listName() const;
75  QCString fileName() const;
76  QCString pageTitle() const;
77  QCString sectionTitle() const;
78 
79  RefList(const char *listName,
80  const char *pageTitle,const char *secTitle
81  );
82  ~RefList();
83  void insertIntoList(const char *key,RefItem *item);
84  void generatePage();
85 
86  private:
87  int m_id;
95 };
96 
97 #endif
QCString listAnchor
anchor in the list
Definition: reflist.h:33
QCString prefix
type prefix for the name
Definition: reflist.h:35
QCString title
display name of the entity
Definition: reflist.h:38
QCString m_pageTitle
Definition: reflist.h:90
SortedRefItems(int size=17)
Definition: reflist.h:48
QCString text
text of the item.
Definition: reflist.h:32
static QCString sectionTitle
Definition: scanner.cpp:10886
int compareValues(const RefItem *r1, const RefItem *r2) const
Definition: reflist.h:51
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
Definition: sortdict.h:73
QIntDictIterator< RefItem > * m_dictIterator
Definition: reflist.h:94
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:567
fileName
Definition: dumpTree.py:9
def key(type, name=None)
Definition: graph.py:13
QCString m_listName
Definition: reflist.h:88
virtual ~SortedRefItems()
Definition: reflist.h:49
int m_id
Definition: reflist.h:87
QCString name
name of the entity containing the reference
Definition: reflist.h:37
RefItem()
Definition: reflist.h:31
QCString m_fileName
Definition: reflist.h:89
SortedRefItems * m_itemList
Definition: reflist.h:92
Definition * scope
scope to use for references.
Definition: reflist.h:36
void addRefItem(const QList< ListItemInfo > *sli, const char *key, const char *prefix, const char *name, const char *title, const char *args, Definition *scope)
Definition: util.cpp:6456
QCString m_secTitle
Definition: reflist.h:91
QCString args
optional arguments for the entity (if function)
Definition: reflist.h:39
QList< RefItem > extraItems
more items belonging to the same entity
Definition: reflist.h:41
QIntDict< RefItem > * m_dict
Definition: reflist.h:93