Blame src/cite.h

Packit Service 50c9f2
/******************************************************************************
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * 
Packit Service 50c9f2
 *
Packit Service 50c9f2
 * Copyright (C) 2011 by Dimitri van Heesch
Packit Service 50c9f2
 * Based on a patch by David Munger
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 CITEDB_H
Packit Service 50c9f2
#define CITEDB_H
Packit Service 50c9f2
Packit Service 50c9f2
#include <qdict.h>
Packit Service 50c9f2
Packit Service 50c9f2
class FTextStream;
Packit Service 50c9f2
Packit Service 50c9f2
/// String constants for citations
Packit Service 50c9f2
struct CiteConsts
Packit Service 50c9f2
{
Packit Service 50c9f2
  static const QCString fileName;
Packit Service 50c9f2
  static const QCString anchorPrefix;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/// Citation-related data.
Packit Service 50c9f2
struct CiteInfo
Packit Service 50c9f2
{
Packit Service 50c9f2
  CiteInfo(const char *label_, const char *text_=0, const char *fullText_=0,
Packit Service 50c9f2
      const char *ref_=0) :
Packit Service 50c9f2
    label(label_), text(text_), fullText(fullText_), ref(ref_)
Packit Service 50c9f2
  { }
Packit Service 50c9f2
Packit Service 50c9f2
  CiteInfo(const CiteInfo &o)
Packit Service 50c9f2
  { label=o.label.copy(); text=o.text.copy(); fullText=o.fullText.copy(); ref=o.ref.copy(); }
Packit Service 50c9f2
Packit Service 50c9f2
  QCString label; 
Packit Service 50c9f2
  QCString text;
Packit Service 50c9f2
  QCString fullText;
Packit Service 50c9f2
  QCString ref;
Packit Service 50c9f2
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
/**
Packit Service 50c9f2
 * @brief Cite database access class.
Packit Service 50c9f2
 * @details This class provides access do the database of bibliographic 
Packit Service 50c9f2
 * references through the bibtex backend.
Packit Service 50c9f2
 */
Packit Service 50c9f2
class CiteDict 
Packit Service 50c9f2
{
Packit Service 50c9f2
  public:
Packit Service 50c9f2
    /** Create the database, with an expected maximum of \a size entries */
Packit Service 50c9f2
    CiteDict(int size);
Packit Service 50c9f2
Packit Service 50c9f2
//    /** Resolve references to citations */
Packit Service 50c9f2
//    void resolve();
Packit Service 50c9f2
Packit Service 50c9f2
    /** Insert a citation identified by \a label into the database */
Packit Service 50c9f2
    void insert(const char *label);
Packit Service 50c9f2
Packit Service 50c9f2
    /** Return the citation info for a given \a label */
Packit Service 50c9f2
    CiteInfo *find(const char *label) const;
Packit Service 50c9f2
Packit Service 50c9f2
    /** Generate the citations page */
Packit Service 50c9f2
    void generatePage() const;
Packit Service 50c9f2
Packit Service 50c9f2
    /** clears the database */
Packit Service 50c9f2
    void clear();
Packit Service 50c9f2
Packit Service 50c9f2
    /** return TRUE if there are no citations. 
Packit Service 50c9f2
     *  Only valid after calling resolve() 
Packit Service 50c9f2
     */
Packit Service 50c9f2
    bool isEmpty() const;
Packit Service 50c9f2
Packit Service 50c9f2
    /** writes the latex code for the standard bibliography 
Packit Service 50c9f2
     *  section to text stream \a t 
Packit Service 50c9f2
     */
Packit Service 50c9f2
    void writeLatexBibliography(FTextStream &t);
Packit Service 50c9f2
Packit Service 50c9f2
  private:
Packit Service 50c9f2
//    bool writeAux();
Packit Service 50c9f2
//    bool writeBst();
Packit Service 50c9f2
//    bool execute();
Packit Service 50c9f2
//    void parse();
Packit Service 50c9f2
//    void clean();
Packit Service 50c9f2
    QDict<CiteInfo> m_entries;
Packit Service 50c9f2
//    QList<QCString> m_ordering;
Packit Service 50c9f2
    QCString m_baseFileName;
Packit Service 50c9f2
};
Packit Service 50c9f2
Packit Service 50c9f2
#endif