~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipemodel/ipepdfdoc.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-06-08 00:44:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040608004402-72yu51xlh7vt6p9m
Tags: upstream-6.0pre16
ImportĀ upstreamĀ versionĀ 6.0pre16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
// --------------------------------------------------------------------
 
3
// The Ipe document, with PDF support.
 
4
// --------------------------------------------------------------------
 
5
/*
 
6
 
 
7
    This file is part of the extensible drawing editor Ipe.
 
8
    Copyright (C) 1993-2004  Otfried Cheong
 
9
 
 
10
    Ipe is free software; you can redistribute it and/or modify it
 
11
    under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation; either version 2 of the License, or
 
13
    (at your option) any later version.
 
14
 
 
15
    As a special exception, you have permission to link Ipe with the
 
16
    CGAL library and distribute executables, as long as you follow the
 
17
    requirements of the Gnu General Public License in regard to all of
 
18
    the software in the executable aside from CGAL.
 
19
 
 
20
    Ipe is distributed in the hope that it will be useful, but WITHOUT
 
21
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
22
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 
23
    License for more details.
 
24
 
 
25
    You should have received a copy of the GNU General Public License
 
26
    along with Ipe; if not, you can find it at
 
27
    "http://www.gnu.org/copyleft/gpl.html", or write to the Free
 
28
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
29
 
 
30
*/
 
31
 
 
32
#ifndef IPEDOCPDF_H
 
33
#define IPEDOCPDF_H
 
34
 
 
35
#include "ipedoc.h"
 
36
 
 
37
#include <qstring.h>
 
38
 
 
39
class IpeFontPool;
 
40
class QStringList;
 
41
 
 
42
// --------------------------------------------------------------------
 
43
 
 
44
class IpePdfDocument : public IpeDocument {
 
45
public:
 
46
  //! There are two Ipe document save formats.
 
47
  enum TFormat {
 
48
    EXml,  //!< Save as XML
 
49
    EPdf,  //!< Save as PDF
 
50
    EPs,   //!< Save as Postscript
 
51
    EEps,  //!< Save as Encapsulated Postscript
 
52
    EIpe5,  //!< Old Ipe format
 
53
    EUnknown //!< Unknown file format
 
54
  };
 
55
 
 
56
  static IpePdfDocument *New(QString fname, TFormat format, int &reason);
 
57
  static TFormat FileFormat(QString fname);
 
58
 
 
59
  IpePdfDocument();
 
60
  ~IpePdfDocument();
 
61
 
 
62
  bool Save(QString fname, TFormat format, bool doExport = false);
 
63
  void SetFontPool(IpeFontPool *fontPool);
 
64
  //! Return the current IpeFontPool.
 
65
  inline const IpeFontPool *FontPool() const { return iFontPool; }
 
66
 
 
67
  //! Error codes returned by RunLatex.
 
68
  enum { ErrNone, ErrNoText, ErrNoDir, ErrWritingSource,
 
69
         ErrOldPdfLatex, ErrLatex, ErrAlreadyHaveForm,
 
70
         ErrLatexOutput };
 
71
 
 
72
  int RunLatex(bool needLatex, const QStringList &styleDirs);
 
73
  //! Return contents of log file from most recent Latex run.
 
74
  inline QString LogFile() const { return iLogFile; }
 
75
  bool AddStyleSheet(const QString &fn);
 
76
 
 
77
private:
 
78
  IpeFontPool *iFontPool;
 
79
  QString iLogFile;
 
80
};
 
81
 
 
82
// --------------------------------------------------------------------
 
83
#endif