author | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-06-26 19:01:18 (UTC) |
commit | b9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff) | |
tree | 2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /microkde/kdecore/kcatalogue.h | |
download | kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2 |
Initial revision
Diffstat (limited to 'microkde/kdecore/kcatalogue.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdecore/kcatalogue.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/microkde/kdecore/kcatalogue.h b/microkde/kdecore/kcatalogue.h new file mode 100644 index 0000000..e229cc8 --- a/dev/null +++ b/microkde/kdecore/kcatalogue.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* This file is part of the KDE libraries | ||
2 | Copyright (c) 2001 Hans Petter Bieker <bieker@kde.org> | ||
3 | |||
4 | This library is free software; you can redistribute it and/or | ||
5 | modify it under the terms of the GNU Library General Public | ||
6 | License as published by the Free Software Foundation; either | ||
7 | version 2 of the License, or (at your option) any later version. | ||
8 | |||
9 | This library is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | Library General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
17 | Boston, MA 02111-1307, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef KCATALOGUE_H | ||
21 | #define KCATALOGUE_H | ||
22 | |||
23 | #include <qstring.h> | ||
24 | |||
25 | struct kde_loaded_l10nfile; | ||
26 | |||
27 | class KCataloguePrivate; | ||
28 | |||
29 | /** | ||
30 | * This class abstracts a gettext message catalogue. It will take care of | ||
31 | * opening the file and reading the catalogue. | ||
32 | * | ||
33 | * @see KLocale | ||
34 | */ | ||
35 | //REVISED: hausmann | ||
36 | class KCatalogue | ||
37 | { | ||
38 | public: | ||
39 | /** | ||
40 | * Constructor. | ||
41 | * | ||
42 | * @param name The name of the catalogue | ||
43 | */ | ||
44 | explicit KCatalogue(const QString & name = QString::null); | ||
45 | |||
46 | /** | ||
47 | * Copy constructor. | ||
48 | */ | ||
49 | KCatalogue(const KCatalogue & rhs); | ||
50 | |||
51 | /** | ||
52 | * Assignment operator. | ||
53 | */ | ||
54 | KCatalogue & operator = ( const KCatalogue & rhs); | ||
55 | |||
56 | /** | ||
57 | * Destructor. | ||
58 | */ | ||
59 | virtual ~KCatalogue(); | ||
60 | |||
61 | /** | ||
62 | * Returns the name of the catalogue. | ||
63 | * | ||
64 | * @return The name of the catalogue | ||
65 | */ | ||
66 | QString name() const; | ||
67 | |||
68 | /** | ||
69 | * Changes the current file name. | ||
70 | * | ||
71 | * @param fileName The new file name | ||
72 | */ | ||
73 | |||
74 | void setFileName( const QString & fileName ); | ||
75 | |||
76 | /** | ||
77 | * Retrieves a translation of the specified message id. | ||
78 | * | ||
79 | * Do not pass 0 or "" strings as message ids. | ||
80 | * | ||
81 | * @param msgid The message id | ||
82 | * | ||
83 | * @return The translated message, in utf8 encoding, or 0 if not found | ||
84 | */ | ||
85 | const char * translate( const char * msgid ) const; | ||
86 | |||
87 | private: | ||
88 | /** | ||
89 | * @internal Retrieves the current file name. | ||
90 | * | ||
91 | * @return The current file name, if any. | ||
92 | */ | ||
93 | QString fileName() const; | ||
94 | |||
95 | /** | ||
96 | * @internal Unloads the current file. | ||
97 | */ | ||
98 | void doUnload(); | ||
99 | |||
100 | private: | ||
101 | KCataloguePrivate * d; | ||
102 | }; | ||
103 | |||
104 | #endif | ||