summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-11 20:56:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 08:20:50 +0100
commit00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch)
treefd1a9bb264fe15dcc129498e62060ecd256b1ee7 /include/vcl
parentfa987cbb813cfd729fe490f2f1258b7c8d7fb174 (diff)
migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/builder.hxx12
-rw-r--r--include/vcl/button.hxx2
-rw-r--r--include/vcl/decoview.hxx2
-rw-r--r--include/vcl/fpicker.hrc34
-rw-r--r--include/vcl/image.hxx1
-rw-r--r--include/vcl/keycod.hxx1
-rw-r--r--include/vcl/keycodes.hxx2
-rw-r--r--include/vcl/menu.hxx2
-rw-r--r--include/vcl/toolbox.hxx2
-rw-r--r--include/vcl/vclenum.hxx114
-rw-r--r--include/vcl/window.hxx2
11 files changed, 121 insertions, 53 deletions
diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 96265f967bc9..a446405d544c 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -247,9 +247,6 @@ private:
static void mungeAdjustment(ScrollBar &rTarget, const Adjustment &rAdjustment);
static void mungeAdjustment(Slider &rTarget, const Adjustment &rAdjustment);
- typedef std::map<OString, OString> WidgetTranslations;
- typedef std::map<OString, WidgetTranslations> Translations;
-
struct stockinfo
{
OUString m_sStock;
@@ -270,6 +267,8 @@ private:
struct ParserState
{
+ std::locale m_aResLocale;
+
std::vector<RadioButtonGroupMap> m_aGroupMaps;
std::vector<ComboBoxModelMap> m_aModelMaps;
@@ -291,8 +290,6 @@ private:
std::vector<ButtonMenuMap> m_aButtonMenuMaps;
- Translations m_aTranslations;
-
std::map<VclPtr<vcl::Window>, VclPtr<vcl::Window>> m_aRedundantParentWidgets;
std::vector<SizeGroup> m_aSizeGroups;
@@ -310,9 +307,6 @@ private:
ParserState();
};
- void loadTranslations(const LanguageTag &rLanguageTag, const OUString &rUri);
- OString getTranslation(const OString &rId, const OString &rProperty) const;
-
OString m_sID;
OString m_sHelpRoot;
ResHookProc m_pStringReplace;
@@ -362,8 +356,6 @@ private:
bool extractStock(const OString &id, stringmap &rMap);
void extractMnemonicWidget(const OString &id, stringmap &rMap);
- void handleTranslations(xmlreader::XmlReader &reader);
-
void handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader);
VclPtr<vcl::Window> handleObject(vcl::Window *pParent, xmlreader::XmlReader &reader);
void handlePacking(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader);
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 3872a8c2c156..6de11784086d 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -27,7 +27,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/salnativewidgets.hxx>
-#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/vclenum.hxx>
#include <vcl/vclptr.hxx>
#include <memory>
#include <vector>
diff --git a/include/vcl/decoview.hxx b/include/vcl/decoview.hxx
index 1cb36bb8d723..136780893f52 100644
--- a/include/vcl/decoview.hxx
+++ b/include/vcl/decoview.hxx
@@ -22,7 +22,7 @@
#include <vcl/dllapi.h>
#include <vcl/vclptr.hxx>
-#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/vclenum.hxx>
#include <o3tl/typed_flags_set.hxx>
namespace tools { class Rectangle; }
diff --git a/include/vcl/fpicker.hrc b/include/vcl/fpicker.hrc
deleted file mode 100644
index 29c446ddbd36..000000000000
--- a/include/vcl/fpicker.hrc
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-#ifndef INCLUDED_VCL_FPICKER_HRC
-#define INCLUDED_VCL_FPICKER_HRC
-
-#include <svl/solar.hrc>
-
-#define STR_SVT_FILEPICKER_START (RID_FPICKER_START+1)
-#define STR_SVT_FILEPICKER_AUTO_EXTENSION (STR_SVT_FILEPICKER_START+ 0)
-#define STR_SVT_FILEPICKER_PASSWORD (STR_SVT_FILEPICKER_START+ 1)
-#define STR_SVT_FILEPICKER_FILTER_OPTIONS (STR_SVT_FILEPICKER_START+ 2)
-#define STR_SVT_FILEPICKER_READONLY (STR_SVT_FILEPICKER_START+ 3)
-#define STR_SVT_FILEPICKER_INSERT_AS_LINK (STR_SVT_FILEPICKER_START+ 4)
-#define STR_SVT_FILEPICKER_SHOW_PREVIEW (STR_SVT_FILEPICKER_START+ 5)
-#define STR_SVT_FILEPICKER_PLAY (STR_SVT_FILEPICKER_START+ 6)
-#define STR_SVT_FILEPICKER_VERSION (STR_SVT_FILEPICKER_START+ 7)
-#define STR_SVT_FILEPICKER_TEMPLATES (STR_SVT_FILEPICKER_START+ 8)
-#define STR_SVT_FILEPICKER_IMAGE_TEMPLATE (STR_SVT_FILEPICKER_START+ 9)
-#define STR_SVT_FILEPICKER_SELECTION (STR_SVT_FILEPICKER_START+10)
-#define STR_SVT_FILEPICKER_FILTER_TITLE (STR_SVT_FILEPICKER_START+11)
-#define STR_SVT_FOLDERPICKER_DEFAULT_TITLE (STR_SVT_FILEPICKER_START+12)
-#define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION (STR_SVT_FILEPICKER_START+13)
-#define STR_SVT_ALREADYEXISTOVERWRITE (STR_SVT_FILEPICKER_START+14)
-#define STR_SVT_DELETESERVICE (STR_SVT_FILEPICKER_START+15)
-#define STR_SVT_ROOTLABEL (STR_SVT_FILEPICKER_START+16)
-
-#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 6ee8f897e942..4577bd8fbed1 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -22,7 +22,6 @@
#include <vcl/dllapi.h>
#include <tools/gen.hxx>
-#include <tools/resid.hxx>
#include <tools/solar.h>
#include <vcl/bitmapex.hxx>
#include <vcl/outdev.hxx>
diff --git a/include/vcl/keycod.hxx b/include/vcl/keycod.hxx
index 89e57b988265..06843738eee1 100644
--- a/include/vcl/keycod.hxx
+++ b/include/vcl/keycod.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_VCL_KEYCOD_HXX
#include <rtl/ustring.hxx>
-#include <tools/resid.hxx>
#include <vcl/dllapi.h>
#include <vcl/keycodes.hxx>
#include <vcl/vclenum.hxx>
diff --git a/include/vcl/keycodes.hxx b/include/vcl/keycodes.hxx
index 06b7c124972f..cc7d51ec30b8 100644
--- a/include/vcl/keycodes.hxx
+++ b/include/vcl/keycodes.hxx
@@ -20,7 +20,7 @@
#ifndef INCLUDED_VCL_KEYCODES_HXX
#define INCLUDED_VCL_KEYCODES_HXX
-#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/vclenum.hxx>
#undef DELETE
#include <com/sun/star/awt/Key.hpp>
#include <com/sun/star/awt/KeyGroup.hpp>
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index c828aae0baa3..680ccd9d5af2 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_VCL_MENU_HXX
#include <memory>
-#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/vclenum.hxx>
#include <tools/color.hxx>
#include <tools/solar.h>
#include <vcl/dllapi.h>
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 5136a343612a..28d05b7783ef 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_VCL_TOOLBOX_HXX
#include <vcl/vclstatuslistener.hxx>
-#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/vclenum.hxx>
#include <vcl/dllapi.h>
#include <vcl/dockwin.hxx>
#include <vcl/image.hxx>
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 10e97df02f3c..95e977c696dd 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -20,10 +20,122 @@
#ifndef INCLUDED_VCL_VCLENUM_HXX
#define INCLUDED_VCL_VCLENUM_HXX
-#include <rsc/rsc-vcl-shared-types.hxx>
#include <sal/types.h>
#include <tools/fontenum.hxx>
+enum class TimeFieldFormat : sal_Int32 { F_NONE, F_SEC, F_SEC_CS };
+
+enum class KeyFuncType : sal_Int32 { DONTKNOW, NEW, OPEN, SAVE,
+ SAVEAS, PRINT, CLOSE, QUIT,
+ CUT, COPY, PASTE, UNDO,
+ REDO, DELETE, REPEAT, FIND,
+ FINDBACKWARD, PROPERTIES, FRONT };
+
+enum class MenuItemType { DONTKNOW, STRING, IMAGE, STRINGIMAGE, SEPARATOR };
+
+enum class MenuItemBits : sal_Int16
+{
+ NONE = 0x0000,
+ CHECKABLE = 0x0001,
+ RADIOCHECK = 0x0002,
+ AUTOCHECK = 0x0004,
+ ABOUT = 0x0008,
+ HELP = 0x0010,
+ POPUPSELECT = 0x0020,
+ // These have been said to be a preliminary (sic) solution since 2007
+ NOSELECT = 0x0040,
+ ICON = 0x0080,
+ TEXT = 0x0100,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<MenuItemBits> : is_typed_flags<MenuItemBits, 0x1ff> {};
+}
+
+enum class ToolBoxItemBits
+{
+ NONE = 0x0000,
+ CHECKABLE = 0x0001,
+ RADIOCHECK = 0x0002,
+ AUTOCHECK = 0x0004,
+ LEFT = 0x0008,
+ AUTOSIZE = 0x0010,
+ DROPDOWN = 0x0020,
+ REPEAT = 0x0040,
+ DROPDOWNONLY = 0x00a0, // 0x0080 | DROPDOWN
+ TEXT_ONLY = 0x0100,
+ ICON_ONLY = 0x0200
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ToolBoxItemBits> : is_typed_flags<ToolBoxItemBits, 0x3ff> {};
+}
+
+enum class ToolBoxItemType { DONTKNOW, BUTTON, SPACE, SEPARATOR, BREAK };
+
+enum class ButtonType { SYMBOLONLY, TEXT, SYMBOLTEXT };
+
+enum class SymbolType : sal_uInt16
+{
+ DONTKNOW = 0,
+ IMAGE = 1,
+ ARROW_UP = 2,
+ ARROW_DOWN = 3,
+ ARROW_LEFT = 4,
+ ARROW_RIGHT = 5,
+ SPIN_UP = 6,
+ SPIN_DOWN = 7,
+ SPIN_LEFT = 8,
+ SPIN_RIGHT = 9,
+ FIRST = 10,
+ LAST = 11,
+ PREV = 12,
+ NEXT = 13,
+ PAGEUP = 14,
+ PAGEDOWN = 15,
+ PLAY = 16,
+ STOP = 19,
+ CLOSE = 25,
+ ROLLUP = 26,
+ ROLLDOWN = 27,
+ CHECKMARK = 28,
+ RADIOCHECKMARK = 29,
+ FLOAT = 31,
+ DOCK = 32,
+ HIDE = 33,
+ HELP = 34,
+ PLUS = 35,
+ MENU = SymbolType::SPIN_DOWN
+};
+
+
+// Border styles for SetBorder()
+enum class WindowBorderStyle : sal_Int16
+{
+ NONE = 0x0000,
+ NORMAL = 0x0001,
+ MONO = 0x0002,
+ MENU = 0x0010,
+ NWF = 0x0020,
+ NOBORDER = 0x1000,
+ REMOVEBORDER = 0x2000
+};
+namespace o3tl
+{
+ template<> struct typed_flags<WindowBorderStyle> : is_typed_flags<WindowBorderStyle, 0x3033> {};
+}
+
+#define KEY_CODE_MASK ((sal_uInt16)0x0FFF)
+
+// Modifier keys
+#define KEY_SHIFT ((sal_uInt16)0x1000)
+#define KEY_MOD1 ((sal_uInt16)0x2000)
+#define KEY_MOD2 ((sal_uInt16)0x4000)
+#define KEY_MOD3 ((sal_uInt16)0x8000)
+#define KEY_MODIFIERS_MASK ((sal_uInt16)0xF000)
+
+
+
enum class ExtTimeFieldFormat
{
Short24H, Long24H
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 1422c14e4165..71ca0d2f282b 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -25,7 +25,7 @@
#include <vcl/outdev.hxx>
#include <vcl/pointr.hxx>
#include <tools/wintypes.hxx>
-#include <rsc/rsc-vcl-shared-types.hxx>
+#include <vcl/vclenum.hxx>
#include <vcl/inputtypes.hxx>
#include <vcl/cursor.hxx>
#include <vcl/inputctx.hxx>