VirtualBox

source: vbox/trunk/src/VBox/Main/include/QMTranslator.h@ 107044

Last change on this file since 107044 was 106061, checked in by vboxsync, 2 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: QMTranslator.h 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * VirtualBox API translation handling class
4 */
5
6/*
7 * Copyright (C) 2014-2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef MAIN_INCLUDED_QMTranslator_h
29#define MAIN_INCLUDED_QMTranslator_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34class QMTranslator_Impl;
35
36class QMTranslator
37{
38public:
39 QMTranslator();
40 virtual ~QMTranslator();
41
42 /**
43 * Gets translation from loaded QM file
44 *
45 * @param pszContext QM context to look for translation
46 * @param pszSource Source string in one-byte encoding
47 * @param ppszSafeSource Where to return pointer to a safe copy of @a
48 * pszSource for the purpose of reverse translation.
49 * Will be set to NULL if @a pszSource is returned.
50 * @param pszDisamb Disambiguationg comment, empty by default
51 * @param aNum Plural form indicator.
52 *
53 * @returns Pointer to a translation (UTF-8 encoding), source string on failure.
54 */
55 const char *translate(const char *pszContext, const char *pszSource, const char **ppszSafeSource,
56 const char *pszDisamb = NULL, const size_t aNum = ~(size_t)0) const RT_NOEXCEPT;
57
58 /**
59 * Loads and parses QM file
60 *
61 * @param pszFilename The name of the file to load
62 * @param hStrCache The string cache to use for storing strings.
63 *
64 * @returns VBox status code.
65 */
66 int load(const char *pszFilename, RTSTRCACHE hStrCache) RT_NOEXCEPT;
67
68private:
69 /** QMTranslator implementation.
70 * To separate all the code from the interface */
71 QMTranslator_Impl *m_impl;
72
73 /* If copying is required, please define the following operators */
74 void operator=(QMTranslator &);
75 QMTranslator(const QMTranslator &);
76};
77
78#endif /* !MAIN_INCLUDED_QMTranslator_h */
79/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette