2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-22 21:23:29 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2006-09-17 14:59:30 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <tools/rc.h>
|
2013-06-28 06:52:03 +02:00
|
|
|
#include <tools/wintypes.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
#include <rsctree.hxx>
|
|
|
|
#include <rsctop.hxx>
|
|
|
|
#include <rscrange.hxx>
|
|
|
|
#include <rscconst.hxx>
|
|
|
|
#include <rscflag.hxx>
|
|
|
|
#include <rscstr.hxx>
|
|
|
|
#include <rsccont.hxx>
|
|
|
|
#include <rscmgr.hxx>
|
|
|
|
#include <rscclass.hxx>
|
|
|
|
#include <rsckey.hxx>
|
|
|
|
#include <rscdb.hxx>
|
2011-08-19 20:31:38 -05:00
|
|
|
#include <rsclex.hxx>
|
|
|
|
#include <rscyacc.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void RscTypCont::Init()
|
|
|
|
{
|
|
|
|
RscEnum * pFieldUnits;
|
|
|
|
RscEnum * pColor;
|
|
|
|
RscEnum * pMapUnit;
|
|
|
|
RscEnum * pKey;
|
|
|
|
RscEnum * pTriState;
|
|
|
|
RscTupel * pGeometry;
|
|
|
|
RscArray * pLangGeometry;
|
|
|
|
RscCont * pStringList;
|
|
|
|
RscArray * pLangStringList;
|
|
|
|
RscTupel * pStringTupel;
|
|
|
|
RscTupel * pStringLongTupel;
|
|
|
|
RscCont * pStringTupelList;
|
|
|
|
RscCont * pStringLongTupelList;
|
|
|
|
RscArray * pLangStringLongTupelList;
|
|
|
|
|
|
|
|
RscTop * pClassMgr;
|
|
|
|
RscTop * pClassString;
|
|
|
|
RscTop * pClassStringArray;
|
|
|
|
RscTop * pClassBitmap;
|
|
|
|
RscTop * pClassImage;
|
|
|
|
RscTop * pClassImageList;
|
|
|
|
RscTop * pClassKeyCode;
|
|
|
|
|
2005-01-03 16:25:43 +00:00
|
|
|
Atom nId;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-07-03 02:35:31 -05:00
|
|
|
aNmTb.SetSort( false );
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-04-19 22:28:56 -05:00
|
|
|
aNmTb.Put( "LINE", LINE, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "NOT", NOT, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "DEFINE", DEFINE, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "INCLUDE", INCLUDE, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "DEFAULT", DEFAULT, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "class", CLASS, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "extendable", EXTENDABLE, (sal_IntPtr)0 );
|
|
|
|
aNmTb.Put( "writeifset", WRITEIFSET, (sal_IntPtr)0 );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-08-25 22:31:58 +02:00
|
|
|
/* values for integer types */
|
2016-04-20 17:18:51 +02:00
|
|
|
aNmTb.Put( "TRUE", BOOLEAN, (sal_IntPtr)true );
|
|
|
|
aNmTb.Put( "FALSE", BOOLEAN, (sal_IntPtr)false );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
aShort.SetRange( -32768, 32767 );
|
|
|
|
|
|
|
|
aUShort.SetRange( 0, 0xFFFF );
|
|
|
|
|
2006-06-20 04:46:27 +00:00
|
|
|
aLong.SetRange( SAL_MIN_INT32, SAL_MAX_INT32 );
|
|
|
|
aEnumLong.SetRange( SAL_MIN_INT32, SAL_MAX_INT32 );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
aIdUShort.SetRange( 0, 0xFFFF );
|
|
|
|
|
|
|
|
aIdNoZeroUShort.SetRange( 1, 0xFFFF );
|
|
|
|
}
|
|
|
|
{
|
2016-10-18 15:27:34 +02:00
|
|
|
aLangType.Init( aNmTb );
|
2011-01-24 07:49:59 -08:00
|
|
|
aBaseLst.push_back( pFieldUnits = InitFieldUnitsType() );
|
|
|
|
aBaseLst.push_back( pColor = InitColor() );
|
|
|
|
aBaseLst.push_back( pMapUnit = InitMapUnit() );
|
|
|
|
aBaseLst.push_back( pKey = InitKey() );
|
|
|
|
aBaseLst.push_back( pTriState = InitTriState() );
|
|
|
|
|
|
|
|
aBaseLst.push_back( pGeometry = InitGeometry() );
|
|
|
|
aBaseLst.push_back( pLangGeometry = InitLangGeometry( pGeometry ) );
|
|
|
|
aBaseLst.push_back( pStringList = InitStringList() );
|
|
|
|
aBaseLst.push_back( pLangStringList = InitLangStringList( pStringList ) );
|
|
|
|
aBaseLst.push_back( pStringTupel = InitStringTupel() );
|
|
|
|
aBaseLst.push_back( pStringTupelList = InitStringTupelList( pStringTupel ) );
|
2014-03-13 14:24:11 +00:00
|
|
|
aBaseLst.push_back( InitLangStringTupelList( pStringTupelList ) );
|
2011-01-24 07:49:59 -08:00
|
|
|
aBaseLst.push_back( pStringLongTupel = InitStringLongTupel() );
|
|
|
|
aBaseLst.push_back( pStringLongTupelList = InitStringLongTupelList( pStringLongTupel ) );
|
|
|
|
aBaseLst.push_back( pLangStringLongTupelList = InitLangStringLongTupelList( pStringLongTupelList ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
pRoot = pClassMgr = InitClassMgr();
|
|
|
|
|
2005-01-03 16:25:43 +00:00
|
|
|
aVersion.pClass = new RscClass( pHS->getID( "VersionControl" ),
|
2000-09-18 16:07:07 +00:00
|
|
|
RSC_VERSIONCONTROL, pClassMgr );
|
2015-11-10 10:21:32 +01:00
|
|
|
aVersion = aVersion.pClass->Create( nullptr, RSCINST() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
pClassString = InitClassString( pClassMgr );
|
|
|
|
pRoot->Insert( pClassString );
|
|
|
|
|
2015-08-25 22:31:58 +02:00
|
|
|
// set String as reference class of the base strings
|
2000-09-18 16:07:07 +00:00
|
|
|
aString.SetRefClass( pClassString );
|
|
|
|
|
2015-08-25 22:31:58 +02:00
|
|
|
// initialize class
|
2005-01-03 16:25:43 +00:00
|
|
|
nId = pHS->getID( "StringArray" );
|
2000-09-18 16:07:07 +00:00
|
|
|
pClassStringArray = new RscClass( nId, RSC_STRINGARRAY, pClassMgr );
|
|
|
|
pClassStringArray->SetCallPar( *pStdPar1, *pStdPar2, *pStdParType );
|
|
|
|
aNmTb.Put( nId, CLASSNAME, pClassStringArray );
|
|
|
|
pRoot->Insert( pClassStringArray );
|
|
|
|
|
2015-08-25 22:31:58 +02:00
|
|
|
// initialize variables
|
2000-09-18 16:07:07 +00:00
|
|
|
nId = aNmTb.Put( "ItemList", VARNAME );
|
|
|
|
pClassStringArray->SetVariable( nId, pLangStringLongTupelList );
|
|
|
|
|
|
|
|
pClassBitmap = InitClassBitmap( pClassMgr );
|
|
|
|
pRoot->Insert( pClassBitmap );
|
|
|
|
|
|
|
|
}
|
|
|
|
{
|
2016-10-06 14:32:21 +01:00
|
|
|
pClassImage = InitClassImage( pClassMgr, pClassBitmap );
|
2000-09-18 16:07:07 +00:00
|
|
|
pRoot->Insert( pClassImage );
|
|
|
|
|
2016-10-06 12:48:49 +01:00
|
|
|
pClassImageList = InitClassImageList( pClassMgr, pStringLongTupelList );
|
2000-09-18 16:07:07 +00:00
|
|
|
pRoot->Insert( pClassImageList );
|
|
|
|
}
|
|
|
|
{
|
|
|
|
pClassKeyCode = InitClassKeyCode( pClassMgr, pKey );
|
|
|
|
pRoot->Insert( pClassKeyCode );
|
|
|
|
}
|
|
|
|
{
|
2016-10-05 21:24:21 +01:00
|
|
|
RscTop* pClassMenuItem = InitClassMenuItem(pClassMgr);
|
2000-09-18 16:07:07 +00:00
|
|
|
pRoot->Insert( pClassMenuItem );
|
|
|
|
|
2015-10-12 07:45:01 +02:00
|
|
|
RscTop* pClassMenu = InitClassMenu( pClassMgr, pClassMenuItem );
|
2000-09-18 16:07:07 +00:00
|
|
|
pRoot->Insert( pClassMenu );
|
|
|
|
|
2015-08-25 22:31:58 +02:00
|
|
|
// pClassMenu is only completely defined here
|
2000-09-18 16:07:07 +00:00
|
|
|
nId = aNmTb.Put( "SubMenu", VARNAME );
|
2015-11-10 10:21:32 +01:00
|
|
|
pClassMenuItem->SetVariable( nId, pClassMenu, nullptr, VAR_SVDYNAMIC,
|
2016-05-14 20:11:29 +02:00
|
|
|
(sal_uInt32)RscMenuItem::Menu );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
aNmTb.SetSort();
|
|
|
|
}
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|