~ubuntu-branches/ubuntu/trusty/freediams/trusty

« back to all changes in this revision

Viewing changes to plugins/coreplugin/itranslators.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille, Eric Maeker, Andreas Tille
  • Date: 2010-11-22 16:17:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122161706-fr0knxhy6571uisn
Tags: 0.5.0-1
[ Eric Maeker ]
* New upstream version
* Updating the description of the package
* Updating Build-Depends : no more dependence with doxygen

[ Andreas Tille ]
* debian/rules
  - do not install /usr/bin/{COPYING,README}
  - copy the readily provided docs instead of moving

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   FreeMedicalForms                                                      *
3
 
 *   (C) 2008-2010 by Eric MAEKER, MD                                      *
4
 
 *   eric.maeker@free.fr                                                   *
5
 
 *   All rights reserved.                                                  *
6
 
 *                                                                         *
7
 
 *   This program is a free and open source software.                      *
8
 
 *   It is released under the terms of the new BSD License.                *
9
 
 *                                                                         *
10
 
 *   Redistribution and use in source and binary forms, with or without    *
11
 
 *   modification, are permitted provided that the following conditions    *
12
 
 *   are met:                                                              *
13
 
 *   - Redistributions of source code must retain the above copyright      *
14
 
 *   notice, this list of conditions and the following disclaimer.         *
15
 
 *   - Redistributions in binary form must reproduce the above copyright   *
16
 
 *   notice, this list of conditions and the following disclaimer in the   *
17
 
 *   documentation and/or other materials provided with the distribution.  *
18
 
 *   - Neither the name of the FreeMedForms' organization nor the names of *
19
 
 *   its contributors may be used to endorse or promote products derived   *
20
 
 *   from this software without specific prior written permission.         *
21
 
 *                                                                         *
22
 
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   *
23
 
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     *
24
 
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS     *
25
 
 *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE        *
26
 
 *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,  *
27
 
 *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,  *
28
 
 *   BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;      *
29
 
 *   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER      *
30
 
 *   CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT    *
31
 
 *   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN     *
32
 
 *   ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE       *
33
 
 *   POSSIBILITY OF SUCH DAMAGE.                                           *
34
 
 ***************************************************************************/
35
 
/***************************************************************************
36
 
 *   Main Developper : Eric MAEKER, <eric.maeker@free.fr>                  *
37
 
 *   Contributors :                                                        *
38
 
 *       NAME <MAIL@ADRESS>                                                *
39
 
 ***************************************************************************/
40
 
#ifndef TKTRANSLATORS_H
41
 
#define TKTRANSLATORS_H
42
 
 
43
 
#include <QObject>
44
 
#include <QMap>
45
 
#include <coreplugin/core_exporter.h>
46
 
 
47
 
class QTranslator;
48
 
 
49
 
/**
50
 
 * \file itranslators.h
51
 
 * \author Eric MAEKER <eric.maeker@free.fr>
52
 
 * \version 0.0.8
53
 
 * \date 09 Aug 2009
54
 
*/
55
 
 
56
 
namespace Core {
57
 
 
58
 
class CORE_EXPORT ITranslators : public QObject
59
 
{
60
 
    Q_OBJECT
61
 
public:
62
 
    static tkTranslators* instance( QObject * parent = 0) ;
63
 
     ~tkTranslators();
64
 
 
65
 
     bool addNewTranslator( const QString & fileName, bool fromDefaultPath = true );
66
 
     bool addNewTranslator( const QString & path, const QString & file );
67
 
 
68
 
public Q_SLOTS:
69
 
     void changeLanguage( const QString & lang );
70
 
 
71
 
 public:
72
 
     static bool setPathToTranslations( const QString & path );
73
 
     static QString pathToTranslations();
74
 
 
75
 
     static QStringList availableLocales();
76
 
     static QStringList availableLanguages();
77
 
     static QMap<QString, QString> availableLocalesAndLanguages();
78
 
 
79
 
 Q_SIGNALS:
80
 
     void languageChanged();
81
 
 
82
 
 protected:
83
 
     tkTranslators( QObject * parent = 0 );
84
 
 
85
 
 private:
86
 
     QMap<QString, QTranslator*>   m_Translators;  // String is file location and mask
87
 
     static QString                m_PathToTranslations;
88
 
     static tkTranslators         *m_Instance;
89
 
};
90
 
 
91
 
} // end Core
92
 
 
93
 
#endif