Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLI18N.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright(c) Kitware Inc.
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16==============================================================================*/
17
18#ifndef __vtkMRMLI18N_h
19#define __vtkMRMLI18N_h
20
21// MRML includes
22#include "vtkMRML.h"
23
24// VTK includes
25#include <vtkObject.h>
26
28
32class VTK_MRML_EXPORT vtkMRMLI18N : public vtkObject
33{
34public:
35 vtkTypeMacro(vtkMRMLI18N, vtkObject);
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
41
48 static vtkMRMLI18N* New();
49
51 static std::string Translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1);
52
66 static std::string Format(const std::string& text,
67 const char* arg1 = nullptr, const char* arg2 = nullptr, const char* arg3 = nullptr,
68 const char* arg4 = nullptr, const char* arg5 = nullptr, const char* arg6 = nullptr,
69 const char* arg7 = nullptr, const char* arg8 = nullptr, const char* arg9 = nullptr);
70
74
77 vtkGetObjectMacro (Translator, vtkMRMLTranslator);
78
79protected:
81 ~vtkMRMLI18N() override;
83 void operator=(const vtkMRMLI18N&);
84
87 static void classInitialize();
88 static void classFinalize();
89
92
94};
95
97class VTK_MRML_EXPORT vtkMRMLI18NInitialize
98{
99public:
101
104private:
105 static unsigned int Count;
106};
107
112
114#define vtkMRMLTr(context, sourceText) vtkMRMLI18N::Translate(context, sourceText)
115
116#endif
Utility class to make sure qSlicerModuleManager is initialized before it is used.
Definition vtkMRMLI18N.h:98
vtkMRMLI18NInitialize Self
static void classFinalize()
vtkMRMLI18N Self
Definition vtkMRMLI18N.h:91
~vtkMRMLI18N() override
vtkMRMLI18N(const vtkMRMLI18N &)
static void classInitialize()
Singleton management functions.
static vtkMRMLI18N * New()
vtkMRMLTranslator * Translator
Definition vtkMRMLI18N.h:93
static vtkMRMLI18N * GetInstance()
Return the singleton instance with no reference counting.
void SetTranslator(vtkMRMLTranslator *translator)
static std::string Format(const std::string &text, const char *arg1=nullptr, const char *arg2=nullptr, const char *arg3=nullptr, const char *arg4=nullptr, const char *arg5=nullptr, const char *arg6=nullptr, const char *arg7=nullptr, const char *arg8=nullptr, const char *arg9=nullptr)
friend class vtkMRMLI18NInitialize
Definition vtkMRMLI18N.h:90
static std::string Translate(const char *context, const char *sourceText, const char *disambiguation=nullptr, int n=-1)
Translate message with the current translator.
void PrintSelf(ostream &os, vtkIndent indent) override
void operator=(const vtkMRMLI18N &)
Base class for localization of messages that may be displayed to users.
static vtkMRMLI18NInitialize vtkMRMLI18NInitializer