Blame src/cite.h

Packit 1c1d7e
/******************************************************************************
Packit 1c1d7e
 *
Packit 1c1d7e
 * 
Packit 1c1d7e
 *
Packit 1c1d7e
 * Copyright (C) 2011 by Dimitri van Heesch
Packit 1c1d7e
 * Based on a patch by David Munger
Packit 1c1d7e
 *
Packit 1c1d7e
 * Permission to use, copy, modify, and distribute this software and its
Packit 1c1d7e
 * documentation under the terms of the GNU General Public License is hereby 
Packit 1c1d7e
 * granted. No representations are made about the suitability of this software 
Packit 1c1d7e
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit 1c1d7e
 * See the GNU General Public License for more details.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Documents produced by Doxygen are derivative works derived from the
Packit 1c1d7e
 * input used in their production; they are not affected by this license.
Packit 1c1d7e
 *
Packit 1c1d7e
 */
Packit 1c1d7e
Packit 1c1d7e
#ifndef CITEDB_H
Packit 1c1d7e
#define CITEDB_H
Packit 1c1d7e
Packit 1c1d7e
#include <qdict.h>
Packit 1c1d7e
Packit 1c1d7e
class FTextStream;
Packit 1c1d7e
Packit 1c1d7e
/// String constants for citations
Packit 1c1d7e
struct CiteConsts
Packit 1c1d7e
{
Packit 1c1d7e
  static const QCString fileName;
Packit 1c1d7e
  static const QCString anchorPrefix;
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
/// Citation-related data.
Packit 1c1d7e
struct CiteInfo
Packit 1c1d7e
{
Packit 1c1d7e
  CiteInfo(const char *label_, const char *text_=0, const char *fullText_=0,
Packit 1c1d7e
      const char *ref_=0) :
Packit 1c1d7e
    label(label_), text(text_), fullText(fullText_), ref(ref_)
Packit 1c1d7e
  { }
Packit 1c1d7e
Packit 1c1d7e
  CiteInfo(const CiteInfo &o)
Packit 1c1d7e
  { label=o.label.copy(); text=o.text.copy(); fullText=o.fullText.copy(); ref=o.ref.copy(); }
Packit 1c1d7e
Packit 1c1d7e
  QCString label; 
Packit 1c1d7e
  QCString text;
Packit 1c1d7e
  QCString fullText;
Packit 1c1d7e
  QCString ref;
Packit 1c1d7e
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
/**
Packit 1c1d7e
 * @brief Cite database access class.
Packit 1c1d7e
 * @details This class provides access do the database of bibliographic 
Packit 1c1d7e
 * references through the bibtex backend.
Packit 1c1d7e
 */
Packit 1c1d7e
class CiteDict 
Packit 1c1d7e
{
Packit 1c1d7e
  public:
Packit 1c1d7e
    /** Create the database, with an expected maximum of \a size entries */
Packit 1c1d7e
    CiteDict(int size);
Packit 1c1d7e
Packit 1c1d7e
//    /** Resolve references to citations */
Packit 1c1d7e
//    void resolve();
Packit 1c1d7e
Packit 1c1d7e
    /** Insert a citation identified by \a label into the database */
Packit 1c1d7e
    void insert(const char *label);
Packit 1c1d7e
Packit 1c1d7e
    /** Return the citation info for a given \a label */
Packit 1c1d7e
    CiteInfo *find(const char *label) const;
Packit 1c1d7e
Packit 1c1d7e
    /** Generate the citations page */
Packit 1c1d7e
    void generatePage() const;
Packit 1c1d7e
Packit 1c1d7e
    /** clears the database */
Packit 1c1d7e
    void clear();
Packit 1c1d7e
Packit 1c1d7e
    /** return TRUE if there are no citations. 
Packit 1c1d7e
     *  Only valid after calling resolve() 
Packit 1c1d7e
     */
Packit 1c1d7e
    bool isEmpty() const;
Packit 1c1d7e
Packit 1c1d7e
    /** writes the latex code for the standard bibliography 
Packit 1c1d7e
     *  section to text stream \a t 
Packit 1c1d7e
     */
Packit 1c1d7e
    void writeLatexBibliography(FTextStream &t);
Packit 1c1d7e
Packit 1c1d7e
  private:
Packit 1c1d7e
//    bool writeAux();
Packit 1c1d7e
//    bool writeBst();
Packit 1c1d7e
//    bool execute();
Packit 1c1d7e
//    void parse();
Packit 1c1d7e
//    void clean();
Packit 1c1d7e
    QDict<CiteInfo> m_entries;
Packit 1c1d7e
//    QList<QCString> m_ordering;
Packit 1c1d7e
    QCString m_baseFileName;
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
#endif