diff options
Diffstat (limited to 'svtools/source/inc')
22 files changed, 2846 insertions, 912 deletions
diff --git a/svtools/source/inc/configitems/historyoptions_const.hxx b/svtools/source/inc/configitems/historyoptions_const.hxx deleted file mode 100644 index c9148aeb26f8..000000000000 --- a/svtools/source/inc/configitems/historyoptions_const.hxx +++ /dev/null @@ -1,63 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: historyoptions_const.hxx,v $ - * - * $Revision: 1.1.4.2 $ - * - * last change: $Author: as $ $Date: 2008/03/19 11:17:49 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_svtools.hxx" - -#ifndef INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX -#define INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX - -#include <rtl/ustring.hxx> - -namespace -{ - static const ::rtl::OUString s_sCommonHistory = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/History"); - static const ::rtl::OUString s_sHistories = ::rtl::OUString::createFromAscii("org.openoffice.Office.Histories/Histories"); - static const ::rtl::OUString s_sPickListSize = ::rtl::OUString::createFromAscii("PickListSize"); - static const ::rtl::OUString s_sURLHistorySize = ::rtl::OUString::createFromAscii("Size"); - static const ::rtl::OUString s_sHelpBookmarksSize = ::rtl::OUString::createFromAscii("HelpBookmarkSize"); - static const ::rtl::OUString s_sPickList = ::rtl::OUString::createFromAscii("PickList"); - static const ::rtl::OUString s_sURLHistory = ::rtl::OUString::createFromAscii("URLHistory"); - static const ::rtl::OUString s_sHelpBookmarks = ::rtl::OUString::createFromAscii("HelpBookmarks"); - static const ::rtl::OUString s_sItemList = ::rtl::OUString::createFromAscii("ItemList"); - static const ::rtl::OUString s_sOrderList = ::rtl::OUString::createFromAscii("OrderList"); - static const ::rtl::OUString s_sHistoryItemRef = ::rtl::OUString::createFromAscii("HistoryItemRef"); - static const ::rtl::OUString s_sURL = ::rtl::OUString::createFromAscii("URL"); - static const ::rtl::OUString s_sFilter = ::rtl::OUString::createFromAscii("Filter"); - static const ::rtl::OUString s_sTitle = ::rtl::OUString::createFromAscii("Title"); - static const ::rtl::OUString s_sPassword = ::rtl::OUString::createFromAscii("Password"); -} - -#endif // INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX diff --git a/svtools/source/inc/configitems/useroptions_const.hxx b/svtools/source/inc/configitems/useroptions_const.hxx deleted file mode 100644 index 4dbd6da8bba3..000000000000 --- a/svtools/source/inc/configitems/useroptions_const.hxx +++ /dev/null @@ -1,64 +0,0 @@ -/************************************************************************* - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: useroptions_const.hxx,v $ - * - * $Revision: 1.1.4.2 $ - * - * last change: $Author: as $ $Date: 2008/03/19 11:17:50 $ - * - * The Contents of this file are made available subject to - * the terms of GNU Lesser General Public License Version 2.1. - * - * - * GNU Lesser General Public License Version 2.1 - * ============================================= - * Copyright 2005 by Sun Microsystems, Inc. - * 901 San Antonio Road, Palo Alto, CA 94303, USA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2.1, as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - ************************************************************************/ - -#ifndef INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX -#define INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX - -#include <rtl/ustring.hxx> - -namespace -{ - static const ::rtl::OUString s_sData = ::rtl::OUString::createFromAscii("org.openoffice.UserProfile/Data"); - static const ::rtl::OUString s_so = ::rtl::OUString::createFromAscii("o"); // USER_OPT_COMPANY - static const ::rtl::OUString s_sgivenname = ::rtl::OUString::createFromAscii("givenname"); // USER_OPT_FIRSTNAME - static const ::rtl::OUString s_ssn = ::rtl::OUString::createFromAscii("sn"); // USER_OPT_LASTNAME - static const ::rtl::OUString s_sinitials = ::rtl::OUString::createFromAscii("initials"); // USER_OPT_ID - static const ::rtl::OUString s_sstreet = ::rtl::OUString::createFromAscii("street"); // USER_OPT_STREET - static const ::rtl::OUString s_sl = ::rtl::OUString::createFromAscii("l"); // USER_OPT_CITY - static const ::rtl::OUString s_sst = ::rtl::OUString::createFromAscii("st"); // USER_OPT_STATE - static const ::rtl::OUString s_spostalcode = ::rtl::OUString::createFromAscii("postalcode"); // USER_OPT_ZIP - static const ::rtl::OUString s_sc = ::rtl::OUString::createFromAscii("c"); // USER_OPT_COUNTRY - static const ::rtl::OUString s_stitle = ::rtl::OUString::createFromAscii("title"); // USER_OPT_TITLE - static const ::rtl::OUString s_sposition = ::rtl::OUString::createFromAscii("position"); // USER_OPT_POSITION - static const ::rtl::OUString s_shomephone = ::rtl::OUString::createFromAscii("homephone"); // USER_OPT_TELEPHONEHOME - static const ::rtl::OUString s_stelephonenumber = ::rtl::OUString::createFromAscii("telephonenumber"); // USER_OPT_TELEPHONEWORK - static const ::rtl::OUString s_sfacsimiletelephonenumber = ::rtl::OUString::createFromAscii("facsimiletelephonenumber"); // USER_OPT_FAX - static const ::rtl::OUString s_smail = ::rtl::OUString::createFromAscii("mail"); // USER_OPT_EMAIL - static const ::rtl::OUString s_scustomernumber = ::rtl::OUString::createFromAscii("customernumber"); // USER_OPT_CUSTOMERNUMBER - static const ::rtl::OUString s_sfathersname = ::rtl::OUString::createFromAscii("fathersname"); // USER_OPT_FATHERSNAME - static const ::rtl::OUString s_sapartment = ::rtl::OUString::createFromAscii("apartment"); // USER_OPT_APARTMENT -} - -#endif // INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX diff --git a/svtools/source/inc/filectrl.hrc b/svtools/source/inc/filectrl.hrc new file mode 100644 index 000000000000..13fb89afd382 --- /dev/null +++ b/svtools/source/inc/filectrl.hrc @@ -0,0 +1,37 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: filectrl.hrc,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SV_FILECTRL_HRC +#define _SV_FILECTRL_HRC + +#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?! + +#endif + diff --git a/svtools/source/inc/fsfactory.hxx b/svtools/source/inc/fsfactory.hxx deleted file mode 100644 index 5954ecebabc2..000000000000 --- a/svtools/source/inc/fsfactory.hxx +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: fsfactory.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef __FSFACTORY_HXX_ -#define __FSACTORY_HXX_ - -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <cppuhelper/implbase2.hxx> - - -class FSStorage; - -class FSStorageFactory : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XSingleServiceFactory, - ::com::sun::star::lang::XServiceInfo > -{ - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - -public: - FSStorageFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ) - : m_xFactory( xFactory ) - { - OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" ); - } - - static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - impl_staticGetSupportedServiceNames(); - - static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); - - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - impl_staticCreateSelfInstance( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); - - - // XSingleServiceFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - -}; - -#endif - diff --git a/svtools/source/inc/gifread.hxx b/svtools/source/inc/gifread.hxx new file mode 100644 index 000000000000..8a9d299930c9 --- /dev/null +++ b/svtools/source/inc/gifread.hxx @@ -0,0 +1,147 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: gifread.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GIFREAD_HXX +#define _GIFREAD_HXX + +#ifndef _GRAPH_HXX +#include <vcl/graph.hxx> +#endif +#ifndef _BMPACC_HXX +#include <vcl/bmpacc.hxx> +#endif + +#ifdef _GIFPRIVATE + +// --------- +// - Enums - +// --------- + +enum GIFAction +{ + GLOBAL_HEADER_READING, + MARKER_READING, + EXTENSION_READING, + LOCAL_HEADER_READING, + FIRST_BLOCK_READING, + NEXT_BLOCK_READING, + ABORT_READING, + END_READING +}; + +// ------------------------------------------------------------------------ + +enum ReadState +{ + GIFREAD_OK, + GIFREAD_ERROR, + GIFREAD_NEED_MORE +}; + +// ------------- +// - GIFReader - +// ------------- + +class GIFLZWDecompressor; + +class SvStream; + +class GIFReader : public GraphicReader +{ + Graphic aImGraphic; + Animation aAnimation; + Bitmap aBmp8; + Bitmap aBmp1; + BitmapPalette aGPalette; + BitmapPalette aLPalette; + SvStream& rIStm; + void* pCallerData; + HPBYTE pSrcBuf; + GIFLZWDecompressor* pDecomp; + BitmapWriteAccess* pAcc8; + BitmapWriteAccess* pAcc1; + long nYAcc; + long nLastPos; + sal_uInt32 nLogWidth100; + sal_uInt32 nLogHeight100; + USHORT nTimer; + USHORT nGlobalWidth; // maximale Bildbreite aus Header + USHORT nGlobalHeight; // maximale Bildhoehe aus Header + USHORT nImageWidth; // maximale Bildbreite aus Header + USHORT nImageHeight; // maximale Bildhoehe aus Header + USHORT nImagePosX; + USHORT nImagePosY; + USHORT nImageX; // maximale Bildbreite aus Header + USHORT nImageY; // maximale Bildhoehe aus Header + USHORT nLastImageY; + USHORT nLastInterCount; + USHORT nLoops; + GIFAction eActAction; + BOOL bStatus; + BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja: + BOOL bInterlaced; + BOOL bOverreadBlock; + BOOL bImGraphicReady; + BOOL bGlobalPalette; + BYTE nBackgroundColor; // Hintergrundfarbe + BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig + BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku) + BYTE cTransIndex1; + BYTE cNonTransIndex1; + + void ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount ); + void ClearImageExtensions(); + BOOL CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, BOOL bWatchForBackgroundColor ); + BOOL ReadGlobalHeader(); + BOOL ReadExtension(); + BOOL ReadLocalHeader(); + ULONG ReadNextBlock(); + void FillImages( HPBYTE pBytes, ULONG nCount ); + void CreateNewBitmaps(); + BOOL ProcessGIF(); + +public: + + ReadState ReadGIF( Graphic& rGraphic ); + const Graphic& GetIntermediateGraphic(); + + GIFReader( SvStream& rStm ); + virtual ~GIFReader(); +}; + +#endif // _GIFPRIVATE + +// ------------- +// - ImportGIF - +// ------------- + + BOOL ImportGIF( SvStream& rStream, Graphic& rGraphic ); + +#endif // _GIFREAD_HXX diff --git a/svtools/source/inc/gradwrap.hxx b/svtools/source/inc/gradwrap.hxx new file mode 100644 index 000000000000..28c9d8db1fcd --- /dev/null +++ b/svtools/source/inc/gradwrap.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: gradwrap.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SVGEN_HXX +#include <svgen.hxx> +#endif + + +/****************************************************************************** +|* +|* class GradientWrapper +|* +|* Ersterstellung: KA 24.11.95 +|* letzte Aenderung: KA 24.11.95 +|* +|* Zeck: dient beim MetaFile-Export dazu, die eigentliche Berechungs- +|* funktionalitaet zu kapseln. Das Schreiben der Records fuer +|* die unterschiedlichen File-Formate geschieht ueber LinkHandler. +|* +|* Klassen, die diesen Wrapper benutzen, muessen drei Linkhandler +|* zur Verfuegung stellen, die im Ctor uebergeben werden: +|* +|* 1. Linkhandler zum Schreiben eines Records fuer Polygonausgabe +|* 2. Linkhandler zum Schreiben eines Records fuer PolyPolygonausgabe +|* 3. Linkhandler zum Schreiben eines Records fuer Setzen der Brush +|* +\******************************************************************************/ + + +class GradientWrapper +{ + Link aDrawPolyRecordHdl; + Link aDrawPolyPolyRecordHdl; + Link aSetFillInBrushRecordHdl; + + GradientWrapper() {}; + + +public: + GradientWrapper(const Link& rDrawPolyRecordHdl, + const Link& rDrawPolyPolyRecordHdl, + const Link& rSetFillInBrushHdl); + ~GradientWrapper(); + + + void WriteLinearGradient(const Rectangle& rRect, + const Gradient& rGradient); + void WriteRadialGradient(const Rectangle& rRect, + const Gradient& rGradient); + void WriteRectGradient(const Rectangle& rRect, + const Gradient& rGradient); +}; diff --git a/svtools/source/inc/hatchwindowfactory.hxx b/svtools/source/inc/hatchwindowfactory.hxx deleted file mode 100644 index 72eaa58bb16d..000000000000 --- a/svtools/source/inc/hatchwindowfactory.hxx +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: hatchwindowfactory.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _XHATCHWINDOWFACTORY_HXX_ -#define _XHATCHWINDOWFACTORY_HXX_ - -#include <com/sun/star/embed/XHatchWindowFactory.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> - - -#ifndef _CPPUHELPER_IMPLBASE5_HXX_ -#include <cppuhelper/implbase2.hxx> -#endif - - -class OHatchWindowFactory : public ::cppu::WeakImplHelper2< - ::com::sun::star::embed::XHatchWindowFactory, - ::com::sun::star::lang::XServiceInfo > -{ - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; - -public: - OHatchWindowFactory( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory ) - : m_xFactory( xFactory ) - { - OSL_ENSURE( xFactory.is(), "No service manager is provided!\n" ); - } - - static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL impl_staticGetSupportedServiceNames(); - - static ::rtl::OUString SAL_CALL impl_staticGetImplementationName(); - - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - impl_staticCreateSelfInstance( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ); - - - // XHatchWindowFactory - virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XHatchWindow > SAL_CALL createHatchWindowInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent, const ::com::sun::star::awt::Rectangle& aBounds, const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::uno::RuntimeException); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); - -}; - -#endif - diff --git a/svtools/source/inc/iodlg.hrc b/svtools/source/inc/iodlg.hrc new file mode 100644 index 000000000000..9c41e06a2b6c --- /dev/null +++ b/svtools/source/inc/iodlg.hrc @@ -0,0 +1,110 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: iodlg.hrc,v $ + * $Revision: 1.10 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVTOOLS_IODLGIMPL_HRC +#define _SVTOOLS_IODLGIMPL_HRC + +#ifndef _SVTOOLS_HRC +#include <svl/svtools.hrc> +#endif + +// ModalDialog DLG_SVT_EXPLORERFILE + +#define FT_EXPLORERFILE_CURRENTPATH 10 +#define BTN_EXPLORERFILE_NEWFOLDER 11 +#define BTN_EXPLORERFILE_LISTVIEW 12 +#define BTN_EXPLORERFILE_DETAILSVIEW 13 +#define BTN_EXPLORERFILE_UP 14 +#define BTN_EXPLORERFILE_STANDARD 15 +#define BTN_EXPLORERFILE_OPEN 16 +#define BTN_EXPLORERFILE_CANCEL 17 +#define BTN_EXPLORERFILE_HELP 18 + +#define IMG_FILEDLG_BTN_UP 10 +#define IMG_FILEDLG_BTN_STD 11 +#define IMG_FILEDLG_CREATEFOLDER 15 + +#define CTL_EXPLORERFILE_FILELIST 20 + +#define FT_EXPLORERFILE_FILENAME 30 +#define ED_EXPLORERFILE_FILENAME 31 +#define FT_EXPLORERFILE_SHARED_LISTBOX 32 +#define LB_EXPLORERFILE_SHARED_LISTBOX 33 +#define FT_EXPLORERFILE_FILETYPE 34 +#define LB_EXPLORERFILE_FILETYPE 35 + +#define CB_EXPLORERFILE_READONLY 40 +#define CB_EXPLORERFILE_PASSWORD 41 +#define CB_AUTO_EXTENSION 42 +#define CB_OPTIONS 43 + +// ----------------------------------------------- + +#define STR_EXPLORERFILE_OPEN 1 +#define STR_EXPLORERFILE_SAVE 2 +#define STR_EXPLORERFILE_BUTTONSAVE 3 +#define STR_PATHNAME 4 +#define STR_PATHSELECT 5 +#define STR_BUTTONSELECT 6 +#define STR_ACTUALVERSION 7 + +// DLG_SVT_QUERYFOLDERNAME ----------------------- + +#define FT_SVT_QUERYFOLDERNAME_DLG_NAME 10 +#define ED_SVT_QUERYFOLDERNAME_DLG_NAME 11 +#define FL_SVT_QUERYFOLDERNAME_DLG_NAME 12 +#define BT_SVT_QUERYFOLDERNAME_DLG_OK 13 +#define BT_SVT_QUERYFOLDERNAME_DLG_CANCEL 14 +#define BT_SVT_QUERYFOLDERNAME_DLG_HELP 15 + +// ----------------------------------------------- + +#define SID_SFX_START 5000 +#define SID_OPENURL (SID_SFX_START + 596) + +#define HID_FILEDLG_STANDARD (HID_SFX_START + 27) +#define HID_FILEDLG_MANAGER (HID_SFX_START + 28) +#define HID_FILEDLG_URL (HID_SFX_START + 29) +#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31) +#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32) + +#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218) +#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219) +#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220) +#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221) +#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222) +#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223) +#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224) +#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225) +#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226) +#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227) + +#endif + diff --git a/svtools/source/inc/jpeg.hxx b/svtools/source/inc/jpeg.hxx new file mode 100644 index 000000000000..d8de26c31009 --- /dev/null +++ b/svtools/source/inc/jpeg.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: jpeg.hxx,v $ + * $Revision: 1.10 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _JPEG_HXX +#define _JPEG_HXX + +#ifndef _GRAPH_HXX +#include <vcl/graph.hxx> +#endif +#include <svtools/fltcall.hxx> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/task/XStatusIndicator.hpp> + +#ifdef _JPEGPRIVATE + +// -------- +// - Enum - +// -------- + +enum ReadState +{ + JPEGREAD_OK, + JPEGREAD_ERROR, + JPEGREAD_NEED_MORE +}; + +// -------------- +// - JPEGReader - +// -------------- + +class JPEGReader : public GraphicReader +{ + SvStream& rIStm; + Bitmap aBmp; + Bitmap aBmp1; + BitmapWriteAccess* pAcc; + BitmapWriteAccess* pAcc1; + void* pBuffer; + long nLastPos; + long nFormerPos; + long nLastLines; + sal_Bool bSetLogSize; + + Graphic CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines ); + void FillBitmap(); + +public: + + void* CreateBitmap( void* JPEGCreateBitmapParam ); + +public: + + + + JPEGReader( SvStream& rStm, void* pCallData, sal_Bool bSetLogSize ); + virtual ~JPEGReader(); + + + ReadState Read( Graphic& rGraphic ); +}; + +// -------------- +// - JPEGWriter - +// -------------- + +class JPEGWriter +{ + SvStream& rOStm; + Bitmap aBmp; + BitmapReadAccess* pAcc; + BYTE* pBuffer; + BOOL bNative; + + sal_Bool bGreys; + sal_Int32 nQuality; + + com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > xStatusIndicator; + +public: + + void* GetScanline( long nY ); + + JPEGWriter( SvStream& rOStm, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData ); + ~JPEGWriter() {}; + + BOOL Write( const Graphic& rGraphic ); +}; + +#endif // _JPEGPRIVATE + +// --------------------- +// - Import/ExportJPEG - +// --------------------- + +BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ); + +BOOL ExportJPEG( SvStream& rStream, const Graphic& rGraphic, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pFilterData ); + +#endif // _JPEG_HXX diff --git a/svtools/source/inc/msgrd.hxx b/svtools/source/inc/msgrd.hxx new file mode 100644 index 000000000000..381ae71c7b83 --- /dev/null +++ b/svtools/source/inc/msgrd.hxx @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: msgrd.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _MSGRD_HXX +#define _MSGRD_HXX + + +BOOL ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile, + BOOL(*pCallback)(void *, USHORT), void * pCallerData, + ULONG nMinPercent, ULONG nMaxPercent); + + +#endif // _MSGRD_HXX diff --git a/svtools/source/inc/msgwr.hxx b/svtools/source/inc/msgwr.hxx new file mode 100644 index 000000000000..c347938fd34d --- /dev/null +++ b/svtools/source/inc/msgwr.hxx @@ -0,0 +1,41 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: msgwr.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _MSGWR_HXX +#define _MSGWR_HXX + + +BOOL ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream, + BOOL(*pCallback)(void *, USHORT), void * pCallerData, + ULONG nMinPercent, ULONG nMaxPercent); + + +#endif // _MSGWR_HXX + diff --git a/svtools/source/inc/passwordcontainer.hxx b/svtools/source/inc/passwordcontainer.hxx deleted file mode 100644 index a067672f3cf6..000000000000 --- a/svtools/source/inc/passwordcontainer.hxx +++ /dev/null @@ -1,429 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: passwordcontainer.hxx,v $ - * $Revision: 1.11 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef INCLUDED_COMPHELPER_PASSWORDCONTAINER_HXX -#define INCLUDED_COMPHELPER_PASSWORDCONTAINER_HXX - -#include <list> -#include <vector> -#include <map> -#include <com/sun/star/task/XPasswordContainer.hpp> -#include <com/sun/star/task/XUrlContainer.hpp> -#include <com/sun/star/task/PasswordRequestMode.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> -#include <com/sun/star/lang/XEventListener.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/task/XMasterPasswordHandling2.hpp> -#include <cppuhelper/implbase5.hxx> -#include <cppuhelper/typeprovider.hxx> -#include <cppuhelper/queryinterface.hxx> -#include <cppuhelper/factory.hxx> - -#include <tools/stream.hxx> -#include <unotools/configitem.hxx> -#include <ucbhelper/interactionrequest.hxx> - -#include <rtl/ref.hxx> -#include <osl/mutex.hxx> - -#include "syscreds.hxx" - -#define MEMORY_RECORD 0 -#define PERSISTENT_RECORD 1 - -//---------------------------------------------------------------------------------- - -class NamePassRecord -{ - ::rtl::OUString m_aName; - - // there are two lists of passwords, memory passwords and persistent passwords - sal_Bool m_bHasMemPass; - ::std::vector< ::rtl::OUString > m_aMemPass; - - // persistent passwords are encrypted in one string - sal_Bool m_bHasPersPass; - ::rtl::OUString m_aPersPass; - - void InitArrays( sal_Bool bHasMemoryList, const ::std::vector< ::rtl::OUString >& aMemoryList, - sal_Bool bHasPersistentList, const ::rtl::OUString& aPersistentList ) - { - m_bHasMemPass = bHasMemoryList; - if ( bHasMemoryList ) - m_aMemPass = aMemoryList; - - m_bHasPersPass = bHasPersistentList; - if ( bHasPersistentList ) - m_aPersPass = aPersistentList; - } - -public: - - NamePassRecord( const ::rtl::OUString& aName ) - : m_aName( aName ) - , m_bHasMemPass( sal_False ) - , m_bHasPersPass( sal_False ) - { - } - - NamePassRecord( const ::rtl::OUString& aName, const ::std::vector< ::rtl::OUString >& aMemoryList ) - : m_aName( aName ) - , m_bHasMemPass( sal_True ) - , m_aMemPass( aMemoryList ) - , m_bHasPersPass( sal_False ) - { - } - - NamePassRecord( const ::rtl::OUString& aName, const ::rtl::OUString& aPersistentList ) - : m_aName( aName ) - , m_bHasMemPass( sal_False ) - , m_bHasPersPass( sal_True ) - , m_aPersPass( aPersistentList ) - { - } - - NamePassRecord( const ::rtl::OUString& aName, - sal_Bool bHasMemoryList, const ::std::vector< ::rtl::OUString >& aMemoryList, - sal_Bool bHasPersistentList, const ::rtl::OUString aPersistentList ) - : m_aName( aName ) - , m_bHasMemPass( bHasMemoryList ) - , m_bHasPersPass( bHasPersistentList ) - { - InitArrays( bHasMemoryList, aMemoryList, bHasPersistentList, aPersistentList ); - } - - NamePassRecord( const NamePassRecord& aRecord ) - : m_aName( aRecord.m_aName ) - , m_bHasMemPass( sal_False ) - , m_bHasPersPass( sal_False ) - { - InitArrays( aRecord.m_bHasMemPass, aRecord.m_aMemPass, aRecord.m_bHasPersPass, aRecord.m_aPersPass ); - } - - NamePassRecord& operator=( const NamePassRecord& aRecord ) - { - m_aName = aRecord.m_aName; - - m_aMemPass.clear(); - m_aPersPass = ::rtl::OUString(); - InitArrays( aRecord.m_bHasMemPass, aRecord.m_aMemPass, aRecord.m_bHasPersPass, aRecord.m_aPersPass ); - - return *this; - } - - ::rtl::OUString GetUserName() const - { - return m_aName; - } - - sal_Bool HasPasswords( sal_Int8 nStatus ) const - { - if ( nStatus == MEMORY_RECORD ) - return m_bHasMemPass; - if ( nStatus == PERSISTENT_RECORD ) - return m_bHasPersPass; - - return sal_False; - } - - ::std::vector< ::rtl::OUString > GetMemPasswords() const - { - if ( m_bHasMemPass ) - return m_aMemPass; - - return ::std::vector< ::rtl::OUString >(); - } - - ::rtl::OUString GetPersPasswords() const - { - if ( m_bHasPersPass ) - return m_aPersPass; - - return ::rtl::OUString(); - } - - void SetMemPasswords( const ::std::vector< ::rtl::OUString >& aMemList ) - { - m_aMemPass = aMemList; - m_bHasMemPass = sal_True; - } - - void SetPersPasswords( const ::rtl::OUString& aPersList ) - { - m_aPersPass = aPersList; - m_bHasPersPass = sal_True; - } - - void RemovePasswords( sal_Int8 nStatus ) - { - if ( nStatus == MEMORY_RECORD ) - { - m_bHasMemPass = sal_False; - m_aMemPass.clear(); - } - else if ( nStatus == PERSISTENT_RECORD ) - { - m_bHasPersPass = sal_False; - m_aPersPass = ::rtl::OUString(); - } - } - -}; - -//---------------------------------------------------------------------------------- - -typedef ::std::pair< const ::rtl::OUString, ::std::list< NamePassRecord > > PairUrlRecord; -typedef ::std::map< ::rtl::OUString, ::std::list< NamePassRecord > > PassMap; - -//---------------------------------------------------------------------------------- - -class PasswordContainer; - -class StorageItem : public ::utl::ConfigItem { - PasswordContainer* mainCont; - sal_Bool hasEncoded; - ::rtl::OUString mEncoded; -public: - StorageItem( PasswordContainer* point, const ::rtl::OUString& path ) : - ConfigItem( path, CONFIG_MODE_IMMEDIATE_UPDATE ), - mainCont( point ), - hasEncoded( sal_False ) - { - ::com::sun::star::uno::Sequence< ::rtl::OUString > aNode( 1 ); - *aNode.getArray() = path; - *aNode.getArray() += ::rtl::OUString::createFromAscii( "/Store" ); - EnableNotification( aNode ); - } - - PassMap getInfo(); - void update( const ::rtl::OUString& url, const NamePassRecord& rec ); - void remove( const ::rtl::OUString& url, const ::rtl::OUString& rec ); - void clear(); - - sal_Bool getEncodedMP( ::rtl::OUString& aResult ); - void setEncodedMP( const ::rtl::OUString& aResult, sal_Bool bAcceptEnmpty = sal_False ); - void setUseStorage( sal_Bool bUse ); - sal_Bool useStorage(); - - virtual void Notify( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ); - virtual void Commit(); -}; - -//---------------------------------------------------------------------------------- - -enum PasswordState { - no_password, - entered, - cancelled -}; - -class PasswordContainer : public ::cppu::WeakImplHelper5< - ::com::sun::star::task::XPasswordContainer, - ::com::sun::star::task::XMasterPasswordHandling2, - ::com::sun::star::task::XUrlContainer, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::lang::XEventListener > -{ -private: - PassMap m_aContainer; - StorageItem* m_pStorageFile; - ::osl::Mutex mMutex; - ::rtl::OUString m_aMasterPasswd; // master password is set when the string is not empty - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mComponent; - SysCredentialsConfig mUrlContainer; - - ::com::sun::star::uno::Sequence< ::com::sun::star::task::UserRecord > CopyToUserRecordSequence( - const ::std::list< NamePassRecord >& original, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - ::com::sun::star::task::UserRecord CopyToUserRecord( - const NamePassRecord& aRecord, - sal_Bool& io_bTryToDecode, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler ); - - ::com::sun::star::uno::Sequence< ::com::sun::star::task::UserRecord > FindUsr( - const ::std::list< NamePassRecord >& userlist, - const ::rtl::OUString& name, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); -bool createUrlRecord( - const PassMap::iterator & rIter, - bool bName, - const ::rtl::OUString & aName, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler, - ::com::sun::star::task::UrlRecord & rRec ) - throw( ::com::sun::star::uno::RuntimeException ); - -::com::sun::star::task::UrlRecord find( - const ::rtl::OUString& aURL, - const ::rtl::OUString& aName, - bool bName, // only needed to support empty user names - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& aHandler ) throw(::com::sun::star::uno::RuntimeException); - - ::rtl::OUString GetDefaultMasterPassword(); - - ::rtl::OUString RequestPasswordFromUser( - ::com::sun::star::task::PasswordRequestMode aRMode, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ); - - ::rtl::OUString GetMasterPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - void UpdateVector( const ::rtl::OUString& url, ::std::list< NamePassRecord >& toUpdate, NamePassRecord& rec, sal_Bool writeFile ) - throw(::com::sun::star::uno::RuntimeException); - - void PrivateAdd( const ::rtl::OUString& aUrl, - const ::rtl::OUString& aUserName, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPasswords, - char aMode, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - ::std::vector< ::rtl::OUString > DecodePasswords( const ::rtl::OUString& aLine, const ::rtl::OUString& aMasterPassword ) - throw(::com::sun::star::uno::RuntimeException); - - ::rtl::OUString EncodePasswords( ::std::vector< ::rtl::OUString > lines, const ::rtl::OUString& aMasterPassword ) - throw(::com::sun::star::uno::RuntimeException); - -public: - PasswordContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ); - ~PasswordContainer(); - - virtual void SAL_CALL add( const ::rtl::OUString& aUrl, - const ::rtl::OUString& aUserName, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPasswords, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL addPersistent( const ::rtl::OUString& aUrl, - const ::rtl::OUString& aUserName, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPasswords, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::task::UrlRecord SAL_CALL - find( const ::rtl::OUString& aUrl, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::task::UrlRecord SAL_CALL - findForName( const ::rtl::OUString& aUrl, - const ::rtl::OUString& aUserName, - const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) - throw(::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL remove( const ::rtl::OUString& aUrl, - const ::rtl::OUString& aUserName ) - throw(::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL removePersistent( const ::rtl::OUString& aUrl, - const ::rtl::OUString& aUserName ) - throw(::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL removeAllPersistent() throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::task::UrlRecord > SAL_CALL - getAllPersistent( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& Handler ) throw(::com::sun::star::uno::RuntimeException); - - - // provide factory - static ::rtl::OUString SAL_CALL impl_getStaticImplementationName( ) throw(::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - impl_getStaticSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > SAL_CALL - impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ServiceManager ) throw(::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL - impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) throw( ::com::sun::star::uno::RuntimeException ); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); - - // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) - throw(::com::sun::star::uno::RuntimeException); - - // XMasterPasswordHandling - virtual ::sal_Bool SAL_CALL authorizateWithMasterPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL changeMasterPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeMasterPassword() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL hasMasterPassword( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL allowPersistentStoring( ::sal_Bool bAllow ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isPersistentStoringAllowed( ) throw (::com::sun::star::uno::RuntimeException); - - // XMasterPasswordHandling2 - virtual ::sal_Bool SAL_CALL useDefaultMasterPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xHandler ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isDefaultMasterPasswordUsed( ) throw (::com::sun::star::uno::RuntimeException); - - // XUrlContainer - virtual void SAL_CALL addUrl( const ::rtl::OUString& Url, ::sal_Bool MakePersistent ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL findUrl( const ::rtl::OUString& Url ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeUrl( const ::rtl::OUString& Url ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getUrls( ::sal_Bool OnlyPersistent ) throw (::com::sun::star::uno::RuntimeException); - - void Notify(); -}; - -//---------------------------------------------------------------------------------- - -class MasterPasswordRequest_Impl : public ucbhelper::InteractionRequest -{ - ::rtl::Reference< ucbhelper::InteractionSupplyAuthentication > m_xAuthSupplier; - -public: - MasterPasswordRequest_Impl( ::com::sun::star::task::PasswordRequestMode Mode ); - - const ::rtl::Reference< ucbhelper::InteractionSupplyAuthentication > & - getAuthenticationSupplier() const { return m_xAuthSupplier; } - -}; - -//---------------------------------------------------------------------------------- - -class RW_SvMemoryStream : public SvMemoryStream { -public: - RW_SvMemoryStream( void* Buf, ULONG Size, StreamMode eMode ): - SvMemoryStream( Buf, Size, eMode){} - - RW_SvMemoryStream( ULONG InitSize=512, ULONG Resize=64 ): - SvMemoryStream( InitSize, Resize ){} - - ULONG getActualSize(){ return nEndOfData; } -}; - - - -#endif // #ifndef INCLUDED_COMPHELPER_PASSWORDCONTAINER_HXX - diff --git a/svtools/source/inc/poolio.hxx b/svtools/source/inc/poolio.hxx deleted file mode 100644 index fb30fc04832d..000000000000 --- a/svtools/source/inc/poolio.hxx +++ /dev/null @@ -1,204 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: poolio.hxx,v $ - * $Revision: 1.7 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include <svtools/brdcst.hxx> - - -#ifndef DELETEZ -#define DELETEZ(pPtr) { delete pPtr; pPtr = 0; } -#endif - - -struct SfxPoolVersion_Impl -{ - USHORT _nVer; - USHORT _nStart, _nEnd; - USHORT* _pMap; - - SfxPoolVersion_Impl( USHORT nVer, USHORT nStart, USHORT nEnd, - USHORT *pMap ) - : _nVer( nVer ), - _nStart( nStart ), - _nEnd( nEnd ), - _pMap( pMap ) - {} - SfxPoolVersion_Impl( const SfxPoolVersion_Impl &rOrig ) - : _nVer( rOrig._nVer ), - _nStart( rOrig._nStart ), - _nEnd( rOrig._nEnd ), - _pMap( rOrig._pMap ) - {} -}; - -SV_DECL_PTRARR( SfxPoolItemArrayBase_Impl, SfxPoolItem*, 0, 5 ) -SV_DECL_PTRARR_DEL( SfxPoolVersionArr_Impl, SfxPoolVersion_Impl*, 0, 2 ) - -struct SfxPoolItemArray_Impl: public SfxPoolItemArrayBase_Impl -{ - USHORT nFirstFree; - - SfxPoolItemArray_Impl (USHORT nInitSize = 0) - : SfxPoolItemArrayBase_Impl( nInitSize ), - nFirstFree( 0 ) - {} -}; - -class SfxStyleSheetIterator; - -struct SfxItemPool_Impl -{ - SfxBroadcaster aBC; - SfxPoolItemArray_Impl** ppPoolItems; - SfxPoolVersionArr_Impl aVersions; - USHORT nVersion; - USHORT nLoadingVersion; - USHORT nInitRefCount; // 1, beim Laden ggf. 2 - USHORT nVerStart, nVerEnd; // WhichRange in Versions - USHORT nStoringStart, nStoringEnd; // zu speichernder Range - BYTE nMajorVer, nMinorVer; // Pool selbst - SfxMapUnit eDefMetric; - FASTBOOL bInSetItem; - FASTBOOL bStreaming; // in Load() bzw. Store() - - SfxItemPool_Impl( USHORT nStart, USHORT nEnd ) - : ppPoolItems (new SfxPoolItemArray_Impl*[ nEnd - nStart + 1]) - { - memset( ppPoolItems, 0, sizeof( SfxPoolItemArray_Impl* ) * ( nEnd - nStart + 1) ); - } - - ~SfxItemPool_Impl() - { - delete[] ppPoolItems; - } - - void DeleteItems() - { - delete[] ppPoolItems; ppPoolItems = 0; - } -}; - -// ----------------------------------------------------------------------- - -// IBM-C-Set mag keine doppelten Defines -#ifdef DBG -# undef DBG -#endif - -#if defined(DBG_UTIL) && defined(MSC) -#define SFX_TRACE(s,p) \ - { \ - ByteString aPtr(RTL_CONSTASCII_STRINGPARAM("0x0000:0x0000")); \ - _snprintf(const_cast< sal_Char *>(aPtr.GetBuffer()), aPtr.Len(), \ - "%lp", p ); \ - aPtr.Insert(s, 0); \ - DbgTrace( aPtr.GetBuffer() ); \ - } -#define DBG(x) x -#else -#define SFX_TRACE(s,p) -#define DBG(x) -#endif - -#define CHECK_FILEFORMAT( rStream, nTag ) \ - { USHORT nFileTag; \ - rStream >> nFileTag; \ - if ( nTag != nFileTag ) \ - { \ - DBG_ERROR( #nTag ); /*! s.u. */ \ - /*! error-code setzen und auswerten! */ \ - (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \ - pImp->bStreaming = FALSE; \ - return rStream; \ - } \ - } - -#define CHECK_FILEFORMAT_RELEASE( rStream, nTag, pPointer ) \ - { USHORT nFileTag; \ - rStream >> nFileTag; \ - if ( nTag != nFileTag ) \ - { \ - DBG_ERROR( #nTag ); /*! s.u. */ \ - /*! error-code setzen und auswerten! */ \ - (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \ - pImp->bStreaming = FALSE; \ - delete pPointer; \ - return rStream; \ - } \ - } - -#define CHECK_FILEFORMAT2( rStream, nTag1, nTag2 ) \ - { USHORT nFileTag; \ - rStream >> nFileTag; \ - if ( nTag1 != nFileTag && nTag2 != nFileTag ) \ - { \ - DBG_ERROR( #nTag1 ); /*! s.u. */ \ - /*! error-code setzen und auswerten! */ \ - (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \ - pImp->bStreaming = FALSE; \ - return rStream; \ - } \ - } - -#define SFX_ITEMPOOL_VER_MAJOR BYTE(2) -#define SFX_ITEMPOOL_VER_MINOR BYTE(0) - -#define SFX_ITEMPOOL_TAG_STARTPOOL_4 USHORT(0x1111) -#define SFX_ITEMPOOL_TAG_STARTPOOL_5 USHORT(0xBBBB) -#define SFX_ITEMPOOL_TAG_ITEMPOOL USHORT(0xAAAA) -#define SFX_ITEMPOOL_TAG_ITEMS USHORT(0x2222) -#define SFX_ITEMPOOL_TAG_ITEM USHORT(0x7777) -#define SFX_ITEMPOOL_TAG_SIZES USHORT(0x3333) -#define SFX_ITEMPOOL_TAG_DEFAULTS USHORT(0x4444) -#define SFX_ITEMPOOL_TAG_VERSIONMAP USHORT(0x5555) -#define SFX_ITEMPOOL_TAG_HEADER USHORT(0x6666) -#define SFX_ITEMPOOL_TAG_ENDPOOL USHORT(0xEEEE) -#define SFX_ITEMPOOL_TAG_TRICK4OLD USHORT(0xFFFF) - -#define SFX_ITEMPOOL_REC BYTE(0x01) -#define SFX_ITEMPOOL_REC_HEADER BYTE(0x10) -#define SFX_ITEMPOOL_REC_VERSIONMAP USHORT(0x0020) -#define SFX_ITEMPOOL_REC_WHICHIDS USHORT(0x0030) -#define SFX_ITEMPOOL_REC_ITEMS USHORT(0x0040) -#define SFX_ITEMPOOL_REC_DEFAULTS USHORT(0x0050) - -#define SFX_ITEMSET_REC BYTE(0x02) - -#define SFX_STYLES_REC BYTE(0x03) -#define SFX_STYLES_REC_HEADER USHORT(0x0010) -#define SFX_STYLES_REC_STYLES USHORT(0x0020) - -//======================================================================== - -inline USHORT SfxItemPool::GetIndex_Impl(USHORT nWhich) const -{ - DBG_CHKTHIS(SfxItemPool, 0); - DBG_ASSERT(nWhich >= nStart && nWhich <= nEnd, "Which-Id nicht im Pool-Bereich"); - return nWhich - nStart; -} - diff --git a/svtools/source/inc/property.hxx b/svtools/source/inc/property.hxx new file mode 100644 index 000000000000..2a756f177608 --- /dev/null +++ b/svtools/source/inc/property.hxx @@ -0,0 +1,588 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: property.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SV_PROPERTY_HXX +#define SV_PROPERTY_HXX + +#ifndef _VIRDEV_HXX //autogen +#include <vcl/virdev.hxx> +#endif +#ifndef SV_FIXED_HXX +#include <vcl/fixed.hxx> +#endif +#ifndef SV_LSTBOX_HXX +#include <vcl/lstbox.hxx> +#endif +#ifndef SV_GROUP_HXX +#include <vcl/group.hxx> +#endif +#ifndef SV_BUTTON_HXX +#include <vcl/button.hxx> +#endif +#ifndef SV_MOREBTN_HXX +#include <vcl/morebtn.hxx> +#endif +#ifndef _DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#include <vcl/combobox.hxx> +#include <vcl/field.hxx> +#include <svl/svarray.hxx> + +#define _SVSTDARR_USHORTS +#include <svl/svstdarr.hxx> +#include <vcl/virdev.hxx> +#include <vcl/scrbar.hxx> +#include <svl/svarray.hxx> + +#ifndef _SVSTDARR_STRINGS +#define _SVSTDARR_STRINGS +#include <svl/svstdarr.hxx> +#endif +#include <vcl/tabpage.hxx> +#include <vcl/tabctrl.hxx> + +//------------------------------------------------------------------------ + +//======================================================================== +enum eKindOfControl { KOC_UNDEFINED=0,KOC_LISTBOX=1, KOC_COMBOBOX=2, + KOC_EDIT=3,KOC_USERDEFINED=5}; + +class SvXPropertyCtrListener; + +class SvXPropertyControl : public Control +{ +public: + SvXPropertyControl( Window* pParent, WinBits nWinStyle = 0 ); + SvXPropertyControl( Window* pParent, const ResId& rResId ); + + virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*)=0; + + virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener()=0; + virtual void SetProperty(const String &rString)=0; + virtual String GetProperty()const=0; + virtual BOOL HasList()=0; + virtual void ClearList()=0; + virtual void InsertEntry( const String& rString, + USHORT nPos = LISTBOX_APPEND )=0; + + virtual void SetCtrSize(const Size& rSize)=0; + virtual void SetLocked(BOOL bLocked=TRUE)=0; + + virtual void SetMyName(const String &rString)=0; + virtual String GetMyName()const=0; + + virtual void SetMyData(void*)=0; + virtual void* GetMyData()=0; +}; + +class SvXPropertyCtrListener +{ + +public: + virtual void Modified (SvXPropertyControl *pSvXPCtr)=0; + virtual void GetFocus (SvXPropertyControl *pSvXPCtr)=0; + virtual void LoseFocus(SvXPropertyControl *pSvXPCtr)=0; + virtual void KeyInput (SvXPropertyControl *pSvXPCtr ,const KeyCode&)=0; +}; + + +class SvXPropertyEdit : public SvXPropertyControl +{ +private: + + String aName; + SvXPropertyCtrListener* pListener; + Edit aEdit; + void* pData; + + DECL_LINK(ModifiedHdl,Edit*); + DECL_LINK(GetFocusHdl,Edit*); + DECL_LINK(LoseFocusHdl,Edit*); + +public: + SvXPropertyEdit( Window* pParent, WinBits nWinStyle = 0 ); + SvXPropertyEdit( Window* pParent, const ResId& rResId ); + + virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*); + + virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener(); + + virtual void SetProperty(const String &rString); + virtual String GetProperty()const; + + virtual BOOL HasList(); + virtual void ClearList(); + virtual void InsertEntry( const String& rString, + USHORT nPos = LISTBOX_APPEND ); + + virtual void SetCtrSize(const Size& rSize); + virtual void SetLocked(BOOL bLocked=TRUE); + + virtual void SetMyName(const String &rString); + virtual String GetMyName()const; + + virtual void SetMyData(void*); + virtual void* GetMyData(); +}; + + +class SvXPropertyListBox : public SvXPropertyControl +{ +private: + + String aName; + SvXPropertyCtrListener* pListener; + ListBox aListBox; + void* pData; + + DECL_LINK(ModifiedHdl,ListBox*); + DECL_LINK(GetFocusHdl,ListBox*); + DECL_LINK(LoseFocusHdl,ListBox*); + + +public: + SvXPropertyListBox( Window* pParent, WinBits nWinStyle = 0 ); + SvXPropertyListBox( Window* pParent, const ResId& rResId ); + + virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*); + + virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener(); + + ListBox* GetListBox(); + + virtual void SetProperty(const String &rString); + virtual String GetProperty()const; + + virtual BOOL HasList(); + virtual void ClearList(); + virtual void InsertEntry( const String& rString, + USHORT nPos = LISTBOX_APPEND ); + + virtual void SetCtrSize(const Size& rSize); + virtual void SetLocked(BOOL bLocked=TRUE); + + virtual void SetMyName(const String &rString); + virtual String GetMyName()const; + + virtual void SetMyData(void*); + virtual void* GetMyData(); +}; + +class SvXPropertyComboBox : public SvXPropertyControl +{ +private: + + String aName; + SvXPropertyCtrListener* pListener; + ComboBox aComboBox; + void* pData; + + DECL_LINK(ModifiedHdl,ComboBox*); + DECL_LINK(GetFocusHdl,ComboBox*); + DECL_LINK(LoseFocusHdl,ComboBox*); + + +public: + SvXPropertyComboBox( Window* pParent, WinBits nWinStyle = 0 ); + SvXPropertyComboBox( Window* pParent, const ResId& rResId ); + + virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*); + + virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener(); + + ComboBox* GetComboBox(); + + virtual void SetProperty(const String &rString); + virtual String GetProperty()const; + + virtual BOOL HasList(); + virtual void ClearList(); + virtual void InsertEntry( const String& rString, + USHORT nPos = LISTBOX_APPEND ); + + virtual void SetCtrSize(const Size& rSize); + virtual void SetLocked(BOOL bLocked=TRUE); + + virtual void SetMyName(const String &rString); + virtual String GetMyName()const; + + virtual void SetMyData(void*); + virtual void* GetMyData(); +}; + + + +class SvPropertyLine : public Control +{ +private: + FixedText aName; + USHORT nNameWidth; + BOOL bNeedsRepaint; + SvXPropertyControl* pSvXPropertyControl; + + PushButton aXButton; + BOOL bIsLocked; + BOOL bHasXButton; + BOOL bIsHyperlink; + eKindOfControl eKindOfCtr; + +protected: + virtual void Resize(); + +public: + SvPropertyLine( Window* pParent, + WinBits nWinStyle = 0 ); + SvPropertyLine( Window* pParent, + const ResId& rResId ); + + BOOL NeedsRepaint(); + void SetNeedsRepaint(BOOL bFlag); + void SetSvXPropertyControl(SvXPropertyControl*); + SvXPropertyControl* GetSvXPropertyControl(); + + void SetKindOfControl(eKindOfControl); + eKindOfControl GetKindOfControl(); + + void SetName(const String& rString ); + String GetName() const; + void SetNameWidth(USHORT); + + void ShowXButton(); + void HideXButton(); + BOOL IsVisibleXButton(); + void ShowAsHyperLink(BOOL nFlag=TRUE); + BOOL IsShownAsHyperlink(); + + void Locked(BOOL nFlag=TRUE); + BOOL IsLineLocked(); + + void SetClickHdl(const Link&); + +}; + + +class SvPropertyData +{ +public: + eKindOfControl eKind; + String aName; + String aValue; + SvStrings theValues; // ??? + + BOOL bHasVisibleXButton; + BOOL bIsHyperLink; + BOOL bIsLocked; + void* pDataPtr; + SvXPropertyControl* pControl; +}; + +class SvPropertyDataObjectControl +{ +}; + +class SvPropertyDataControl +{ +public: + virtual void Modified( const String& aName, + const String& aVal, + void* pData)=0; + + virtual void Clicked( const String& aName, + const String& aVal, + void* pData)=0; + + virtual void Commit( const String& aName, + const String& aVal, + void* pData)=0; + + virtual void Select( const String& aName, + void* pData)=0; + + virtual void LinkClicked(const String& aName, + void* pData)=0; +}; + +class SvXPropEvListener: public SvXPropertyCtrListener +{ + Link aModifyLink; + Link aGetFocusLink; + Link aLoseFocusLink; + Link aKeyInputLink; + String aModifiedResult; + + SvXPropertyControl * pTheActiveControl; + KeyCode aKeyCode; + +public: + SvXPropEvListener(); + virtual ~SvXPropEvListener(); + + virtual void Modified (SvXPropertyControl *pSvXPCtr); + virtual void GetFocus (SvXPropertyControl *pSvXPCtr); + virtual void LoseFocus(SvXPropertyControl *pSvXPCtr); + virtual void KeyInput(SvXPropertyControl *pSvXPCtr ,const KeyCode&); + + SvXPropertyControl * GetPropertyControl(); + KeyCode GetKeyCode() const; + + void SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; } + const Link& GetModifyHdl() const { return aModifyLink; } + + void SetGetFocusHdl( const Link& rLink ) { aGetFocusLink = rLink; } + const Link& GetGetFocusHdl() const { return aGetFocusLink; } + + void SetLoseFocusHdl( const Link& rLink ) { aLoseFocusLink = rLink; } + const Link& GetLoseFocusHdl() const { return aLoseFocusLink; } + + void SetKeyInputHdl( const Link& rLink ) { aKeyInputLink = rLink; } + const Link& GetKeyInputHdl() const { return aKeyInputLink; } + + +}; + +typedef SvPropertyLine * SvPropertyLinePtr; + +SV_DECL_PTRARR(SvPropLineArray,SvPropertyLinePtr,1,1) + +class SvListBoxForProperties: public Control +{ +private: + + SvXPropEvListener aListener; + Window aPlayGround; + ScrollBar aVScroll; + SvPropLineArray PLineArray; + SvPropertyDataControl* pPropDataControl; + USHORT nRowHeight; + BOOL bUpdate; + USHORT nTheNameSize; + long nYOffset; + + DECL_LINK( ScrollHdl,ScrollBar*); + DECL_LINK( ClickHdl ,PushButton*); + + DECL_LINK( ModifyHdl,SvXPropEvListener*); + DECL_LINK( GetFocusHdl,SvXPropEvListener*); + DECL_LINK(LoseFocusHdl,SvXPropEvListener*); + DECL_LINK( KeyInputHdl,SvXPropEvListener*); + +protected: + void UpdateAll(); + void UpdatePosNSize(); + void UpdatePlayGround(); + void UpdateVScroll(); + + void Resize(); + +public: + SvListBoxForProperties( Window* pParent, WinBits nWinStyle = 0 ); + SvListBoxForProperties( Window* pParent, const ResId& rResId ); + + ~SvListBoxForProperties(); + + virtual USHORT CalcVisibleLines(); + virtual void EnableUpdate(); + virtual void DisableUpdate(); + + virtual void SetController(SvPropertyDataControl *); + + virtual void Clear(); + + virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND ); + + virtual void ChangeEntry( const SvPropertyData&, USHORT nPos); + + virtual USHORT AppendEntry( const SvPropertyData&); + + virtual void SetPropertyValue( const String & rEntryName, const String & rValue ); + + virtual void SetFirstVisibleEntry(USHORT nPos); + virtual USHORT GetFirstVisibleEntry(); + + virtual void SetSelectedEntry(USHORT nPos); + virtual USHORT GetSelectedEntry(); +}; + +class SvTabPageForProperties: public TabPage +{ + +private: + + SvListBoxForProperties aLbProp; + +protected: + + virtual void Resize(); + +public: + SvTabPageForProperties(Window* pParent,WinBits nWinStyle = 0 ); + + SvListBoxForProperties* GetTheListBox(); +}; + + +class SvBasicPropertyDataControl: public SvPropertyDataControl +{ +private: + + BOOL bCorrectness; + String aEntryName; + String aEntryProperty; + String aCorrectProperty; + void* pTheData; + Link aModifyLink; + Link aClickedLink; + Link aCommitLink; + Link aSelectLink; + +public: + virtual ~SvBasicPropertyDataControl(); + + virtual void Modified( const String& aName, + const String& aVal, + void* pData); //User has modified Property + + virtual void Clicked( const String& aName, + const String& aVal, + void* pData); //Xtension-Button pressed + + virtual void Commit( const String& aName, + const String& aVal, + void* pData); //User accept changes + + virtual void Select( const String& aName, + void* pData); //User select new Row + + virtual void LinkClicked(const String& aName, + void* pData); + + virtual void SetIsCorrect(BOOL nFlag); + + //virtual String GetTheCorrectProperty()const; + virtual void SetTheCorrectProperty(const String& aName); + + String GetName() const; //Tell's the name of the Property + String GetProperty() const; //Tell's the content of the Property + void* GetData(); //Tell's the storage + + + void SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; } + const Link& GetModifyHdl() const { return aModifyLink; } + + void SetClickedHdl( const Link& rLink ) { aClickedLink = rLink; } + const Link& GetClickedHdl() const { return aClickedLink; } + + void SetCommitHdl( const Link& rLink ) { aCommitLink = rLink; } + const Link& GetCommitHdl() const { return aCommitLink; } + + void SetSelectHdl( const Link& rLink ) { aSelectLink = rLink; } + const Link& GetSelectHdl() const { return aSelectLink; } + +}; + + +class SvPropertyBox: public Control +{ +private: + SvPropertyDataControl* pThePropDataCtr; + TabControl aTabControl; + +protected: + virtual void Resize(); + +public: + SvPropertyBox ( Window* pParent, WinBits nWinStyle = 0 ); + SvPropertyBox ( Window* pParent, const ResId& rResId ); + + ~SvPropertyBox(); + + virtual USHORT CalcVisibleLines(); + virtual void EnableUpdate(); // auch IDL? + virtual void DisableUpdate(); // auch IDL? + + // AB: Hier beginnt das 'offizielle' Interface, das in IDL uebernommen werden soll + virtual void SetController(SvPropertyDataControl *); + + virtual USHORT AppendPage( const String & r ); + virtual void SetPage( USHORT ); + virtual USHORT GetCurPage(); + virtual void ClearAll(); + virtual void ClearTable(); + + virtual void SetPropertyValue( const String & rEntryName, const String & rValue ); + + virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND ); + virtual void ChangeEntry( const SvPropertyData&, USHORT nPos); + virtual USHORT AppendEntry( const SvPropertyData&); + + virtual void SetFirstVisibleEntry(USHORT nPos); + virtual USHORT GetFirstVisibleEntry(); + + virtual void SetSelectedEntry(USHORT nPos); + virtual USHORT GetSelectedEntry(); +}; + + + +/* +class ScPropertyDlg : public ModalDialog +{ +private: + SvBasicPropertyDataControl aBaProDatCtr; + OKButton anOk; + CancelButton aCancel; + USHORT nCount; + USHORT nClickCount; + + SvPropertyData aProperty; + SvPropertyBox aPropListBox; + + ListBox aKindOfListBox; + FixedText aModAnswer; + FixedText aClickAnswer; + FixedText aCommitAnswer; + FixedText aSelectAnswer; + + DECL_LINK( ModifiedHdl, ListBox*); + + DECL_LINK( RowModifiedHdl, SvBasicPropertyDataControl*); + DECL_LINK( ClickHdl , SvBasicPropertyDataControl*); + DECL_LINK( SelectHdl , SvBasicPropertyDataControl*); + DECL_LINK( CommitHdl , SvBasicPropertyDataControl*); + +public: + ScPropertyDlg( Window* pParent); + ~ScPropertyDlg(); +}; +*/ +#endif // SC_AUTOFMT_HXX + + diff --git a/svtools/source/inc/sgfbram.hxx b/svtools/source/inc/sgfbram.hxx new file mode 100644 index 000000000000..ca7e90b59cd4 --- /dev/null +++ b/svtools/source/inc/sgfbram.hxx @@ -0,0 +1,160 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sgfbram.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SGFBRAM_HXX +#define _SGFBRAM_HXX + +#include <tools/solar.h> + +#define SgfBitImag0 1 /* Bitmap */ +#define SgfBitImag1 4 /* Bitmap */ +#define SgfBitImag2 5 /* Bitmap */ +#define SgfBitImgMo 6 /* Monochrome Bitmap */ +#define SgfSimpVect 2 /* Einfaches Vectorformat */ +#define SgfPostScrp 3 /* Postscript file */ +#define SgfStarDraw 7 /* StarDraw SGV-Datei */ +#define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */ + +// Konstanten fr SgfHeader.SwGrCol +#define SgfBlckWhit 1 /* Schwarz/Weiá Bild Ä¿ SimpVector, */ +#define SgfGrayscal 2 /* Bild mit Graustufen ³ StarDraw und */ +#define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */ +#define SgfVectFarb 4 /* Farben fr Linien verwenden Ä¿ */ +#define SgfVectGray 5 /* Graustufen fr Linien verwenden ³ Nur fr */ +#define SgfVectWdth 6 /* Strichst„rken fr Linien verwenden ÄÙ SimpVector */ + + +#define SgfHeaderSize 42 +class SgfHeader +{ +public: + UINT16 Magic; + UINT16 Version; + UINT16 Typ; + UINT16 Xsize; + UINT16 Ysize; + INT16 Xoffs; + INT16 Yoffs; + UINT16 Planes; // Layer + UINT16 SwGrCol; + char Autor[10]; + char Programm[10]; + UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) ! + + UINT32 GetOffset(); + friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead); + BOOL ChkMagic(); +}; + +#define SgfEntrySize 22 +class SgfEntry +{ +public: + UINT16 Typ; + UINT16 iFrei; + UINT16 lFreiLo,lFreiHi; + char cFrei[10]; + UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) ! + + UINT32 GetOffset(); + friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr); +}; + +#define SgfVectorSize 10 +class SgfVector +{ +public: + UINT16 Flag; + INT16 x; + INT16 y; + UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) ! + + friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr); +}; + +extern long SgfVectXofs; +extern long SgfVectYofs; +extern long SgfVectXmul; +extern long SgfVectYmul; +extern long SgfVectXdiv; +extern long SgfVectYdiv; +extern BOOL SgfVectScal; + +//////////////////////////////////////////////////////////////////////////////////////////////////// +// Windows BMP ///////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#define BmpFileHeaderSize 14 +class BmpFileHeader +{ +public: + UINT16 Typ; // = "BM" + UINT16 SizeLo,SizeHi; // Filesize in Bytes + UINT16 Reserve1; // Reserviert + UINT16 Reserve2; // Reserviert + UINT16 OfsLo,OfsHi; // Offset? + + void SetSize(UINT32 Size); + void SetOfs(UINT32 Size); + UINT32 GetOfs(); + friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead); +}; + +#define BmpInfoHeaderSize 40 +class BmpInfoHeader +{ +public: + UINT32 Size; // Gr”áe des BmpInfoHeaders + INT32 Width; // Breite in Pixel + INT32 Hight; // H”he in Pixel + UINT16 Planes; // Anzahl der Planes (immer 1) + UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24) + UINT32 Compress; // Datenkompression + UINT32 ImgSize; // Gr”áe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt. + INT32 xDpmm; // Dot per Meter (0 ist erlaubt) + INT32 yDpmm; // Dot per Meter (0 ist erlaubt) + UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle) + UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle) + + friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead); +}; + +#define RGBQuadSize 4 +class RGBQuad { +private: + BYTE Red; + BYTE Grn; + BYTE Blu; + BYTE Fil; +public: + RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; } +}; + +#endif //_SGFBRAM_HXX diff --git a/svtools/source/inc/sgffilt.hxx b/svtools/source/inc/sgffilt.hxx new file mode 100644 index 000000000000..a93522fcf590 --- /dev/null +++ b/svtools/source/inc/sgffilt.hxx @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sgffilt.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SGFFILT_HXX +#define _SGFFILT_HXX +#include <tools/urlobj.hxx> + +BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion); +BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut); +BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf); +BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath ); + +// Konstanten fr CheckSgfTyp() +#define SGF_BITIMAGE 1 /* Bitmap */ +#define SGF_SIMPVECT 2 /* Einfaches Vectorformat */ +#define SGF_POSTSCRP 3 /* Postscript file */ +#define SGF_STARDRAW 7 /* StarDraw SGV-Datei */ +#define SGF_DONTKNOW 255 /* Unbekannt oder kein SGF/SGV */ + +#define SGV_VERSION 3 /* SGV mit anderer Version wird abgewiesen */ + /* 3 entspricht StarDraw 2.00/2.01 M„rz'93 */ +#endif //_SGFFILT_HXX diff --git a/svtools/source/inc/sgvmain.hxx b/svtools/source/inc/sgvmain.hxx new file mode 100644 index 000000000000..58e43e0a00b2 --- /dev/null +++ b/svtools/source/inc/sgvmain.hxx @@ -0,0 +1,356 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sgvmain.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SGVMAIN_HXX +#define _SGVMAIN_HXX + +#include <vcl/font.hxx> +#include <vcl/outdev.hxx> +#include <vcl/virdev.hxx> + + +#define UCHAR unsigned char + +struct PointType { + INT16 x; + INT16 y; +}; + +#define SgfDpmm 40 + +#define DtHdSize 256 +class DtHdType { +public: + BYTE Reserved[256]; + friend SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd); + friend void DtHdOverSeek(SvStream& rInp); +}; + + +struct Seitenformat { + PointType Size; // 0.00mm...819.175mm (Papiergr��e) + INT16 RandL; // links Rand auf + INT16 RandR; // rechts dem Papier + INT16 RandO; // oben Rand auf + INT16 RandU; // unten dem Papier + BYTE PColor; // Future Use + BYTE PIntens; // erst recht Future use +// BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) +}; + + +#define PageSize 146 +class PageType { +public: + UINT32 Next; // N�chste Seite + UINT32 nList; // Objektdaten, erster Record + UINT32 ListEnd; // Objektdaten, letzter Record + Seitenformat Paper; // Papierdaten + BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT) + BYTE StdPg; // welche Standardseite einblenden ? + PointType U; // Nullpunkt + INT16 HlpLnH[20]; // Hilfslinien + INT16 HlpLnV[20]; + BYTE LnAnzH; + BYTE LnAnzV; + UCHAR PgName[32]; // Seitenname + friend SvStream& operator>>(SvStream& rIStream, PageType& rPage); +}; + + +enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln, + ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi}; + +struct ObjLineType { + BYTE LFarbe; // [Index] + BYTE LBFarbe; // [Index] + BYTE LIntens; // [%] + BYTE LMuster; // [Index] inkl. Transparenz + INT16 LMSize; // [Koeffizient/100] + INT16 LDicke; // Strichst�rke +}; + +struct ObjAreaType { + BYTE FFarbe; // [Index] + BYTE FBFarbe; // [Index] + BYTE FIntens; // [%] + BYTE FDummy1; // + INT16 FDummy2; // + UINT16 FMuster; // [Index] inkl. Invers, Transparenz +}; + +#define ObjTextTypeSize 64 +class ObjTextType { +public: + ObjLineType L; // Text-Outline (future) + ObjAreaType F; // Text innen + UINT16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType. + UINT16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schlu� sein + UINT16 Breite; // 1..65535% bitte nicht mehr als 500% + BYTE Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo) + BYTE Kapit; // 1..255% + UINT16 Schnitt; // 8 Flags + UINT16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile + UINT16 Slant; // Kursivwinkel 0.00..89.99� default 15.00� doppelt Breit angesehen) + BYTE ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als + INT8 ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63�) + ObjLineType ShdL; // Schatten-Outline (neu 2.0) + ObjAreaType ShdF; // Schatten-innen (neu 2.0) + PointType ShdVers; // Schattenversatz Max.300.00% + BOOL ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad + BOOL NoSpc; // True-> kein Zwischenraum (f�r BackArea) + ObjAreaType BackF; // Hintergrundfl�che + UINT32 GetFont(); + void SetFont(UINT32 FontID); +}; + +class Obj0Type { // SuperClass f�r Apple-VMT +public: + virtual void Draw(OutputDevice& rOut); + virtual ~Obj0Type() {} +}; + +#define ObjkSize 20 /* eigentlich 21. Wg. Allignment ist Flags jedoch verschoben worden*/ +class ObjkType: public Obj0Type { // Grundkomponenten aller Stardraw-Objekte +public: + UINT32 Last; + UINT32 Next; + UINT16 MemSize; // in Bytes + PointType ObjMin; // XY-Minimum des Objekts + PointType ObjMax; // XY-Maximum des Objekts + BYTE Art; + BYTE Layer; +// BYTE Flags; // (Schummel f�r Allignment unter NT) + friend SvStream& operator>>(SvStream& rIStream, ObjkType& rObjk); + friend BOOL ObjOverSeek(SvStream& rInp, ObjkType& rObjk); + virtual void Draw(OutputDevice& rOut); +}; + + +#define StrkSize 38 +class StrkType: public ObjkType { +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE LEnden; // Linienenden + ObjLineType L; + PointType Pos1; // Anfangspunkt + PointType Pos2; // Endpunkt + friend SvStream& operator>>(SvStream& rIStream, StrkType& rStrk); + virtual void Draw(OutputDevice& rOut); +}; + + +#define RectSize 52 +class RectType: public ObjkType { +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE Reserve; + ObjLineType L; + ObjAreaType F; + PointType Pos1; // LO-Ecke = Bezugspunkt + PointType Pos2; // R-Ecke + INT16 Radius; // Eckenradius + UINT16 DrehWink; // 315...<45 + UINT16 Slant; // >270...<90 + friend SvStream& operator>>(SvStream& rIStream, RectType& rRect); + virtual void Draw(OutputDevice& rOut); +}; + + +#define PolySize 44 +class PolyType: public ObjkType { // identisch mit Spline ! +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE LEnden; // nur f�r Polyline + ObjLineType L; + ObjAreaType F; // nicht f�r Polyline + BYTE nPoints; + BYTE Reserve; + UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) + PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!)) + friend SvStream& operator>>(SvStream& rIStream, PolyType& rPoly); + virtual void Draw(OutputDevice& rOut); +}; +#define PolyClosBit 0x01 // Unterarten von Poly: 0: PolyLine 1: Polygon + + +#define SplnSize 44 +class SplnType: public ObjkType { // identisch mit Poly ! +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE LEnden; // nur f�r nSpline + ObjLineType L; + ObjAreaType F; // nicht f�r nSpline + BYTE nPoints; + BYTE Reserve; + UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw) + PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!)) + friend SvStream& operator>>(SvStream& rIStream, SplnType& rSpln); + virtual void Draw(OutputDevice& rOut); +}; +// Unterarten von Spline: siehe Poly + + +#define CircSize 52 +class CircType: public ObjkType { +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE LEnden; // nur Bogen (Kr & El) + ObjLineType L; + ObjAreaType F; // nicht f�r Bogen (Kr & El) + PointType Center; // Mittelpunkt + PointType Radius; // Radius + UINT16 DrehWink; // nur Ellipse + UINT16 StartWink; // � nicht f�r Vollkreis + UINT16 RelWink; // � und Vollellipse + friend SvStream& operator>>(SvStream& rIStream, CircType& rCirc); + virtual void Draw(OutputDevice& rOut); +}; +#define CircFull 0x00 /* Unterarten von Kreis: 0: Kreis */ +#define CircSect 0x01 /* 1: Kreissektor */ +#define CircAbsn 0x02 /* 2: Kreisabschnitt */ +#define CircArc 0x03 /* 3: Kreisbogen */ + + +#define TextSize 116 +class TextType: public ObjkType { +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE Reserve; // f�r Word Allign + ObjTextType T; // 64 Bytes << DWord-Allign bei FontID erforderlich + PointType Pos1; // Bezugspunkt (ObenLinks) + PointType Pos2; // (untenRechts) + INT16 TopOfs; // Von Oberkante bis Textbegin (future f�r vJustify) + UINT16 DrehWink; // 0...<360 + UINT16 BoxSlant; // >270...<90 (nur Box) + UINT16 BufSize; // Gr��e von Buf f�r Load, Save, Copy und so + UINT16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich + UINT16 ExtLo,ExtHi;// (Ptr) Text �ber mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich + PointType FitSize; // Ursprungsgr��e f�r Fit2Size + INT16 FitBreit; // Breite zum formatieren bei Fit2Size + UCHAR* Buffer; // Diese Variable wird nicht durch Lesen von Disk gef�llt, sondern explizit! + friend SvStream& operator>>(SvStream& rIStream, TextType& rText); + virtual void Draw(OutputDevice& rOut); +}; +#define TextOutlBit 0x01 /* 1=Sourcecode f�r Outliner (wird von DrawObjekt() ignoriert) */ +#define TextFitSBit 0x02 /* Bit1: 1=Text-FitToSize, auch Outliner (2.0) */ +#define TextFitZBit 0x08 /* Bit3: 1=Fit2Size Zeilenweise (2.0) */ +#define TextDrftBit 0x04 /* Bit2: 1=DraftDraw (2.0) */ +#define TextFitBits (TextFitSBit | TextFitZBit) + + +enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf}; + +#define BmapSize 132 +class BmapType: public ObjkType { +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + BYTE Reserve; + ObjAreaType F; // Farbe und Muster der 1-Plane Bitmap + PointType Pos1; + PointType Pos2; + UINT16 DrehWink; // 315...<45 (Future) + UINT16 Slant; // >270...<90 (Future) + UCHAR Filename[80]; // Pfad + PointType PixSize; // Gr��e in Pixel (0 bei Vektor) + GrafStat Format; // siehe GpmDef.Pas + BYTE nPlanes; // Anzahl der Bitplanes (0 bei Vektor) + BOOL RawOut; // als Raw ausgeben ? + BOOL InvOut; // invertiert ausgeben ? + BOOL LightOut; // aufhellen? (SD20) + BYTE GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(f�r Fix in DrawBmp) + + INetURLObject aFltPath; // F�r GraphicFilter + friend SvStream& operator>>(SvStream& rIStream, BmapType& rBmap); + virtual void Draw(OutputDevice& rOut); + void SetPaths( const INetURLObject rFltPath ); +}; + + +#define GrupSize 48 +class GrupType: public ObjkType { +public: + BYTE Flags; // (Schummel f�r Allignment unter NT) + UCHAR Name[13]; // Name der Gruppe + UINT16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich + UINT16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich + UINT16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur + UINT32 ChartPtr; // Diagrammstruktur + UINT32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist. + friend SvStream& operator>>(SvStream& rIStream, GrupType& rGrup); +// virtual void Draw(OutputDevice& rOut); +}; + + +void SetLine(ObjLineType& rLine, OutputDevice& rOut); +void SetArea(ObjAreaType& rArea, OutputDevice& rOut); +Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts); +void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs); +void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs); +INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div); +UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div); + + +class SgfFontOne { +public: + SgfFontOne* Next; // Zeiger f�r Listenverkettung + UINT32 IFID; + BOOL Bold; + BOOL Ital; + BOOL Sans; + BOOL Serf; + BOOL Fixd; + FontFamily SVFamil; + CharSet SVChSet; + String SVFName; // z.B. "Times New Roman" = 15 Chars + USHORT SVWidth; // Durchschnittliche Zeichenbreite in % + SgfFontOne(); + void ReadOne( ByteString& ID, ByteString& Dsc); +}; + +class SgfFontLst { +public: + String FNam; // vollst�ndiger Filename des Inifiles + SgfFontOne* pList; // Listenanfang + SgfFontOne* Last; // Listenende + UINT32 LastID; // f�r schnelleren Zugriff bei Wiederholungen + SgfFontOne* LastLn; // f�r schnelleren Zugriff bei Wiederholungen + BOOL Tried; + SgfFontLst(); + ~SgfFontLst(); + void AssignFN(const String& rFName); + void ReadList(); + void RausList(); + SgfFontOne* GetFontDesc(UINT32 ID); +}; + +#endif //_SGVMAIN_HXX + + diff --git a/svtools/source/inc/sgvspln.hxx b/svtools/source/inc/sgvspln.hxx new file mode 100644 index 000000000000..7e9976eaf25b --- /dev/null +++ b/svtools/source/inc/sgvspln.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sgvspln.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SGVSPLN_HXX +#define _SGVSPLN_HXX + +/************************************************************************* +|* +|* CalcSpline() +|* +|* Beschreibung Berechnet die Koeffizienten eines parametrischen +|* natrlichen oder periodischen kubischen +|* Polynomsplines. Die Eckpunkte des šbergebenen +|* Polygons werden als Sttzstellen angenommen. +|* n liefert die Anzahl der Teilpolynome. +|* Ist die Berechnung fehlerfrei verlaufen, so +|* liefert die Funktion TRUE. Nur in diesem Fall +|* ist Speicher fr die Koeffizientenarrays +|* allokiert, der dann sp„ter vom Aufrufer mittels +|* delete freizugeben ist. +|* Ersterstellung JOE 17-08.93 +|* Letzte Aenderung JOE 17-08.93 +|* +*************************************************************************/ + +BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n, + double*& ax, double*& ay, double*& bx, double*& by, + double*& cx, double*& cy, double*& dx, double*& dy, double*& T); + +/************************************************************************* +|* +|* Poly2Spline() +|* +|* Beschreibung Konvertiert einen parametrichen kubischen +|* Polynomspline Spline (natrlich oder periodisch) +|* in ein angen„hertes Polygon. +|* Die Funktion liefert FALSE, wenn ein Fehler bei +|* der Koeffizientenberechnung aufgetreten ist oder +|* das Polygon zu groá wird (>PolyMax=16380). Im 1. +|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte. +|* Um Koordinatenberl„ufe zu vermeiden werden diese +|* auf +/-32000 begrenzt. +|* Ersterstellung JOE 23.06.93 +|* Letzte Aenderung JOE 23.06.93 +|* +*************************************************************************/ +BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly); + +#endif //_SGVSPLN_HXX diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx new file mode 100644 index 000000000000..10463fc05906 --- /dev/null +++ b/svtools/source/inc/svimpbox.hxx @@ -0,0 +1,477 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: svimpbox.hxx,v $ + * $Revision: 1.22 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SVIMPLBOX_HXX +#define _SVIMPLBOX_HXX + +#ifndef _SELENG_HXX +#include <vcl/seleng.hxx> +#endif +#ifndef _SCRBAR_HXX +#include <vcl/scrbar.hxx> +#endif +#include <vcl/vclevent.hxx> +// #102891# ---------------- +#include <unotools/intlwrapper.hxx> +// #97680# ----------------- +#include <vector> +#include "svtaccessiblefactory.hxx" + +class SvTreeListBox; +class Point; +class DropEvent; +class SvLBoxTreeList; +class SvImpLBox; +class SvLBoxEntry; +class SvLBoxItem; +class SvLBoxTab; +class TabBar; + +class ImpLBSelEng : public FunctionSet +{ + SvImpLBox* pImp; + SelectionEngine* pSelEng; + SvTreeListBox* pView; + +public: + ImpLBSelEng( SvImpLBox* pImp, SelectionEngine* pSelEng, + SvTreeListBox* pView ); + virtual ~ImpLBSelEng(); + void BeginDrag(); + void CreateAnchor(); + void DestroyAnchor(); + BOOL SetCursorAtPoint( const Point& rPoint, + BOOL bDontSelectAtCursor=FALSE ); + BOOL IsSelectionAtPoint( const Point& rPoint ); + void DeselectAtPoint( const Point& rPoint ); + void DeselectAll(); +}; + +// Flags fuer nFlag +#define F_VER_SBARSIZE_WITH_HBAR 0x0001 +#define F_HOR_SBARSIZE_WITH_VBAR 0x0002 +#define F_IGNORE_NEXT_MOUSEMOVE 0x0004 // OS/2 only +#define F_IN_SCROLLING 0x0008 +#define F_DESEL_ALL 0x0010 +#define F_START_EDITTIMER 0x0020 // MAC only +#define F_IGNORE_SELECT 0x0040 +#define F_IN_RESIZE 0x0080 +#define F_REMOVED_ENTRY_INVISIBLE 0x0100 +#define F_REMOVED_RECALC_MOST_RIGHT 0x0200 +#define F_IGNORE_CHANGED_TABS 0x0400 +#define F_PAINTED 0x0800 +#define F_IN_PAINT 0x1000 +#define F_ENDSCROLL_SET_VIS_SIZE 0x2000 +#define F_FILLING 0x4000 + + +class SvImpLBox +{ +friend class ImpLBSelEng; +friend class SvTreeListBox; +private: + SvTreeListBox* pView; + SvLBoxTreeList* pTree; + SvLBoxEntry* pCursor; + SvLBoxEntry* pStartEntry; + SvLBoxEntry* pAnchor; + SvLBoxEntry* pMostRightEntry; + SvLBoxButton* pActiveButton; + SvLBoxEntry* pActiveEntry; + SvLBoxTab* pActiveTab; + TabBar* pTabBar; + + ScrollBar aVerSBar; + ScrollBar aHorSBar; + ScrollBarBox aScrBarBox; + + ::svt::AccessibleFactoryAccess + m_aFactoryAccess; + + static Image* s_pDefCollapsed; + static Image* s_pDefExpanded; + static Image* s_pDefCollapsedHC; + static Image* s_pDefExpandedHC; + static oslInterlockedCount s_nImageRefCount; /// When 0 all static images will be destroyed + + // Node Bitmaps + enum ImageType + { + itNodeExpanded = 0, // node is expanded ( usually a bitmap showing a minus ) + itNodeCollapsed, // node is collapsed ( usually a bitmap showing a plus ) + itNodeDontKnow, // don't know the node state + itEntryDefExpanded, // default for expanded entries + itEntryDefCollapsed, // default for collapsed entries + + IT_IMAGE_COUNT + }; + + // all our images + Image m_aNodeAndEntryImages[ IT_IMAGE_COUNT ]; + // plus the high contrast versions + Image m_aNodeAndEntryImages_HC[ IT_IMAGE_COUNT ]; + + // wg. kompat. hier + Size aOutputSize; + SelectionEngine aSelEng; + ImpLBSelEng aFctSet; + Timer aAsyncBeginDragTimer; + Point aAsyncBeginDragPos; + + long nYoffsNodeBmp; + long nNodeBmpTabDistance; // typisch kleiner 0 + long nNodeBmpWidth; + long nNextVerVisSize; + long nMostRight; + ULONG nVisibleCount; // Anzahl Zeilen im Control + ULONG nCurUserEvent; //-1 == kein Userevent amn Laufen + short nHorSBarHeight, nVerSBarWidth; + USHORT nFlags; + USHORT nCurTabPos; + + WinBits nWinBits; + ExtendedWinBits nExtendedWinBits; + BOOL bSimpleTravel : 1; // ist TRUE bei SINGLE_SELECTION + BOOL bUpdateMode : 1; + BOOL bInVScrollHdl : 1; + BOOL bAsyncBeginDrag : 1; + BOOL bSubLstOpRet : 1; // open/close sublist with return/enter, defaulted with FALSE + BOOL bSubLstOpLR : 1; // open/close sublist with cursor left/right, defaulted with FALSE + BOOL bContextMenuHandling : 1; + BOOL bIsCellFocusEnabled : 1; + + sal_Bool bAreChildrenTransient; + + Point aEditClickPos; + Timer aEditTimer; + + // #102891# ------------------- + IntlWrapper * pIntlWrapper; + + // #97680# -------------------- + std::vector< short > aContextBmpWidthVector; + + DECL_LINK( EditTimerCall, Timer * ); + + DECL_LINK( BeginDragHdl, void* ); + DECL_LINK( MyUserEvent,void*); + void StopUserEvent(); + + void InvalidateEntriesFrom( long nY ) const; + void InvalidateEntry( long nY ) const; + void ShowVerSBar(); + // setzt Thumb auf FirstEntryToDraw + void SyncVerThumb(); + BOOL IsLineVisible( long nY ) const; + long GetEntryLine( SvLBoxEntry* pEntry ) const; + void FillView(); + void CursorDown(); + void CursorUp(); + void KeyLeftRight( long nDiff ); + void PageDown( USHORT nDelta ); + void PageUp( USHORT nDelta ); + + void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE ); + + void DrawNet(); + + // ScrollBar-Handler + DECL_LINK( ScrollUpDownHdl, ScrollBar * ); + DECL_LINK( ScrollLeftRightHdl, ScrollBar * ); + DECL_LINK( EndScrollHdl, ScrollBar * ); + + void SetNodeBmpYOffset( const Image& ); + void SetNodeBmpTabDistance(); + + // Selection-Engine + SvLBoxEntry* MakePointVisible( const Point& rPoint, + BOOL bNotifyScroll=TRUE ); + + void SetAnchorSelection( SvLBoxEntry* pOld, + SvLBoxEntry* pNewCursor ); + void BeginDrag(); + BOOL ButtonDownCheckCtrl( const MouseEvent& rMEvt, + SvLBoxEntry* pEntry, long nY ); + BOOL MouseMoveCheckCtrl( const MouseEvent& rMEvt, + SvLBoxEntry* pEntry ); + BOOL ButtonUpCheckCtrl( const MouseEvent& rMEvt ); + BOOL ButtonDownCheckExpand( const MouseEvent&, + SvLBoxEntry*,long nY ); + + void PositionScrollBars( Size& rOSize, USHORT nMask ); + USHORT AdjustScrollBars( Size& rSize ); + + void BeginScroll(); + void EndScroll(); + BOOL InScroll() const { return (BOOL)(nFlags & F_IN_SCROLLING)!=0;} + Rectangle GetVisibleArea() const; + BOOL EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine); + void InitScrollBarBox(); + SvLBoxTab* NextTab( SvLBoxTab* ); + + BOOL SetMostRight( SvLBoxEntry* pEntry ); + void FindMostRight( SvLBoxEntry* EntryToIgnore ); + void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore ); + void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore ); + void NotifyTabsChanged(); + + inline BOOL IsExpandable() const // if element at cursor can be expanded in general + { return pCursor->HasChilds() || pCursor->HasChildsOnDemand(); } + inline BOOL IsNowExpandable() const // if element at cursor can be expanded at this moment + { return IsExpandable() && !pView->IsExpanded( pCursor ); } + + static void implInitDefaultNodeImages(); + + // #102891# ------------------- + void UpdateIntlWrapper(); + + // #97680# -------------------- + short UpdateContextBmpWidthVector( SvLBoxEntry* pEntry, short nWidth ); + void UpdateContextBmpWidthMax( SvLBoxEntry* pEntry ); + void UpdateContextBmpWidthVectorFromMovedEntry( SvLBoxEntry* pEntry ); + + void CalcCellFocusRect( SvLBoxEntry* pEntry, Rectangle& rRect ); + + inline sal_Bool AreChildrenTransient() const { return bAreChildrenTransient; } + inline void SetChildrenNotTransient() { bAreChildrenTransient = sal_False; } + +public: + SvImpLBox( SvTreeListBox* pView, SvLBoxTreeList*, WinBits nWinStyle ); + ~SvImpLBox(); + + void Clear(); + void SetWindowBits( WinBits nWinStyle ); + void SetExtendedWindowBits( ExtendedWinBits _nBits ); + ExtendedWinBits GetExtendedWindowBits() const { return nExtendedWinBits; } + void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;} + + void EntryInserted( SvLBoxEntry*); + void RemovingEntry( SvLBoxEntry* pEntry ); + void EntryRemoved(); + void MovingEntry( SvLBoxEntry* pEntry ); + void EntryMoved( SvLBoxEntry* pEntry ); + void TreeInserted( SvLBoxEntry* pEntry ); + + void IndentChanged( short nIndentPixel ); + void EntryExpanded( SvLBoxEntry* pEntry ); + void EntryCollapsed( SvLBoxEntry* pEntry ); + void CollapsingEntry( SvLBoxEntry* pEntry ); + void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + + void Paint( const Rectangle& rRect ); + void RepaintSelectionItems(); + void MouseButtonDown( const MouseEvent& ); + void MouseButtonUp( const MouseEvent& ); + void MouseMove( const MouseEvent&); + BOOL KeyInput( const KeyEvent& ); + void Resize(); + void GetFocus(); + void LoseFocus(); + void UpdateAll( + BOOL bInvalidateCompleteView= TRUE, + BOOL bUpdateVerSBar = TRUE ); + void SetEntryHeight( short nHeight ); + void PaintEntry( SvLBoxEntry* pEntry ); + void InvalidateEntry( SvLBoxEntry* ); + void RecalcFocusRect(); + + inline void SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect ); + void SetDragDropMode( DragDropMode eDDMode ); + void SetSelectionMode( SelectionMode eSelMode ); + void SetAddMode( BOOL ) { aSelEng.AddAlways(FALSE); } + BOOL IsAddMode() const { return aSelEng.IsAlwaysAdding(); } + + SvLBoxEntry* GetCurrentEntry() const { return pCursor; } + BOOL IsEntryInView( SvLBoxEntry* ) const; + SvLBoxEntry* GetEntry( const Point& rPos ) const; + // gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag + SvLBoxEntry* GetClickedEntry( const Point& ) const; + SvLBoxEntry* GetCurEntry() const { return pCursor; } + void SetCurEntry( SvLBoxEntry* ); + Point GetEntryPosition( SvLBoxEntry* ) const; + void MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop=FALSE ); + + void PaintDDCursor( SvLBoxEntry* ); + + // Images + inline Image& implGetImageLocation( const ImageType _eType, BmpColorMode _eMode ); + inline Image& implGetImageLocationWithFallback( const ImageType _eType, BmpColorMode _eMode ) const; + + inline void SetExpandedNodeBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); + inline void SetCollapsedNodeBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); + inline void SetDontKnowNodeBmp( const Image& rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); + + inline const Image& GetExpandedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const; + inline const Image& GetCollapsedNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const; + inline const Image& GetDontKnowNodeBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ) const; + + inline void SetDefaultEntryExpBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); + inline void SetDefaultEntryColBmp( const Image& _rImg, BmpColorMode _eMode = BMP_COLOR_NORMAL ); + inline const Image& GetDefaultEntryExpBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ); + inline const Image& GetDefaultEntryColBmp( BmpColorMode _eMode = BMP_COLOR_NORMAL ); + + static const Image& GetDefaultExpandedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ); + static const Image& GetDefaultCollapsedNodeImage( BmpColorMode _eMode = BMP_COLOR_NORMAL ); + + const Size& GetOutputSize() const { return aOutputSize;} + void KeyUp( BOOL bPageUp, BOOL bNotifyScroll = TRUE ); + void KeyDown( BOOL bPageDown, BOOL bNotifyScroll = TRUE ); + void Command( const CommandEvent& rCEvt ); + + void Invalidate(); + void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); } + void SelAllDestrAnch( BOOL bSelect, + BOOL bDestroyAnchor = TRUE, + BOOL bSingleSelToo = FALSE ); + void ShowCursor( BOOL bShow ); + + BOOL RequestHelp( const HelpEvent& rHEvt ); + void EndSelection(); + BOOL IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const; + void RepaintScrollBars(); + void EnableAsyncDrag( BOOL b) { bAsyncBeginDrag = b; } + void SetUpdateMode( BOOL ); + void SetUpdateModeFast( BOOL ); + BOOL GetUpdateMode() const { return bUpdateMode; } + Rectangle GetClipRegionRect() const; + BOOL HasHorScrollBar() const { return aHorSBar.IsVisible(); } + void ShowFocusRect( const SvLBoxEntry* pEntry ); + void SetTabBar( TabBar* pTabBar ); + void CancelPendingEdit(); + + void CallEventListeners( ULONG nEvent, void* pData = NULL ); + + /** Enables, that one cell of a tablistbox entry can be focused */ + inline BOOL IsCellFocusEnabled() const { return bIsCellFocusEnabled; } + inline void EnableCellFocus() { bIsCellFocusEnabled = TRUE; } + bool SetCurrentTabPos( USHORT _nNewPos ); + inline USHORT GetCurrentTabPos() const { return nCurTabPos; } + + bool IsSelectable( const SvLBoxEntry* pEntry ); +}; + +inline Image& SvImpLBox::implGetImageLocation( const ImageType _eType, BmpColorMode _eMode ) +{ + DBG_ASSERT( ( BMP_COLOR_HIGHCONTRAST == _eMode ) || ( BMP_COLOR_NORMAL == _eMode ), + "SvImpLBox::implGetImageLocation: invalid mode!" ); + DBG_ASSERT( ( _eType >= 0 ) && ( _eType < IT_IMAGE_COUNT ), + "SvImpLBox::implGetImageLocation: invalid image index (will crash)!" ); + + Image* _pSet = ( BMP_COLOR_HIGHCONTRAST == _eMode ) ? m_aNodeAndEntryImages_HC : m_aNodeAndEntryImages; + return *( _pSet + (sal_Int32)_eType ); +} + +inline Image& SvImpLBox::implGetImageLocationWithFallback( const ImageType _eType, BmpColorMode _eMode ) const +{ + Image& rImage = const_cast< SvImpLBox* >( this )->implGetImageLocation( _eType, _eMode ); + if ( !rImage ) + // fallback to normal images in case the one for the special mode has not been set + rImage = const_cast< SvImpLBox* >( this )->implGetImageLocation( _eType, BMP_COLOR_NORMAL ); + return rImage; +} + +inline void SvImpLBox::SetDontKnowNodeBmp( const Image& rImg, BmpColorMode _eMode ) +{ + implGetImageLocation( itNodeDontKnow, _eMode ) = rImg; +} + +inline void SvImpLBox::SetExpandedNodeBmp( const Image& rImg, BmpColorMode _eMode ) +{ + implGetImageLocation( itNodeExpanded, _eMode ) = rImg; + SetNodeBmpYOffset( rImg ); +} + +inline void SvImpLBox::SetCollapsedNodeBmp( const Image& rImg, BmpColorMode _eMode ) +{ + implGetImageLocation( itNodeCollapsed, _eMode ) = rImg; + SetNodeBmpYOffset( rImg ); +} + +inline const Image& SvImpLBox::GetDontKnowNodeBmp( BmpColorMode _eMode ) const +{ + return implGetImageLocationWithFallback( itNodeDontKnow, _eMode ); +} + +inline const Image& SvImpLBox::GetExpandedNodeBmp( BmpColorMode _eMode ) const +{ + return implGetImageLocationWithFallback( itNodeExpanded, _eMode ); +} + +inline const Image& SvImpLBox::GetCollapsedNodeBmp( BmpColorMode _eMode ) const +{ + return implGetImageLocationWithFallback( itNodeCollapsed, _eMode ); +} + +inline void SvImpLBox::SetDefaultEntryExpBmp( const Image& _rImg, BmpColorMode _eMode ) +{ + implGetImageLocation( itEntryDefExpanded, _eMode ) = _rImg; +} + +inline void SvImpLBox::SetDefaultEntryColBmp( const Image& _rImg, BmpColorMode _eMode ) +{ + implGetImageLocation( itEntryDefCollapsed, _eMode ) = _rImg; +} + +inline const Image& SvImpLBox::GetDefaultEntryExpBmp( BmpColorMode _eMode ) +{ + return implGetImageLocationWithFallback( itEntryDefExpanded, _eMode ); +} + +inline const Image& SvImpLBox::GetDefaultEntryColBmp( BmpColorMode _eMode ) +{ + return implGetImageLocationWithFallback( itEntryDefCollapsed, _eMode ); +} + +inline Point SvImpLBox::GetEntryPosition( SvLBoxEntry* pEntry ) const +{ + return Point( 0, GetEntryLine( pEntry ) ); +} + +inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry ) +{ + long nY = GetEntryLine( pEntry ); + pView->PaintEntry( pEntry, nY ); +} + +inline BOOL SvImpLBox::IsLineVisible( long nY ) const +{ + BOOL bRet = TRUE; + if ( nY < 0 || nY >= aOutputSize.Height() ) + bRet = FALSE; + return bRet; +} + +inline void SvImpLBox::TreeInserted( SvLBoxEntry* pInsTree ) +{ + EntryInserted( pInsTree ); +} + +#endif // #ifndef _SVIMPLBOX_HXX + diff --git a/svtools/source/inc/svimpicn.hxx b/svtools/source/inc/svimpicn.hxx new file mode 100644 index 000000000000..724a92543700 --- /dev/null +++ b/svtools/source/inc/svimpicn.hxx @@ -0,0 +1,324 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: svimpicn.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SVIMPICN_HXX +#define _SVIMPICN_HXX + +#ifndef _VIRDEV_HXX +#include <vcl/virdev.hxx> +#endif + +#ifndef _SCRBAR_HXX +#include <vcl/scrbar.hxx> +#endif +#include <limits.h> + +class SvLBoxEntry; +class SvLBoxTreeList; +class SvImpIconView; +class ImpIcnCursor; +class SvPtrarr; + +#define PAINTFLAG_HOR_CENTERED 0x0001 +#define PAINTFLAG_VER_CENTERED 0x0002 + +#define SELRECT_BORDER_OFFS -7 +// Flags +#define F_VER_SBARSIZE_WITH_HBAR 0x00000001 +#define F_HOR_SBARSIZE_WITH_VBAR 0x00000002 +#define F_IGNORE_NEXT_MOUSEMOVE 0x00000004 // OS/2 only +#define F_ENTRY_REMOVED 0x00000008 +// ist gesetzt, wenn nach Clear oder Ctor mind. einmal gepaintet wurde +#define F_PAINTED 0x00000010 +#define F_ADD_MODE 0x00000020 +#define F_MOVING_SIBLING 0x00000040 +#define F_SELRECT_VISIBLE 0x00000080 +#define F_CMD_ARRIVED 0x00000100 +#define F_DRAG_SOURCE 0x00000200 +#define F_GRIDMODE 0x00000400 +// beim Einfuegen eines Eintrags ergibt sich dessen Position +// durch simples Addieren auf die Position des zuletzt eingefuegten Eintrags +#define F_GRID_INSERT 0x00000800 +#define F_DOWN_CTRL 0x00001000 +#define F_DOWN_DESELECT 0x00002000 +// Hack fuer D&D: Hintergrund des Entries nicht painten +#define F_NO_EMPHASIS 0x00004000 +// Selektion per Gummiband +#define F_RUBBERING 0x00008000 +#define F_START_EDITTIMER_IN_MOUSEUP 0x00010000 + +class SvImpIconView +{ + friend class ImpIcnCursor; + ScrollBar aVerSBar; + ScrollBar aHorSBar; + Rectangle aCurSelectionRect; + SvPtrarr aSelectedRectList; + MouseEvent aMouseMoveEvent; + Timer aEditTimer; // fuer Inplace-Editieren + Timer aMouseMoveTimer; // generiert MouseMoves bei Gummibandselektion + // Boundrect des zuletzt eingefuegten Entries + Rectangle aPrevBoundRect; + Size aOutputSize; // Pixel + Size aVirtOutputSize; // expandiert automatisch + Point aDDLastEntryPos; + Point aDDLastRectPos; + + SvLBoxTreeList* pModel; + SvIconView* pView; + ImpIcnCursor* pImpCursor; + long nMaxVirtWidth; // max.breite aVirtOutputSize + SvPtrarr* pZOrderList; + long nGridDX, + nGridDY; + long nHorSBarHeight, + nVerSBarWidth; + WinBits nWinBits; + int nViewMode; + long nHorDist; + long nVerDist; + long nMaxBmpWidth; + long nMaxBmpHeight; + long nMaxTextWidth; + long nMaxBoundHeight; // Hoehe des hoechsten BoundRects + ULONG nFlags; + ULONG nCurUserEvent; + SvLBoxEntry* pCurParent; + SvLBoxEntry* pCursor; + SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist + // nur in EntryMoved gueltig! + SvLBoxEntry* pDDRefEntry; + VirtualDevice* pDDDev; + VirtualDevice* pDDBufDev; + VirtualDevice* pDDTempDev; + + SvIconViewTextMode eTextMode; + BOOL bMustRecalcBoundingRects; + + void CheckAllSizes(); + void CheckSizes( SvLBoxEntry* pEntry, + const SvIcnVwDataEntry* pViewData = 0 ); + void ShowCursor( BOOL bShow ); + + void SetNextEntryPos(const Point& rPos); + Point FindNextEntryPos( const Size& rBoundSize ); + void ImpArrange(); + void AdjustVirtSize( const Rectangle& ); + void ResetVirtSize(); + void CheckScrollBars(); + + DECL_LINK( ScrollUpDownHdl, ScrollBar * ); + DECL_LINK( ScrollLeftRightHdl, ScrollBar * ); + DECL_LINK( MouseMoveTimeoutHdl, Timer* ); + DECL_LINK( EditTimeoutHdl, Timer* ); + DECL_LINK( UserEventHdl, void* ); + void AdjustScrollBars(); + void PositionScrollBars( long nRealWidth, long nRealHeight ); + void CalcDocPos( Point& aMousePos ); + BOOL GetResizeRect( Rectangle& ); + void PaintResizeRect( const Rectangle& ); + SvLBoxEntry* GetNewCursor(); + void ToggleSelection( SvLBoxEntry* ); + void DeselectAllBut( SvLBoxEntry* ); + void Center( SvLBoxEntry* pEntry, SvIcnVwDataEntry* ) const; + void StopEditTimer() { aEditTimer.Stop(); } + void StartEditTimer() { aEditTimer.Start(); } + void ImpHideDDIcon(); + void ImpDrawXORRect( const Rectangle& rRect ); + void AddSelectedRect( const Rectangle&, short nOffset = SELRECT_BORDER_OFFS ); + void ClearSelectedRectList(); + Rectangle CalcMaxTextRect( const SvLBoxEntry* pEntry, + const SvIcnVwDataEntry* pViewData ) const; + + void ClipAtVirtOutRect( Rectangle& rRect ) const; + void AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart=0 ); + Point AdjustAtGrid( + const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect) + const Rectangle& rBoundRect ) const; + SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry, + const SvIcnVwDataEntry* pViewData ) const; + + BOOL CheckVerScrollBar(); + BOOL CheckHorScrollBar(); + void CancelUserEvent(); + +public: + + SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle ); + ~SvImpIconView(); + + void Clear( BOOL bInCtor = FALSE ); + void SetWindowBits( WinBits nWinStyle ); + void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent ) + { pModel = pTree; SetCurParent(pParent); } + void EntryInserted( SvLBoxEntry*); + void RemovingEntry( SvLBoxEntry* pEntry ); + void EntryRemoved(); + void MovingEntry( SvLBoxEntry* pEntry ); + void EntryMoved( SvLBoxEntry* pEntry ); + void TreeInserted( SvLBoxEntry* pEntry ); + void ChangedFont(); + void ModelHasEntryInvalidated( SvListEntry* ); + void EntryExpanded( SvLBoxEntry* pEntry ); + void EntryCollapsed( SvLBoxEntry* pEntry ); + void CollapsingEntry( SvLBoxEntry* pEntry ); + void EntrySelected( SvLBoxEntry*, BOOL bSelect ); + + void Paint( const Rectangle& rRect ); + void RepaintSelectionItems(); + void MouseButtonDown( const MouseEvent& ); + void MouseButtonUp( const MouseEvent& ); + void MouseMove( const MouseEvent&); + BOOL KeyInput( const KeyEvent& ); + void Resize(); + void GetFocus(); + void LoseFocus(); + void UpdateAll(); + void PaintEntry( SvLBoxEntry* pEntry, + SvIcnVwDataEntry* pViewData = 0 ); + void PaintEntry( SvLBoxEntry*, const Point&, + SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0); + void SetEntryPosition( SvLBoxEntry* pEntry, const Point& rPos, + BOOL bAdjustRow = FALSE, + BOOL bCheckScrollBars = FALSE ); + void InvalidateEntry( SvLBoxEntry* ); + void ViewDataInitialized( SvLBoxEntry* pEntry ); + SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos ); + + void SetNoSelection(); + void SetDragDropMode( DragDropMode eDDMode ); + void SetSelectionMode( SelectionMode eSelMode ); + + void SttDrag( const Point& rPos ); + void EndDrag(); + + SvLBoxEntry* GetCurEntry() const { return pCursor; } + void SetCursor( SvLBoxEntry* ); + + BOOL IsEntryInView( SvLBoxEntry* ); + SvLBoxEntry* GetEntry( const Point& rDocPos ); + SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); + SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry ); + + Point GetEntryPosition( SvLBoxEntry* ); + void MakeVisible( SvLBoxEntry* pEntry ); + + void Arrange(); + + void SetSpaceBetweenEntries( long nHor, long Ver ); + long GetHorSpaceBetweenEntries() const { return nHorDist; } + long GetVerSpaceBetweenEntries() const { return nVerDist; } + + Rectangle CalcFocusRect( SvLBoxEntry* ); + + Rectangle CalcBmpRect( SvLBoxEntry*, const Point* pPos = 0, + SvIcnVwDataEntry* pViewData=0 ); + Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0, + const Point* pPos = 0, + BOOL bForInplaceEdit = FALSE, + SvIcnVwDataEntry* pViewData = 0 ); + + long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const; + long CalcBoundingHeight( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData= 0 ) const; + Size CalcBoundingSize( SvLBoxEntry*, + SvIcnVwDataEntry* pViewData = 0 ) const; + void FindBoundingRect( SvLBoxEntry* pEntry, + SvIcnVwDataEntry* pViewData = 0 ); + // berechnet alle BoundRects neu + void RecalcAllBoundingRects(); + // berechnet alle ungueltigen BoundRects neu + void RecalcAllBoundingRectsSmart(); + const Rectangle& GetBoundingRect( SvLBoxEntry*, + SvIcnVwDataEntry* pViewData=0); + void InvalidateBoundingRect( SvLBoxEntry* ); + void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; } + BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); } + + void PaintEmphasis( const Rectangle&, BOOL bSelected, + BOOL bCursored, OutputDevice* pOut = 0 ); + void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem, + SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 ); + // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE + void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); } + // berechnet alle invalidierten BoundingRects neu + void UpdateBoundingRects(); + void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow ); + SvLBoxEntry* GetDropTarget( const Point& rPosPixel ); + BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); + BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry, + SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos ); + + void WriteDragServerInfo( const Point&, SvLBoxDDInfo* ); + void ReadDragServerInfo( const Point&, SvLBoxDDInfo* ); + void ToTop( SvLBoxEntry* ); + + void SetCurParent( SvLBoxEntry* pNewParent ); + SvLBoxEntry* GetCurParent() const { return pCurParent; } + USHORT GetSelectionCount() const; + void SetGrid( long nDX, long nDY ); + void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE ); + const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*, + const SvIcnVwDataEntry* pViewData = 0 ) const; + void PrepareCommandEvent( const Point& rPt ); + + void HideDDIcon(); + void ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); + void HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos ); + + SvLBoxEntry* mpViewData; + + BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const; + void SelectRect( const Rectangle&, BOOL bAdd = TRUE, + SvPtrarr* pOtherRects = 0, + short nOffs = SELRECT_BORDER_OFFS ); + void DrawSelectionRect( const Rectangle& ); + void HideSelectionRect(); + void CalcScrollOffsets( const Point& rRefPosPixel, + long& rX, long& rY, BOOL bDragDrop = FALSE, + USHORT nBorderWidth = 10 ); + void EndTracking(); + BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos ); + void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE); + void AdjustAtGrid( SvLBoxEntry* pStart = 0 ); + void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 ); + SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0, + const SvIcnVwDataEntry* pViewData = 0 ) const; + void ShowFocusRect( const SvLBoxEntry* pEntry ); +}; + +inline void SvImpIconView::MakeVisible( SvLBoxEntry* pEntry ) +{ + const Rectangle& rRect = GetBoundingRect( pEntry ); + MakeVisible( rRect ); +} + +#endif // #ifndef _SVIMPICN_HXX + + diff --git a/svtools/source/inc/xbmread.hxx b/svtools/source/inc/xbmread.hxx new file mode 100644 index 000000000000..c9623fbb2cda --- /dev/null +++ b/svtools/source/inc/xbmread.hxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xbmread.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XBMREAD_HXX +#define _XBMREAD_HXX + +#ifndef _GRAPH_HXX +#include <vcl/graph.hxx> +#endif +#ifndef _BMPACC_HXX +#include <vcl/bmpacc.hxx> +#endif + +#ifdef _XBMPRIVATE + +// --------- +// - Enums - +// --------- + +enum XBMFormat +{ + XBM10, + XBM11 +}; + +enum ReadState +{ + XBMREAD_OK, + XBMREAD_ERROR, + XBMREAD_NEED_MORE +}; + +// ------------- +// - XBMReader - +// ------------- + +class XBMReader : public GraphicReader +{ + SvStream& rIStm; + Bitmap aBmp1; + BitmapWriteAccess* pAcc1; + short* pHexTable; + BitmapColor aWhite; + BitmapColor aBlack; + long nLastPos; + long nWidth; + long nHeight; + BOOL bStatus; + + void InitTable(); + ByteString FindTokenLine( SvStream* pInStm, const char* pTok1, + const char* pTok2 = NULL, const char* pTok3 = NULL ); + long ParseDefine( const sal_Char* pDefine ); + BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat ); + + +public: + + XBMReader( SvStream& rStm ); + virtual ~XBMReader(); + + ReadState ReadXBM( Graphic& rGraphic ); +}; + +#endif // _XBMPRIVATE + +// ------------- +// - ImportXBM - +// ------------- + +BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic ); + +#endif // _XBMREAD_HXX diff --git a/svtools/source/inc/xpmread.hxx b/svtools/source/inc/xpmread.hxx new file mode 100644 index 000000000000..f1a76c9bc62f --- /dev/null +++ b/svtools/source/inc/xpmread.hxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xpmread.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _XPMREAD_HXX +#define _XPMREAD_HXX + +#ifndef _BITMAP_HXX +#include <vcl/bitmap.hxx> +#endif + +#ifdef _XPMPRIVATE + +#define XPMTEMPBUFSIZE 0x00008000 +#define XPMSTRINGBUF 0x00008000 + +#define XPMIDENTIFIER 0x00000001 // mnIdentifier includes on of the six phases +#define XPMDEFINITION 0x00000002 // the XPM format consists of +#define XPMVALUES 0x00000003 +#define XPMCOLORS 0x00000004 +#define XPMPIXELS 0x00000005 +#define XPMEXTENSIONS 0x00000006 +#define XPMENDEXT 0x00000007 + + +#define XPMREMARK 0x00000001 // defines used by mnStatus +#define XPMDOUBLE 0x00000002 +#define XPMSTRING 0x00000004 +#define XPMFINISHED 0x00000008 + +#define XPMCASESENSITIVE 0x00000001 +#define XPMCASENONSENSITIVE 0x00000002 + +// --------- +// - Enums - +// --------- + +enum ReadState +{ + XPMREAD_OK, + XPMREAD_ERROR, + XPMREAD_NEED_MORE +}; + +// ------------- +// - XPMReader - +// ------------- + +class BitmapWriteAccess; +class Graphic; + +class XPMReader : public GraphicReader +{ +private: + + SvStream& mrIStm; + Bitmap maBmp; + BitmapWriteAccess* mpAcc; + Bitmap maMaskBmp; + BitmapWriteAccess* mpMaskAcc; + long mnLastPos; + + ULONG mnWidth; + ULONG mnHeight; + ULONG mnColors; + ULONG mnCpp; // characters per pix + BOOL mbTransparent; + BOOL mbStatus; + ULONG mnStatus; + ULONG mnIdentifier; + BYTE mcThisByte; + BYTE mcLastByte; + ULONG mnTempAvail; + BYTE* mpTempBuf; + BYTE* mpTempPtr; + BYTE* mpFastColorTable; + BYTE* mpColMap; + ULONG mnStringSize; + BYTE* mpStringBuf; + ULONG mnParaSize; + BYTE* mpPara; + + BOOL ImplGetString( void ); + BOOL ImplGetColor( ULONG ); + BOOL ImplGetScanLine( ULONG ); + BOOL ImplGetColSub( BYTE* ); + BOOL ImplGetColKey( BYTE ); + void ImplGetRGBHex( BYTE*, ULONG ); + BOOL ImplGetPara( ULONG numb ); + BOOL ImplCompare( BYTE*, BYTE*, ULONG, ULONG nmode = XPMCASENONSENSITIVE ); + ULONG ImplGetULONG( ULONG nPara ); + +public: + XPMReader( SvStream& rStm ); + virtual ~XPMReader(); + + ReadState ReadXPM( Graphic& rGraphic ); +}; + +#endif // _XPMPRIVATE + +// ------------- +// - ImportXPM - +// ------------- + +BOOL ImportXPM( SvStream& rStream, Graphic& rGraphic ); + +#endif // _XPMREAD_HXX |