1 /***************************************************************************
2                  defaultprovider.h  - Defaults for this and that
3                              -------------------
4     begin                : November 2006
5     copyright            : (C) 2006 by Klaas Freitag
6     email                : freitag@kde.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 #ifndef DEFAULTPROVIDER_H
18 #define DEFAULTPROVIDER_H
19 
20 #include <QtCore>
21 
22 #include "kraftcat_export.h"
23 
24 #include "kraftdoc.h"
25 #include "doctext.h"
26 
27 class QSqlRecord;
28 class QStringList;
29 class dbID;
30 
31 /**
32  * encapsulates all relevant for default values for documents such as
33  * texts etc.
34  */
35 class KRAFTCAT_EXPORT DefaultProvider
36 {
37 public:
38   ~DefaultProvider();
39 
40   static DefaultProvider *self();
41 
42   QString defaultText( const QString&, KraftDoc::Part, DocGuardedPtr = 0 );
43   dbID saveDocumentText( const DocText& );
44   void deleteDocumentText( const DocText& );
45 
46   QString docType(); // the default document type for new docs
47   DocTextList documentTexts( const QString&, KraftDoc::Part );
48 
49   QString currencySymbol() const;
50 
51   QLocale* locale();
52 
53   QString iconvTool() const;
54   QStringList findTrml2Pdf() const;
55   QString locateKraftTool(const QString& toolName) const;
56   QString locateBinary(const QString& name) const;
57   QString locateFile(const QString& findFile) const;
58 
59   QString getStyleSheet( const QString& ) const;
60 
61   DefaultProvider();
62 
63   bool writeXmlArchive();
64   QString pdfOutputDir();
65   QString xmlArchivePath();
66 
67 private:
68 
69  //  static DefaultProvider *mSelf;
70   QLocale _locale;
71   const QString EuroTag;
72 
73 };
74 
75 #endif
76