~librecad-dev/librecad/librecad

« back to all changes in this revision

Viewing changes to librecad/src/lib/information/rs_locale.h

  • Committer: Scott Howard
  • Date: 2014-02-21 19:07:55 UTC
  • Revision ID: showard@debian.org-20140221190755-csjax9wb146hgdq4
first commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** This file is part of the LibreCAD project, a 2D CAD program
 
4
**
 
5
** Copyright (C) 2011 R. van Twisk (librecad@rvt.dds.nl)
 
6
**
 
7
**
 
8
** This file may be distributed and/or modified under the terms of the
 
9
** GNU General Public License version 2 as published by the Free Software
 
10
** Foundation and appearing in the file gpl-2.0.txt included in the
 
11
** packaging of this file.
 
12
**
 
13
** This program is distributed in the hope that it will be useful,
 
14
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
** GNU General Public License for more details.
 
17
**
 
18
** You should have received a copy of the GNU General Public License
 
19
** along with this program; if not, write to the Free Software
 
20
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
21
**
 
22
** This copyright notice MUST APPEAR in all copies of the script!
 
23
**
 
24
**********************************************************************/
 
25
 
 
26
#ifndef RS_LOCALE_H
 
27
#define RS_LOCALE_H
 
28
 
 
29
#include <QLocale>
 
30
#include "rs.h"
 
31
 
 
32
/**
 
33
  * Store Locale information in a class
 
34
  * (c) 2011 R. van Twisk
 
35
  *
 
36
  **/
 
37
class RS_Locale :public QLocale {
 
38
public:
 
39
    RS_Locale();
 
40
    RS_Locale(const QString &_canonical);
 
41
        /* without virtual destructor => warning: deleting object of polymorphic  
 
42
         * class type 'RS_Locale' which has non-virtual destructor might cause 
 
43
         * undefined behaviour [-Wdelete-non-virtual-dtor]
 
44
         * 
 
45
         * TNick <nicu.tofan@gmail.com>
 
46
         */
 
47
        virtual ~RS_Locale(){}
 
48
        
 
49
 
 
50
    virtual void setCanonical(const QString &_canonical);
 
51
    virtual void setDirection(RS2::TextLocaleDirection direction);
 
52
    virtual void setName(const QString &_name);
 
53
    virtual QString name() const;
 
54
    static QString toCanonical(const QString &canonical);
 
55
 
 
56
    QString getCanonical();
 
57
    QString getName();
 
58
 
 
59
protected:
 
60
    QString canonical;
 
61
    QString localeName;
 
62
    int direction;
 
63
};
 
64
 
 
65
 
 
66
 
 
67
#endif