pagedef.h 2.59 KB
Newer Older
dimitri's avatar
dimitri committed
1 2
/******************************************************************************
 *
dimitri's avatar
dimitri committed
3
 * 
dimitri's avatar
dimitri committed
4
 *
dimitri's avatar
dimitri committed
5
 * Copyright (C) 1997-2012 by Dimitri van Heesch.
dimitri's avatar
dimitri committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 * Documents produced by Doxygen are derivative works derived from the
 * input used in their production; they are not affected by this license.
 *
 */

#include "definition.h"
#include "sortdict.h"

dimitri's avatar
dimitri committed
21 22 23
class PageSDict;
class OutputList;

dimitri's avatar
dimitri committed
24 25 26 27 28
class PageDef : public Definition
{
  public:
    PageDef(const char *f,int l,const char *n,const char *d,const char *t);
   ~PageDef();
dimitri's avatar
dimitri committed
29 30 31 32 33 34

    // setters
    void setFileName(const char *name) { m_fileName = name; }
    void setShowToc(bool b);

    // getters
dimitri's avatar
dimitri committed
35
    DefType definitionType() const { return TypePage; }
dimitri's avatar
dimitri committed
36 37
    bool isLinkableInProject() const 
    { 
dimitri's avatar
dimitri committed
38
      return /*hasDocumentation() &&*/ !isReference();
dimitri's avatar
dimitri committed
39 40 41 42 43
    }
    bool isLinkable() const 
    {
      return isLinkableInProject() || isReference();
    } 
dimitri's avatar
dimitri committed
44 45

    // functions to get a uniform interface with Definitions
dimitri's avatar
dimitri committed
46
    QCString getOutputFileBase() const;
dimitri's avatar
dimitri committed
47
    QCString anchor() const { return QCString(); }
dimitri's avatar
dimitri committed
48 49
    void findSectionsInDocumentation();
    QCString title() const { return m_title; }
dimitri's avatar
dimitri committed
50
    GroupDef *  getGroupDef() const;
dimitri's avatar
dimitri committed
51
    PageSDict * getSubPages() const { return m_subPageDict; }
dimitri's avatar
dimitri committed
52
    void addInnerCompound(Definition *d);
dimitri's avatar
dimitri committed
53 54 55
    bool visibleInIndex() const;
    bool documentedPage() const;
    bool hasSubPages() const;
dimitri's avatar
dimitri committed
56
    bool hasParentPage() const;
dimitri's avatar
dimitri committed
57
    bool showToc() const { return m_showToc; }
dimitri's avatar
dimitri committed
58 59
    void setPageScope(Definition *d){ m_pageScope = d; }
    Definition *getPageScope() const { return m_pageScope; }
dimitri's avatar
dimitri committed
60
    QCString displayName() const { return !m_title.isEmpty() ? m_title : Definition::name(); }
dimitri's avatar
dimitri committed
61

dimitri's avatar
dimitri committed
62 63
    void writeDocumentation(OutputList &ol);

dimitri's avatar
dimitri committed
64
  private:
dimitri's avatar
dimitri committed
65 66
    void setNestingLevel(int l);
    void writePageDocumentation(OutputList &ol);
dimitri's avatar
dimitri committed
67 68
    QCString m_fileName;
    QCString m_title;
dimitri's avatar
dimitri committed
69
    GroupDef *m_inGroup;
dimitri's avatar
dimitri committed
70 71 72
    PageSDict *m_subPageDict;                 // list of pages in the group
    Definition *m_pageScope;
    int m_nestingLevel;
dimitri's avatar
dimitri committed
73
    bool m_showToc;
dimitri's avatar
dimitri committed
74 75 76 77 78 79 80 81 82 83 84 85 86
};

class PageSDict : public SDict<PageDef>
{
  public:
    PageSDict(int size) : SDict<PageDef>(size) {}
    virtual ~PageSDict() {}
    int compareItems(GCI i1,GCI i2)
    {
      return stricmp(((PageDef *)i1)->name(),((PageDef *)i2)->name());
    }
};