summaryrefslogtreecommitdiff
path: root/rsc/inc/rsctop.hxx
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 /rsc/inc/rsctop.hxx
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 'rsc/inc/rsctop.hxx')
-rw-r--r--rsc/inc/rsctop.hxx210
1 files changed, 0 insertions, 210 deletions
diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx
deleted file mode 100644
index 76c96844cb73..000000000000
--- a/rsc/inc/rsctop.hxx
+++ /dev/null
@@ -1,210 +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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_RSC_INC_RSCTOP_HXX
-#define INCLUDED_RSC_INC_RSCTOP_HXX
-
-#include <rscerror.h>
-#include <rsctools.hxx>
-#include <rschash.hxx>
-#include <rscclobj.hxx>
-#include <rsc/rscsfx.hxx>
-#include <o3tl/typed_flags_set.hxx>
-#include <tools/resid.hxx>
-
-enum class RSCVAR {
- NONE = 0x0000,
- Pointer = 0x0001,
- Hidden = 0x0002,
- NoDataInst = 0x0004,
- NoRc = 0x0008,
- SvDynamic = 0x0010,
- NoEnum = 0x0020
-};
-namespace o3tl {
- template<> struct typed_flags<RSCVAR> : is_typed_flags<RSCVAR, 0x007f> {};
-}
-
-class RscTop : public RefNode
-{
- RscTop * pSuperClass;
- RSCINST aDfltInst;
- RESOURCE_TYPE nTypId;
- RscTop * pRefClass;
-
-protected:
- RscTop( Atom nId, RESOURCE_TYPE nTypIdent,
- RscTop * pSuperCl = nullptr );
-
-public:
- OString aCallPar1; // class call without types until ResId
- OString aCallPar2; // class call without types staring at ResId
- OString aCallParType; // class call with types
-
- RscTop* GetSuperClass() const
- { return pSuperClass; }
- // returns the type identifier
- RESOURCE_TYPE GetTypId() const
- { return nTypId; };
- // returns the super class
- bool InHierarchy( RscTop * pClass );
- void SetCallPar( const OString& rPar1, const OString& rPar2,
- const OString& rParType );
- RscTop* GetRefClass() const { return pRefClass; }
- RSCINST const & GetDefault();
-
- // preparation fro the destructor call
- // given that classes can have mutual dependencies,
- // we cannot assume in destructor that all class pointer
- // are still valid
- virtual void Pre_dtor();
-
- virtual RscTop* GetTypeClass() const;
-
- // returns the class size in bytes
- virtual sal_uInt32 Size() const;
-
- // returns the reference
- virtual ERRTYPE GetRef( const RSCINST & rInst, RscId * );
-
- // sets the reference
- virtual ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId );
-
- // sets the variable
- virtual ERRTYPE SetVariable( Atom nVarName, RscTop * pClass,
- RSCINST * pDflt = nullptr,
- RSCVAR nVarType = RSCVAR::NONE, sal_uInt32 nMask = 0,
- Atom nDataBaseName = InvalidAtom );
-
- // returns variable instance
- // returned pData, pClass may be NULL
- virtual RSCINST GetVariable( const RSCINST & rInst, Atom nVarName,
- const RSCINST & rInitInst,
- bool bInitDflt = false,
- RscTop * pCreateClass = nullptr );
- virtual RSCINST GetCopyVar( const RSCINST & rInst, Atom nVarName );
-
- virtual RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos,
- const RSCINST & rInitInst );
-
- // returns instance from a field
- // returned pGetInst may be NULL
- virtual ERRTYPE GetElement( const RSCINST & rInst, const RscId & rEleName,
- RscTop *pCreateClass, const RSCINST & rCreateInst,
- RSCINST * pGetInst );
-
- // returns instance from a value
- // returned pGetInst may be NULL
- virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
- RscTop * pCreateClass,
- RSCINST * pGetInst );
-
- // returns instance from an array
- // returned pGetInst may be NULL
- virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
- RscTop * pCreateClass,
- RSCINST * pGetInst );
-
- virtual RSCINST SearchEle( const RSCINST & rInst, const RscId & rEleName,
- RscTop * pClass );
-
- // returns instance at the position
- virtual RSCINST GetPosEle( const RSCINST & rInst, sal_uInt32 nPos );
-
- // move an instance
- virtual ERRTYPE MovePosEle( const RSCINST & rInst, sal_uInt32 nDestPos,
- sal_uInt32 nSourcePos );
-
- // changes RscId at position
- virtual ERRTYPE SetPosRscId( const RSCINST & rInst, sal_uInt32 nPos,
- const RscId & rRscId);
-
- // returns instance information at position
- virtual SUBINFO_STRUCT GetInfoEle( const RSCINST & rInst, sal_uInt32 nPos );
-
- // number of entries
- virtual sal_uInt32 GetCount( const RSCINST & rInst );
-
- // an assignment to a variable
- virtual ERRTYPE SetNumber( const RSCINST & rInst, sal_Int32 lValue );
-
- // an assignment to a variable
- virtual ERRTYPE SetBool( const RSCINST & rInst, bool bValue );
-
- // an assignment to a variable
- virtual ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
- sal_Int32 nValue );
-
- // an assignment to a variable
- ERRTYPE SetNotConst( const RSCINST & rInst, Atom nId );
-
- virtual ERRTYPE SetString( const RSCINST & rInst, const char * pStr );
-
- virtual ERRTYPE GetNumber( const RSCINST & rInst, sal_Int32 * pN );
-
- ERRTYPE GetBool( const RSCINST & rInst, bool * pB );
-
- virtual ERRTYPE GetConst( const RSCINST & rInst, Atom * pH );
-
- virtual ERRTYPE GetString( const RSCINST & rInst, char ** ppStr );
-
- virtual RSCINST Create( RSCINST * pInst,
- const RSCINST & rDefInst, bool bOwnClass = false );
-
- // destroys instance
- virtual void Destroy( const RSCINST & rInst );
-
- // checks consistency
- virtual bool IsConsistent( const RSCINST & rInst );
-
- // sets all default values
- virtual void SetToDefault( const RSCINST & rInst );
-
- // whether input is equal to default
- virtual bool IsDefault( const RSCINST & rInst );
-
- // sets value to default
- virtual bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
-
- // sets intance to default
- virtual void SetDefault( const RSCINST & rInst, Atom nVarId );
-
- // returns a variable default
- virtual RSCINST GetDefault( Atom nVarId );
-
- virtual void Delete( const RSCINST & rInst, RscTop * pClass,
- const RscId & rId );
-
- virtual void DeletePos( const RSCINST & rInst, sal_uInt32 nPos );
-
- // writes header and footer of a resource script file
- virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
- RscTypCont * pTC, sal_uInt32 nTab,
- const RscId & aId, const char * );
- virtual void WriteSrc( const RSCINST & rInst, FILE * fOutput,
- RscTypCont * pTC, sal_uInt32 nTab,const char * );
- virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, const RscId & aId,
- sal_uInt32 nDeep );
- virtual ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
- RscTypCont * pTC, sal_uInt32 nDeep );
-};
-
-#endif // INCLUDED_RSC_INC_RSCTOP_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */