diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-08 12:20:11 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-08 12:20:11 +0200 |
commit | e6b4345c7f4026cb9b3e8dee6ecc84b3531e1950 (patch) | |
tree | 35a66a82b052424c4664f1c4bb77b6ef71f654ba /svl/inc | |
parent | b429c6949ce70e47538f90f5c67979b9d0ec0333 (diff) |
#i103496#: split svtools in two libs, depending on whether the code needs vcl or not
Diffstat (limited to 'svl/inc')
107 files changed, 17376 insertions, 0 deletions
diff --git a/svl/inc/PasswordHelper.hxx b/svl/inc/PasswordHelper.hxx new file mode 100644 index 000000000000..7139a3ebe361 --- /dev/null +++ b/svl/inc/PasswordHelper.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * 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: PasswordHelper.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 _SVTOOLS_PASSWORDHELPER_HXX +#define _SVTOOLS_PASSWORDHELPER_HXX + +#include "svtools/svldllapi.h" +#include "sal/types.h" +#include "com/sun/star/uno/Sequence.hxx" + +class String; + +class SvPasswordHelper +{ + static void GetHashPassword(com::sun::star::uno::Sequence <sal_Int8>& rPassHash, const sal_Char* pPass, sal_uInt32 nLen); + static void GetHashPasswordLittleEndian(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const String& sPass); + static void GetHashPasswordBigEndian(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const String& sPass); + +public: + SVL_DLLPUBLIC static void GetHashPassword(com::sun::star::uno::Sequence<sal_Int8>& rPassHash, const String& sPass); + /** + Use this method to compare a given string with another given Hash value. + This is necessary, because in older versions exists different hashs of the same string. They were endian dependent. + We need this to handle old files. This method will compare against big and little endian. See #101326# + */ + SVL_DLLPUBLIC static bool CompareHashPassword(const com::sun::star::uno::Sequence<sal_Int8>& rOldPassHash, const String& sNewPass); +}; + +#endif + diff --git a/svl/inc/adrparse.hxx b/svl/inc/adrparse.hxx new file mode 100644 index 000000000000..439168441057 --- /dev/null +++ b/svl/inc/adrparse.hxx @@ -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: adrparse.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 _ADRPARSE_HXX +#define _ADRPARSE_HXX + +#include "svtools/svldllapi.h" +#include <tools/list.hxx> +#include <tools/string.hxx> + +//============================================================================ +struct SvAddressEntry_Impl +{ + UniString m_aAddrSpec; + UniString m_aRealName; + + SvAddressEntry_Impl() {}; + SvAddressEntry_Impl(UniString const & rTheAddrSpec, + UniString const & rTheRealName): + m_aAddrSpec(rTheAddrSpec), m_aRealName(rTheRealName) {} +}; + +//============================================================================ +DECLARE_LIST(SvAddressList_Impl, SvAddressEntry_Impl *) + +//============================================================================ +class SVL_DLLPUBLIC SvAddressParser +{ + friend class SvAddressParser_Impl; + + SvAddressEntry_Impl m_aFirst; + SvAddressList_Impl m_aRest; + bool m_bHasFirst; + +public: + SvAddressParser(UniString const & rInput); + + ~SvAddressParser(); + + sal_Int32 Count() const { return m_bHasFirst ? m_aRest.Count() + 1 : 0; } + + inline UniString const & GetEmailAddress(sal_Int32 nIndex) const; + + inline UniString const &GetRealName(sal_Int32 nIndex) const; + + /** Create an RFC 822 <mailbox> (i.e., 'e-mail address'). + + @param rPhrase Either an empty string (the <mailbox> will have no + <phrase> an will be of the form <addr-spec>), or some text that will + become the <phrase> part of a <phrase route-addr> form <mailbox>. Non + US-ASCII characters within the text are put into a <qouted-string> + verbatim, so the result may actually not be a valid RFC 822 <mailbox>, + but a more human-readable representation. + + @param rAddrSpec A valid RFC 822 <addr-spec>. (An RFC 822 <mailbox> + including a <route> cannot be created by this method.) + + @param rMailbox If this method returns true, this parameter returns + the created RFC 822 <mailbox> (rather, a more human-readable + representation thereof). Otherwise, this parameter is not modified. + + @return True, if rAddrSpec is a valid RFC 822 <addr-spec>. + */ + static bool createRFC822Mailbox(String const & rPhrase, + String const & rAddrSpec, + String & rMailbox); +}; + +inline UniString const & SvAddressParser::GetEmailAddress(sal_Int32 nIndex) + const +{ + return nIndex == 0 ? m_aFirst.m_aAddrSpec : + m_aRest.GetObject(nIndex - 1)->m_aAddrSpec; +} + +inline UniString const & SvAddressParser::GetRealName(sal_Int32 nIndex) const +{ + return nIndex == 0 ? m_aFirst.m_aRealName : + m_aRest.GetObject(nIndex - 1)->m_aRealName; +} + +#endif // _ADRPARSE_HXX + diff --git a/svl/inc/broadcast.hxx b/svl/inc/broadcast.hxx new file mode 100644 index 000000000000..e3e409c46e96 --- /dev/null +++ b/svl/inc/broadcast.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * 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: broadcast.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 _SVT_BROADCAST_HXX +#define _SVT_BROADCAST_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> + +class SvtListener; +class SfxHint; +class SvtListenerBase; + +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SvtBroadcaster +{ +friend class SvtListener; +friend class SvtListenerBase; +friend class SvtListenerIter; + SvtListenerBase* pRoot; + + const SvtBroadcaster& operator=(const SvtBroadcaster &); // verboten + +protected: + void Forward( SvtBroadcaster& rBC, + const SfxHint& rHint ); + virtual void ListenersGone(); + +public: + TYPEINFO(); + + SvtBroadcaster(); + SvtBroadcaster( const SvtBroadcaster &rBC ); + virtual ~SvtBroadcaster(); + + void Broadcast( const SfxHint &rHint ); + + BOOL HasListeners() const { return 0 != pRoot; } +}; + + +#endif + diff --git a/svl/inc/cntnrsrt.hxx b/svl/inc/cntnrsrt.hxx new file mode 100644 index 000000000000..13553f7f16fd --- /dev/null +++ b/svl/inc/cntnrsrt.hxx @@ -0,0 +1,177 @@ +/************************************************************************* + * + * 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: cntnrsrt.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 _CNTRSRT_HXX +#define _CNTRSRT_HXX + +#if 0 +*********************************************************************** +* +* Hier folgt die Beschreibung fuer die exportierten Makros: +* +* DECLARE_CONTAINER_SORT( ClassName, Type ) +* IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) +* +* Definiert eine von Container abgeleitete Klasse "ClassName", +* in der die Elemente des Typs "Type" sortiert enthalten sind. +* Dazu muss einer Funktion "SortFunc" definiert sein, die als +* Paramter zwei "const Type&" erwartet und 0 zurueckgibt, wenn +* beide gleich sind, -1 wenn der erste Paramter kleiner ist als +* der zweite und +1 wenn der erste Paramter groesser ist als +* der zweite. +* +* Die Zugriffs-Methoden entsprechen in etwa denen der Container- +* Klasse, mit Ausnahme von Insert, DeleteAndDestroy und Seek_Entry, +* der den SV-Pointer-Arrays entsprechen. +* +* DECLARE_CONTAINER_SORT_DEL( ClassName, Type ) +* IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) +* +* Wie DECLARE_CONTAINER_SORT, nur dass beim Aufruf des Destruktors +* alle im Conatiner vorhandenen Objekte geloescht werden. +* +#endif + +#include <tools/contnr.hxx> + +#define DECLARE_CONTAINER_SORT_COMMON( ClassName, Type ) \ + ClassName( const ClassName& ); \ + ClassName& operator =( const ClassName& ); \ +public: \ + using Container::Count; \ + \ + ClassName( USHORT InitSize, USHORT ReSize ) : \ + Container( CONTAINER_MAXBLOCKSIZE, InitSize, ReSize ) {} \ + \ + BOOL Insert( Type* pObj ); \ + \ + Type *Remove( ULONG nPos ) \ + { return (Type *)Container::Remove( nPos ); } \ + \ + Type *Remove( Type* pObj ); \ + \ + void DeleteAndDestroy( ULONG nPos ) \ + { \ + Type *pObj = Remove( nPos ); \ + if( pObj ) \ + delete pObj; \ + } \ + \ + void DeleteAndDestroy() \ + { while( Count() ) DeleteAndDestroy( 0 ); } \ + \ + Type* GetObject( ULONG nPos ) const \ + { return (Type *)Container::GetObject( nPos ); } \ + \ + Type* operator[]( ULONG nPos ) const \ + { return GetObject(nPos); } \ + \ + BOOL Seek_Entry( const Type *pObj, ULONG* pPos ) const; \ + \ + ULONG GetPos( const Type* pObj ) const; \ + + +#define DECLARE_CONTAINER_SORT( ClassName, Type ) \ +class ClassName : private Container \ +{ \ + DECLARE_CONTAINER_SORT_COMMON( ClassName, Type ) \ + ~ClassName() {} \ +}; \ + + +#define DECLARE_CONTAINER_SORT_DEL( ClassName, Type ) \ +class ClassName : private Container \ +{ \ + DECLARE_CONTAINER_SORT_COMMON( ClassName, Type ) \ + ~ClassName() { DeleteAndDestroy(); } \ +}; \ + + +#define IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) \ +BOOL ClassName::Insert( Type *pObj ) \ +{ \ + ULONG nPos; \ + BOOL bExist = Seek_Entry( pObj, &nPos ); \ + if( !bExist ) \ + Container::Insert( pObj, nPos ); \ + return !bExist; \ +} \ + \ +Type *ClassName::Remove( Type* pObj ) \ +{ \ + ULONG nPos; \ + if( Seek_Entry( pObj, &nPos ) ) \ + return Remove( nPos ); \ + else \ + return 0; \ +} \ + \ +ULONG ClassName::GetPos( const Type* pObj ) const \ +{ \ + ULONG nPos; \ + if( Seek_Entry( pObj, &nPos ) ) \ + return nPos; \ + else \ + return CONTAINER_ENTRY_NOTFOUND; \ +} \ + \ +BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \ +{ \ + register ULONG nO = Count(), \ + nM, \ + nU = 0; \ + if( nO > 0 ) \ + { \ + nO--; \ + while( nU <= nO ) \ + { \ + nM = nU + ( nO - nU ) / 2; \ + int nCmp = SortFunc( *GetObject(nM), *pObj ); \ + \ + if( 0 == nCmp ) \ + { \ + if( pPos ) *pPos = nM; \ + return TRUE; \ + } \ + else if( nCmp < 0 ) \ + nU = nM + 1; \ + else if( nM == 0 ) \ + { \ + if( pPos ) *pPos = nU; \ + return FALSE; \ + } \ + else \ + nO = nM - 1; \ + } \ + } \ + if( pPos ) *pPos = nU; \ + return FALSE; \ +} \ + +#endif diff --git a/svl/inc/cntwids.hrc b/svl/inc/cntwids.hrc new file mode 100644 index 000000000000..fcb9f855453b --- /dev/null +++ b/svl/inc/cntwids.hrc @@ -0,0 +1,509 @@ +/************************************************************************* + * + * 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: cntwids.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 _CNTWIDS_HRC +#define _CNTWIDS_HRC + +#ifndef OLD_CHAOS +#define TF_NEW_TABPAGES +#define CNT_COOL_ABO +#endif + +//========================================================================= +// ARGS, MSG, ALL, FOLDER, BOXALL, BOXEXT +//========================================================================= + +#define WID_CHAOS_START 500 + +//FUNC MSG +#define WID_MARK_THREAD_MARKED (499) +#define WID_MARK_THREAD_UNMARKED (498) + +// ARGS +#define WID_DUMMY_ARG1 (WID_CHAOS_START + 0) +#define WID_FACTORY_NO (WID_CHAOS_START + 1) +#define WID_FACTORY_NAME (WID_CHAOS_START + 2) +#define WID_NEWS_XREF (WID_CHAOS_START + 3) +#define WID_CREATION_FLAGS (WID_CHAOS_START + 4) +#define WID_FACTORY_HELP_ID (WID_CHAOS_START + 5) + +//FUNC MSG +#define WID_MSG_START (WID_CHAOS_START + 6) +#define WID_MAIL_REPLY (WID_CHAOS_START + 6) +#define WID_POST_REPLY (WID_CHAOS_START + 7) +#define WID_FORWARD (WID_CHAOS_START + 8) +#define WID_MARK_THREAD_READ (WID_CHAOS_START + 9) +#define WID_HIDE_THREAD (WID_CHAOS_START + 10) +#define WID_HIDE_AUTHOR (WID_CHAOS_START + 11) +#define WID_HIDE_SUBJECT (WID_CHAOS_START + 12) +#define WID_RESEND_MSG (WID_CHAOS_START + 13) +#define WID_MARK_THREAD_UNREAD (WID_CHAOS_START + 14) + +//PROP MSG +#define WID_PRIORITY (WID_CHAOS_START + 15) +#define WID_RULE_APPLIED (WID_CHAOS_START + 16) +#define WID_MSG_LOCK (WID_CHAOS_START + 17) +#define WID_SEEN_STATUS (WID_CHAOS_START + 18) +#define WID_REPLY_TO (WID_CHAOS_START + 19) +#define WID_IN_REPLY_TO (WID_CHAOS_START + 20) + +#define WID_MESSAGE_ID (WID_CHAOS_START + 21) +#define WID_BCC (WID_CHAOS_START + 22) +#define WID_CC (WID_CHAOS_START + 23) +#define WID_TO (WID_CHAOS_START + 24) +#define WID_FROM (WID_CHAOS_START + 25) +#define WID_TITLE (WID_CHAOS_START + 26) +#define WID_SUBJECT WID_TITLE // only here to prevent panic, should be removed +#define WID_MESSAGEBODY (WID_CHAOS_START + 27) + +#define WID_REFERENCES (WID_CHAOS_START + 28) +#define WID_NEWSGROUPS (WID_CHAOS_START + 29) +#define WID_NEWS_XREFLIST (WID_CHAOS_START + 30) + +#define WID_OUTMSGINTERNALSTATE (WID_CHAOS_START + 31) +#define WID_RECIPIENTLIST (WID_CHAOS_START + 32) +#define WID_MSG_END (WID_CHAOS_START + 32) + +//FUNC ALL +#define WID_ALL_START (WID_CHAOS_START + 33) +#define WID_DEFAULT (WID_CHAOS_START + 33) +#define WID_OPEN (WID_CHAOS_START + 34) +#define WID_DELETE (WID_CHAOS_START + 35) +#define WID_CUT (WID_CHAOS_START + 36) +#define WID_COPY (WID_CHAOS_START + 37) +#define WID_PASTE (WID_CHAOS_START + 38) +#define WID_RENAME (WID_CHAOS_START + 39) + +#define WID_HAS_DATA (WID_CHAOS_START + 40) +#define WID_GETDATA (WID_CHAOS_START + 41) +#define WID_PUTDATA (WID_CHAOS_START + 42) + +//PROP ALL +#define WID_INTERIM_URL (WID_CHAOS_START + 43) +#define WID_CONTENT_TYPE (WID_CHAOS_START + 44) + +#define WID_OWN_URL (WID_CHAOS_START + 45) +#define WID_REAL_URL (WID_CHAOS_START + 46) +#define WID_OBSOLETE_TITLE (WID_CHAOS_START + 47) +#define WID_FLAG_READONLY (WID_CHAOS_START + 48) + +#define WID_REFERED_URL (WID_CHAOS_START + 49) +#define WID_REFERER_COUNT (WID_CHAOS_START + 50) +#define WID_FLAG_IS_FOLDER (WID_CHAOS_START + 51) +#define WID_FLAG_HAS_FOLDER (WID_CHAOS_START + 52) +#define WID_FLAG_IS_MESSAGE (WID_CHAOS_START + 53) +#define WID_FLAG_IS_DOCUMENT (WID_FLAG_IS_MESSAGE) +#define WID_FLAG_HAS_MESSAGES (WID_CHAOS_START + 54) + +#define WID_DATE_CREATED (WID_CHAOS_START + 55) +#define WID_DATE_MODIFIED (WID_CHAOS_START + 56) +#define WID_VIEW_DESCRIPTION (WID_CHAOS_START + 57) +#define WID_IS_READ (WID_CHAOS_START + 58) +#define WID_IS_MARKED (WID_CHAOS_START + 59) +#define WID_ALL_END (WID_CHAOS_START + 59) + +//FUNC FOLDER +#define WID_FOLDER_START (WID_CHAOS_START + 60) +#define WID_SYNCHRONIZE (WID_CHAOS_START + 60) +#define WID_CREATE_NEW (WID_CHAOS_START + 61) +#define WID_INSERT (WID_CHAOS_START + 62) +#define WID_UPDATE (WID_CHAOS_START + 63) +#define WID_IMPORT (WID_CHAOS_START + 64) + +//PROP FOLDER VIEW +#define WID_DUMMY_PROPFOLDERVIEW1 (WID_CHAOS_START + 65) +#define WID_THREADING (WID_CHAOS_START + 66) +#define WID_MSG_COLUMN_INFO /* obsolete */ (WID_CHAOS_START + 67) +#define WID_FLD_COLUMN_INFO /* obsolete */ (WID_CHAOS_START + 68) +#define WID_FOLDERVIEW_MODE (WID_CHAOS_START + 69) +#define WID_MESSAGEVIEW_MODE (WID_CHAOS_START + 70) +#define WID_SENTMESSAGEVIEW_MODE (WID_CHAOS_START + 71) +#define WID_SORTING (WID_CHAOS_START + 72) +#define WID_THREADED (WID_CHAOS_START + 73) +#define WID_FILTERED (WID_CHAOS_START + 74) +#define WID_RULES (WID_CHAOS_START + 75) +#define WID_SUBSCRNEWSGROUPCOUNT (WID_CHAOS_START + 76) +#define WID_FLAG_SUBSCRIBED (WID_CHAOS_START + 77) +#define WID_FLAG_SUPPORTMODE (WID_CHAOS_START + 78) + +//PROP FOLDER DIR +#define WID_DUMMY_FOLDERDIR1 (WID_CHAOS_START + 79) +#define WID_TOTALCONTENTCOUNT (WID_CHAOS_START + 80) +#define WID_NEWSGROUPCOUNT /* ??? */ (WID_CHAOS_START + 81) +#define WID_ARTICLECOUNT /* ??? */ (WID_CHAOS_START + 82) +#define WID_KNOWN_RANGES (WID_CHAOS_START + 83) +#define WID_IMAPFOLDERINFO (WID_CHAOS_START + 84) + +//PROP FOLDER USER +#define WID_DUMMY_FOLDERUSER1 (WID_CHAOS_START + 85) +#define WID_SEENCONTENTCOUNT (WID_CHAOS_START + 86) +#define WID_UNREAD_ARTICLECOUNT (WID_SEENCONTENTCOUNT) +#define WID_SENTCONTENTCOUNT (WID_SEENCONTENTCOUNT) +#define WID_READ_RANGES (WID_CHAOS_START + 87) +#define WID_MARK_RANGES (WID_CHAOS_START + 88) +#define WID_FOLDER_END (WID_CHAOS_START + 88) + +//PROP BOXALL +#define WID_BOXALL_START (WID_CHAOS_START + 89) +// Used for d&d of View Storages... +#define WID_PREPARE_MOVE (WID_CHAOS_START + 89) +#define WID_OUTTRAY_WANTED (WID_CHAOS_START + 90) +#define WID_USERNAME (WID_CHAOS_START + 91) +#define WID_PASSWORD (WID_CHAOS_START + 92) +#define WID_SERVERNAME (WID_CHAOS_START + 93) +#define WID_SERVERPORT (WID_CHAOS_START + 94) +// obsolete +#define WID_MAILSEND_USERNAME (WID_CHAOS_START + 95) +#define WID_MAILSEND_PASSWORD (WID_CHAOS_START + 96) +#define WID_MAILSEND_SERVERNAME (WID_CHAOS_START + 97) +#define WID_NEWSSEND_USERNAME (WID_CHAOS_START + 98) +#define WID_NEWSSEND_PASSWORD (WID_CHAOS_START + 99) +#define WID_NEWSSEND_SERVERNAME (WID_CHAOS_START + 100) +// end obsolete +#define WID_SERVERBASE (WID_CHAOS_START + 101) +// not used +#define WID_SMTP_GATEWAY (WID_CHAOS_START + 102) + +// -> ..._DEFAULT +// obsolete +#define WID_FROM_DEFAULT (WID_CHAOS_START + 103) +// obsolete +#define WID_REPLY_TO_DEFAULT (WID_CHAOS_START + 104) + +#define WID_AUTOUPDATE_INTERVAL (WID_CHAOS_START + 105) +#define WID_UPDATE_ENABLED (WID_CHAOS_START + 106) +#define WID_BOXALL_END (WID_CHAOS_START + 106) + +//PROP BOX RNMGR +#define WID_BOXEXT_START (WID_CHAOS_START + 107) +#define WID_CONNECTION_MODE (WID_CHAOS_START + 107) +#define WID_NEWS_GROUPLIST (WID_CHAOS_START + 108) +#ifdef OLD_CHAOS +#define WID_BOX_CONNECTION_PROP (WID_CHAOS_START + 109) +#else +#define WID_MESSAGE_STOREMODE (WID_CHAOS_START + 109) +#endif +#define WID_DELETE_ON_SERVER (WID_CHAOS_START + 110) + +//PROP BOX USER + +//PROP BOX OUT DIR +#define WID_OUTMSGEXTERNALSTATE (WID_CHAOS_START + 111) + +//PROP RNM +#define WID_RNM_UPDATETIMER_LIST (WID_CHAOS_START + 112) +#define WID_BOXEXT_END (WID_CHAOS_START + 112) + +////////////////////////////////////////////////////////////////////////// +// MISC - Added after initial pool version +////////////////////////////////////////////////////////////////////////// + +// PROP BOX +#define WID_SERVER_RANGES (WID_CHAOS_START + 113) +#define WID_LAST_UPDATE (WID_CHAOS_START + 114) +#define WID_LAST_MSGID (WID_CHAOS_START + 115) +#define WID_LAST_UID (WID_CHAOS_START + 116) + +// FUNC ALL +#define WID_UNDELETE (WID_CHAOS_START + 117) +#define WID_CLOSE (WID_CHAOS_START + 118) +#define WID_REOPEN (WID_CHAOS_START + 119) + +// PROP RNM +#define WID_RNM_FILECONVERSION_LIST (WID_CHAOS_START + 120) + +// PROP FOLDER +#define WID_SHOW_MSGS_HAS_TIMELIMIT (WID_CHAOS_START + 121) +#define WID_SHOW_MSGS_TIMELIMIT (WID_CHAOS_START + 122) +#define WID_STORE_MSGS_HAS_TIMELIMIT (WID_CHAOS_START + 123) +#define WID_STORE_MSGS_TIMELIMIT (WID_CHAOS_START + 124) + +// PROP BOX +#define WID_MSG_COLUMN_WIDTHS /* obsolete */(WID_CHAOS_START + 125) + +#ifdef OLD_CHAOS + +#define WID_CHAOS_END (WID_CHAOS_START + 125) + +#else + +////////////////////////////////////////////////////////////////////////// +// WID's added after SO 4.0 release ( SUPD > 364 ) +////////////////////////////////////////////////////////////////////////// + +// PROP ALL +#define WID_PROPERTYLIST (WID_CHAOS_START + 126) + +// PROP BOXALL +#define WID_BOXALL_START2 (WID_CHAOS_START + 127) +#define WID_SEND_PUBLIC_PROT_ID (WID_CHAOS_START + 127) +#define WID_SEND_PRIVATE_PROT_ID (WID_CHAOS_START + 128) +#define WID_SEND_PUBLIC_OUTBOXPROPS (WID_CHAOS_START + 129) +#define WID_SEND_PRIVATE_OUTBOXPROPS (WID_CHAOS_START + 130) +#define WID_SEND_SERVERNAME (WID_CHAOS_START + 131) +#define WID_SEND_USERNAME (WID_CHAOS_START + 132) +#define WID_SEND_PASSWORD (WID_CHAOS_START + 133) +#define WID_SEND_REPLY_TO_DEFAULT (WID_CHAOS_START + 134) +#define WID_SEND_FROM_DEFAULT (WID_CHAOS_START + 135) +#define WID_VIM_POPATH (WID_CHAOS_START + 136) +#define WID_SEND_VIM_POPATH (WID_CHAOS_START + 137) +#define WID_PURGE (WID_CHAOS_START + 138) +#define WID_CLEAN_CACHE (WID_CHAOS_START + 139) +#define WID_SEARCH (WID_CHAOS_START + 140) +#define WID_JOURNAL (WID_CHAOS_START + 141) +#define WID_LOCALBASE (WID_CHAOS_START + 142) +#define WID_BOXALL_END2 (WID_CHAOS_START + 142) + +// PROP DOCUMENT +#define WID_DOCUMENT_HEADER (WID_CHAOS_START + 143) +#define WID_DOCUMENT_BODY (WID_CHAOS_START + 144) +#define WID_DOCUMENT_SIZE (WID_CHAOS_START + 145) + +// PROP ALL +#define WID_SIZE WID_DOCUMENT_SIZE + +// PROP PROJECT +#define WID_PRJ_MEDIUM (WID_CHAOS_START + 146) +#define WID_PRJ_FILENAMECONVENTION (WID_CHAOS_START + 147) + +// PROP FSYS +#define WID_FSYS_DISKSPACE_LEFT (WID_CHAOS_START + 148) +#define WID_TRANSFER (WID_CHAOS_START + 149) + +// PROP ALL +#define WID_KEYWORDS (WID_CHAOS_START + 150) +#define WID_IS_PROTECTED (WID_CHAOS_START + 151) + +// PROP SEARCH +#define WID_SEARCH_CRITERIA (WID_CHAOS_START + 152) +#define WID_SEARCH_LOCATIONS (WID_CHAOS_START + 153) +#define WID_SEARCH_RECURSIVE (WID_CHAOS_START + 154) +#define WID_SEARCH_FOLDER_VIEW (WID_CHAOS_START + 155) +#define WID_SEARCH_DOCUMENT_VIEW (WID_CHAOS_START + 156) + +// PROP Channel +#define WID_SCHEDULE_RANGE (WID_CHAOS_START + 157) +#define WID_ALLOWED_SCHEDULE_RANGE (WID_CHAOS_START + 158) +#define WID_TARGET_URL (WID_CHAOS_START + 159) +#define WID_FREQUENCY (WID_CHAOS_START + 160) + +// PROP HTTP +#define WID_HTTP_CONNECTION_LIMIT (WID_CHAOS_START + 161) +#define WID_HTTP_COOKIE_MANAGER (WID_CHAOS_START + 162) + +// PROP Channel +#define WID_COLUMN_NEXT_UPD (WID_CHAOS_START + 163) +#define WID_CRAWL_STATUS (WID_CHAOS_START + 164) +#define WID_CRAWL_LEVEL (WID_CHAOS_START + 165) +#define WID_CRAWL_MODE (WID_CHAOS_START + 166) +// WID_CRAWL_MAX_VOLUME shall be removed in the future! +// --> WID_SIZE_LIMIT +#define WID_CRAWL_MAX_VOLUME (WID_CHAOS_START + 167) +#define WID_CRAWL_IMAGE (WID_CHAOS_START + 168) +#define WID_CRAWL_LINK_OUT (WID_CHAOS_START + 169) +#define WID_NOTIFICATION_MODE (WID_CHAOS_START + 170) +#define WID_NOTIFICATION_ADDRESS (WID_CHAOS_START + 171) + +// PROP BOXALL +#define WID_ACCOUNT (WID_CHAOS_START + 172) + +// PROP FSYS +#define WID_FSYS_KIND (WID_CHAOS_START + 173) +#define WID_FSYS_FLAGS (WID_CHAOS_START + 174) + +// PROP FOLDER +#define WID_VIEWDATA /* obsolete */ (WID_CHAOS_START + 175) + +// PROP FSYS +#define WID_WHO_IS_MASTER (WID_CHAOS_START + 176) + +// FUNC HTTP +#define WID_HTTP_POST (WID_CHAOS_START + 177) + +// PROP ALL +#define WID_SUPPORTED_FUNCS (WID_CHAOS_START + 178) +#define WID_SIZE_LIMIT (WID_CHAOS_START + 179) + +// PROP FOLDER +#define WID_MARKED_DOCUMENT_COUNT (WID_CHAOS_START + 180) +#define WID_FOLDER_COUNT (WID_CHAOS_START + 181) + +// PROP FSYS +#define WID_FSYS_SHOW_HIDDEN (WID_CHAOS_START + 182) + +// TRASHCAN +#define WID_TRASHCAN_START (WID_CHAOS_START + 183) +#define WID_TRASHCAN_EMPTY_TRASH (WID_CHAOS_START + 183) +#define WID_TRASHCAN_FLAG_AUTODELETE (WID_CHAOS_START + 184) +#define WID_TRASHCAN_FLAG_CONFIRMEMPTY (WID_CHAOS_START + 185) +#define WID_TRASHCAN_DUMMY1 (WID_CHAOS_START + 186) +#define WID_TRASHCAN_DUMMY2 (WID_CHAOS_START + 187) +#define WID_TRASHCAN_END (WID_CHAOS_START + 187) + +// TRASH +#define WID_TRASH_START (WID_CHAOS_START + 188) +#define WID_TRASH_RESTORE (WID_CHAOS_START + 188) +#define WID_TRASH_ORIGIN (WID_CHAOS_START + 189) +#define WID_TRASH_DUMMY2 (WID_CHAOS_START + 190) +#define WID_TRASH_END (WID_CHAOS_START + 190) + +// PROP ALL +#define WID_TARGET_FRAMES (WID_CHAOS_START + 191) + +// FUNC FOLDER +#define WID_EXPORT (WID_CHAOS_START + 192) + +// COMPONENT +#define WID_COMPONENT_COMMAND (WID_CHAOS_START + 193) +#define WID_COMPONENT_MENU (WID_CHAOS_START + 194) + +// PROP Channel +#define WID_HREF (WID_CHAOS_START + 195) + +// PROP FOLDER (VIEW) +#define WID_VIEW_START (WID_CHAOS_START + 196) +#define WID_VIEW_COLS_BEAMER (WID_CHAOS_START + 196) +#define WID_VIEW_COLS_FILEDLG (WID_CHAOS_START + 197) +#define WID_VIEW_COLS_FLDWIN (WID_CHAOS_START + 198) +#define WID_VIEW_MODE_FLDWIN (WID_CHAOS_START + 199) +#define WID_VIEW_LAYOUT_FLDWIN (WID_CHAOS_START + 200) +#define WID_VIEW_ICON_POS_FLDWIN (WID_CHAOS_START + 201) +#define WID_VIEW_SORT_BEAMER (WID_CHAOS_START + 202) +#define WID_VIEW_SORT_FILEDLG (WID_CHAOS_START + 203) +#define WID_VIEW_SORT_FLDWIN_DETAILS (WID_CHAOS_START + 204) +#define WID_VIEW_SORT_FLDWIN_ICON (WID_CHAOS_START + 205) +#define WID_VIEW_WINDOW_POS_FLDWIN (WID_CHAOS_START + 206) +#define WID_VIEW_END (WID_CHAOS_START + 206) + +// PROP ALL +#define WID_IS_INVALID (WID_CHAOS_START + 207) + +// PROP Channel +#define WID_VIEW_TIPHELP (WID_CHAOS_START + 208) +#define WID_PUBLISHER_SCHEDULE (WID_CHAOS_START + 209) +#define WID_GETMODE (WID_CHAOS_START + 210) +#define WID_READ_OFFLINE (WID_CHAOS_START + 211) + +// PROP ALL +#define WID_ALL_START2 (WID_CHAOS_START + 212) +#define WID_REAL_NAME (WID_CHAOS_START + 212) +#define WID_FLAG_UPDATE_ON_OPEN (WID_CHAOS_START + 213) +#define WID_ACTION_LIST (WID_CHAOS_START + 214) +#define WID_EDIT_STRING (WID_CHAOS_START + 215) +#define WID_SET_AS_DEFAULT (WID_CHAOS_START + 216) +#define WID_ALL_END2 (WID_CHAOS_START + 216) + +// PROP FOLDER (VIEW) +#define WID_VIEW2_START (WID_CHAOS_START + 217) +#define WID_VIEW2_FLD_PIC (WID_CHAOS_START + 217) +#define WID_FLAG_EXPANDED (WID_CHAOS_START + 218) +#define WID_CHILD_DEFAULTS (WID_CHAOS_START + 219) +#define WID_VIEW2_END (WID_CHAOS_START + 219) + +// PROP HTTP +#define WID_HTTP_KEEP_EXPIRED (WID_CHAOS_START + 220) +#define WID_HTTP_VERIFY_MODE (WID_CHAOS_START + 221) +#define WID_HTTP_NOCACHE_LIST (WID_CHAOS_START + 222) +#define WID_HTTP_REFERER (WID_CHAOS_START + 223) + +// PROP FSYS +#define WID_FSYS_START (WID_CHAOS_START + 224) +#define WID_FSYS_VALUE_FOLDER (WID_CHAOS_START + 224) +#define WID_FSYS_SHOW_EXTENSION (WID_CHAOS_START + 225) +#define WID_VALUE_ADDED_MODE (WID_CHAOS_START + 226) +#define WID_FSYS_DUMMY3 (WID_CHAOS_START + 227) +#define WID_FSYS_DUMMY4 (WID_CHAOS_START + 228) +#define WID_FSYS_END (WID_CHAOS_START + 228) + +// FUNC HTTP +#define WID_HTTP_GET_COOKIE (WID_CHAOS_START + 229) +#define WID_HTTP_SET_COOKIE (WID_CHAOS_START + 230) + +// PROP HTTP +#define WID_HTTP_COOKIE (WID_CHAOS_START + 231) +#define WID_HTTP_DUMMY_1 (WID_CHAOS_START + 232) + +////////////////////////////////////////////////////////////////////////// +// WID's added after SO 5.0 release ( SUPD > 505 ) +////////////////////////////////////////////////////////////////////////// + +// PROP FOLDER +#define WID_FOLDER_START2 (WID_CHAOS_START + 233) +#define WID_USER_SORT_CRITERIUM (WID_CHAOS_START + 233) +#define WID_HEADER_CONFIG (WID_CHAOS_START + 234) +#define WID_GROUPVIEW_CONFIG (WID_CHAOS_START + 235) +#define WID_FLD_WEBVIEW_TEMPLATE (WID_CHAOS_START + 236) +// eigene Iconpositionen fuer den Explorer, da er noch +// keinen eigenen View-Storage hat +#define WID_VIEW_ICON_POS_GRPWIN (WID_CHAOS_START + 237) +#define WID_FOLDER_END2 (WID_CHAOS_START + 237) + +// PROP ALL +#define WID_SHOW_IN_EXPLORER (WID_CHAOS_START + 238) + +// PROP FOLDER (VIEW) +#define WID_VIEW3_START (WID_CHAOS_START + 239) +#define WID_FLD_FONT (WID_CHAOS_START + 239) +#define WID_FLD_WEBVIEW_USE_GLOBAL (WID_CHAOS_START + 240) +#define WID_VIEW3_DUMMY2 (WID_CHAOS_START + 241) +#define WID_VIEW3_DUMMY3 (WID_CHAOS_START + 242) +#define WID_VIEW3_END (WID_CHAOS_START + 242) + +// PROP FTP +#define WID_FTP_ACCOUNT (WID_CHAOS_START + 243) + +// PROP FOLDER +#define WID_STORE_MARKED (WID_CHAOS_START + 244) + +// REPLICATION ( Currently only here to have file compatibility between +// SO51 Client and SO51 Server, for which the functionality +// first shall be implemented ). +#define WID_REPLICATION_1 (WID_CHAOS_START + 245) +#define WID_REPLICATION_2 (WID_CHAOS_START + 246) +#define WID_REPLICATION_3 (WID_CHAOS_START + 247) +#define WID_REPLICATION_4 (WID_CHAOS_START + 248) +#define WID_REPLICATION_5 (WID_CHAOS_START + 249) + +// PROP SEARCH +#define WID_SEARCH_INDIRECTIONS (WID_CHAOS_START + 250) + +// PROP ALL +#define WID_SEND_FORMATS (WID_CHAOS_START + 251) +#define WID_SEND_COPY_TARGET (WID_CHAOS_START + 252) + +// FUNC ALL +#define WID_TRANSFER_RESULT (WID_CHAOS_START + 253) + +// END +#define WID_CHAOS_END (WID_CHAOS_START + 253) + +#endif /* OLD_CHAOS */ + +#endif /* !_CNTWIDS_HRC */ diff --git a/svl/inc/filenotation.hxx b/svl/inc/filenotation.hxx new file mode 100644 index 000000000000..460d425d471a --- /dev/null +++ b/svl/inc/filenotation.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * 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: filenotation.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 SVTOOLS_FILENOTATION_HXX +#define SVTOOLS_FILENOTATION_HXX + +#include "svtools/svldllapi.h" +#include <rtl/ustring.hxx> + +//......................................................................... +namespace svt +{ +//......................................................................... + + //===================================================================== + //= OFileNotation + //===================================================================== + class SVL_DLLPUBLIC OFileNotation + { + protected: + ::rtl::OUString m_sSystem; + ::rtl::OUString m_sFileURL; + + public: + enum NOTATION + { + N_SYSTEM, + N_URL + }; + + OFileNotation( const ::rtl::OUString& _rUrlOrPath ); + OFileNotation( const ::rtl::OUString& _rUrlOrPath, NOTATION _eInputNotation ); + + ::rtl::OUString get(NOTATION _eOutputNotation); + + private: + SVL_DLLPRIVATE void construct( const ::rtl::OUString& _rUrlOrPath ); + SVL_DLLPRIVATE bool implInitWithSystemNotation( const ::rtl::OUString& _rSystemPath ); + SVL_DLLPRIVATE bool implInitWithURLNotation( const ::rtl::OUString& _rURL ); + }; + +//......................................................................... +} // namespace svt +//......................................................................... + +#endif // SVTOOLS_FILENOTATION_HXX + diff --git a/svl/inc/flbytes.hxx b/svl/inc/flbytes.hxx new file mode 100644 index 000000000000..86c19191de2a --- /dev/null +++ b/svl/inc/flbytes.hxx @@ -0,0 +1,174 @@ +/************************************************************************* + * + * 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: flbytes.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 _FLBYTES_HXX +#define _FLBYTES_HXX + +#include <tools/debug.hxx> +#include <tools/stream.hxx> + +//============================================================================ +class SvFillLockBytes : public SvLockBytes +{ + SvLockBytesRef xLockBytes; + ULONG nFilledSize; + BOOL bTerminated; + BOOL bSync; +public: + TYPEINFO(); + + SvFillLockBytes( SvLockBytes* pLockBytes ); + virtual ErrCode ReadAt( + ULONG nPos, void* pBuffer, ULONG nCount, ULONG* pRead ) const; + virtual ErrCode WriteAt( + ULONG nPos, const void* pBuffer, ULONG nCount, ULONG* pWritten ); + virtual ErrCode Flush() const; + virtual ErrCode SetSize( ULONG nSize ); + virtual ErrCode LockRegion( ULONG nPos, ULONG nCount, LockType ); + virtual ErrCode UnlockRegion( ULONG nPos, ULONG nCount, LockType ); + virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const; + ErrCode FillAppend( const void* pBuffer, ULONG nCount, ULONG *pWritten ); + ULONG Tell() const { return nFilledSize; } + void Seek( ULONG nPos ) { nFilledSize = nPos; } + + void Terminate(); +}; + +SV_DECL_IMPL_REF( SvFillLockBytes ) + +//============================================================================ +class SvSyncLockBytes: public SvOpenLockBytes +{ + SvAsyncLockBytesRef m_xAsyncLockBytes; + +public: + TYPEINFO(); + + /// Create a synchronous wrapper around existing asynchronous lock bytes. + /// + /// @param pTheAsyncLockBytes Must not be null. + inline SvSyncLockBytes(SvAsyncLockBytes * pTheAsyncLockBytes); + + /// Create a synchronous wrapper around an existing stream. + /// + /// @descr This is like first creating asynchronous lock bytes around the + /// stream and than creating a synchronous wrapper around the asynchronous + /// lock bytes. + /// + /// @param pStream Must not be null. + /// + /// @param bOwner True if these lock bytes own the stream (delete it on + /// destruction). + SvSyncLockBytes(SvStream * pStream, BOOL bOwner): + m_xAsyncLockBytes(new SvAsyncLockBytes(pStream, bOwner)) {} + + virtual const SvStream * GetStream() const + { return m_xAsyncLockBytes->GetStream(); } + + virtual void SetSynchronMode(BOOL bSync = TRUE) + { m_xAsyncLockBytes->SetSynchronMode(bSync); } + + virtual BOOL IsSynchronMode() const + { return m_xAsyncLockBytes->IsSynchronMode(); } + + virtual ErrCode ReadAt(ULONG nPos, void * pBuffer, ULONG nCount, + ULONG * pRead) const; + + virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount, + ULONG * pWritten); + + virtual ErrCode Flush() const { return m_xAsyncLockBytes->Flush(); } + + virtual ErrCode SetSize(ULONG nSize) + { return m_xAsyncLockBytes->SetSize(nSize); } + + virtual ErrCode LockRegion(ULONG nPos, ULONG nCount, LockType eType) + { return m_xAsyncLockBytes->LockRegion(nPos, nCount, eType); } + + virtual ErrCode UnlockRegion(ULONG nPos, ULONG nCount, LockType eType) + { return m_xAsyncLockBytes->UnlockRegion(nPos, nCount, eType); } + + virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag eFlag) + const + { return m_xAsyncLockBytes->Stat(pStat, eFlag); } + + virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount, + ULONG * pWritten) + { return m_xAsyncLockBytes->FillAppend(pBuffer, nCount, pWritten); } + + virtual ULONG Tell() const { return m_xAsyncLockBytes->Tell(); } + + virtual ULONG Seek(ULONG nPos) + { return m_xAsyncLockBytes->Seek(nPos); } + + virtual void Terminate() { m_xAsyncLockBytes->Terminate(); } +}; + +inline SvSyncLockBytes::SvSyncLockBytes(SvAsyncLockBytes * + pTheAsyncLockBytes): + m_xAsyncLockBytes(pTheAsyncLockBytes) +{ + DBG_ASSERT(m_xAsyncLockBytes.Is(), + "SvSyncLockBytes::SvSyncLockBytes(): Null"); +} + +SV_DECL_IMPL_REF(SvSyncLockBytes); + +//============================================================================ +struct SvCompositeLockBytes_Impl; +class SvCompositeLockBytes : public SvLockBytes +{ + SvCompositeLockBytes_Impl* pImpl; +public: + TYPEINFO(); + + SvCompositeLockBytes( ); + ~SvCompositeLockBytes(); + + void Append( SvLockBytes* pLockBytes, ULONG nPos, ULONG nOffset ); + ULONG RelativeOffset( ULONG nPos ) const; + void SetIsPending( BOOL bSet ); + SvLockBytes* GetLastLockBytes() const; + + virtual ErrCode ReadAt( + ULONG nPos, void* pBuffer, ULONG nCount, ULONG* pRead ) const; + virtual ErrCode WriteAt( + ULONG nPos, const void* pBuffer, ULONG nCount, ULONG* pWritten ); + virtual ErrCode Flush() const; + virtual ErrCode SetSize( ULONG nSize ); + virtual ErrCode LockRegion( ULONG nPos, ULONG nCount, LockType ); + virtual ErrCode UnlockRegion( ULONG nPos, ULONG nCount, LockType ); + virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const; +}; + +SV_DECL_IMPL_REF( SvCompositeLockBytes ) + + +#endif diff --git a/svl/inc/folderrestriction.hxx b/svl/inc/folderrestriction.hxx new file mode 100644 index 000000000000..f7e683b31ad6 --- /dev/null +++ b/svl/inc/folderrestriction.hxx @@ -0,0 +1,59 @@ +/************************************************************************* + * + * 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: folderrestriction.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 SVTOOLS_FOLDER_RESTRICTION_HXX +#define SVTOOLS_FOLDER_RESTRICTION_HXX + +#include "svtools/svldllapi.h" +#include <tools/string.hxx> + +#ifndef INCLUDED_VECTOR +#include <vector> +#define INCLUDED_VECTOR +#endif + +//........................................................................ +namespace svt +{ +//........................................................................ + + /** retrieves a list of folders which's access is not restricted. + + <p>Note that this is not meant as security feature, but only as + method to restrict some UI presentation, such as browsing + in the file open dialog.</p> + */ + SVL_DLLPUBLIC void getUnrestrictedFolders( ::std::vector< String >& _rFolders ); + +//........................................................................ +} // namespace svt +//........................................................................ + +#endif // SVTOOLS_FOLDER_RESTRICTION_HXX diff --git a/svl/inc/fstathelper.hxx b/svl/inc/fstathelper.hxx new file mode 100644 index 000000000000..b9761d7131a0 --- /dev/null +++ b/svl/inc/fstathelper.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * 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: fstathelper.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 _SVTOOLS_FSTATHELPER_HXX +#define _SVTOOLS_FSTATHELPER_HXX + +#include "svtools/svldllapi.h" +#include <tools/solar.h> + +class UniString; +class Date; +class Time; + +namespace FStatHelper { + +/** Return the modified time and date stamp for this URL. + + @param URL the asking URL + + @param pDate if unequal 0, the function set the date stamp + + @param pTime if unequal 0, the function set the time stamp + + @return it was be able to get the date/time stamp +*/ +SVL_DLLPUBLIC sal_Bool GetModifiedDateTimeOfFile( const UniString& rURL, + Date* pDate, Time* pTime ); + +/** Return if under the URL a document exist. This is only a wrapper for the + UCB.IsContent. +*/ +SVL_DLLPUBLIC sal_Bool IsDocument( const UniString& rURL ); + +/** Return if under the URL a folder exist. This is only a wrapper for the + UCB.isFolder. +*/ +SVL_DLLPUBLIC sal_Bool IsFolder( const UniString& rURL ); + +} + +#endif diff --git a/svl/inc/inetdef.hxx b/svl/inc/inetdef.hxx new file mode 100644 index 000000000000..6ea380529147 --- /dev/null +++ b/svl/inc/inetdef.hxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * 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: inetdef.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. + * + ************************************************************************/ + +#include <tools/inetdef.hxx> + diff --git a/svl/inc/inetmsg.hxx b/svl/inc/inetmsg.hxx new file mode 100644 index 000000000000..f011102a79e2 --- /dev/null +++ b/svl/inc/inetmsg.hxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * 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: inetmsg.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. + * + ************************************************************************/ + +#include <tools/inetmsg.hxx> + diff --git a/svl/inc/inetstrm.hxx b/svl/inc/inetstrm.hxx new file mode 100644 index 000000000000..46e15d5e4cf4 --- /dev/null +++ b/svl/inc/inetstrm.hxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * 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: inetstrm.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. + * + ************************************************************************/ + +#include <tools/inetstrm.hxx> + diff --git a/svl/inc/instrm.hxx b/svl/inc/instrm.hxx new file mode 100644 index 000000000000..58a70fcc6917 --- /dev/null +++ b/svl/inc/instrm.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * 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: instrm.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 SVTOOLS_INSTRM_HXX +#define SVTOOLS_INSTRM_HXX + +#include "svtools/svldllapi.h" +#include <com/sun/star/uno/Reference.h> +#include <tools/stream.hxx> + +namespace com { namespace sun { namespace star { namespace io { + class XInputStream; + class XSeekable; +} } } } + +class SvDataPipe_Impl; + +//============================================================================ +class SVL_DLLPUBLIC SvInputStream: public SvStream +{ + com::sun::star::uno::Reference< com::sun::star::io::XInputStream > + m_xStream; + com::sun::star::uno::Reference< com::sun::star::io::XSeekable > + m_xSeekable; + SvDataPipe_Impl * m_pPipe; + ULONG m_nSeekedFrom; + + SVL_DLLPRIVATE bool open(); + + SVL_DLLPRIVATE virtual ULONG GetData(void * pData, ULONG nSize); + + SVL_DLLPRIVATE virtual ULONG PutData(void const *, ULONG); + + SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG nPos); + + SVL_DLLPRIVATE virtual void FlushData(); + + SVL_DLLPRIVATE virtual void SetSize(ULONG); + +public: + SvInputStream( + com::sun::star::uno::Reference< com::sun::star::io::XInputStream > + const & + rTheStream); + + virtual ~SvInputStream(); + + virtual USHORT IsA() const; + + virtual void AddMark(ULONG nPos); + + virtual void RemoveMark(ULONG nPos); +}; + +#endif // SVTOOLS_INSTRM_HXX + diff --git a/svl/inc/listener.hxx b/svl/inc/listener.hxx new file mode 100644 index 000000000000..6d70f135eb92 --- /dev/null +++ b/svl/inc/listener.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * 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: listener.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 _SVT_LISTENER_HXX +#define _SVT_LISTENER_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> + +class SvtBroadcaster; +class SfxHint; +class SvtListenerBase; + +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SvtListener +{ + friend class SvtListenerBase; + SvtListenerBase *pBrdCastLst; + + const SvtListener& operator=(const SvtListener &); // n.i., ist verboten + +public: + TYPEINFO(); + + SvtListener(); + SvtListener( const SvtListener &rCopy ); + virtual ~SvtListener(); + + BOOL StartListening( SvtBroadcaster& rBroadcaster ); + BOOL EndListening( SvtBroadcaster& rBroadcaster ); + void EndListeningAll(); + BOOL IsListening( SvtBroadcaster& rBroadcaster ) const; + + BOOL HasBroadcaster() const { return 0 != pBrdCastLst; } + + virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint ); +}; + + +#endif + diff --git a/svl/inc/listeneriter.hxx b/svl/inc/listeneriter.hxx new file mode 100644 index 000000000000..e531ead6bf5d --- /dev/null +++ b/svl/inc/listeneriter.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * 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: listeneriter.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 _SVT_LISTENERITER_HXX +#define _SVT_LISTENERITER_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> + +class SvtListener; +class SvtListenerBase; +class SvtBroadcaster; + +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SvtListenerIter +{ + friend class SvtListenerBase; + + SvtBroadcaster& rRoot; + SvtListenerBase *pAkt, *pDelNext; + + // for the update of all iterator's, if a listener is added or removed + // at the same time. + static SvtListenerIter *pListenerIters; + SvtListenerIter *pNxtIter; + TypeId aSrchId; // fuer First/Next - suche diesen Type + + SVL_DLLPRIVATE static void RemoveListener( SvtListenerBase& rDel, + SvtListenerBase* pNext ); + +public: + SvtListenerIter( SvtBroadcaster& ); + ~SvtListenerIter(); + + const SvtBroadcaster& GetBroadcaster() const { return rRoot; } + SvtBroadcaster& GetBroadcaster() { return rRoot; } + + SvtListener* GoNext(); // to the next + SvtListener* GoPrev(); // to the previous + + SvtListener* GoStart(); // to the start of the list + SvtListener* GoEnd(); // to the end of the list + + SvtListener* GoRoot(); // to the root + SvtListener* GetCurr() const; // returns the current + + int IsChanged() const { return pDelNext != pAkt; } + + SvtListener* First( TypeId nType ); + SvtListener* Next(); +}; + + +#endif + diff --git a/svl/inc/lngmisc.hxx b/svl/inc/lngmisc.hxx new file mode 100644 index 000000000000..6bfe7b1c737c --- /dev/null +++ b/svl/inc/lngmisc.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: lngmisc.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 _SVTOOLS_LNGMISC_HXX_ +#define _SVTOOLS_LNGMISC_HXX_ + +#include "svtools/svldllapi.h" +#include <tools/solar.h> +#include <sal/types.h> +#include <rtl/ustring.hxx> + +/////////////////////////////////////////////////////////////////////////// + +#define SVT_SOFT_HYPHEN ((sal_Unicode) 0x00AD) +#define SVT_HARD_HYPHEN ((sal_Unicode) 0x2011) + +// the non-breaking space +#define SVT_HARD_SPACE ((sal_Unicode) 0x00A0) + +namespace linguistic +{ + +inline BOOL IsHyphen( sal_Unicode cChar ) +{ + return cChar == SVT_SOFT_HYPHEN || cChar == SVT_HARD_HYPHEN; +} + + +inline BOOL IsControlChar( sal_Unicode cChar ) +{ + return cChar < (sal_Unicode) ' '; +} + + +inline BOOL HasHyphens( const rtl::OUString &rTxt ) +{ + return rTxt.indexOf( SVT_SOFT_HYPHEN ) != -1 || + rTxt.indexOf( SVT_HARD_HYPHEN ) != -1; +} + +SVL_DLLPUBLIC INT32 GetNumControlChars( const rtl::OUString &rTxt ); +SVL_DLLPUBLIC BOOL RemoveHyphens( rtl::OUString &rTxt ); +SVL_DLLPUBLIC BOOL RemoveControlChars( rtl::OUString &rTxt ); + +SVL_DLLPUBLIC BOOL ReplaceControlChars( rtl::OUString &rTxt, sal_Char aRplcChar = ' ' ); + +} // namespace linguistic + +#endif diff --git a/svl/inc/makefile.mk b/svl/inc/makefile.mk new file mode 100644 index 000000000000..a9974d75065c --- /dev/null +++ b/svl/inc/makefile.mk @@ -0,0 +1,52 @@ +#************************************************************************* +# +# 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: makefile.mk,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. +# +#************************************************************************* +PRJ=.. + +PRJNAME=svtools +TARGET=inc + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/util$/svt.pmk + +# --- Files -------------------------------------------------------- +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + +.IF "$(ENABLE_PCH)"!="" +ALLTAR : \ + $(SLO)$/precompiled.pch \ + $(SLO)$/precompiled_ex.pch + +.ENDIF # "$(ENABLE_PCH)"!="" + diff --git a/svl/inc/memberid.hrc b/svl/inc/memberid.hrc new file mode 100644 index 000000000000..c917bd993e97 --- /dev/null +++ b/svl/inc/memberid.hrc @@ -0,0 +1,47 @@ +/************************************************************************* + * + * 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: memberid.hrc,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 _MEMBERID_HRC +#define _MEMBERID_HRC + +#define SFX_MEMBERID(nUserData) ( ( (nUserData) >> 20 ) & 0xFF ) +#define SFX_SLOTID(nUserData) ( (nUserData) & 0xFFFF ) + +#define MID_X 1 +#define MID_Y 2 +#define MID_RECT_LEFT 3 +#define MID_RECT_TOP 4 +#define MID_WIDTH 5 +#define MID_HEIGHT 6 +#define MID_RECT_RIGHT 7 + + +#endif + diff --git a/svl/inc/misccfg.hxx b/svl/inc/misccfg.hxx new file mode 100644 index 000000000000..3f897e1cecc3 --- /dev/null +++ b/svl/inc/misccfg.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * 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: misccfg.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 _SFX_MISCCFG_HXX +#define _SFX_MISCCFG_HXX + +#include "svtools/svtdllapi.h" +#include "tools/solar.h" +#include "unotools/configitem.hxx" + +/*-------------------------------------------------------------------- + Beschreibung: + --------------------------------------------------------------------*/ + +class SVT_DLLPUBLIC SfxMiscCfg : public utl::ConfigItem +{ + BOOL bPaperSize; // printer warnings + BOOL bPaperOrientation; + BOOL bNotFound; + sal_Int32 nYear2000; // two digit year representation + + const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames(); + void Load(); + +public: + SfxMiscCfg( ); + ~SfxMiscCfg( ); + + virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames); + virtual void Commit(); + + BOOL IsNotFoundWarning() const {return bNotFound;} + void SetNotFoundWarning( BOOL bSet); + + BOOL IsPaperSizeWarning() const {return bPaperSize;} + void SetPaperSizeWarning(BOOL bSet); + + BOOL IsPaperOrientationWarning() const {return bPaperOrientation;} + void SetPaperOrientationWarning( BOOL bSet); + + // 0 ... 99 + sal_Int32 GetYear2000() const { return nYear2000; } + void SetYear2000( sal_Int32 nSet ); + +}; + +#endif // _MISCCFG_HXX + + diff --git a/svl/inc/nfsymbol.hxx b/svl/inc/nfsymbol.hxx new file mode 100644 index 000000000000..46fe47599359 --- /dev/null +++ b/svl/inc/nfsymbol.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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: nfsymbol.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 INCLUDED_SVTOOLS_NFSYMBOL_HXX +#define INCLUDED_SVTOOLS_NFSYMBOL_HXX + +/* ATTENTION! If new types arrive that had its content previously handled as + * SYMBOLTYPE_STRING, they have to be added at several places in zforscan.cxx + * and/or zformat.cxx, and in xmloff/source/style/xmlnumfe.cxx. Mostly these + * are places where already NF_SYMBOLTYPE_STRING together with + * NF_SYMBOLTYPE_CURRENCY or NF_SYMBOLTYPE_DATESEP are used in the same case of + * a switch respectively an if-condition. + */ + +namespace svt { + +/// Number formatter's symbol types of a token, if not key words, which are >0 +enum NfSymbolType +{ + NF_SYMBOLTYPE_STRING = -1, // literal string in output + NF_SYMBOLTYPE_DEL = -2, // special character + NF_SYMBOLTYPE_BLANK = -3, // blank for '_' + NF_SYMBOLTYPE_STAR = -4, // *-character + NF_SYMBOLTYPE_DIGIT = -5, // digit place holder + NF_SYMBOLTYPE_DECSEP = -6, // decimal separator + NF_SYMBOLTYPE_THSEP = -7, // group AKA thousand separator + NF_SYMBOLTYPE_EXP = -8, // exponent E + NF_SYMBOLTYPE_FRAC = -9, // fraction / + NF_SYMBOLTYPE_EMPTY = -10, // deleted symbols + NF_SYMBOLTYPE_FRACBLANK = -11, // delimiter between integer and fraction + NF_SYMBOLTYPE_COMMENT = -12, // comment is following + NF_SYMBOLTYPE_CURRENCY = -13, // currency symbol + NF_SYMBOLTYPE_CURRDEL = -14, // currency symbol delimiter [$] + NF_SYMBOLTYPE_CURREXT = -15, // currency symbol extension -xxx + NF_SYMBOLTYPE_CALENDAR = -16, // calendar ID + NF_SYMBOLTYPE_CALDEL = -17, // calendar delimiter [~] + NF_SYMBOLTYPE_DATESEP = -18, // date separator + NF_SYMBOLTYPE_TIMESEP = -19, // time separator + NF_SYMBOLTYPE_TIME100SECSEP = -20, // time 100th seconds separator + NF_SYMBOLTYPE_PERCENT = -21 // percent % +}; + +} // namespace svt + +#endif // INCLUDED_SVTOOLS_NFSYMBOL_HXX diff --git a/svl/inc/numuno.hxx b/svl/inc/numuno.hxx new file mode 100644 index 000000000000..c31829dec020 --- /dev/null +++ b/svl/inc/numuno.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * 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: numuno.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 _NUMUNO_HXX +#define _NUMUNO_HXX + +#include "svtools/svtdllapi.h" +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/implbase2.hxx> + +class SvNumberFormatter; +class SvNumFmtSuppl_Impl; + +namespace comphelper +{ + class SharedMutex; +} + +//------------------------------------------------------------------ + +// SvNumberFormatterServiceObj must be registered as service somewhere + +com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL + SvNumberFormatterServiceObj_NewInstance( + const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory>& rSMgr ); + +//------------------------------------------------------------------ + +// SvNumberFormatsSupplierObj: aggregate to document, +// construct with SvNumberFormatter + +class SVT_DLLPUBLIC SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2< + com::sun::star::util::XNumberFormatsSupplier, + com::sun::star::lang::XUnoTunnel> +{ +private: + SvNumFmtSuppl_Impl* pImpl; + +public: + SvNumberFormatsSupplierObj(); + SvNumberFormatsSupplierObj(SvNumberFormatter* pForm); + virtual ~SvNumberFormatsSupplierObj(); + + void SetNumberFormatter(SvNumberFormatter* pNew); + SvNumberFormatter* GetNumberFormatter() const; + + // ueberladen, um Attribute im Dokument anzupassen + virtual void NumberFormatDeleted(sal_uInt32 nKey); + // ueberladen, um evtl. neu zu formatieren + virtual void SettingsChanged(); + + // XNumberFormatsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL + getNumberFormatSettings() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL + getNumberFormats() + throw(::com::sun::star::uno::RuntimeException); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< + sal_Int8 >& aIdentifier ) + throw(::com::sun::star::uno::RuntimeException); + + static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); + static SvNumberFormatsSupplierObj* getImplementation( const com::sun::star::uno::Reference< + com::sun::star::util::XNumberFormatsSupplier> xObj ); + + ::comphelper::SharedMutex& getSharedMutex() const; +}; + +#endif // #ifndef _NUMUNO_HXX + + diff --git a/svl/inc/outstrm.hxx b/svl/inc/outstrm.hxx new file mode 100644 index 000000000000..e11c7ed1c1a9 --- /dev/null +++ b/svl/inc/outstrm.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * 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: outstrm.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 SVTOOLS_OUTSTRM_HXX +#define SVTOOLS_OUTSTRM_HXX + +#include "svtools/svldllapi.h" +#include <com/sun/star/uno/Reference.h> +#include <tools/stream.hxx> + +namespace com { namespace sun { namespace star { namespace io { + class XOutputStream; +} } } } + +//============================================================================ +class SVL_DLLPUBLIC SvOutputStream: public SvStream +{ + com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > + m_xStream; + + SVL_DLLPRIVATE virtual ULONG GetData(void *, ULONG); + + SVL_DLLPRIVATE virtual ULONG PutData(void const * pData, ULONG nSize); + + SVL_DLLPRIVATE virtual ULONG SeekPos(ULONG); + + SVL_DLLPRIVATE virtual void FlushData(); + + SVL_DLLPRIVATE virtual void SetSize(ULONG); + +public: + SvOutputStream(com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > const & + rTheStream); + + virtual ~SvOutputStream(); + + virtual USHORT IsA() const; +}; + +#endif // SVTOOLS_OUTSTRM_HXX + diff --git a/svl/inc/pch/precompiled_svtools.cxx b/svl/inc/pch/precompiled_svtools.cxx new file mode 100644 index 000000000000..2346d52b68af --- /dev/null +++ b/svl/inc/pch/precompiled_svtools.cxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * 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: precompiled_svtools.cxx,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. + * + ************************************************************************/ + +#include "precompiled_svtools.hxx" + diff --git a/svl/inc/pch/precompiled_svtools.hxx b/svl/inc/pch/precompiled_svtools.hxx new file mode 100644 index 000000000000..cab81cac04ec --- /dev/null +++ b/svl/inc/pch/precompiled_svtools.hxx @@ -0,0 +1,440 @@ +/************************************************************************* + * + * 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: precompiled_svtools.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. + * + ************************************************************************/ + +// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:05.076676 + +#ifdef PRECOMPILED_HEADERS + +//---MARKER--- +#include "sal/config.h" +#include "sal/types.h" + +#include "com/sun/star/accessibility/AccessibleEventId.hpp" +#include "com/sun/star/accessibility/AccessibleRelationType.hpp" +#include "com/sun/star/accessibility/AccessibleRole.hpp" +#include "com/sun/star/accessibility/AccessibleStateType.hpp" +#include "com/sun/star/accessibility/AccessibleTextType.hpp" +#include "com/sun/star/accessibility/XAccessible.hpp" +#include "com/sun/star/accessibility/XAccessibleContext.hpp" +#include "com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp" +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#include <com/sun/star/accessibility/AccessibleEventObject.hpp> +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp> +#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleAction.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/accessibility/XAccessibleEventListener.hpp> +#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> +#include <com/sun/star/accessibility/XAccessibleStateSet.hpp> +#include <com/sun/star/accessibility/XAccessibleTable.hpp> +#include <com/sun/star/accessibility/XAccessibleValue.hpp> + +#include "com/sun/star/awt/FontWeight.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/beans/XPropertySetInfo.hpp" +#include "com/sun/star/io/XAsyncOutputMonitor.hpp" +#include "com/sun/star/lang/EventObject.hpp" +#include "com/sun/star/lang/Locale.hpp" +#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" +#include "com/sun/star/lang/XComponent.hpp" +#include "com/sun/star/lang/XMultiComponentFactory.hpp" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/ucb/Command.hpp" +#include "com/sun/star/ucb/CommandAbortedException.hpp" +#include "com/sun/star/ucb/IllegalIdentifierException.hpp" +#include "com/sun/star/ucb/UnsupportedCommandException.hpp" +#include "com/sun/star/ucb/XCommandEnvironment.hpp" +#include "com/sun/star/ucb/XCommandProcessor.hpp" +#include "com/sun/star/ucb/XContent.hpp" +#include "com/sun/star/ucb/XContentIdentifier.hpp" +#include "com/sun/star/ucb/XContentIdentifierFactory.hpp" +#include "com/sun/star/ucb/XContentProvider.hpp" +#include "com/sun/star/ucb/XContentProviderManager.hpp" +#include "com/sun/star/ui/dialogs/XFilePicker.hpp" +#include "com/sun/star/ui/dialogs/XFolderPicker.hpp" +#include "com/sun/star/uno/Exception.hpp" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XInterface.hpp" +#include "com/sun/star/uri/XUriReference.hpp" +#include "com/sun/star/uri/XUriReferenceFactory.hpp" +#include <com/sun/star/awt/KeyEvent.hpp> +#include <com/sun/star/awt/KeyModifier.hpp> +#include <com/sun/star/awt/LineEndFormat.hpp> +#include <com/sun/star/awt/XFocusListener.hpp> +#include <com/sun/star/awt/XImageConsumer.hpp> +#include <com/sun/star/awt/XItemEventBroadcaster.hpp> +#include <com/sun/star/awt/XTextArea.hpp> +#include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/beans/PropertyChangeEvent.hpp> +#include <com/sun/star/beans/PropertyState.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/beans/XFastPropertySet.hpp> +#include <com/sun/star/beans/XMaterialHolder.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XPropertiesChangeListener.hpp> +#include <com/sun/star/beans/XPropertyAccess.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/container/XHierarchicalNameAccess.hpp> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/container/XIndexContainer.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/datatransfer/XMimeContentType.hpp> +#include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp> +#include <com/sun/star/datatransfer/XTransferable.hpp> +#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> +#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp> +#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp> +#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp> +#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp> +#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp> +#include <com/sun/star/datatransfer/dnd/DropTargetDragEvent.hpp> +#include <com/sun/star/datatransfer/dnd/DropTargetDropEvent.hpp> +#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp> +#include <com/sun/star/datatransfer/dnd/XDragSourceListener.hpp> +#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> +#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp> +#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/document/XTypeDetection.hpp> +#include <com/sun/star/document/XViewDataSupplier.hpp> +#include <com/sun/star/embed/Actions.hpp> +#include <com/sun/star/embed/Aspects.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/EmbedMisc.hpp> +#include <com/sun/star/embed/EmbedStates.hpp> +#include <com/sun/star/embed/NoVisualAreaSizeException.hpp> +#include <com/sun/star/embed/XActionsApproval.hpp> +#include <com/sun/star/embed/XComponentSupplier.hpp> +#include <com/sun/star/embed/XEmbedPersist.hpp> +#include <com/sun/star/embed/XExtendedStorageStream.hpp> +#include <com/sun/star/embed/XHierarchicalStorageAccess.hpp> +#include <com/sun/star/embed/XStateChangeListener.hpp> +#include <com/sun/star/embed/XStorage.hpp> +#include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/frame/DoubleInitializationException.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/frame/XConfigManager.hpp> +#include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XDocumentTemplates.hpp> +#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/frame/XStatusListener.hpp> +#include <com/sun/star/frame/XTerminateListener.hpp> +#include <com/sun/star/frame/status/ItemState.hpp> +#include <com/sun/star/frame/status/ItemStatus.hpp> +#include <com/sun/star/frame/status/Visibility.hpp> +#include <com/sun/star/graphic/XGraphicProvider.hpp> +#include <com/sun/star/i18n/AmPmValue.hpp> +#include <com/sun/star/i18n/CalendarDisplayCode.hpp> +#include <com/sun/star/i18n/CalendarDisplayIndex.hpp> +#include <com/sun/star/i18n/CalendarFieldIndex.hpp> +#include <com/sun/star/i18n/CharacterIteratorMode.hpp> +#include <com/sun/star/i18n/CollatorOptions.hpp> +#include <com/sun/star/i18n/InputSequenceCheckMode.hpp> +#include <com/sun/star/i18n/KNumberFormatType.hpp> +#include <com/sun/star/i18n/KNumberFormatUsage.hpp> +#include <com/sun/star/i18n/NumberFormatCode.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> +#include <com/sun/star/i18n/TransliterationModules.hpp> +#include <com/sun/star/i18n/Weekdays.hpp> +#include <com/sun/star/i18n/WordType.hpp> +#include <com/sun/star/i18n/XBreakIterator.hpp> +#include <com/sun/star/i18n/XCollator.hpp> +#include <com/sun/star/i18n/XExtendedCalendar.hpp> +#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp> +#include <com/sun/star/io/IOException.hpp> +#include <com/sun/star/io/NotConnectedException.hpp> +#include <com/sun/star/io/XActiveDataControl.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XPersist.hpp> +#include <com/sun/star/io/XPersistObject.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XTruncate.hpp> +#include <com/sun/star/java/InvalidJavaSettingsException.hpp> +#include <com/sun/star/java/JavaDisabledException.hpp> +#include <com/sun/star/java/JavaNotFoundException.hpp> +#include <com/sun/star/java/JavaVMCreationFailureException.hpp> +#include <com/sun/star/java/RestartRequiredException.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XEventListener.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/packages/NoEncryptionException.hpp> +#include <com/sun/star/registry/XRegistryKey.hpp> +#include <com/sun/star/registry/XSimpleRegistry.hpp> +#include <com/sun/star/script/XTypeConverter.hpp> +#include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/SQLContext.hpp> +#include <com/sun/star/sdb/XCompletedConnection.hpp> +#include <com/sun/star/sdbc/SQLWarning.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdbc/XDataSource.hpp> +#include <com/sun/star/sdbc/XResultSet.hpp> +#include <com/sun/star/sdbc/XRow.hpp> +#include <com/sun/star/sdbcx/XColumnsSupplier.hpp> +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> +#include <com/sun/star/svg/XSVGWriter.hpp> +#include <com/sun/star/system/SystemShellExecuteFlags.hpp> +#include <com/sun/star/system/XProxySettings.hpp> +#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/task/DocumentPasswordRequest.hpp> +#include <com/sun/star/task/DocumentMSPasswordRequest.hpp> +#include <com/sun/star/task/MasterPasswordRequest.hpp> +#include <com/sun/star/task/NoMasterException.hpp> +#include <com/sun/star/task/PasswordRequestMode.hpp> +#include <com/sun/star/task/XInteractionAbort.hpp> +#include <com/sun/star/task/XInteractionContinuation.hpp> +#include <com/sun/star/task/XInteractionHandler.hpp> +#include <com/sun/star/task/XInteractionPassword.hpp> +#include <com/sun/star/task/XInteractionRequest.hpp> +#include <com/sun/star/task/XInteractionRetry.hpp> +#include <com/sun/star/task/XJob.hpp> +#include <com/sun/star/task/XJobExecutor.hpp> +#include <com/sun/star/task/XPasswordContainer.hpp> +#include <com/sun/star/ucb/CommandAbortedException.hpp> +#include <com/sun/star/ucb/ContentCreationException.hpp> +#include <com/sun/star/ucb/FileSystemNotation.hpp> +#include <com/sun/star/ucb/IOErrorCode.hpp> +#include <com/sun/star/ucb/InteractiveIOException.hpp> +#include <com/sun/star/ucb/NumberedSortingInfo.hpp> +#include <com/sun/star/ucb/TransferResult.hpp> +#include <com/sun/star/ucb/XAnyCompareFactory.hpp> +#include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <com/sun/star/ucb/XContent.hpp> +#include <com/sun/star/ucb/XContentAccess.hpp> +#include <com/sun/star/ucb/XContentProviderManager.hpp> +#include <com/sun/star/ucb/XDynamicResultSet.hpp> +#include <com/sun/star/ucb/XProgressHandler.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp> +#include <com/sun/star/ui/ImageType.hpp> +#include <com/sun/star/ui/XAcceleratorConfiguration.hpp> +#include <com/sun/star/ui/XImageManager.hpp> +#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/XUIConfigurationManager.hpp> +#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker.hpp> +#include <com/sun/star/ui/dialogs/XFilterManager.hpp> +#include <com/sun/star/uno/Any.h> +#include <com/sun/star/uno/Exception.hpp> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/uno/RuntimeException.hpp> +#include <com/sun/star/uno/Sequence.h> +#include <com/sun/star/uno/XAggregation.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/uno/XCurrentContext.hpp> +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/uno/XWeak.hpp> +#include <com/sun/star/util/AliasProgrammaticPair.hpp> +#include <com/sun/star/util/Date.hpp> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/util/DateTimeRange.hpp> +#include <com/sun/star/util/SearchAlgorithms.hpp> +#include <com/sun/star/util/SearchFlags.hpp> +#include <com/sun/star/util/SearchOptions.hpp> +#include <com/sun/star/util/SearchResult.hpp> +#include <com/sun/star/util/URL.hpp> +#include <com/sun/star/util/XChangesBatch.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/util/XCloseBroadcaster.hpp> +#include <com/sun/star/util/XCloseable.hpp> +#include <com/sun/star/util/XModifiable.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <com/sun/star/util/XNumberFormatTypes.hpp> +#include <com/sun/star/util/XNumberFormats.hpp> +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/util/XOfficeInstallationDirectories.hpp> +#include <com/sun/star/util/XStringSubstitution.hpp> +#include <com/sun/star/util/XURLTransformer.hpp> +#include <com/sun/star/util/XUpdatable.hpp> +#include <com/sun/star/view/XPrintable.hpp> +#include <com/sun/star/xml/sax/XAttributeList.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/xml/sax/XParser.hpp> + +#include <algorithm> +#include <deque> +#include <hash_map> +#include <limits> + +#include <list> +#include <map> +#include <memory> +#include <queue> +#include <set> +#include <stack> +#include <utility> +#include <vector> + + +#include <i18npool/lang.h> +#include <i18npool/mslangid.hxx> + +#include "comphelper/processfactory.hxx" +#include <comphelper/accessibleeventnotifier.hxx> +#include <comphelper/broadcasthelper.hxx> +#include <comphelper/configurationhelper.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/regpathhelper.hxx> +#include <comphelper/sequence.hxx> +#include <comphelper/sequenceashashmap.hxx> +#include <comphelper/servicehelper.hxx> +#include <comphelper/stl_types.hxx> +#include <comphelper/storagehelper.hxx> +#include <comphelper/types.hxx> +#include <comphelper/uno3.hxx> + +#include "cppuhelper/bootstrap.hxx" +#include "cppuhelper/exc_hlp.hxx" +#include "cppuhelper/factory.hxx" +#include "cppuhelper/interfacecontainer.hxx" +#include "cppuhelper/weakref.hxx" +#include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/exc_hlp.hxx> +#include <cppuhelper/factory.hxx> +#include <cppuhelper/interfacecontainer.h> +#include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/propshlp.hxx> +#include <cppuhelper/queryinterface.hxx> +#include <cppuhelper/servicefactory.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/weakagg.hxx> +#include <cppuhelper/weakref.hxx> + +#include <osl/conditn.hxx> +#include <osl/conditn.hxx> +#include <osl/diagnose.h> +#include <osl/endian.h> +#include <osl/file.h> +#include <osl/file.hxx> +#include <osl/module.h> +#include <osl/module.hxx> +#include <osl/mutex.h> +#include <osl/mutex.hxx> +#include <osl/process.h> +#include <osl/thread.h> +#include <osl/thread.hxx> + +#include <rsc/rscsfx.hxx> + +#include "rtl/crc.h" +#include "rtl/memory.h" +#include "rtl/strbuf.hxx" +#include "rtl/string.h" +#include "rtl/string.hxx" +#include "rtl/textenc.h" +#include "rtl/ustrbuf.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include <rtl/alloc.h> +#include <rtl/byteseq.hxx> +#include <rtl/cipher.h> +#include <rtl/crc.h> +#include <rtl/digest.h> +#include <rtl/logfile.hxx> +#include <rtl/math.hxx> +#include <rtl/memory.h> +#include <rtl/strbuf.hxx> +#include <rtl/string.hxx> +#include <rtl/tencinfo.h> +#include <rtl/textcvt.h> +#include <rtl/textenc.h> +#include <rtl/ustrbuf.hxx> +#include <rtl/ustring.h> +#include <rtl/ustring.hxx> +#include <rtl/uuid.h> + +#include "unotools/configitem.hxx" +#include "unotools/configmgr.hxx" + +#include <sot/clsids.hxx> + +#include <tools/inetdef.hxx> + +#include <ucbhelper/commandenvironment.hxx> +#include <ucbhelper/content.hxx> +#include <ucbhelper/contentbroker.hxx> +#include <ucbhelper/fileidentifierconverter.hxx> + +#include <uno/mapping.hxx> + +#include <unotools/bootstrap.hxx> +#include <unotools/collatorwrapper.hxx> +#include <unotools/configitem.hxx> +#include <unotools/configmgr.hxx> +#include <unotools/confignode.hxx> +#include <unotools/configpathes.hxx> +#include <unotools/nativenumberwrapper.hxx> +#include <unotools/numberformatcodewrapper.hxx> +#include <unotools/processfactory.hxx> + +#include <vcl/dndhelp.hxx> +#include <vcl/fldunit.hxx> +#include <vcl/mapunit.hxx> +#include <vcl/unohelp.hxx> + +#include <vos/mutex.hxx> +#include <vos/process.hxx> +#include <vos/ref.hxx> +#include <vos/refernce.hxx> +#include <vos/security.hxx> +#include <vos/thread.hxx> +#include <vos/timer.hxx> + +//---MARKER--- + +#endif + diff --git a/svl/inc/pickerhelper.hxx b/svl/inc/pickerhelper.hxx new file mode 100644 index 000000000000..4be84296c678 --- /dev/null +++ b/svl/inc/pickerhelper.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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: pickerhelper.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 _PICKERHELPER_HXX +#define _PICKERHELPER_HXX + +#include "svtools/svldllapi.h" +#include "sal/types.h" +#include "com/sun/star/uno/Reference.hxx" + +namespace com +{ + namespace sun + { + namespace star + { + namespace ui + { + namespace dialogs + { + class XFilePicker; + class XFolderPicker; + } + } + } + } +} + + +namespace svt +{ + + SVL_DLLPUBLIC void SetDialogHelpId( + ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > _mxFileDlg, + sal_Int32 _nHelpId ); + + SVL_DLLPUBLIC void SetDialogHelpId( + ::com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFolderPicker > _mxFileDlg, + sal_Int32 _nHelpId ); + +} + +//----------------------------------------------------------------------------- + +#endif diff --git a/svl/inc/pickerhistory.hxx b/svl/inc/pickerhistory.hxx new file mode 100644 index 000000000000..f99ad5dcc0f1 --- /dev/null +++ b/svl/inc/pickerhistory.hxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * 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: pickerhistory.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 SVTOOLS_PICKERHISTORY_HXX +#define SVTOOLS_PICKERHISTORY_HXX + +#include "svtools/svldllapi.h" +#include <com/sun/star/uno/XInterface.hpp> + +//......................................................................... +namespace svt +{ +//......................................................................... + + // -------------------------------------------------------------------- + SVL_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + GetTopMostFolderPicker( ); + + SVL_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + GetTopMostFilePicker( ); + +//......................................................................... +} // namespace svt +//......................................................................... + +#endif // SVTOOLS_PICKERHISTORY_HXX + diff --git a/svl/inc/pickerhistoryaccess.hxx b/svl/inc/pickerhistoryaccess.hxx new file mode 100644 index 000000000000..983b0c416ef3 --- /dev/null +++ b/svl/inc/pickerhistoryaccess.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * 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: pickerhistoryaccess.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 SVTOOLS_PICKERHISTORYACCESS_HXX +#define SVTOOLS_PICKERHISTORYACCESS_HXX + +#include "svtools/svldllapi.h" + +#ifndef _COM_SUN_STAR_UNO_REFERENX_HXX_ +#include <com/sun/star/uno/Reference.hxx> +#endif + +//......................................................................... +namespace svt +{ +//......................................................................... + + // -------------------------------------------------------------------- + SVL_DLLPUBLIC void addFolderPicker( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxPicker ); + + SVL_DLLPUBLIC void addFilePicker( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxPicker ); + +//......................................................................... +} // namespace svt +//......................................................................... + +#endif // SVTOOLS_PICKERHISTORYACCESS_HXX + diff --git a/svl/inc/poolcach.hxx b/svl/inc/poolcach.hxx new file mode 100644 index 000000000000..20d9e4d19c43 --- /dev/null +++ b/svl/inc/poolcach.hxx @@ -0,0 +1,61 @@ +/************************************************************************* + * + * 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: poolcach.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 _SFXPOOLCACH_HXX +#define _SFXPOOLCACH_HXX + +#include "svtools/svtdllapi.h" +#include <tools/solar.h> + +class SfxItemModifyArr_Impl; +class SfxItemPool; +class SfxItemSet; +class SfxPoolItem; +class SfxSetItem; + +class SVT_DLLPUBLIC SfxItemPoolCache +{ + SfxItemPool *pPool; + SfxItemModifyArr_Impl *pCache; + const SfxItemSet *pSetToPut; + const SfxPoolItem *pItemToPut; + +public: + SfxItemPoolCache( SfxItemPool *pPool, + const SfxPoolItem *pPutItem ); + SfxItemPoolCache( SfxItemPool *pPool, + const SfxItemSet *pPutSet ); + ~SfxItemPoolCache(); + + const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, BOOL bNew = FALSE ); +}; + + +#endif + diff --git a/svl/inc/strmadpt.hxx b/svl/inc/strmadpt.hxx new file mode 100644 index 000000000000..7a080c1c7bcc --- /dev/null +++ b/svl/inc/strmadpt.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * 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: strmadpt.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 SVTOOLS_STRMADPT_HXX +#define SVTOOLS_STRMADPT_HXX + +#include "svtools/svldllapi.h" +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <cppuhelper/weak.hxx> +#include <tools/stream.hxx> + +//============================================================================ +class SVL_DLLPUBLIC SvOutputStreamOpenLockBytes: public SvOpenLockBytes +{ + com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > + m_xOutputStream; + sal_uInt32 m_nPosition; + +public: + TYPEINFO(); + + SvOutputStreamOpenLockBytes( + const com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > & + rTheOutputStream): + m_xOutputStream(rTheOutputStream), m_nPosition(0) {} + + virtual ErrCode ReadAt(ULONG, void *, ULONG, ULONG *) const; + + virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount, + ULONG * pWritten); + + virtual ErrCode Flush() const; + + virtual ErrCode SetSize(ULONG); + + virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const; + + virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount, + ULONG * pWritten); + + virtual ULONG Tell() const; + + virtual ULONG Seek(ULONG); + + virtual void Terminate(); +}; + +//============================================================================ +class SVL_DLLPUBLIC SvLockBytesInputStream: public cppu::OWeakObject, + public com::sun::star::io::XInputStream, + public com::sun::star::io::XSeekable +{ + SvLockBytesRef m_xLockBytes; + sal_Int64 m_nPosition; + bool m_bDone; + +public: + SvLockBytesInputStream(SvLockBytes * pTheLockBytes): + m_xLockBytes(pTheLockBytes), m_nPosition(0), m_bDone(false) {} + + virtual com::sun::star::uno::Any SAL_CALL + queryInterface(const com::sun::star::uno::Type & rType) + throw (com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw(); + + virtual void SAL_CALL release() throw(); + + virtual sal_Int32 SAL_CALL + readBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData, + sal_Int32 nBytesToRead) + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL + readSomeBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData, + sal_Int32 nMaxBytesToRead) + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL available() + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL closeInput() + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL seek(sal_Int64 nLocation) + throw (com::sun::star::lang::IllegalArgumentException, + com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual sal_Int64 SAL_CALL getPosition() + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual sal_Int64 SAL_CALL getLength() + throw (com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); +}; + +#endif // SVTOOLS_STRMADPT_HXX + diff --git a/svl/inc/stylepool.hxx b/svl/inc/stylepool.hxx new file mode 100644 index 000000000000..1b1f129d7f4c --- /dev/null +++ b/svl/inc/stylepool.hxx @@ -0,0 +1,103 @@ +/************************************************************************* + * + * 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: stylepool.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 INCLUDED_SVTOOLS_STYLEPOOL_HXX +#define INCLUDED_SVTOOLS_STYLEPOOL_HXX + +#include <boost/shared_ptr.hpp> +#include <rtl/ustring.hxx> +#include <svtools/itemset.hxx> + +class StylePoolImpl; +class StylePoolIterImpl; +class IStylePoolIteratorAccess; + +class SVL_DLLPUBLIC StylePool +{ +private: + StylePoolImpl *pImpl; +public: + typedef boost::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t; + + // --> OD 2008-03-07 #i86923# + explicit StylePool( SfxItemSet* pIgnorableItems = 0 ); + // <-- + + /** Insert a SfxItemSet into the style pool. + + The pool makes a copy of the provided SfxItemSet. + + @param SfxItemSet + the SfxItemSet to insert + + @return a shared pointer to the SfxItemSet + */ + virtual SfxItemSet_Pointer_t insertItemSet( const SfxItemSet& rSet ); + + /** Create an iterator + + The iterator walks through the StylePool + OD 2008-03-07 #i86923# + introduce optional parameter to control, if unused SfxItemsSet are skipped or not + introduce optional parameter to control, if ignorable items are skipped or not + + @attention every change, e.g. destruction, of the StylePool could cause undefined effects. + + @param bSkipUnusedItemSets + input parameter - boolean, indicating if unused SfxItemSets are skipped or not + + @param bSkipIgnorableItems + input parameter - boolean, indicating if ignorable items are skipped or not + + @postcond the iterator "points before the first" SfxItemSet of the pool. + The first StylePoolIterator::getNext() call will deliver the first SfxItemSet. + */ + virtual IStylePoolIteratorAccess* createIterator( const bool bSkipUnusedItemSets = false, + const bool bSkipIgnorableItems = false ); + + /** Returns the number of styles + */ + virtual sal_Int32 getCount() const; + + virtual ~StylePool(); + + static ::rtl::OUString nameOf( SfxItemSet_Pointer_t pSet ); +}; + +class SVL_DLLPUBLIC IStylePoolIteratorAccess +{ +public: + /** Delivers a shared pointer to the next SfxItemSet of the pool + If there is no more SfxItemSet, the delivered share_pointer is empty. + */ + virtual StylePool::SfxItemSet_Pointer_t getNext() = 0; + virtual ::rtl::OUString getName() = 0; + virtual ~IStylePoolIteratorAccess() {}; +}; +#endif diff --git a/svl/inc/svl/aeitem.hxx b/svl/inc/svl/aeitem.hxx new file mode 100644 index 000000000000..5cfd3d0fc15e --- /dev/null +++ b/svl/inc/svl/aeitem.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * 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: aeitem.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 _AEITEM_HXX +#define _AEITEM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/poolitem.hxx> +#include <svtools/eitem.hxx> + +class SfxAllEnumValueArr; +class SvUShorts; + +class SVT_DLLPUBLIC SfxAllEnumItem: public SfxEnumItem +{ + SfxAllEnumValueArr* pValues; + SvUShorts* pDisabledValues; + +protected: + USHORT _GetPosByValue( USHORT nValue ) const; + +public: + TYPEINFO(); + SfxAllEnumItem(); + SfxAllEnumItem( USHORT nWhich); + SfxAllEnumItem( USHORT nWhich, USHORT nVal ); + SfxAllEnumItem( USHORT nWhich, USHORT nVal, const XubString &rText ); + SfxAllEnumItem( USHORT nWhich, SvStream &rStream ); + SfxAllEnumItem( const SfxAllEnumItem & ); + ~SfxAllEnumItem(); + + void InsertValue( USHORT nValue ); + void InsertValue( USHORT nValue, const XubString &rText ); + void RemoveValue( USHORT nValue ); + void RemoveAllValues(); + + USHORT GetPosByValue( USHORT nValue ) const; + + virtual USHORT GetValueCount() const; + virtual USHORT GetValueByPos( USHORT nPos ) const; + virtual XubString GetValueTextByPos( USHORT nPos ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; + virtual BOOL IsEnabled( USHORT ) const; + void DisableValue( USHORT ); +}; + +#endif diff --git a/svl/inc/svl/bintitem.hxx b/svl/inc/svl/bintitem.hxx new file mode 100644 index 000000000000..83119d9f3b18 --- /dev/null +++ b/svl/inc/svl/bintitem.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * 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: bintitem.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 _BINTITEM_HXX +#define _BINTITEM_HXX + +#include <tools/solar.h> +#include <tools/rtti.hxx> +#include <tools/bigint.hxx> +#include <tools/debug.hxx> + +#include <svtools/poolitem.hxx> + +class SfxArguments; +class SvStream; + +DBG_NAMEEX(SfxBigIntItem) + +class SfxBigIntItem: public SfxPoolItem +{ + BigInt aVal; + +public: + TYPEINFO(); + SfxBigIntItem(); + SfxBigIntItem(USHORT nWhich, const BigInt& rValue); + SfxBigIntItem(USHORT nWhich, SvStream &); + SfxBigIntItem(const SfxBigIntItem&); + ~SfxBigIntItem() { DBG_DTOR(SfxBigIntItem, 0); } + + virtual SfxItemPresentation GetPresentation( + SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + + virtual int operator==(const SfxPoolItem&) const; + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem &rWith) const; + virtual SfxPoolItem* Clone(SfxItemPool *pPool = 0) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + + virtual SfxFieldUnit GetUnit() const; // FUNIT_NONE + + const BigInt& GetValue() const { return aVal; } + void SetValue(const BigInt& rNewVal) + { + DBG_ASSERT(GetRefCount() == 0, "SetValue() with pooled item"); + aVal = rNewVal; + } +}; + +#endif /* _BINTITEM_HXX */ + diff --git a/svl/inc/svl/brdcst.hxx b/svl/inc/svl/brdcst.hxx new file mode 100644 index 000000000000..2f9270f3cd4b --- /dev/null +++ b/svl/inc/svl/brdcst.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * 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: brdcst.hxx,v $ + * $Revision: 1.3.60.2 $ + * + * 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 _SFXBRDCST_HXX +#define _SFXBRDCST_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> +#include <svtools/svarray.hxx> + +class SfxListener; +class SfxHint; + +#ifndef _SFX_BRDCST_CXX +typedef SvPtrarr SfxListenerArr_Impl; +#endif + +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxBroadcaster +{ +friend class SfxListener; + + SfxListenerArr_Impl aListeners; + +private: + BOOL AddListener( SfxListener& rListener ); + void RemoveListener( SfxListener& rListener ); + const SfxBroadcaster& operator=(const SfxBroadcaster &); // verboten + +protected: + void Forward(SfxBroadcaster& rBC, const SfxHint& rHint); + virtual void ListenersGone(); + +public: + TYPEINFO(); + + SfxBroadcaster(); + SfxBroadcaster( const SfxBroadcaster &rBC ); + virtual ~SfxBroadcaster(); + + void Broadcast( const SfxHint &rHint ); + void BroadcastDelayed( const SfxHint& rHint ); + void BroadcastInIdle( const SfxHint& rHint ); + + BOOL HasListeners() const; + USHORT GetListenerCount() const { return aListeners.Count(); } + SfxListener* GetListener( USHORT nNo ) const + { return (SfxListener*) aListeners[nNo]; } +}; + +#endif diff --git a/svl/inc/svl/cancel.hxx b/svl/inc/svl/cancel.hxx new file mode 100644 index 000000000000..5929fc4db47a --- /dev/null +++ b/svl/inc/svl/cancel.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * 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: cancel.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 _SFXCANCEL_HXX +#define _SFXCANCEL_HXX + +#include "svtools/svldllapi.h" +#include <tools/string.hxx> +#include <tools/ref.hxx> +#include <svtools/brdcst.hxx> +#include <svtools/smplhint.hxx> + +class SfxCancellable; + +#ifdef _SFX_CANCEL_CXX +#include <svtools/svarray.hxx> + +SV_DECL_PTRARR( SfxCancellables_Impl, SfxCancellable*, 0, 4 ) + +#else + +typedef SvPtrarr SfxCancellables_Impl; + +#endif + +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxCancelManager: public SfxBroadcaster +, public SvWeakBase + +/* [Beschreibung] + + An Instanzen dieser Klasse k"onnen nebenl"aufige Prozesse angemeldet + werden, um vom Benutzer abbrechbar zu sein. Werden abbrechbare + Prozesse (Instanzen von <SfxCancellable>) an- oder abgemeldet, wird + dies durch einen <SfxSimpleHint> mit dem Flag SFX_HINT_CANCELLABLE + gebroadcastet. + + SfxCancelManager k"onnen hierarchisch angeordnet werden, so k"onnen + z.B. Dokument-lokale Prozesse getrennt gecancelt werden. + + [Beispiel] + + SfxCancelManager *pMgr = new SfxCancelManager; + StartListening( pMgr ); + pMailSystem->SetCancelManager( pMgr ) +*/ + +{ + SfxCancelManager* _pParent; + SfxCancellables_Impl _aJobs; + +public: + SfxCancelManager( SfxCancelManager *pParent = 0 ); + ~SfxCancelManager(); + + BOOL CanCancel() const; + void Cancel( BOOL bDeep ); + SfxCancelManager* GetParent() const { return _pParent; } + + void InsertCancellable( SfxCancellable *pJob ); + void RemoveCancellable( SfxCancellable *pJob ); + USHORT GetCancellableCount() const + { return _aJobs.Count(); } + SfxCancellable* GetCancellable( USHORT nPos ) const + { return (SfxCancellable*) _aJobs[nPos]; } +}; + +SV_DECL_WEAK( SfxCancelManager ) +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxCancellable + +/* [Beschreibung] + + Instanzen dieser Klasse werden immer an einem Cancel-Manager angemeldet, + der dadurch dem Benutzer signalisieren kann, ob abbrechbare Prozesse + vorhanden sind und der die SfxCancellable-Instanzen auf 'abgebrochen' + setzen kann. + + Die im Ctor "ubergebene <SfxCancelManger>-Instanz mu\s die Instanz + dieser Klasse "uberleben! + + [Beispiel] + + { + SfxCancellable aCancel( pCancelMgr ); + while ( !aCancel && GetData() ) + Reschedule(); + } + +*/ + +{ + SfxCancelManager* _pMgr; + BOOL _bCancelled; + String _aTitle; + +public: + SfxCancellable( SfxCancelManager *pMgr, + const String &rTitle ) + : _pMgr( pMgr ), + _bCancelled( FALSE ), + _aTitle( rTitle ) + { pMgr->InsertCancellable( this ); } + + virtual ~SfxCancellable(); + + void SetManager( SfxCancelManager *pMgr ); + SfxCancelManager* GetManager() const { return _pMgr; } + + virtual void Cancel(); + BOOL IsCancelled() const { return _bCancelled; } + operator BOOL() const { return _bCancelled; } + const String& GetTitle() const { return _aTitle; } +}; + +#endif + diff --git a/svl/inc/svl/cenumitm.hxx b/svl/inc/svl/cenumitm.hxx new file mode 100644 index 000000000000..d65825849869 --- /dev/null +++ b/svl/inc/svl/cenumitm.hxx @@ -0,0 +1,180 @@ +/************************************************************************* + * + * 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: cenumitm.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 _SVTOOLS_CENUMITM_HXX +#define _SVTOOLS_CENUMITM_HXX + +#include "svtools/svldllapi.h" +#include <tools/debug.hxx> +#include <svtools/poolitem.hxx> + +//============================================================================ +DBG_NAMEEX(SfxEnumItemInterface) + +class SVL_DLLPUBLIC SfxEnumItemInterface: public SfxPoolItem +{ +protected: + SfxEnumItemInterface(USHORT which): SfxPoolItem(which) {} + + SfxEnumItemInterface(const SfxEnumItemInterface & rItem): + SfxPoolItem(rItem) {} + +public: + TYPEINFO(); + + virtual int operator ==(const SfxPoolItem & rItem) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any & rVal, BYTE = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any & rVal, BYTE = 0); + + virtual USHORT GetValueCount() const = 0; + + virtual XubString GetValueTextByPos(USHORT nPos) const; + + virtual USHORT GetValueByPos(USHORT nPos) const; + + /// Return the position of some value within this enumeration. + /// + /// @descr This method is implemented using GetValueCount() and + /// GetValueByPos(). Derived classes may replace this with a more + /// efficient implementation. + /// + /// @param nValue Some value. + /// + /// @return The position of nValue within this enumeration, or USHRT_MAX + /// if not included. + virtual USHORT GetPosByValue(USHORT nValue) const; + + virtual BOOL IsEnabled(USHORT nValue) const; + + virtual USHORT GetEnumValue() const = 0; + + virtual void SetEnumValue(USHORT nValue) = 0; + + virtual int HasBoolValue() const; + + virtual BOOL GetBoolValue() const; + + virtual void SetBoolValue(BOOL bValue); +}; + +//============================================================================ +DBG_NAMEEX(CntEnumItem) + +class SVL_DLLPUBLIC CntEnumItem: public SfxEnumItemInterface +{ + USHORT m_nValue; + +protected: + CntEnumItem(USHORT which = 0, USHORT nTheValue = 0): + SfxEnumItemInterface(which), m_nValue(nTheValue) {} + + CntEnumItem(USHORT which, SvStream & rStream); + + CntEnumItem(const CntEnumItem & rItem): + SfxEnumItemInterface(rItem), m_nValue(rItem.m_nValue) {} + +public: + TYPEINFO(); + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual USHORT GetEnumValue() const; + + virtual void SetEnumValue(USHORT nTheValue); + + USHORT GetValue() const { return m_nValue; } + + inline void SetValue(USHORT nTheValue); +}; + +inline void CntEnumItem::SetValue(USHORT nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "CntEnumItem::SetValue(): Pooled item"); + m_nValue = nTheValue; +} + +//============================================================================ +DBG_NAMEEX(CntBoolItem) + +class SVL_DLLPUBLIC CntBoolItem: public SfxPoolItem +{ + BOOL m_bValue; + +public: + TYPEINFO(); + + CntBoolItem(USHORT which = 0, BOOL bTheValue = FALSE): + SfxPoolItem(which), m_bValue(bTheValue) {} + + CntBoolItem(USHORT nWhich, SvStream & rStream); + + CntBoolItem(const CntBoolItem & rItem): + SfxPoolItem(rItem), m_bValue(rItem.m_bValue) {} + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + UniString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, BYTE = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, BYTE = 0); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual USHORT GetValueCount() const; + + virtual UniString GetValueTextByVal(BOOL bTheValue) const; + + BOOL GetValue() const { return m_bValue; } + + void SetValue(BOOL bTheValue) { m_bValue = bTheValue; } +}; + +#endif // _SVTOOLS_CENUMITM_HXX + diff --git a/svl/inc/svl/cintitem.hxx b/svl/inc/svl/cintitem.hxx new file mode 100644 index 000000000000..a944e2139818 --- /dev/null +++ b/svl/inc/svl/cintitem.hxx @@ -0,0 +1,286 @@ +/************************************************************************* + * + * 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: cintitem.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 _SVTOOLS_CINTITEM_HXX +#define _SVTOOLS_CINTITEM_HXX + +#include "svtools/svldllapi.h" +#include <tools/debug.hxx> +#include <svtools/poolitem.hxx> + +//============================================================================ +DBG_NAMEEX_VISIBILITY(CntByteItem, SVL_DLLPUBLIC) + +class SVL_DLLPUBLIC CntByteItem: public SfxPoolItem +{ + BYTE m_nValue; + +public: + TYPEINFO(); + + CntByteItem(USHORT which = 0, BYTE nTheValue = 0): + SfxPoolItem(which), m_nValue(nTheValue) { DBG_CTOR(CntByteItem, 0); } + + CntByteItem(USHORT which, SvStream & rStream); + + CntByteItem(const CntByteItem & rItem): + SfxPoolItem(rItem), m_nValue(rItem.m_nValue) + { DBG_CTOR(CntByteItem, 0); } + + virtual ~CntByteItem() { DBG_DTOR(CntByteItem, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual BYTE GetMin() const; + + virtual BYTE GetMax() const; + + virtual SfxFieldUnit GetUnit() const; + + BYTE GetValue() const { return m_nValue; } + + inline void SetValue(BYTE nTheValue); +}; + +inline void CntByteItem::SetValue(BYTE nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "CntByteItem::SetValue(): Pooled item"); + m_nValue = nTheValue; +} + +//============================================================================ +DBG_NAMEEX_VISIBILITY(CntUInt16Item, SVL_DLLPUBLIC) + +class SVL_DLLPUBLIC CntUInt16Item: public SfxPoolItem +{ + UINT16 m_nValue; + +public: + TYPEINFO(); + + CntUInt16Item(USHORT which = 0, UINT16 nTheValue = 0): + SfxPoolItem(which), m_nValue(nTheValue) + { DBG_CTOR(CntUInt16Item, 0); } + + CntUInt16Item(USHORT which, SvStream & rStream); + + CntUInt16Item(const CntUInt16Item & rItem): + SfxPoolItem(rItem), m_nValue(rItem.m_nValue) + { DBG_CTOR(CntUInt16Item, 0); } + + virtual ~CntUInt16Item() { DBG_DTOR(CntUInt16Item, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual UINT16 GetMin() const; + + virtual UINT16 GetMax() const; + + virtual SfxFieldUnit GetUnit() const; + + INT16 GetValue() const { return m_nValue; } + + inline void SetValue(UINT16 nTheValue); +}; + +inline void CntUInt16Item::SetValue(UINT16 nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "CntUInt16Item::SetValue(): Pooled item"); + m_nValue = nTheValue; +} + +//============================================================================ +DBG_NAMEEX_VISIBILITY(CntInt32Item, SVL_DLLPUBLIC) + +class SVL_DLLPUBLIC CntInt32Item: public SfxPoolItem +{ + INT32 m_nValue; + +public: + TYPEINFO(); + + CntInt32Item(USHORT which = 0, INT32 nTheValue = 0): + SfxPoolItem(which), m_nValue(nTheValue) + { DBG_CTOR(CntInt32Item, 0); } + + CntInt32Item(USHORT which, SvStream & rStream); + + CntInt32Item(const CntInt32Item & rItem): + SfxPoolItem(rItem), m_nValue(rItem.m_nValue) + { DBG_CTOR(CntInt32Item, 0); } + + virtual ~CntInt32Item() { DBG_DTOR(CntInt32Item, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream &, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual INT32 GetMin() const; + + virtual INT32 GetMax() const; + + virtual SfxFieldUnit GetUnit() const; + + INT32 GetValue() const { return m_nValue; } + + inline void SetValue(INT32 nTheValue); +}; + +inline void CntInt32Item::SetValue(INT32 nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "CntInt32Item::SetValue(): Pooled item"); + m_nValue = nTheValue; +} + +//============================================================================ +DBG_NAMEEX_VISIBILITY(CntUInt32Item, SVL_DLLPUBLIC) + +class SVL_DLLPUBLIC CntUInt32Item: public SfxPoolItem +{ + UINT32 m_nValue; + +public: + TYPEINFO(); + + CntUInt32Item(USHORT which = 0, UINT32 nTheValue = 0): + SfxPoolItem(which), m_nValue(nTheValue) + { DBG_CTOR(CntUInt32Item, 0); } + + CntUInt32Item(USHORT nWhich, SvStream & rStream); + + CntUInt32Item(const CntUInt32Item & rItem): + SfxPoolItem(rItem), m_nValue(rItem.m_nValue) + { DBG_CTOR(CntUInt32Item, 0); } + + virtual ~CntUInt32Item() { DBG_DTOR(CntUInt32Item, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual UINT32 GetMin() const; + + virtual UINT32 GetMax() const; + + virtual SfxFieldUnit GetUnit() const; + + UINT32 GetValue() const { return m_nValue; } + + inline void SetValue(UINT32 nTheValue); +}; + +inline void CntUInt32Item::SetValue(UINT32 nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "CntUInt32Item::SetValue(): Pooled item"); + m_nValue = nTheValue; +} + +#endif // _SVTOOLS_CINTITEM_HXX + diff --git a/svl/inc/svl/cjkoptions.hxx b/svl/inc/svl/cjkoptions.hxx new file mode 100644 index 000000000000..1573a029f29f --- /dev/null +++ b/svl/inc/svl/cjkoptions.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * 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: cjkoptions.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 _SVTOOLS_CJKOPTIONS_HXX +#define _SVTOOLS_CJKOPTIONS_HXX + +#include "svtools/svtdllapi.h" +#include <sal/types.h> +#include <unotools/options.hxx> + +class SvtCJKOptions_Impl; + +// class SvtCJKOptions -------------------------------------------------- + +class SVT_DLLPUBLIC SvtCJKOptions: public utl::detail::Options +{ +private: + SvtCJKOptions_Impl* pImp; + +public: + + enum EOption + { + E_CJKFONT, + E_VERTICALTEXT, + E_ASIANTYPOGRAPHY, + E_JAPANESEFIND, + E_RUBY, + E_CHANGECASEMAP, + E_DOUBLELINES, + E_EMPHASISMARKS, + E_VERTICALCALLOUT, + E_ALL // special one for IsAnyEnabled()/SetAll() functionality + }; + + // bDontLoad is for referencing purposes only + SvtCJKOptions(sal_Bool bDontLoad = sal_False); + virtual ~SvtCJKOptions(); + + sal_Bool IsCJKFontEnabled() const; + sal_Bool IsVerticalTextEnabled() const; + sal_Bool IsAsianTypographyEnabled() const; + sal_Bool IsJapaneseFindEnabled() const; + sal_Bool IsRubyEnabled() const; + sal_Bool IsChangeCaseMapEnabled() const; + sal_Bool IsDoubleLinesEnabled() const; + sal_Bool IsEmphasisMarksEnabled() const; + sal_Bool IsVerticalCallOutEnabled() const; + + void SetAll(sal_Bool bSet); + sal_Bool IsAnyEnabled() const; + sal_Bool IsReadOnly(EOption eOption) const; +}; + +#endif // _SVTOOLS_CJKOPTIONS_HXX + diff --git a/svl/inc/svl/cnclhint.hxx b/svl/inc/svl/cnclhint.hxx new file mode 100644 index 000000000000..38781a6c2143 --- /dev/null +++ b/svl/inc/svl/cnclhint.hxx @@ -0,0 +1,51 @@ +/************************************************************************* + * + * 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: cnclhint.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 _SFXCNCLHINT_HXX +#define _SFXCNCLHINT_HXX + +#include <svtools/hint.hxx> +#include <svtools/cancel.hxx> +#include <tools/rtti.hxx> + +#define SFXCANCELHINT_REMOVED 1 + +class SfxCancelHint: public SfxHint +{ +private: + SfxCancellable* pCancellable; + USHORT nAction; +public: + TYPEINFO(); + SfxCancelHint( SfxCancellable*, USHORT nAction ); + USHORT GetAction() const { return nAction; } + const SfxCancellable& GetCancellable() const { return *pCancellable; } +}; + +#endif diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx new file mode 100644 index 000000000000..51b2982fe1dd --- /dev/null +++ b/svl/inc/svl/cntwall.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * 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: cntwall.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 _CNTWALL_HXX +#define _CNTWALL_HXX + +#include "svtools/svldllapi.h" + +#ifndef SHL_HXX +#include <tools/shl.hxx> +#endif +#include <tools/rtti.hxx> +#include <tools/color.hxx> +#include <svtools/poolitem.hxx> + +class SvStream; + +class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem +{ +private: + UniString _aURL; + Color _nColor; + USHORT _nStyle; + +public: + TYPEINFO(); + + CntWallpaperItem( USHORT nWhich ); + CntWallpaperItem( USHORT nWhich, SvStream& rStream, USHORT nVersion ); + CntWallpaperItem( const CntWallpaperItem& rCpy ); + ~CntWallpaperItem(); + + virtual USHORT GetVersion(USHORT) const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; } + void SetColor( Color nColor ) { _nColor = nColor; } + void SetStyle( USHORT nStyle ) { _nStyle = nStyle; } + + const UniString& GetBitmapURL() const { return _aURL; } + Color GetColor() const { return _nColor; } + USHORT GetStyle() const { return _nStyle; } +}; + +//////////////////////////////////////////////////////////////////////////////// + +#endif // _CNTWALL_HXX + diff --git a/svl/inc/svl/cstitem.hxx b/svl/inc/svl/cstitem.hxx new file mode 100644 index 000000000000..654ee9c15a75 --- /dev/null +++ b/svl/inc/svl/cstitem.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * 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: cstitem.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 _CSTITEM_HXX +#define _CSTITEM_HXX + +#include <tools/rtti.hxx> + +#include <svtools/poolitem.hxx> + +class SvStream; + +enum CrawlStatus +{ + CSTAT_NEVER_UPD = 0, /* noch nie ueberprueft */ + CSTAT_IN_UPD = 1, /* Ueberpruefung laeuft */ + CSTAT_UPD_NEWER = 2, /* wurde ueberprueft und ist neuer */ + CSTAT_UPD_NOT_NEWER = 3, /* wurde ueberprueft und ist nicht neuer */ + CSTAT_UPD_CANCEL = 4, /* Ueberpruefung vom Benutzer abgebrochen */ + CSTAT_ERR_GENERAL = 5, /* allgemeiner Fehler */ + CSTAT_ERR_NOTEXISTS = 6, /* Server existiert nicht */ + CSTAT_ERR_NOTREACHED = 7, /* Server nicht ereicht */ + CSTAT_UPD_IMMEDIATELY = 8, /* es wird gleich ueberprueftt */ + CSTAT_ERR_OFFLINE = 9 /* Ueberpruefung nicht m�glich, da Offline */ +}; + +DBG_NAMEEX(SfxCrawlStatusItem) + +// class SfxDateTimeRangeItem ------------------------------------------------- + +class SfxCrawlStatusItem : public SfxPoolItem +{ +private: + CrawlStatus eStatus; +public: + TYPEINFO(); + + SfxCrawlStatusItem( const SfxCrawlStatusItem& rCpy ); + SfxCrawlStatusItem( USHORT nWhich ); + SfxCrawlStatusItem( USHORT nWhich, CrawlStatus eStat ); + ~SfxCrawlStatusItem() { DBG_DTOR(SfxCrawlStatusItem, 0); } + + virtual int operator==( const SfxPoolItem& ) const; + using SfxPoolItem::Compare; + virtual int Compare( const SfxPoolItem &rWith ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * pIntlWrapper = 0 ) + const; + + CrawlStatus GetStatus() const { return eStatus; } + void SetStatus(CrawlStatus eNew) { eStatus = eNew; } + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; +}; + +#endif + diff --git a/svl/inc/svl/ctloptions.hxx b/svl/inc/svl/ctloptions.hxx new file mode 100644 index 000000000000..4157d129cce1 --- /dev/null +++ b/svl/inc/svl/ctloptions.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: ctloptions.hxx,v $ + * $Revision: 1.3.164.1 $ + * + * 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_CTLOPTIONS_HXX +#define _SVTOOLS_CTLOPTIONS_HXX + +#include "svtools/svtdllapi.h" +#include <sal/types.h> +#include <svtools/brdcst.hxx> +#include <svtools/lstner.hxx> +#include <unotools/options.hxx> + +class SvtCTLOptions_Impl; + +// class SvtCTLOptions -------------------------------------------------------- + +class SVT_DLLPUBLIC SvtCTLOptions: + public utl::detail::Options, public SfxBroadcaster, public SfxListener +{ +private: + SvtCTLOptions_Impl* m_pImp; + +public: + + // bDontLoad is for referencing purposes only + SvtCTLOptions( sal_Bool bDontLoad = sal_False ); + virtual ~SvtCTLOptions(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + void SetCTLFontEnabled( sal_Bool _bEnabled ); + sal_Bool IsCTLFontEnabled() const; + + void SetCTLSequenceChecking( sal_Bool _bEnabled ); + sal_Bool IsCTLSequenceChecking() const; + + void SetCTLSequenceCheckingRestricted( sal_Bool _bEnable ); + sal_Bool IsCTLSequenceCheckingRestricted( void ) const; + + void SetCTLSequenceCheckingTypeAndReplace( sal_Bool _bEnable ); + sal_Bool IsCTLSequenceCheckingTypeAndReplace() const; + + enum CursorMovement + { + MOVEMENT_LOGICAL = 0, + MOVEMENT_VISUAL + }; + void SetCTLCursorMovement( CursorMovement _eMovement ); + CursorMovement GetCTLCursorMovement() const; + + enum TextNumerals + { + NUMERALS_ARABIC = 0, + NUMERALS_HINDI, + NUMERALS_SYSTEM, + NUMERALS_CONTEXT + }; + void SetCTLTextNumerals( TextNumerals _eNumerals ); + TextNumerals GetCTLTextNumerals() const; + + enum EOption + { + E_CTLFONT, + E_CTLSEQUENCECHECKING, + E_CTLCURSORMOVEMENT, + E_CTLTEXTNUMERALS, + E_CTLSEQUENCECHECKINGRESTRICTED, + E_CTLSEQUENCECHECKINGTYPEANDREPLACE + }; + sal_Bool IsReadOnly(EOption eOption) const; +}; + +#endif // _SVTOOLS_CTLOPTIONS_HXX + diff --git a/svl/inc/svl/ctypeitm.hxx b/svl/inc/svl/ctypeitm.hxx new file mode 100644 index 000000000000..2592c6e0f388 --- /dev/null +++ b/svl/inc/svl/ctypeitm.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * 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: ctypeitm.hxx,v $ + * $Revision: 1.3.136.1 $ + * + * 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_CTYPEITM_HXX +#define _SVTOOLS_CTYPEITM_HXX + +#include <svtools/inettype.hxx> +#include <svtools/custritm.hxx> + +//========================================================================= + +class CntContentTypeItem : public CntUnencodedStringItem +{ +private: + INetContentType _eType; + XubString _aPresentation; + +public: + TYPEINFO(); + + CntContentTypeItem(); + CntContentTypeItem( USHORT nWhich, const XubString& rType ); + CntContentTypeItem( USHORT nWhich, const INetContentType eType ); + CntContentTypeItem( const CntContentTypeItem& rOrig ); + + virtual SfxPoolItem* Create( SvStream& rStream, + USHORT nItemVersion ) const; + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual int operator==( const SfxPoolItem& rOrig ) const; + + virtual USHORT GetVersion(USHORT) const; + + virtual SfxPoolItem* Clone( SfxItemPool *pPool = NULL ) const; + + void SetValue( const XubString& rNewVal ); + void SetPresentation( const XubString& rNewVal ); + + using SfxPoolItem::Compare; + virtual int Compare( const SfxPoolItem &rWith, const IntlWrapper& rIntlWrapper ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper* pIntlWrapper = 0 ) const; + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0); + + INetContentType GetEnumValue() const; + + void SetValue( const INetContentType eType ); +}; + +#endif /* !_SVTOOLS_CTYPEITM_HXX */ + diff --git a/svl/inc/svl/custritm.hxx b/svl/inc/svl/custritm.hxx new file mode 100644 index 000000000000..83a88b1f240f --- /dev/null +++ b/svl/inc/svl/custritm.hxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * 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: custritm.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 _SVTOOLS_CUSTRITM_HXX +#define _SVTOOLS_CUSTRITM_HXX + +#include "svtools/svldllapi.h" +#include <tools/debug.hxx> +#include <svtools/poolitem.hxx> + +//============================================================================ +DBG_NAMEEX_VISIBILITY(CntUnencodedStringItem, SVL_DLLPUBLIC) + +class SVL_DLLPUBLIC CntUnencodedStringItem: public SfxPoolItem +{ + XubString m_aValue; + +public: + TYPEINFO(); + + CntUnencodedStringItem(USHORT which = 0): SfxPoolItem(which) + { DBG_CTOR(CntUnencodedStringItem, 0); } + + CntUnencodedStringItem(USHORT which, const XubString & rTheValue): + SfxPoolItem(which), m_aValue(rTheValue) + { DBG_CTOR(CntUnencodedStringItem, 0); } + + CntUnencodedStringItem(const CntUnencodedStringItem & rItem): + SfxPoolItem(rItem), m_aValue(rItem.m_aValue) + { DBG_CTOR(CntUnencodedStringItem, 0); } + + virtual ~CntUnencodedStringItem() { DBG_DTOR(CntUnencodedStringItem, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual int Compare(SfxPoolItem const & rWith, + IntlWrapper const & rIntlWrapper) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue(com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0); + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + const XubString & GetValue() const { return m_aValue; } + + inline void SetValue(const XubString & rTheValue); +}; + +inline void CntUnencodedStringItem::SetValue(const XubString & rTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, + "CntUnencodedStringItem::SetValue(): Pooled item"); + m_aValue = rTheValue; +} + +#endif // _SVTOOLS_CUSTRITM_HXX + diff --git a/svl/inc/svl/dateitem.hxx b/svl/inc/svl/dateitem.hxx new file mode 100644 index 000000000000..073c1a6ef825 --- /dev/null +++ b/svl/inc/svl/dateitem.hxx @@ -0,0 +1,109 @@ + /************************************************************************* + * + * 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: dateitem.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 _DATETIMEITEM_HXX +#define _DATETIMEITEM_HXX + +#include <tools/rtti.hxx> +#include <tools/datetime.hxx> + +#include <svtools/poolitem.hxx> + +class SvStream; + +DBG_NAMEEX(SfxDateTimeItem) + +// class SfxDateTimeItem ------------------------------------------------- + +class SfxDateTimeItem : public SfxPoolItem +{ +private: + DateTime aDateTime; + +public: + TYPEINFO(); + + SfxDateTimeItem( USHORT nWhich ); + SfxDateTimeItem( USHORT nWhich, + const DateTime& rDT ); + SfxDateTimeItem( const SfxDateTimeItem& rCpy ); + + ~SfxDateTimeItem() { + DBG_DTOR(SfxDateTimeItem, 0); } + + virtual int operator==( const SfxPoolItem& ) const; + using SfxPoolItem::Compare; + virtual int Compare( const SfxPoolItem &rWith ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * pIntlWrapper = 0 ) + const; + + const DateTime& GetDateTime() const { return aDateTime; } + void SetDateTime( const DateTime& rDT ) { + DBG_ASSERT( GetRefCount() == 0, + "SetDateTime() with pooled item" ); + aDateTime = rDT; } + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; +}; + +class SfxColumnDateTimeItem : public SfxDateTimeItem +{ +public: + TYPEINFO(); + + SfxColumnDateTimeItem( USHORT nWhich ); + SfxColumnDateTimeItem( USHORT nWhich, + const DateTime& rDT ); + SfxColumnDateTimeItem( const SfxDateTimeItem& rCpy ); + + ~SfxColumnDateTimeItem() {} + + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * pIntlWrapper = 0 ) + const; +}; + +#endif + diff --git a/svl/inc/svl/documentlockfile.hxx b/svl/inc/svl/documentlockfile.hxx new file mode 100644 index 000000000000..f2625f7955bb --- /dev/null +++ b/svl/inc/svl/documentlockfile.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * 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: documentlockfile.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 _SVT_DOCUMENTLOCKFILE_HXX +#define _SVT_DOCUMENTLOCKFILE_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/io/XTruncate.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <svtools/lockfilecommon.hxx> + +namespace svt { + +class SVT_DLLPUBLIC DocumentLockFile : public LockFileCommon +{ + // the workaround for automated testing! + static sal_Bool m_bAllowInteraction; + + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenStream(); + + void WriteEntryToStream( ::com::sun::star::uno::Sequence< ::rtl::OUString > aEntry, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xStream ); + +public: + DocumentLockFile( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ); + ~DocumentLockFile(); + + sal_Bool CreateOwnLockFile(); + ::com::sun::star::uno::Sequence< ::rtl::OUString > GetLockData(); + sal_Bool OverwriteOwnLockFile(); + void RemoveFile(); + + // the methods allow to control whether UI interaction regarding the locked document file is allowed + // this is a workaround for automated tests + static void AllowInteraction( sal_Bool bAllow ) { m_bAllowInteraction = bAllow; } + static sal_Bool IsInteractionAllowed() { return m_bAllowInteraction; } +}; + +} + +#endif + diff --git a/svl/inc/svl/dtritem.hxx b/svl/inc/svl/dtritem.hxx new file mode 100644 index 000000000000..87666a306a43 --- /dev/null +++ b/svl/inc/svl/dtritem.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * 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: dtritem.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 _DTRITEM_HXX +#define _DTRITEM_HXX + +#include <tools/rtti.hxx> +#include <tools/datetime.hxx> + +#include <svtools/poolitem.hxx> + +class SvStream; + +DBG_NAMEEX(SfxDateTimeRangeItem) + +// class SfxDateTimeRangeItem ------------------------------------------------- + +class SfxDateTimeRangeItem : public SfxPoolItem +{ +private: + DateTime aStartDateTime; + DateTime aEndDateTime; + +public: + TYPEINFO(); + + SfxDateTimeRangeItem( const SfxDateTimeRangeItem& rCpy ); + SfxDateTimeRangeItem( USHORT nWhich ); + SfxDateTimeRangeItem( USHORT nWhich, const DateTime& rStartDT, + const DateTime& rEndDT ); + + ~SfxDateTimeRangeItem() + { DBG_DTOR(SfxDateTimeRangeItem, 0); } + + virtual int operator==( const SfxPoolItem& ) const; + using SfxPoolItem::Compare; + virtual int Compare( const SfxPoolItem &rWith ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * pIntlWrapper = 0 ) + const; + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + + const DateTime& GetStartDateTime() const { return aStartDateTime; } + const DateTime& GetEndDateTime() const { return aEndDateTime; } + + void SetStartDateTime( const DateTime& rDT ) + { DBG_ASSERT( GetRefCount() == 0, "SetDateTime() with pooled item" ); + aStartDateTime = rDT; } + + void SetEndDateTime( const DateTime& rDT ) + { DBG_ASSERT( GetRefCount() == 0, "SetDateTime() with pooled item" ); + aEndDateTime = rDT; } +}; + +#endif + diff --git a/svl/inc/svl/eitem.hxx b/svl/inc/svl/eitem.hxx new file mode 100644 index 000000000000..f9e1927a881d --- /dev/null +++ b/svl/inc/svl/eitem.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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: eitem.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 _SFXENUMITEM_HXX +#define _SFXENUMITEM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/cenumitm.hxx> + +//============================================================================ +class SVT_DLLPUBLIC SfxEnumItem: public CntEnumItem +{ +protected: + SfxEnumItem(USHORT which = 0, USHORT nValue = 0): + CntEnumItem(which, nValue) {} + + SfxEnumItem(USHORT which, SvStream & rStream): + CntEnumItem(which, rStream) {} + +public: + TYPEINFO(); + +}; + +//============================================================================ +class SVT_DLLPUBLIC SfxBoolItem: public CntBoolItem +{ +public: + TYPEINFO(); + + SfxBoolItem(USHORT which = 0, BOOL bValue = FALSE): + CntBoolItem(which, bValue) {} + + SfxBoolItem(USHORT which, SvStream & rStream): + CntBoolItem(which, rStream) {} + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + { return new SfxBoolItem(Which(), rStream); } + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const + { return new SfxBoolItem(*this); } +}; + +#endif // _SFXENUMITEM_HXX + diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx new file mode 100644 index 000000000000..77ba6c1b5c52 --- /dev/null +++ b/svl/inc/svl/filerec.hxx @@ -0,0 +1,1087 @@ +/************************************************************************* + * + * 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: filerec.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 _SFXFILEREC_HXX +#define _SFXFILEREC_HXX + +//========================================================================= + +#include "svtools/svldllapi.h" +#include <tools/debug.hxx> +#include <tools/stream.hxx> +#include <svtools/svarray.hxx> + +SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 ) + +//------------------------------------------------------------------------ + +#define SFX_BOOL_DONTCARE BOOL(2) // Don't-Care-Wert f"ur BOOLs + +#define SFX_REC_PRETAG_EXT BYTE(0x00) // Pre-Tag f"ur Extended-Records +#define SFX_REC_PRETAG_EOR BYTE(0xFF) // Pre-Tag f"ur End-Of-Records + +#define SFX_REC_TYPE_NONE BYTE(0x00) // unbekannter Record-Typ +#define SFX_REC_TYPE_FIRST BYTE(0x01) +#define SFX_REC_TYPE_SINGLE BYTE(0x01) // Single-Content-Record +#define SFX_REC_TYPE_FIXSIZE BYTE(0x02) // Fix-Size-Multi-Content-Record +#define SFX_REC_TYPE_VARSIZE_RELOC BYTE(0x03) // variable Rec-Size +#define SFX_REC_TYPE_VARSIZE BYTE(0x04) // alt (nicht verschiebbar) +#define SFX_REC_TYPE_MIXTAGS_RELOC BYTE(0x07) // Mixed Tag Content-Record +#define SFX_REC_TYPE_MIXTAGS BYTE(0x08) // alt (nicht verschiebbar) +#define SFX_REC_TYPE_LAST BYTE(0x08) +#define SFX_REC_TYPE_MINI 0x100 // Mini-Record +#define SFX_REC_TYPE_DRAWENG 0x400 // Drawing-Engine-Record +#define SFX_REC_TYPE_EOR 0xF00 // End-Of-Records + +//------------------------------------------------------------------------ + +#define SFX_REC_HEADERSIZE_MINI 4 // Gr"o\se des Mini-Record-Headers +#define SFX_REC_HEADERSIZE_SINGLE 4 // zzgl. HEADERSIZE_MINI => 8 +#define SFX_REC_HEADERSIZE_MULTI 6 // zzgl. HEADERSIZE_SINGLE => 14 + +//------------------------------------------------------------------------ + +#ifndef DBG +#ifdef DBG_UTIL +#define DBG(x) x +#else +#define DBG(x) +#endif +#endif + +//------------------------------------------------------------------------ + +/* [Fileformat] + + Jeder Record beginnt mit einem Byte, dem sogenannten 'Pre-Tag'. + + Ist dieses 'Pre-Tag' == 0x00, dann handelt es sich um einen Extended- + Record, dessen Typ durch ein weiteres Byte an Position 5 n�her + beschrieben wird: + + 0x01: SfxSingleRecord + 0x02: SfxMultiFixRecord + 0x03+0x04: SfxMultiVarRecord + 0x07+0x08: SfxMultiMixRecord + (Alle weiteren Record-Typ-Kennungen sind reserviert.) + + I.d.R. werden File-Formate schon aus Performance-Gr"unden so aufgebaut, + da\s beim Lesen jeweils vorher schon feststeht, welcher Record-Typ + vorliegt. Diese Kennung dient daher hautps"achlich der "Uberpr"ufung + und File-Viewern, die das genaue File-Format (unterhalb der Records) + nicht kennen. + + Der 'SfxMiniRecordReader' verf"ugt dazu auch "uber eine statische + Methode 'ScanRecordType()', mit der festgestellt werden kann, welcher + Record-Typ in dem "ubergebenen Stream zu finden ist. + + Ein 'Pre-Tag' mit dem Wert 0xFF ist als Terminator reserviert. + Terminatoren werden verwendet, um das Suchen nach einem speziellen + Record zu terminieren, d.h. ist er bis dorthin nicht gefunden, wird + auch nicht weitergesucht. + + Bei allen anderen Werten des 'Pre-Tags' (also von 0x01 bis 0xFE) + handelt es sich um einen zum SW3 kompatbilen Record, der hier + 'SfxMiniRecord' genannt wird, er kann daher mit einem <SfxMiniRecordReader> + gelesen werden. + + Beginnt ein Record mit 0x44 k"onnte es sich um einen Drawing-Engine- + Record handeln. Dies ist dann der Fall, wenn die folgenden drei Bytes + die Zeichenkette 'RMD' bzw. 'RVW' ergeben (zusammen mit 'D'==0x44 + ergibt dies die K"urzel f"ur 'DRaw-MoDel' bzw. 'DRaw-VieW'). Records + dieser Art k"onnen von den hier dargestellten Klassen weder gelesen, + noch in irgendeiner Weise interpretiert werden. Einzig die Methode + 'ScanRecordType()' kann sie erkennen - weitere Behandlung obliegt + jedoch der Anwendungsprogrammierung. + + Diese drei Bytes an den Positionen 2 bis 4 enthalten normalerweise + die Gr"o\se des Records ohne Pre-Tag und Gr"o\sen-Bytes selbst, + also die Restgr"o\se nach diesem 4-Byte-Header. + + Struktur des Mini-Records: + + 1 BYTE Pre-Tag + 3 BYTE OffsetToEndOfRec + OffsetToEndOfRec* 1 BYTE Content + + Bei den Extended-Reords folgt auf diesen 4-Byte-Header ein erweiterter + Header, der zun"achst den o.g. Record-Typ, dann eine Versions-Kennung + sowie ein Tag enth"alt, welches den Inhalt kennzeichnet. + + Struktur des Extended-Records: + + 1 BYTE Pre-Tag (==0x00) + 3 BYTE OffsetToEndOfRec + OffsetToEndOfRec* 1 BYTE Content + 1 BYTE Record-Type + 1 BYTE Version + 2 BYTE Tag + ContentSize* 1 BYTE Content + + (ContentSize = OffsetToEndOfRec - 8) + + [Anmerkung] + + Der Aufbau der Records wird wie folgt begr"undet: + + Der SW-Record-Typ war zuerst vorhanden, mu\ste also 1:1 "ubernommen + werden. Zum Gl"uck wurden einige Record-Tags nicht verwendet, (Z.B. + 0x00 und 0xFF). + => 1. Byte 0x00 kann als Kennung f"ur erweiterten Record verwendet werden + => 1. Byte 0xFF kann f"ur besondere Zwecke verwendet werden + + Egal welcher Record-Typ vorliegt, sollte eine Erkennung des Typs, ein + Auslesen des Headers und ein "uberpspringen des Records m"oglich sein, + ohne zu"uck-seeken zu m"ussen und ohne "uberfl"ussige Daten lesen zu + m"ussen. + => die Bytes 2-4 werden bei allen Records als Offset zum Ende des + Records interpretiert, so da\s die Gesamt-Recors-Size sich wie + folgt berechnet: sizeof(UINT32) + OffsetToEndOfRec + + Die Records sollten einfach zu parsen un einheitlich aufgebaut sein. + => Sie bauen aufeinander auf, so ist z.B. der SfxMiniRecord in jedem + anderen enthalten. + + Die Records sollten auch von denen der Drawing Enginge unterscheidbar + sein. Diese beginnen mit 'DRMD' und 'DRVW'. + => Mini-Records mit dem Pre-Tag 'D' d"urfen maximal 4MB gro\s sein, + um nicht in diesen Kennungs-Bereich zu reichen. + + [Erweiterungen] + + Es ist geplant das File-Format so zu erweitern, da\s das High-Nibble + des Record-Typs der erweiterten Records besondere Aufgaben "ubernehmen + soll. Zum Beispiel ist geplant, Record-Contents als 'nur aus Records + bestehend' zu kennzeichnen. Ein File-Viewer k"onnte sich dann automatisch + durch solche Strukturen 'hangeln', ohne Gefahr zu laufen, auf Daten + zu sto\sen, die sich zwar als Records interpretieren lassen, aber + tats"achlis als 'flache' Daten geschrieben wurden. Die m"ogliche + Erweiterung wird schon jetzt insofern vorbereitet, als da\s das + High-Nibble des Typs bei Vergleichen nicht ber"ucksichtigt wird. +*/ + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxMiniRecordWriter + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein einfacher Record in einen Stream + geschrieben werden, der sich durch ein BYTE-Tag identifiziert, sowie + seine eigene L"ange speichert und somit auch von "alteren Versionen + bzw. Readern, die diesen Record-Type (Tag) nicht kennen, "ubersprungen + werden kann. Es wird keine Version-Nummer gespeichert. + + Alternativ kann die Gr"o\se fest angegeben werden oder sie wird + automatisch aus der Differenz der Tell()-Angaben vor und nach dem + Streamen des Inhalts ermittelt. + + Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen + neue Versionen die Daten der "alteren immer komplett enthalten, + es d"urfen allenfalls neue Daten hintenan geh"angt werden! + + [Fileformat] + + 1* BYTE Content-Tag (!= 0) + 1* 3-BYTE OffsetToEndOfRec in Bytes + SizeOfContent* BYTE Content + + [Beispiel] + + { + SfxMiniRecordWriter aRecord( pStream, MY_TAG_X ); + *aRecord << aMember1; + *aRecord << aMember2; + } +*/ + +{ +protected: + SvStream* _pStream; // <SvStream>, in dem der Record liegt + UINT32 _nStartPos; // Start-Position des Gesamt-Records im Stream + FASTBOOL _bHeaderOk; /* TRUE, wenn der Header schon geschrieben ist; + bei DBG_UTIL wird SFX_BOOL_DONTCARE ver- + wendet, um die Gr"o\se von Fix-Sized-Records + zu pr"ufen. */ + BYTE _nPreTag; // in den Header zu schreibendes 'Pre-Tag' + +public: + inline SfxMiniRecordWriter( SvStream *pStream, + BYTE nTag ); + inline SfxMiniRecordWriter( SvStream *pStream, BYTE nTag, + UINT32 nSize ); + + inline ~SfxMiniRecordWriter(); + + inline SvStream& operator*() const; + + inline void Reset(); + + UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); + +private: + // not implementend, not allowed + SfxMiniRecordWriter( const SfxMiniRecordWriter& ); + SfxMiniRecordWriter& operator=(const SfxMiniRecordWriter&); +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxMiniRecordReader + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein einfacher Record aus einem Stream + gelesen werden, der mit der Klasse <SfxRecordWriter> geschrieben wurde. + + Es ist auch m"oglich, den Record zu "uberspringen, ohne sein internes + Format zu kennen. + + [Beispiel] + + { + SfxMiniRecordReader aRecord( pStream ); + switch ( aRecord.GetTag() ) + { + case MY_TAG_X: + *aRecord >> aMember1; + *aRecord >> aMember2; + break; + + ... + } + } +*/ + +{ +protected: + SvStream* _pStream; // <SvStream>, aus dem gelesen wird + UINT32 _nEofRec; // Position direkt hinter dem Record + FASTBOOL _bSkipped; // TRUE: der Record wurde explizit geskippt + BYTE _nPreTag; // aus dem Header gelesenes Pre-Tag + + // Drei-Phasen-Ctor f"ur Subklassen + SfxMiniRecordReader() {} + void Construct_Impl( SvStream *pStream, BYTE nTag ) + { + _pStream = pStream; + _bSkipped = FALSE; + _nPreTag = nTag; + } + inline FASTBOOL SetHeader_Impl( UINT32 nHeader ); + + // als ung"ultig markieren und zur"uck-seeken + void SetInvalid_Impl( UINT32 nRecordStartPos ) + { + _nPreTag = SFX_REC_PRETAG_EOR; + _pStream->Seek( nRecordStartPos ); + } + +public: + static USHORT ScanRecordType( SvStream *pStream ); + + SfxMiniRecordReader( SvStream *pStream ); + SfxMiniRecordReader( SvStream *pStream, BYTE nTag ); + inline ~SfxMiniRecordReader(); + + inline BYTE GetTag() const; + inline FASTBOOL IsValid() const; + + inline SvStream& operator*() const; + + inline void Skip(); + +private: + // not implementend, not allowed + SfxMiniRecordReader( const SfxMiniRecordReader& ); + SfxMiniRecordReader& operator=(const SfxMiniRecordReader&); +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxSingleRecordWriter: public SfxMiniRecordWriter + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben + werden, dessen einziger Inhalt sich durch ein UINT16-Tag und eine + BYTE-Versions-Nummer identifiziert, sowie seine eigene L"ange speichert + und somit auch von "alteren Versionen bzw. Readern, die diesen + Record-Type (Tag) nicht kennen, "ubersprungen werden kann. + + Alternativ kann die Gr"o\se fest angegeben werden oder sie wird + automatisch aus der Differenz der Tell()-Angaben vor und nach dem + Streamen des Inhalts ermittelt. + + Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen + neue Versionen die Daten der "alteren immer komplett enthalten, + es d"urfen allenfalls neue Daten hintenan geh"angt werden! + + [Fileformat] + + 1* BYTE Pre-Tag (!= 0) + 1* 3-BYTE OffsetToEndOfRec in Bytes + 1* BYTE Record-Type (==SFX_REC_TYPE_SINGLE) + 1* BYTE Content-Version + 1* USHORT Content-Tag + SizeOfContent* BYTE Content + + [Beispiel] + + { + SfxSingleRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); + *aRecord << aMember1; + *aRecord << aMember2; + } +*/ + +{ +protected: + SfxSingleRecordWriter( BYTE nRecordType, + SvStream *pStream, + UINT16 nTag, BYTE nCurVer ); + +public: + SfxSingleRecordWriter( SvStream *pStream, + UINT16 nTag, BYTE nCurVer ); + SfxSingleRecordWriter( SvStream *pStream, + UINT16 nTag, BYTE nCurVer, + UINT32 nSize ); + + inline void Reset(); + + UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxSingleRecordReader: public SfxMiniRecordReader + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein einfacher Record aus einem Stream + gelesen werden, der mit der Klasse <SfxSingleRecordWriter> geschrieben + wurde. + + Es ist auch m"oglich, den Record zu "uberspringen, ohne sein internes + Format zu kennen. + + [Beispiel] + + { + SfxSingleRecordReader aRecord( pStream ); + switch ( aRecord.GetTag() ) + { + case MY_TAG_X: + aRecord >> aMember1; + if ( aRecord.HasVersion(2) ) + *aRecord >> aMember2; + break; + + ... + } + } +*/ + +{ +protected: + UINT16 _nRecordTag; // Art des Gesamt-Inhalts + BYTE _nRecordVer; // Version des Gesamt-Inhalts + BYTE _nRecordType; // Record Type aus dem Header + + // Drei-Phasen-Ctor f"ur Subklassen + SfxSingleRecordReader() {} + void Construct_Impl( SvStream *pStream ) + { + SfxMiniRecordReader::Construct_Impl( + pStream, SFX_REC_PRETAG_EXT ); + } + FASTBOOL FindHeader_Impl( UINT16 nTypes, UINT16 nTag ); + FASTBOOL ReadHeader_Impl( USHORT nTypes ); + +public: + SfxSingleRecordReader( SvStream *pStream ); + SfxSingleRecordReader( SvStream *pStream, USHORT nTag ); + + inline UINT16 GetTag() const; + + inline BYTE GetVersion() const; + inline FASTBOOL HasVersion( USHORT nVersion ) const; +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxMultiFixRecordWriter: public SfxSingleRecordWriter + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben + werden, der seine eigene L"ange speichert und somit auch von "alteren + Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, + "ubersprungen werden kann. + + Er enth"alt mehrere Inhalte von demselben Typ (Tag) und derselben + Version, die einmalig (stellvertretend f"ur alle) im Header des Records + identifiziert werden. Alle Inhalte haben eine vorher bekannte und + identische L"ange. + + Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen + neue Versionen die Daten der "alteren immer komplett enthalten, + es d"urfen allenfalls neue Daten hinten angeh"angt werden! Hier sind + damit selbstverst"andlich nur die Daten der einzelnen Inhalte gemeint, + die Anzahl der Inhalte ist selbstverst"andlich variabel und sollte + von lesenden Applikationen auch so behandelt werden. + + [Fileformat] + + 1* BYTE Pre-Tag (==0) + 1* 3-BYTE OffsetToEndOfRec in Bytes + 1* BYTE Record-Type (==SFX_REC_TYPE_FIXSIZE) + 1* BYTE Content-Version + 1* UINT16 Content-Tag + 1* UINT16 NumberOfContents + 1* UINT32 SizeOfEachContent + NumberOfContents* ( + SizeOfEachContent BYTE Content + ) + + [Beispiel] + + { + SfxMultiFixRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); + for ( USHORT n = 0; n < Count(); ++n ) + { + aRecord.NewContent(); + *aRecord << aMember1[n]; + *aRecord << aMember2[n]; + } + } +*/ + +{ +protected: + UINT32 _nContentStartPos; /* Startposition des jeweiligen + Contents - nur bei DBG_UTIL + und f"ur Subklassen */ + UINT32 _nContentSize; // Gr"o\se jedes Contents + UINT16 _nContentCount; // jeweilige Anzahl der Contents + + SfxMultiFixRecordWriter( BYTE nRecordType, + SvStream *pStream, + UINT16 nTag, BYTE nCurVer, + UINT32 nContentSize ); + +public: + SfxMultiFixRecordWriter( SvStream *pStream, + UINT16 nTag, BYTE nCurVer, + UINT32 nContentSize ); + inline ~SfxMultiFixRecordWriter(); + + inline void NewContent(); + + inline void Reset(); + + UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxMultiVarRecordWriter: public SfxMultiFixRecordWriter + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben + werden, der seine eigene L"ange speichert und somit auch von "alteren + Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, + "ubersprungen werden kann. + + Er enth"alt mehrere Inhalte von demselben Typ (Tag) und derselben + Version, die einmalig (stellvertretend f"ur alle) im Header des Records + identifiziert werden. Die L"ange f"ur jeden einzelnen Inhalt wird + automatisch berechnet und gespeichert, so da\s auch einzelne Inhalte + "ubersprungen werden k"onnen, ohne sie interpretieren zu m"ussen. + + Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen + neue Versionen die Daten der "alteren immer komplett enthalten, + es d"urfen allenfalls neue Daten hinten angeh"angt werden! + + [Fileformat] + + 1* BYTE Pre-Tag (==0) + 1* 3-BYTE OffsetToEndOfRec in Bytes + 1* BYTE Record-Type (==SFX_FILETYPE_TYPE_VARSIZE) + 1* BYTE Content-Version + 1* USHORT Content-Tag + 1* UINT16 NumberOfContents + 1* UINT32 OffsetToOfsTable + NumberOfContents* ( + ContentSize* BYTE Content + ) + NumberOfContents* UINT32 ContentOfs (je per <<8 verschoben) + + [Beispiel] + + { + SfxMultiVarRecordWriter aRecord( pStream, MY_TAG_X, MY_VERSION ); + for ( USHORT n = 0; n < Count(); ++n ) + { + aRecord.NewContent(); + *aRecord << aMember1[n]; + *aRecord << aMember2[n]; + } + } +*/ + +{ +protected: + SfxUINT32s _aContentOfs; + USHORT _nContentVer; // nur f"ur SfxMultiMixRecordWriter + + SfxMultiVarRecordWriter( BYTE nRecordType, + SvStream *pStream, + USHORT nRecordTag, + BYTE nRecordVer ); + + void FlushContent_Impl(); + +public: + SfxMultiVarRecordWriter( SvStream *pStream, + USHORT nRecordTag, + BYTE nRecordVer ); + virtual ~SfxMultiVarRecordWriter(); + + void NewContent(); + + virtual UINT32 Close( FASTBOOL bSeekToEndOfRec = TRUE ); +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxMultiMixRecordWriter: public SfxMultiVarRecordWriter + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein Record in einen Stream geschrieben + werden, der seine eigene L"ange speichert und somit auch von "alteren + Versionen bzw. Readern, die diesen Record-Type (Tag) nicht kennen, + "ubersprungen werden kann. + + Er enth"alt mehrere Inhalte von demselben Typ (Tag) und derselben + Version, die einmalig (stellvertretend f"ur alle) im Header des Records + identifiziert werden. Alle Inhalte haben eine vorher bekannte und + identische L"ange. + + Um Auf- und Abw"artskompatiblit"at gew"ahrleisten zu k"onnen, m"ussen + neue Versionen die Daten der "alteren immer komplett enthalten, + es d"urfen allenfalls neue Daten hinten angeh"angt werden! + + [Fileformat] + + 1* BYTE Pre-Tag (==0) + 1* 3-BYTE OffsetToEndOfRec in Bytes + 1* BYTE Record-Type (==SFX_REC_TYPE_MIXTAGS) + 1* BYTE Content-Version + 1* USHORT Record-Tag + 1* UINT16 NumberOfContents + 1* UINT32 OffsetToOfsTable + NumberOfContents* ( + 1* USHORT Content-Tag + ContentSize* BYTE Content + ) + NumberOfContents* UINT32 ( ContentOfs << 8 + Version ) +*/ + +{ +public: + inline SfxMultiMixRecordWriter( SvStream *pStream, + USHORT nRecordTag, + BYTE nRecordVer ); + + void NewContent( USHORT nTag, BYTE nVersion ); + +// private: geht nicht, da einige Compiler dann auch vorherige privat machen + void NewContent() + { DBG_ERROR( "NewContent() only allowed with args" ); } +}; + +//------------------------------------------------------------------------ + +class SVL_DLLPUBLIC SfxMultiRecordReader: public SfxSingleRecordReader + +/* [Beschreibung] + + Mit Instanzen dieser Klasse kann ein aus mehreren Contents bestehender + Record aus einem Stream gelesen werden, der mit einer der Klassen + <SfxMultiFixRecordWriter>, <SfxMultiVarRecordWriter> oder + <SfxMultiMixRecordWriter> geschrieben wurde. + + Es ist auch m"oglich, den Record oder einzelne Contents zu "uberspringen, + ohne das jeweilis interne Format zu kennen. + + [Beispiel] + + { + SfxMultiRecordReader aRecord( pStream ); + for ( USHORT nRecNo = 0; aRecord.GetContent(); ++nRecNo ) + { + switch ( aRecord.GetTag() ) + { + case MY_TAG_X: + X *pObj = new X; + *aRecord >> pObj.>aMember1; + if ( aRecord.HasVersion(2) ) + *aRecord >> pObj->aMember2; + Append( pObj ); + break; + + ... + } + } + } +*/ + +{ + UINT32 _nStartPos; // Start-Position des Records + UINT32* _pContentOfs; // Offsets der Startpositionen + UINT32 _nContentSize; // Size jedes einzelnen / Tabellen-Pos + UINT16 _nContentCount; // Anzahl der Contents im Record + UINT16 _nContentNo; /* der Index des aktuellen Contents + enth"alt jeweils den Index des + Contents, der beim n"achsten + GetContent() geholt wird */ + UINT16 _nContentTag; // Art-Kennung des aktuellen Contents + BYTE _nContentVer; // Versions-Kennung des akt. Contents + + FASTBOOL ReadHeader_Impl(); + +public: + SfxMultiRecordReader( SvStream *pStream ); + SfxMultiRecordReader( SvStream *pStream, UINT16 nTag ); + ~SfxMultiRecordReader(); + + FASTBOOL GetContent(); + inline UINT16 GetContentTag(); + inline BYTE GetContentVersion() const; + inline FASTBOOL HasContentVersion( USHORT nVersion ) const; + + inline UINT32 ContentCount() const; +}; + +//========================================================================= + +inline SfxMiniRecordWriter::SfxMiniRecordWriter +( + SvStream* pStream, // Stream, in dem der Record angelegt wird + BYTE nTag // Record-Tag zwischen 0x01 und 0xFE +) + +/* [Beschreibung] + + Legt in 'pStream' einen 'SfxMiniRecord' an, dessen Content-Gr"o\se + nicht bekannt ist, sondern nach dam Streamen des Contents errechnet + werden soll. +*/ + +: _pStream( pStream ), + _nStartPos( pStream->Tell() ), + _bHeaderOk(FALSE), + _nPreTag( nTag ) +{ + DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" ); + DBG( DbgOutf( "SfxFileRec: writing record to %ul", pStream->Tell() ) ); + + pStream->SeekRel( + SFX_REC_HEADERSIZE_MINI ); +} + +//------------------------------------------------------------------------- + +inline SfxMiniRecordWriter::SfxMiniRecordWriter +( + SvStream* pStream, // Stream, in dem der Record angelegt wird + BYTE nTag, // Record-Tag zwischen 0x01 und 0xFE + UINT32 nSize // Gr"o\se der Daten in Bytes +) + +/* [Beschreibung] + + Legt in 'pStream' einen 'SfxMiniRecord' an, dessen Content-Gr"o\se + von vornherein bekannt ist. +*/ + +: _pStream( pStream ), + // _nTag( uninitialized ), + // _nStarPos( uninitialized ), + _bHeaderOk(SFX_BOOL_DONTCARE) +{ + DBG_ASSERT( nTag != 0 && nTag != 0xFF, "invalid Tag" ); + DBG(_nStartPos = pStream->Tell()); + DBG( DbgOutf( "SfxFileRec: writing record to %ul", _nStartPos ) ); + + *pStream << ( ( nTag << 24 ) | nSize ); +} + +//------------------------------------------------------------------------- + +inline SfxMiniRecordWriter::~SfxMiniRecordWriter() + +/* [Beschreibung] + + Der Dtor der Klasse <SfxMiniRecordWriter> schlie\st den Record + automatisch, falls <SfxMiniRecordWriter::Close()> nicht bereits + explizit gerufen wurde. +*/ + +{ + // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden + if ( !_bHeaderOk DBG(||TRUE) ) + Close(); +} + +//------------------------------------------------------------------------- + +inline SvStream& SfxMiniRecordWriter::operator*() const + +/* [Beschreibung] + + Dieser Operator liefert den Stream, in dem der Record liegt. + Der Record darf noch nicht geschlossen worden sein. +*/ + +{ + DBG_ASSERT( !_bHeaderOk, "getting Stream of closed record" ); + return *_pStream; +} + +//------------------------------------------------------------------------- + +inline void SfxMiniRecordWriter::Reset() +{ + _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI ); + _bHeaderOk = FALSE; +} + +//========================================================================= + +inline SfxMiniRecordReader::~SfxMiniRecordReader() + +/* [Beschreibung] + + Der Dtor der Klasse <SfxMiniRecordReader> positioniert den Stream + automatisch auf die Position direkt hinter dem Record, falls nicht + <SfxMiniRecordReader::Skip()> bereits explizit gerufen wurde. +*/ + +{ + // noch nicht explizit ans Ende gesprungen? + if ( !_bSkipped ) + Skip(); +} + +//------------------------------------------------------------------------- + +inline void SfxMiniRecordReader::Skip() + +/* [Beschreibung] + + Mit dieser Methode wird der Stream direkt hinter das Ende des Records + positioniert. +*/ + +{ + _pStream->Seek(_nEofRec); + _bSkipped = TRUE; +} + +//------------------------------------------------------------------------- + +inline BYTE SfxMiniRecordReader::GetTag() const + +/* [Beschreibung] + + Liefert des aus dem Header gelesene Pre-Tag des Records. Dieses kann + auch SFX_REC_PRETAG_EXT oder SFX_REC_PRETAG_EOR sein, im + letzteren Fall ist am Stream der Fehlercode ERRCODE_IO_WRONGFORMAT + gesetzt. SFX_REC_PRETAG_EXT ist g"ultig, da diese extended-Records + nur eine Erweiterung des SfxMiniRecord darstellen. +*/ + +{ + return _nPreTag; +} + +//------------------------------------------------------------------------- + +inline FASTBOOL SfxMiniRecordReader::IsValid() const + +/* [Beschreibung] + + Hiermit kann abgefragt werden, ob der Record erfolgreich aus dem + Stream konstruiert werden konnte, der Header also f"ur diesen Record-Typ + passend war. +*/ + +{ + return _nPreTag != SFX_REC_PRETAG_EOR; +} + +//------------------------------------------------------------------------- + +inline SvStream& SfxMiniRecordReader::operator*() const + +/* [Beschreibung] + + Dieser Operator liefert den Stream in dem der Record liegt. + Die aktuelle Position des Streams mu\s innerhalb des Records liegen. +*/ + +{ + DBG_ASSERT( _pStream->Tell() < _nEofRec, "read behind record" ); + return *_pStream; +} + +//========================================================================= + +inline UINT32 SfxSingleRecordWriter::Close( FASTBOOL bSeekToEndOfRec ) + +// siehe <SfxMiniRecordWriter::Close(FASTBOOL)> + +{ + UINT32 nRet = 0; + + // wurde der Header noch nicht geschrieben? + if ( !_bHeaderOk ) + { + // Basisklassen-Header schreiben + UINT32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec ); + + // ggf. ans Ende des eigenen Headers seeken oder hinter Rec bleiben + if ( !bSeekToEndOfRec ) + _pStream->SeekRel( SFX_REC_HEADERSIZE_SINGLE ); + nRet = nEndPos; + } +#ifdef DBG_UTIL + else + // Basisklassen-Header pr"ufen + SfxMiniRecordWriter::Close( bSeekToEndOfRec ); +#endif + + // Record war bereits geschlossen +// nRet = 0; + return nRet; +} + +//------------------------------------------------------------------------- + +inline void SfxSingleRecordWriter::Reset() +{ + _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + + SFX_REC_HEADERSIZE_SINGLE ); + _bHeaderOk = FALSE; +} + +//========================================================================= + +inline UINT16 SfxSingleRecordReader::GetTag() const + +/* [Beschreibung] + + Liefert des aus dem Header gelesene Tag f"ur den Gesamt-Record. +*/ + +{ + return _nRecordTag; +} + +//------------------------------------------------------------------------- + +inline BYTE SfxSingleRecordReader::GetVersion() const + +/* [Beschreibung] + + Liefert die Version des aus dem Stream gelesenen Records. +*/ + +{ + return _nRecordVer; +} + +//------------------------------------------------------------------------- + +inline FASTBOOL SfxSingleRecordReader::HasVersion( USHORT nVersion ) const + +/* [Beschreibung] + + Stellt fest, ob der aus dem Stream gelese Record in der Version + 'nVersion' oder h"oher vorliegt. +*/ + +{ + return _nRecordVer >= nVersion; +} + +//========================================================================= + +inline SfxMultiFixRecordWriter::~SfxMultiFixRecordWriter() + +/* [Beschreibung] + + Der Dtor der Klasse <SfxMultiFixRecordWriter> schlie\st den Record + automatisch, falls <SfxMutiFixRecordWriter::Close()> nicht bereits + explizit gerufen wurde. +*/ + +{ + // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden + if ( !_bHeaderOk ) + Close(); +} + +//------------------------------------------------------------------------- + +inline void SfxMultiFixRecordWriter::NewContent() + +/* [Beschreibung] + + Mit dieser Methode wird in den Record ein neuer Content eingef"ugt. + Jeder, auch der 1. Record mu\s durch Aufruf dieser Methode eingeleitet + werden. +*/ + +{ + #ifdef DBG_UTIL + ULONG nOldStartPos; + // Startposition des aktuellen Contents merken - Achtung Subklassen! + nOldStartPos = _nContentStartPos; + #endif + _nContentStartPos = _pStream->Tell(); + +#ifdef DBG_UTIL + // ist ein vorhergehender Content vorhanden? + if ( _nContentCount ) + { + // pr"ufen, ob der vorhergehende die Soll-Gr"o\se eingehalten hat + DBG_ASSERT( _nContentStartPos - nOldStartPos == _nContentSize, + "wrong content size detected" ); + } +#endif + + // Anzahl mitz"ahlen + ++_nContentCount; +} + +//========================================================================= + +inline SfxMultiMixRecordWriter::SfxMultiMixRecordWriter +( + SvStream* pStream, // Stream, in dem der Record angelegt wird + USHORT nRecordTag, // Gesamt-Record-Art-Kennung + BYTE nRecordVer // Gesamt-Record-Versions-Kennung +) + +/* [Beschreibung] + + Legt in 'pStream' einen 'SfxMultiMixRecord' an, f"ur dessen Contents + je eine separate Kennung f"ur Art (Tag) und Version gespeichert wird. + Die Gr"o\sen der einzelnen Contents werden automatisch ermittelt. +*/ + +: SfxMultiVarRecordWriter( SFX_REC_TYPE_MIXTAGS, + pStream, nRecordTag, nRecordVer ) +{ +} + +//========================================================================= + +inline void SfxMultiFixRecordWriter::Reset() +{ + _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI + + SFX_REC_HEADERSIZE_SINGLE + + SFX_REC_HEADERSIZE_MULTI ); + _bHeaderOk = FALSE; +} + +//========================================================================= + +inline UINT16 SfxMultiRecordReader::GetContentTag() + +/* [Beschreibung] + + Diese Methode liefert die Art-Kennung des zuletzt mit der Methode + <SfxMultiRecordReder::GetContent()> ge"offneten Contents. +*/ + +{ + return _nContentTag; +} + +//------------------------------------------------------------------------- + +inline BYTE SfxMultiRecordReader::GetContentVersion() const + +/* [Beschreibung] + + Diese Methode liefert die Version-Kennung des zuletzt mit der Methode + <SfxMultiRecordReder::GetContent()> ge"offneten Contents. +*/ + +{ + return _nContentVer; +} + +//------------------------------------------------------------------------- + +inline FASTBOOL SfxMultiRecordReader::HasContentVersion( USHORT nVersion ) const + +/* [Beschreibung] + + Diese Methode stellt fest, ob die Version 'nVersion' in der Version des + zuletzt mit der Methode <SfxMultiRecordReder::GetContent()> ge"offneten + Contents enthalten ist. +*/ + +{ + return _nContentVer >= nVersion; +} + +//------------------------------------------------------------------------- + +inline UINT32 SfxMultiRecordReader::ContentCount() const + +/* [Beschreibung] + + Diese Methode liefert die Anzahl im Record befindlichen Contents. +*/ + +{ + return _nContentCount; +} + +#endif + diff --git a/svl/inc/svl/flagitem.hxx b/svl/inc/svl/flagitem.hxx new file mode 100644 index 000000000000..5298bbd1678b --- /dev/null +++ b/svl/inc/svl/flagitem.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * 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: flagitem.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 _SFXFLAGITEM_HXX +#define _SFXFLAGITEM_HXX + +#include "svtools/svtdllapi.h" +#include <tools/solar.h> +#include <tools/rtti.hxx> +#include <svtools/poolitem.hxx> + +class SvStream; + +extern USHORT nSfxFlagVal[16]; + +// ----------------------------------------------------------------------- + +DBG_NAMEEX_VISIBILITY(SfxFlagItem, SVT_DLLPUBLIC) + +class SVT_DLLPUBLIC SfxFlagItem: public SfxPoolItem +{ + USHORT nVal; + +public: + TYPEINFO(); + + SfxFlagItem( USHORT nWhich = 0, USHORT nValue = 0 ); + SfxFlagItem( USHORT nWhich, SvStream & ); + SfxFlagItem( const SfxFlagItem& ); + + ~SfxFlagItem() { + DBG_DTOR(SfxFlagItem, 0); } + + virtual BYTE GetFlagCount() const; + virtual XubString GetFlagText( BYTE nFlag ) const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + USHORT GetValue() const { return nVal; } + void SetValue( USHORT nNewVal ) { + DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); + nVal = nNewVal; + } + int GetFlag( BYTE nFlag ) const { + return ( (nVal & nSfxFlagVal[nFlag]) != 0 ); } + void SetFlag( BYTE nFlag, int bVal ); +}; + +#endif diff --git a/svl/inc/svl/frqitem.hxx b/svl/inc/svl/frqitem.hxx new file mode 100644 index 000000000000..11b2d31a1123 --- /dev/null +++ b/svl/inc/svl/frqitem.hxx @@ -0,0 +1,178 @@ +/************************************************************************* + * + * 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: frqitem.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 _FRQITEM_HXX +#define _FRQITEM_HXX + +#include <tools/rtti.hxx> +#include <tools/time.hxx> +#include <tools/datetime.hxx> +#include <tools/string.hxx> + +#include <svtools/poolitem.hxx> + +class SvStream; + +DBG_NAMEEX(SfxFrequencyItem) + +// class SfxFrequencyItem ------------------------------------------------- + +/////////////////////////////////////////////////////////////////////////////// +/* +FRQ_DAILY + * jeden X'ten Tag + nInterval1 = 1 .. 999 + + * jeden Wochentag + nInterval1 = USHRT_MAX + +FRQ_WEEKLY + + wiederhole jede X'te Woche + nInterval1 = 1 .. 99 + + + an SU, MO, TU, WE, TH, FR, SA + nInterval2 = WD_SUNDAY | WD_MONDAY | WD_TUESDAY | WD_WEDNESDAY | + WD_THURSDAY | WD_FRIDAY | WD_SATURDAY + +FRQ_MONTHLY_DAILY + * jeden X'ten Tag von jedem X'ten Monat + nInterval1 = 1 .. 31 + nInterval2 = 1 .. 6 + +FRQ_MONTHLY_LOGIC + * jeden ersten, zweiten, dritten, vierten oder letzten Wochentag jeden X'ten Monats + nInterval1 = 0 .. 4 + nInterval2 = WD_SUNDAY | WD_MONDAY | WD_TUESDAY | WD_WEDNESDAY | + WD_THURSDAY | WD_FRIDAY | WD_SATURDAY + nInterval3 = 1 .. 6 + +=============================================================================== + +FRQ_TIME_AT + * Update um Uhrzeit + nTime1 = 00:00:00 - 24:00:00 + +FRQ_TIME_REPEAT + * Wiederhole alle X Stunden + nTInterval1 = 1 .. 8 + + zwischen Uhrzeit 1 und 2 + nTime1 = 00:00:00 - 24:00:00 + nTime2 = 00:00:00 - 24:00:00 + +*/ +/////////////////////////////////////////////////////////////////////////////// + +enum FrequencyMode +{ + FRQ_DAILY = 1, + FRQ_WEEKLY = 2, + FRQ_MONTHLY_DAILY = 3, + FRQ_MONTHLY_LOGIC = 4 +}; + +enum FrequencyTimeMode +{ + FRQ_TIME_AT = 1, + FRQ_TIME_REPEAT = 2, + FRQ_TIME_REPEAT_RANGE = 3 +}; + +#define WD_SUNDAY 0x0001 +#define WD_MONDAY 0x0002 +#define WD_TUESDAY 0x0004 +#define WD_WEDNESDAY 0x0008 +#define WD_THURSDAY 0x0010 +#define WD_FRIDAY 0x0020 +#define WD_SATURDAY 0x0040 + +class SfxFrequencyItem : public SfxPoolItem +{ +private: + FrequencyMode eFrqMode; + FrequencyTimeMode eFrqTimeMode; + + USHORT nDInterval1; + USHORT nDInterval2; + USHORT nDInterval3; + + USHORT nTInterval1; + Time aTime1; + Time aTime2; + + BOOL bMissingDate; + DateTime aMissingDate; + + Time _CalcTime( BOOL bForToday ) const; +public: + TYPEINFO(); + + SfxFrequencyItem( const SfxFrequencyItem& rCpy ); + SfxFrequencyItem( USHORT nWhich ); + SfxFrequencyItem( USHORT nWhich, FrequencyMode eMode, FrequencyTimeMode eTMode, + USHORT nDI1, USHORT nDI2, USHORT nDI3, USHORT nTI1, + const Time& rT1, const Time& rT2 ); + ~SfxFrequencyItem() { DBG_DTOR(SfxFrequencyItem, 0); } + + virtual int operator==( const SfxPoolItem& ) const; + using SfxPoolItem::Compare; + virtual int Compare( const SfxPoolItem &rWith ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, XubString &rText, + const IntlWrapper * = 0 ) const; + + DateTime CalcNextTick( const DateTime& rNow, BOOL bFirst = FALSE ); + + BOOL HasMissingDate() const { return bMissingDate; } + DateTime GetMissingDate() const { return aMissingDate; } + + FrequencyMode GetFrequencyMode() const { return eFrqMode; } + FrequencyTimeMode GetFrequencyTimeMode() const { return eFrqTimeMode; } + USHORT GetDInterval_1() const { return nDInterval1; } + USHORT GetDInterval_2() const { return nDInterval2; } + USHORT GetDInterval_3() const { return nDInterval3; } + USHORT GetTInterval_1() const { return nTInterval1; } + const Time& GetTime_1() const { return aTime1; } + const Time& GetTime_2() const { return aTime2; } + + void SetFrequencyMode(FrequencyMode eNew) { eFrqMode = eNew; } + void SetFrequencyTimeMode(FrequencyTimeMode eNew){ eFrqTimeMode = eNew; } + void SetDInterval_1(USHORT nNew) { nDInterval1 = nNew; } + void SetDInterval_2(USHORT nNew) { nDInterval2 = nNew; } + void SetDInterval_3(USHORT nNew) { nDInterval3 = nNew; } + void SetTInterval_1(USHORT nNew) { nTInterval1 = nNew; } + void SetTime_1(const Time& rNew) { aTime1 = rNew; } + void SetTime_2(const Time& rNew) { aTime2 = rNew; } +}; + +#endif + diff --git a/svl/inc/svl/globalnameitem.hxx b/svl/inc/svl/globalnameitem.hxx new file mode 100644 index 000000000000..f19ea1dd8457 --- /dev/null +++ b/svl/inc/svl/globalnameitem.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * 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: globalnameitem.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 _GLOBALNAMEITEM_HXX +#define _GLOBALNAMEITEM_HXX + +#include "svtools/svtdllapi.h" +#include <tools/solar.h> +#include <tools/rtti.hxx> +#include <tools/globname.hxx> +#include <svtools/poolitem.hxx> + +// ----------------------------------------------------------------------- + +class SVT_DLLPUBLIC SfxGlobalNameItem: public SfxPoolItem +{ + SvGlobalName m_aName; + +public: + TYPEINFO(); + SfxGlobalNameItem(); + SfxGlobalNameItem( USHORT nWhich, const SvGlobalName& ); + ~SfxGlobalNameItem(); + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + SvGlobalName GetValue() const { return m_aName; } + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; +}; + +#endif + diff --git a/svl/inc/svl/hint.hxx b/svl/inc/svl/hint.hxx new file mode 100644 index 000000000000..9417b2bc1702 --- /dev/null +++ b/svl/inc/svl/hint.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * 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: hint.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 _SFXHINT_HXX +#define _SFXHINT_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> + +class SVL_DLLPUBLIC SfxHint +{ +public: + TYPEINFO(); + + virtual ~SfxHint(); +}; + +//-------------------------------------------------------------------- + +#define DECL_PTRHINT(Visibility, Name, Type) \ + class Visibility Name: public SfxHint \ + { \ + Type* pObj; \ + BOOL bIsOwner; \ + \ + public: \ + TYPEINFO(); \ + Name( Type* Object, BOOL bOwnedByHint = FALSE ); \ + ~Name(); \ + \ + Type* GetObject() const { return pObj; } \ + BOOL IsOwner() const { return bIsOwner; } \ + } + +#define IMPL_PTRHINT_AUTODELETE(Name, Type) \ + TYPEINIT1(Name, SfxHint); \ + Name::Name( Type* pObject, BOOL bOwnedByHint ) \ + { pObj = pObject; bIsOwner = bOwnedByHint; } \ + Name::~Name() { if ( bIsOwner ) delete pObj; } + +#define IMPL_PTRHINT(Name, Type) \ + TYPEINIT1(Name, SfxHint); \ + Name::Name( Type* pObject, BOOL bOwnedByHint ) \ + { pObj = pObject; bIsOwner = bOwnedByHint; } \ + Name::~Name() {} + + +#endif + diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx new file mode 100644 index 000000000000..354680a86f30 --- /dev/null +++ b/svl/inc/svl/httpcook.hxx @@ -0,0 +1,155 @@ +/************************************************************************* + * + * 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: httpcook.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 SVTOOLS_HTTPCOOK_HXX +#define SVTOOLS_HTTPCOOK_HXX + +#include <tools/datetime.hxx> +#include <tools/stream.hxx> +#include <tools/string.hxx> +#include <svtools/poolitem.hxx> + +/*======================================================================= + * + *=====================================================================*/ +#define CNTHTTP_COOKIE_FLAG_SECURE 0x01 + +#define CNTHTTP_COOKIE_POLICY_INTERACTIVE 0x00 +#define CNTHTTP_COOKIE_POLICY_ACCEPTED 0x01 +#define CNTHTTP_COOKIE_POLICY_BANNED 0x02 + +#define CNTHTTP_COOKIE_DOMAIN_POLICY 0x10 + +#define CNTHTTP_COOKIE_DOMAIN_ACCEPTED \ + (CNTHTTP_COOKIE_DOMAIN_POLICY | CNTHTTP_COOKIE_POLICY_ACCEPTED) +#define CNTHTTP_COOKIE_DOMAIN_BANNED \ + (CNTHTTP_COOKIE_DOMAIN_POLICY | CNTHTTP_COOKIE_POLICY_BANNED) + +/*======================================================================= + * + * CntHTTPCookie. + * + *=====================================================================*/ +struct CntHTTPCookie +{ + String m_aName; + String m_aValue; + String m_aDomain; + String m_aPath; + DateTime m_aExpires; + USHORT m_nFlags; + USHORT m_nPolicy; + + CntHTTPCookie (void) + : m_aExpires (Date(0), Time(0)), + m_nFlags (0), + m_nPolicy (CNTHTTP_COOKIE_POLICY_INTERACTIVE) + {} + + BOOL replaces (const CntHTTPCookie& rOther) const + { + return ((m_aDomain == rOther.m_aDomain) && + (m_aPath == rOther.m_aPath ) && + (m_aName == rOther.m_aName ) ); + } + + BOOL operator== (const CntHTTPCookie& rOther) const + { + return ((m_aName == rOther.m_aName ) && + (m_aValue == rOther.m_aValue ) && + (m_aDomain == rOther.m_aDomain ) && + (m_aPath == rOther.m_aPath ) && + (m_aExpires == rOther.m_aExpires) && + (m_nFlags == rOther.m_nFlags ) && + (m_nPolicy == rOther.m_nPolicy ) ); + } + + void write (SvStream& rStrm) const + { + SfxPoolItem::writeUnicodeString(rStrm, m_aName); + SfxPoolItem::writeUnicodeString(rStrm, m_aValue); + SfxPoolItem::writeUnicodeString(rStrm, m_aDomain); + SfxPoolItem::writeUnicodeString(rStrm, m_aPath); + + rStrm << m_aExpires.GetDate(); + rStrm << m_aExpires.GetTime(); + + rStrm << m_nFlags; + rStrm << m_nPolicy; + } + + void read (SvStream& rStrm, bool bUnicode) + { + SfxPoolItem::readUnicodeString(rStrm, m_aName, bUnicode); + SfxPoolItem::readUnicodeString(rStrm, m_aValue, bUnicode); + SfxPoolItem::readUnicodeString(rStrm, m_aDomain, bUnicode); + SfxPoolItem::readUnicodeString(rStrm, m_aPath, bUnicode); + + sal_uInt32 nValue = 0; + rStrm >> nValue; + m_aExpires.SetDate (nValue); + rStrm >> nValue; + m_aExpires.SetTime (nValue); + + rStrm >> m_nFlags; + rStrm >> m_nPolicy; + } +}; + +/*======================================================================= + * + * CntHTTPCookieRequest. + * + *=====================================================================*/ +enum CntHTTPCookieRequestType +{ + CNTHTTP_COOKIE_REQUEST_RECV = 0, + CNTHTTP_COOKIE_REQUEST_SEND +}; + +struct CntHTTPCookieRequest +{ + const String& m_rURL; + List& m_rCookieList; + CntHTTPCookieRequestType m_eType; + USHORT m_nRet; + + CntHTTPCookieRequest ( + const String& rURL, + List& rCookieList, + CntHTTPCookieRequestType eType) + : m_rURL (rURL), + m_rCookieList (rCookieList), + m_eType(eType), + m_nRet (CNTHTTP_COOKIE_POLICY_BANNED) {} +}; + +#endif // SVTOOLS_HTTPCOOK_HXX + diff --git a/svl/inc/svl/ilstitem.hxx b/svl/inc/svl/ilstitem.hxx new file mode 100644 index 000000000000..0bc76f1d0627 --- /dev/null +++ b/svl/inc/svl/ilstitem.hxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * 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: ilstitem.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 _SFXILSTITEM_HXX +#define _SFXILSTITEM_HXX + +#include "svtools/svldllapi.h" +#include <svtools/poolitem.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +class SvULongs; + +class SVL_DLLPUBLIC SfxIntegerListItem : public SfxPoolItem +{ + ::com::sun::star::uno::Sequence < sal_Int32 > m_aList; + +public: + TYPEINFO(); + + SfxIntegerListItem(); + SfxIntegerListItem( USHORT nWhich, const SvULongs& rList ); + SfxIntegerListItem( const SfxIntegerListItem& rItem ); + ~SfxIntegerListItem(); + + ::com::sun::star::uno::Sequence < sal_Int32 > GetSequence() + { return m_aList; } + ::com::sun::star::uno::Sequence < sal_Int32 > GetConstSequence() const + { return SAL_CONST_CAST(SfxIntegerListItem *, this)->GetSequence(); } + + void GetList( SvULongs& rList ) const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; +}; + +#endif // _SFXINTITEM_HXX + diff --git a/svl/inc/svl/imageitm.hxx b/svl/inc/svl/imageitm.hxx new file mode 100644 index 000000000000..e0151729c2e0 --- /dev/null +++ b/svl/inc/svl/imageitm.hxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * 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: imageitm.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 _SVT_IMAGEITM_HXX +#define _SVT_IMAGEITM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/intitem.hxx> + +class String; + +struct SfxImageItem_Impl; +class SVT_DLLPUBLIC SfxImageItem : public SfxInt16Item +{ + SfxImageItem_Impl* pImp; +public: + TYPEINFO(); + SfxImageItem( USHORT nWhich = 0, UINT16 nImage = 0 ); + SfxImageItem( USHORT nWhich, const String& rURL ); + SfxImageItem( const SfxImageItem& ); + virtual ~SfxImageItem(); + + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + virtual int operator==( const SfxPoolItem& ) const; + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + void SetRotation( long nValue ); + long GetRotation() const; + void SetMirrored( BOOL bSet ); + BOOL IsMirrored() const; + String GetURL() const; +}; + +#endif // _SFX_IMAGEITM_HXX diff --git a/svl/inc/svl/inethist.hxx b/svl/inc/svl/inethist.hxx new file mode 100644 index 000000000000..ad64e1131bf3 --- /dev/null +++ b/svl/inc/svl/inethist.hxx @@ -0,0 +1,135 @@ +/************************************************************************* + * + * 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: inethist.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 _INETHIST_HXX +#define _INETHIST_HXX + +#include "svtools/svldllapi.h" +#include <tools/solar.h> +#include <tools/string.hxx> +#include <tools/urlobj.hxx> +#include <svtools/brdcst.hxx> +#include <svtools/hint.hxx> + +/*======================================================================== + * + * INetURLHistory interface. + * + *=======================================================================*/ +class INetURLHistory_Impl; +class INetURLHistory : public SfxBroadcaster +{ + struct StaticInstance + { + INetURLHistory * operator()(); + }; + friend INetURLHistory * StaticInstance::operator()(); + + /** Representation. + */ + INetURLHistory_Impl *m_pImpl; + + /** Construction/Destruction. + */ + INetURLHistory (void); + virtual ~INetURLHistory (void); + + /** Implementation. + */ + static void NormalizeUrl_Impl (INetURLObject &rUrl); + + SVL_DLLPUBLIC void PutUrl_Impl (const INetURLObject &rUrl); + SVL_DLLPUBLIC BOOL QueryUrl_Impl (const INetURLObject &rUrl); + + /** Not implemented. + */ + INetURLHistory (const INetURLHistory&); + INetURLHistory& operator= (const INetURLHistory&); + +public: + /** GetOrCreate. + */ + SVL_DLLPUBLIC static INetURLHistory* GetOrCreate (void); + + /** QueryProtocol. + */ + BOOL QueryProtocol (INetProtocol eProto) const + { + return ((eProto == INET_PROT_FILE ) || + (eProto == INET_PROT_FTP ) || + (eProto == INET_PROT_HTTP ) || + (eProto == INET_PROT_HTTPS) ); + } + + /** QueryUrl. + */ + BOOL QueryUrl (const INetURLObject &rUrl) + { + if (QueryProtocol (rUrl.GetProtocol())) + return QueryUrl_Impl (rUrl); + else + return FALSE; + } + + BOOL QueryUrl (const String &rUrl) + { + INetProtocol eProto = + INetURLObject::CompareProtocolScheme (rUrl); + if (QueryProtocol (eProto)) + return QueryUrl_Impl (INetURLObject (rUrl)); + else + return FALSE; + } + + /** PutUrl. + */ + void PutUrl (const INetURLObject &rUrl) + { + if (QueryProtocol (rUrl.GetProtocol())) + PutUrl_Impl (rUrl); + } + + void PutUrl (const String &rUrl) + { + INetProtocol eProto = + INetURLObject::CompareProtocolScheme (rUrl); + if (QueryProtocol (eProto)) + PutUrl_Impl (INetURLObject (rUrl)); + } +}; + +/*======================================================================== + * + * INetURLHistoryHint (broadcasted from PutUrl()). + * + *=======================================================================*/ +DECL_PTRHINT (SVL_DLLPUBLIC, INetURLHistoryHint, const INetURLObject); + +#endif /* _INETHIST_HXX */ + diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx new file mode 100644 index 000000000000..2d9f0ba8694c --- /dev/null +++ b/svl/inc/svl/inettype.hxx @@ -0,0 +1,479 @@ +/************************************************************************* + * + * 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: inettype.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 _INETTYPE_HXX +#define _INETTYPE_HXX + +#include "svtools/svldllapi.h" +#include <tools/inetmime.hxx> +#include <com/sun/star/lang/Locale.hpp> + +//============================================================================ +/** Definitions for frequently used media type names. + */ +#define CONTENT_TYPE_STR_APP_OCTSTREAM "application/octet-stream" +#define CONTENT_TYPE_STR_APP_PDF "application/pdf" +#define CONTENT_TYPE_STR_APP_RTF "application/rtf" +#define CONTENT_TYPE_STR_APP_VND_CALC "application/vnd.stardivision.calc" +#define CONTENT_TYPE_STR_APP_VND_CHART "application/vnd.stardivision.chart" +#define CONTENT_TYPE_STR_APP_VND_DRAW "application/vnd.stardivision.draw" +#define CONTENT_TYPE_STR_APP_VND_IMAGE "application/vnd.stardivision.image" +#define CONTENT_TYPE_STR_APP_VND_IMPRESSPACKED \ + "application/vnd.stardivision.impress-packed" +#define CONTENT_TYPE_STR_APP_VND_IMPRESS \ + "application/vnd.stardivision.impress" +#define CONTENT_TYPE_STR_APP_VND_MAIL "application/vnd.stardivision.mail" +#define CONTENT_TYPE_STR_APP_VND_MATH "application/vnd.stardivision.math" +#define CONTENT_TYPE_STR_APP_VND_NEWS "application/vnd.stardivision.news" +#define CONTENT_TYPE_STR_APP_VND_OUTTRAY \ + "application/vnd.stardivision.outtray" +#define CONTENT_TYPE_STR_APP_VND_TEMPLATE \ + "application/vnd.stardivision.template" +#define CONTENT_TYPE_STR_APP_VND_WRITER_GLOBAL \ + "application/vnd.stardivision.writer-global" +#define CONTENT_TYPE_STR_APP_VND_WRITER_WEB \ + "application/vnd.stardivision.writer-web" +#define CONTENT_TYPE_STR_APP_VND_WRITER "application/vnd.stardivision.writer" +#define CONTENT_TYPE_STR_APP_FRAMESET "application/x-frameset" +#define CONTENT_TYPE_STR_APP_GALLERY_THEME "application/x-gallery-theme" +#define CONTENT_TYPE_STR_APP_GALLERY "application/x-gallery" +#define CONTENT_TYPE_STR_APP_JAR "application/x-jar" +#define CONTENT_TYPE_STR_APP_MACRO "application/x-macro" +#define CONTENT_TYPE_STR_APP_MSEXCEL_TEMPL "application/x-msexcel-template" +#define CONTENT_TYPE_STR_APP_MSEXCEL "application/x-msexcel" +#define CONTENT_TYPE_STR_APP_MSPPOINT_TEMPL "application/x-mspowerpoint-template" +#define CONTENT_TYPE_STR_APP_MSPPOINT "application/x-mspowerpoint" +#define CONTENT_TYPE_STR_APP_MSWORD_TEMPL "application/x-msword-template" +#define CONTENT_TYPE_STR_APP_MSWORD "application/x-msword" +#define CONTENT_TYPE_STR_APP_SCHEDULE_EVT "application/x-schedule-event" +#define CONTENT_TYPE_STR_APP_SCHEDULE_FEVT "application/x-schedule-form-event" +#define CONTENT_TYPE_STR_APP_SCHEDULE_FTASK "application/x-schedule-form-task" +#define CONTENT_TYPE_STR_APP_SCHEDULE_TASK "application/x-schedule-task" +#define CONTENT_TYPE_STR_APP_SCHEDULE_CMB "application/x-schedule" +#define CONTENT_TYPE_STR_APP_STARCALC "application/x-starcalc" +#define CONTENT_TYPE_STR_APP_STARCHART "application/x-starchart" +#define CONTENT_TYPE_STR_APP_STARDRAW "application/x-stardraw" +#define CONTENT_TYPE_STR_APP_STARHELP "application/x-starhelp" +#define CONTENT_TYPE_STR_APP_STARIMAGE "application/x-starimage" +#define CONTENT_TYPE_STR_APP_STARIMPRESS "application/x-starimpress" +#define CONTENT_TYPE_STR_APP_STARMAIL_SDM "application/x-starmail-sdm" +#define CONTENT_TYPE_STR_APP_STARMAIL_SMD "application/x-starmail-smd" +#define CONTENT_TYPE_STR_APP_STARMATH "application/x-starmath" +#define CONTENT_TYPE_STR_APP_STARWRITER_GLOB "application/x-starwriter-global" +#define CONTENT_TYPE_STR_APP_STARWRITER "application/x-starwriter" +#define CONTENT_TYPE_STR_APP_CDE_CALENDAR_APP "application/x-sun-ae-file" +#define CONTENT_TYPE_STR_APP_ZIP "application/x-zip-compressed" +#define CONTENT_TYPE_STR_AUDIO_AIFF "audio/aiff" +#define CONTENT_TYPE_STR_AUDIO_BASIC "audio/basic" +#define CONTENT_TYPE_STR_AUDIO_MIDI "audio/midi" +#define CONTENT_TYPE_STR_AUDIO_WAV "audio/wav" +#define CONTENT_TYPE_STR_X_CNT_DOCUMENT ".chaos/document" +#define CONTENT_TYPE_STR_X_CNT_FSYSBOX ".chaos/fsys-box" +#define CONTENT_TYPE_STR_X_CNT_CDROM_VOLUME ".chaos/fsys-cdrom-volume" +#define CONTENT_TYPE_STR_X_CNT_DISK_35 ".chaos/fsys-disk-35" +#define CONTENT_TYPE_STR_X_CNT_DISK_525 ".chaos/fsys-disk-525" +#define CONTENT_TYPE_STR_X_CNT_FSYSFILE ".chaos/fsys-file" +#define CONTENT_TYPE_STR_X_CNT_FIXED_VOLUME ".chaos/fsys-fixed-volume" +#define CONTENT_TYPE_STR_X_CNT_FSYSFOLDER ".chaos/fsys-folder" +#define CONTENT_TYPE_STR_X_CNT_RAM_VOLUME ".chaos/fsys-ram-volume" +#define CONTENT_TYPE_STR_X_CNT_REMOTE_VOLUME ".chaos/fsys-remote-volume" +#define CONTENT_TYPE_STR_X_CNT_REMOVEABLE_VOLUME \ + ".chaos/fsys-removeable-volume" +#define CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFILE ".chaos/fsys-special-file" +#define CONTENT_TYPE_STR_X_CNT_FSYSSPECIALFOLDER ".chaos/fsys-special-folder" +#define CONTENT_TYPE_STR_X_CNT_TAPEDRIVE ".chaos/fsys-tapedrive" +#define CONTENT_TYPE_STR_X_CNT_FSYSURLFILE ".chaos/fsys-urlfile" +#define CONTENT_TYPE_STR_X_CNT_FTPBOX ".chaos/ftp-box" +#define CONTENT_TYPE_STR_X_CNT_FTPFILE ".chaos/ftp-file" +#define CONTENT_TYPE_STR_X_CNT_FTPFOLDER ".chaos/ftp-folder" +#define CONTENT_TYPE_STR_X_CNT_FTPLINK ".chaos/ftp-link" +#define CONTENT_TYPE_STR_X_CNT_HTTPBOX ".chaos/http-box" +#define CONTENT_TYPE_STR_X_CNT_HTTPFILE ".chaos/http-file" +#define CONTENT_TYPE_STR_X_CNT_IMAPBOX ".chaos/imap-box" +#define CONTENT_TYPE_STR_X_CNT_IMAPFOLDER ".chaos/imap-folder" +#define CONTENT_TYPE_STR_X_CNT_MESSAGE ".chaos/message" +#define CONTENT_TYPE_STR_X_CNT_NEWSBOX ".chaos/news-box" +#define CONTENT_TYPE_STR_X_CNT_NEWSGROUP ".chaos/news-group" +#define CONTENT_TYPE_STR_X_CNT_OUTBOX ".chaos/out-box" +#define CONTENT_TYPE_STR_X_CNT_POP3BOX ".chaos/pop3-box" +#define CONTENT_TYPE_STR_X_CNT_PUBLISHBOX ".chaos/publish-box" +#define CONTENT_TYPE_STR_X_CNT_SEARCHBOX ".chaos/search-box" +#define CONTENT_TYPE_STR_X_CNT_SEPARATOR ".chaos/separator" +#define CONTENT_TYPE_STR_X_CNT_BOOKMARK ".chaos/subscribe-bookmark" +#define CONTENT_TYPE_STR_X_CNT_SUBSCRIBEBOX ".chaos/subscribe-box" +#define CONTENT_TYPE_STR_X_CNT_CDFITEM ".chaos/subscribe-cdf-item" +#define CONTENT_TYPE_STR_X_CNT_CDFSUB ".chaos/subscribe-cdf-sub" +#define CONTENT_TYPE_STR_X_CNT_CDF ".chaos/subscribe-cdf" +#define CONTENT_TYPE_STR_X_CNT_STARCHANNEL ".chaos/subscribe-sdc" +#define CONTENT_TYPE_STR_X_CNT_TRASHBOX ".chaos/trash-box" +#define CONTENT_TYPE_STR_X_CNT_TRASH ".chaos/trash-item" +#define CONTENT_TYPE_STR_X_CNT_VIMBBOARDBOX ".chaos/vim-bboardbox" +#define CONTENT_TYPE_STR_X_CNT_VIMBBOARD ".chaos/vim-bboard" +#define CONTENT_TYPE_STR_X_CNT_VIMBOX ".chaos/vim-box" +#define CONTENT_TYPE_STR_X_CNT_VIMINBOX ".chaos/vim-inbox" +#define CONTENT_TYPE_STR_IMAGE_GENERIC "image/generic" +#define CONTENT_TYPE_STR_IMAGE_GIF "image/gif" +#define CONTENT_TYPE_STR_IMAGE_JPEG "image/jpeg" +#define CONTENT_TYPE_STR_IMAGE_PCX "image/pcx" +#define CONTENT_TYPE_STR_IMAGE_PNG "image/png" +#define CONTENT_TYPE_STR_IMAGE_TIFF "image/tiff" +#define CONTENT_TYPE_STR_IMAGE_BMP "image/x-MS-bmp" +#define CONTENT_TYPE_STR_INET_MSG_RFC822 "message/rfc822" +#define CONTENT_TYPE_STR_INET_MULTI_ALTERNATIVE "multipart/alternative" +#define CONTENT_TYPE_STR_INET_MULTI_DIGEST "multipart/digest" +#define CONTENT_TYPE_STR_INET_MULTI_MIXED "multipart/mixed" +#define CONTENT_TYPE_STR_INET_MULTI_PARALLEL "multipart/parallel" +#define CONTENT_TYPE_STR_INET_MULTI_RELATED "multipart/related" +#define CONTENT_TYPE_STR_TEXT_ICALENDAR "text/calendar" +#define CONTENT_TYPE_STR_TEXT_HTML "text/html" +#define CONTENT_TYPE_STR_TEXT_PLAIN "text/plain" +#define CONTENT_TYPE_STR_TEXT_XMLICALENDAR "text/x-icalxml" +#define CONTENT_TYPE_STR_TEXT_URL "text/x-url" +#define CONTENT_TYPE_STR_TEXT_VCALENDAR "text/x-vCalendar" +#define CONTENT_TYPE_STR_TEXT_VCARD "text/x-vCard" +#define CONTENT_TYPE_STR_VIDEO_VDO "video/vdo" +#define CONTENT_TYPE_STR_VIDEO_MSVIDEO "video/x-msvideo" +#define CONTENT_TYPE_STR_X_STARMAIL "x-starmail" +#define CONTENT_TYPE_STR_X_VRML "x-world/x-vrml" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER "application/vnd.sun.xml.writer" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_CALC "application/vnd.sun.xml.calc" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESS "application/vnd.sun.xml.impress" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_DRAW "application/vnd.sun.xml.draw" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_CHART "application/vnd.sun.xml.chart" + +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_MATH "application/vnd.sun.xml.math" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER_GLOBAL "application/vnd.sun.xml.writer-global" +#define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESSPACKED "application/vnd.sun.xml.impress-packed" + +//============================================================================ +/** Definitions for frequently used media type parameter names. + */ +#define INET_CONTENT_TYPE_PARAMETER_CHARSET "charset" + +//============================================================================ +/** Definitions for matching parts of URIs. + */ +#define INETTYPE_URL_PROT_COMPONENT ".component" +#define INETTYPE_URL_PROT_DATA "data" +#define INETTYPE_URL_PROT_FILE "file" +#define INETTYPE_URL_PROT_HTTP "http" +#define INETTYPE_URL_PROT_HTTPS "https" +#define INETTYPE_URL_PROT_MACRO "macro" +#define INETTYPE_URL_PROT_MAILTO "mailto" +#define INETTYPE_URL_PROT_PRIVATE "private" + +#define INETTYPE_URL_SUB_FACTORY "factory" +#define INETTYPE_URL_SUB_HELPID "helpid" + +#define INETTYPE_URL_SSUB_FRAMESET "frameset" +#define INETTYPE_URL_SSUB_SCALC "scalc" +#define INETTYPE_URL_SSUB_SCHART "schart" +#define INETTYPE_URL_SSUB_SDRAW "sdraw" +#define INETTYPE_URL_SSUB_SIMAGE "simage" +#define INETTYPE_URL_SSUB_SIMPRESS "simpress" +#define INETTYPE_URL_SSUB_SMATH "smath" +#define INETTYPE_URL_SSUB_SS "ss" +#define INETTYPE_URL_SSUB_SWRITER "swriter" + +#define INETTYPE_URL_SSSUB_GLOB "GlobalDocument" +#define INETTYPE_URL_SSSUB_WEB "web" + +#define INETTYPE_URL_SCHED_CMB "cmbview" +#define INETTYPE_URL_SCHED_FORM "formular" +#define INETTYPE_URL_SCHED_EVENT "type=event" +#define INETTYPE_URL_SCHED_TASK "type=task" + +//============================================================================ +enum INetContentType +{ + CONTENT_TYPE_UNKNOWN, + CONTENT_TYPE_APP_OCTSTREAM, + CONTENT_TYPE_APP_PDF, + CONTENT_TYPE_APP_RTF, + CONTENT_TYPE_APP_MSWORD, + CONTENT_TYPE_APP_MSWORD_TEMPL, + CONTENT_TYPE_APP_STARCALC, + CONTENT_TYPE_APP_STARCHART, + CONTENT_TYPE_APP_STARDRAW, + CONTENT_TYPE_APP_STARHELP, + CONTENT_TYPE_APP_STARIMAGE, + CONTENT_TYPE_APP_STARIMPRESS, + CONTENT_TYPE_APP_STARMATH, + CONTENT_TYPE_APP_STARWRITER, + CONTENT_TYPE_APP_ZIP, + CONTENT_TYPE_AUDIO_AIFF, + CONTENT_TYPE_AUDIO_BASIC, + CONTENT_TYPE_AUDIO_MIDI, + CONTENT_TYPE_AUDIO_WAV, + CONTENT_TYPE_IMAGE_GIF, + CONTENT_TYPE_IMAGE_JPEG, + CONTENT_TYPE_IMAGE_PCX, + CONTENT_TYPE_IMAGE_PNG, + CONTENT_TYPE_IMAGE_TIFF, + CONTENT_TYPE_IMAGE_BMP, + CONTENT_TYPE_TEXT_HTML, + CONTENT_TYPE_TEXT_PLAIN, + CONTENT_TYPE_TEXT_URL, + CONTENT_TYPE_TEXT_VCARD, + CONTENT_TYPE_VIDEO_VDO, + CONTENT_TYPE_VIDEO_MSVIDEO, + CONTENT_TYPE_X_CNT_MESSAGE, + CONTENT_TYPE_X_CNT_DOCUMENT, + CONTENT_TYPE_X_CNT_POP3BOX, + CONTENT_TYPE_X_CNT_IMAPBOX, + CONTENT_TYPE_X_CNT_IMAPFOLDER, + CONTENT_TYPE_X_CNT_VIMBOX, + CONTENT_TYPE_X_CNT_VIMINBOX, + CONTENT_TYPE_X_CNT_VIMBBOARDBOX, + CONTENT_TYPE_X_CNT_VIMBBOARD, + CONTENT_TYPE_X_CNT_NEWSBOX, + CONTENT_TYPE_X_CNT_NEWSGROUP, + CONTENT_TYPE_X_CNT_OUTBOX, + CONTENT_TYPE_X_CNT_FTPBOX, + CONTENT_TYPE_X_CNT_FTPFOLDER, + CONTENT_TYPE_X_CNT_FTPFILE, + CONTENT_TYPE_X_CNT_FTPLINK, + CONTENT_TYPE_X_CNT_HTTPBOX, + CONTENT_TYPE_X_CNT_FSYSBOX, + CONTENT_TYPE_X_CNT_FSYSFOLDER, + CONTENT_TYPE_X_CNT_FSYSFILE, + CONTENT_TYPE_X_CNT_FSYSURLFILE, + CONTENT_TYPE_X_CNT_PUBLISHBOX, + CONTENT_TYPE_X_CNT_SEARCHBOX, + CONTENT_TYPE_X_CNT_SUBSCRIBEBOX, + CONTENT_TYPE_X_CNT_BOOKMARK, + CONTENT_TYPE_X_CNT_CDF, + CONTENT_TYPE_X_CNT_CDFSUB, + CONTENT_TYPE_X_CNT_CDFITEM, + CONTENT_TYPE_X_CNT_TRASHBOX, + CONTENT_TYPE_X_CNT_TRASH, + CONTENT_TYPE_X_STARMAIL, + CONTENT_TYPE_X_VRML, + CONTENT_TYPE_X_CNT_REMOVEABLE_VOLUME, + CONTENT_TYPE_X_CNT_FIXED_VOLUME, + CONTENT_TYPE_X_CNT_REMOTE_VOLUME, + CONTENT_TYPE_X_CNT_RAM_VOLUME, + CONTENT_TYPE_X_CNT_CDROM_VOLUME, + CONTENT_TYPE_X_CNT_DISK_35, + CONTENT_TYPE_X_CNT_DISK_525, + CONTENT_TYPE_X_CNT_TAPEDRIVE, + CONTENT_TYPE_APP_GALLERY, + CONTENT_TYPE_APP_GALLERY_THEME, + CONTENT_TYPE_X_CNT_STARCHANNEL, + CONTENT_TYPE_X_CNT_SEPARATOR, + CONTENT_TYPE_APP_STARWRITER_GLOB, + CONTENT_TYPE_APP_STARMAIL_SDM, + CONTENT_TYPE_APP_STARMAIL_SMD, + CONTENT_TYPE_APP_VND_CALC, + CONTENT_TYPE_APP_VND_CHART, + CONTENT_TYPE_APP_VND_DRAW, + CONTENT_TYPE_APP_VND_IMAGE, + CONTENT_TYPE_APP_VND_IMPRESS, + CONTENT_TYPE_APP_VND_MAIL, + CONTENT_TYPE_APP_VND_MATH, + CONTENT_TYPE_APP_VND_WRITER, + CONTENT_TYPE_APP_VND_WRITER_GLOBAL, + CONTENT_TYPE_APP_VND_WRITER_WEB, + CONTENT_TYPE_APP_SCHEDULE, + CONTENT_TYPE_APP_SCHEDULE_EVT, + CONTENT_TYPE_APP_SCHEDULE_TASK, + CONTENT_TYPE_APP_SCHEDULE_FORM_EVT, + CONTENT_TYPE_APP_SCHEDULE_FORM_TASK, + CONTENT_TYPE_APP_FRAMESET, + CONTENT_TYPE_APP_MACRO, + CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER, + CONTENT_TYPE_X_CNT_FSYSSPECIALFILE, + CONTENT_TYPE_APP_VND_TEMPLATE, + CONTENT_TYPE_IMAGE_GENERIC, + CONTENT_TYPE_APP_VND_NEWS, + CONTENT_TYPE_APP_VND_OUTTRAY, + CONTENT_TYPE_X_CNT_HTTPFILE, + CONTENT_TYPE_APP_MSEXCEL, + CONTENT_TYPE_APP_MSEXCEL_TEMPL, + CONTENT_TYPE_APP_MSPPOINT, + CONTENT_TYPE_APP_MSPPOINT_TEMPL, + CONTENT_TYPE_TEXT_VCALENDAR, + CONTENT_TYPE_TEXT_ICALENDAR, + CONTENT_TYPE_TEXT_XMLICALENDAR, + CONTENT_TYPE_APP_CDE_CALENDAR_APP, + CONTENT_TYPE_INET_MESSAGE_RFC822, + CONTENT_TYPE_INET_MULTIPART_ALTERNATIVE, + CONTENT_TYPE_INET_MULTIPART_DIGEST, + CONTENT_TYPE_INET_MULTIPART_PARALLEL, + CONTENT_TYPE_INET_MULTIPART_RELATED, + CONTENT_TYPE_INET_MULTIPART_MIXED, + CONTENT_TYPE_APP_VND_IMPRESSPACKED, + CONTENT_TYPE_APP_JAR, + CONTENT_TYPE_APP_VND_SUN_XML_WRITER, + CONTENT_TYPE_APP_VND_SUN_XML_CALC, + CONTENT_TYPE_APP_VND_SUN_XML_IMPRESS, + CONTENT_TYPE_APP_VND_SUN_XML_DRAW, + CONTENT_TYPE_APP_VND_SUN_XML_CHART, + CONTENT_TYPE_APP_VND_SUN_XML_MATH, + CONTENT_TYPE_APP_VND_SUN_XML_WRITER_GLOBAL, + CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED, + CONTENT_TYPE_LAST = CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED +}; + +//============================================================================ +class SVL_DLLPUBLIC INetContentTypes +{ +public: + static void Uninitialize(); + + static INetContentType RegisterContentType(UniString const & rTypeName, + UniString const & + rPresentation, + UniString const * pExtension + = 0, + UniString const * + pSystemFileType = 0); + + static INetContentType GetContentType(UniString const & rTypeName); + + static UniString GetContentType(INetContentType eTypeID); + + static UniString GetPresentation(INetContentType eTypeID, + const ::com::sun::star::lang::Locale& aLocale); + + static UniString GetExtension(UniString const & rTypeName); + + static INetContentType GetContentType4Extension(UniString const & + rExtension); + + static INetContentType GetContentTypeFromURL(UniString const & rURL); + + static bool GetExtensionFromURL(UniString const & rURL, + UniString & rExtension); + + static INetContentType MapStringToContentType(UniString const & + rPresentation); + + /** Parse the body of an RFC 2045 Content-Type header field. + + @param rMediaType The body of the Content-Type header field. It must + be of the form + + token "/" token *(";" token "=" (token / quoted-string)) + + with intervening linear white space and comments (cf. RFCs 822, 2045). + The RFC 2231 extension are supported. The encoding of rMediaType + should be US-ASCII, but any values in the range 0x80--0xFF are + interpretet 'as appropriate.' + + @param rType Returns the type (the first of the above tokens), in US- + ASCII encoding and converted to lower case. + + @param rSubType Returns the sub type (the second of the above + tokens), in US-ASCII encoding and converted to lower case. + + @param rParameters If not null, returns the parameters as a list of + INetContentTypeParameters (the attributes are in US-ASCII encoding and + converted to lower case, the values are in Unicode encoding). If + null, only the syntax of the parameters is checked, but they are not + returned. + + @return True if the syntax of the field body is correct. If false is + returned, none of the output parameters will be modified! + */ + static bool parse(ByteString const & rMediaType, ByteString & rType, + ByteString & rSubType, + INetContentTypeParameterList * pParameters = 0); + + /** Parse the body of an RFC 2045 Content-Type header field. + + @param rMediaType The body of the Content-Type header field. It must + be of the form + + token "/" token *(";" token "=" (token / quoted-string)) + + with intervening linear white space and comments (cf. RFCs 822, 2045). + The RFC 2231 extension are supported. The encoding of rMediaType + should be US-ASCII, but any Unicode values in the range U+0080..U+FFFF + are interpretet 'as appropriate.' + + @param rType Returns the type (the first of the above tokens), in US- + ASCII encoding and converted to lower case. + + @param rSubType Returns the sub type (the second of the above + tokens), in US-ASCII encoding and converted to lower case. + + @param rParameters If not null, returns the parameters as a list of + INetContentTypeParameters (the attributes are in US-ASCII encoding and + converted to lower case, the values are in Unicode encoding). If + null, only the syntax of the parameters is checked, but they are not + returned. + + @return True if the syntax of the field body is correct. If false is + returned, none of the output parameters will be modified! + */ + static bool parse(UniString const & rMediaType, UniString & rType, + UniString & rSubType, + INetContentTypeParameterList * pParameters = 0); + + /** Append a parameter to the string representation of a MIME media type. + + @param rMediaType The string representation of a MIME media type. + + @param rAttribute The name of the parameter. Must be a valid RFC + 2045 token. + + @param rValue The value of the paramter. Must only consist of US- + ASCII characters. + + @return The string representation of rMediaType with the new + parameter appended. It is not checked whether a parameter with that + name already existed in rMediaType. + */ + static ByteString appendUSASCIIParameter(ByteString const & rMediaType, + ByteString const & rAttribute, + ByteString const & rValue); + + /** Append a parameter to the string representation of a MIME media type. + + @param rMediaType The string representation of a MIME media type. + + @param rAttribute The name of the parameter. Must be a valid RFC + 2045 token. + + @param rValue The value of the paramter. Must only consist of US- + ASCII characters. + + @return The string representation of rMediaType with the new + parameter appended. It is not checked whether a parameter with that + name already existed in rMediaType. + */ + static UniString appendUSASCIIParameter(UniString const & rMediaType, + UniString const & rAttribute, + UniString const & rValue); +}; + +#endif // _INETTYPE_HXX + diff --git a/svl/inc/svl/intitem.hxx b/svl/inc/svl/intitem.hxx new file mode 100644 index 000000000000..fe2a3543e630 --- /dev/null +++ b/svl/inc/svl/intitem.hxx @@ -0,0 +1,176 @@ +/************************************************************************* + * + * 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: intitem.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 _SFXINTITEM_HXX +#define _SFXINTITEM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/cintitem.hxx> + +//============================================================================ +class SVT_DLLPUBLIC SfxByteItem: public CntByteItem +{ +public: + TYPEINFO(); + + SfxByteItem(USHORT which = 0, BYTE nValue = 0): + CntByteItem(which, nValue) {} + + SfxByteItem(USHORT which, SvStream & rStream): + CntByteItem(which, rStream) {} + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const + { return new SfxByteItem(*this); } +}; + +//============================================================================ +DBG_NAMEEX_VISIBILITY(SfxInt16Item, SVT_DLLPUBLIC) + +class SVT_DLLPUBLIC SfxInt16Item: public SfxPoolItem +{ + INT16 m_nValue; + +public: + TYPEINFO(); + + SfxInt16Item(USHORT which = 0, INT16 nTheValue = 0): + SfxPoolItem(which), m_nValue(nTheValue) + { DBG_CTOR(SfxInt16Item, 0); } + + SfxInt16Item(USHORT nWhich, SvStream & rStream); + + SfxInt16Item(const SfxInt16Item & rItem): + SfxPoolItem(rItem), m_nValue(rItem.m_nValue) + { DBG_CTOR(SfxInt16Item, 0); } + + virtual ~SfxInt16Item() { DBG_DTOR(SfxInt16Item, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual INT16 GetMin() const; + + virtual INT16 GetMax() const; + + virtual SfxFieldUnit GetUnit() const; + + INT16 GetValue() const { return m_nValue; } + + inline void SetValue(INT16 nTheValue); +}; + +inline void SfxInt16Item::SetValue(INT16 nTheValue) +{ + DBG_ASSERT(GetRefCount() == 0, "SfxInt16Item::SetValue(); Pooled item"); + m_nValue = nTheValue; +} + +//============================================================================ +class SVT_DLLPUBLIC SfxUInt16Item: public CntUInt16Item +{ +public: + TYPEINFO(); + + SfxUInt16Item(USHORT which = 0, UINT16 nValue = 0): + CntUInt16Item(which, nValue) {} + + SfxUInt16Item(USHORT which, SvStream & rStream): + CntUInt16Item(which, rStream) {} + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + { return new SfxUInt16Item(Which(), rStream); } + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const + { return new SfxUInt16Item(*this); } +}; + +//============================================================================ +class SVT_DLLPUBLIC SfxInt32Item: public CntInt32Item +{ +public: + TYPEINFO(); + + SfxInt32Item(USHORT which = 0, INT32 nValue = 0): + CntInt32Item(which, nValue) {} + + SfxInt32Item(USHORT which, SvStream & rStream): + CntInt32Item(which, rStream) {} + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + { return new SfxInt32Item(Which(), rStream); } + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const + { return new SfxInt32Item(*this); } + +}; + +//============================================================================ +class SVT_DLLPUBLIC SfxUInt32Item: public CntUInt32Item +{ +public: + TYPEINFO(); + + SfxUInt32Item(USHORT which = 0, UINT32 nValue = 0): + CntUInt32Item(which, nValue) {} + + SfxUInt32Item(USHORT which, SvStream & rStream): + CntUInt32Item(which, rStream) {} + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const + { return new SfxUInt32Item(Which(), rStream); } + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const + { return new SfxUInt32Item(*this); } +}; + +#endif // _SFXINTITEM_HXX + diff --git a/svl/inc/svl/isethint.hxx b/svl/inc/svl/isethint.hxx new file mode 100644 index 000000000000..d30fc4a65b27 --- /dev/null +++ b/svl/inc/svl/isethint.hxx @@ -0,0 +1,58 @@ +/************************************************************************* + * + * 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: isethint.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 _SFXISETHINT_HXX +#define _SFXISETHINT_HXX + +#include "svtools/svldllapi.h" + +#ifndef _HINT_HXX +#include <svtools/hint.hxx> +#endif + +class SfxItemSet; + +//-------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxItemSetHint: public SfxHint +{ + SfxItemSet* _pItemSet; + +public: + TYPEINFO(); + + SfxItemSetHint( SfxItemSet *pItemSet ); + SfxItemSetHint( const SfxItemSet &rItemSet ); + virtual ~SfxItemSetHint(); + + const SfxItemSet& GetItemSet() const { return *_pItemSet; } +}; + +#endif + diff --git a/svl/inc/svl/itemiter.hxx b/svl/inc/svl/itemiter.hxx new file mode 100644 index 000000000000..6a9b5e212720 --- /dev/null +++ b/svl/inc/svl/itemiter.hxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * 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: itemiter.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 _SFXITEMITER_HXX +#define _SFXITEMITER_HXX + +#include "svtools/svldllapi.h" +#include <tools/solar.h> +#include <svtools/itemset.hxx> + +class SfxPoolItem; +class SfxItemSet; +class SfxItemPool; + +class SVL_DLLPUBLIC SfxItemIter +{ + // Item-Feld - Start & Ende + const SfxItemSet& _rSet; + USHORT _nStt, _nEnd, _nAkt; + +public: + SfxItemIter( const SfxItemSet& rSet ); + ~SfxItemIter(); + + // falls es diese gibt, returne sie, sonst 0 + const SfxPoolItem* FirstItem() + { _nAkt = _nStt; + return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; } + const SfxPoolItem* LastItem() + { _nAkt = _nEnd; + return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; } + const SfxPoolItem* GetCurItem() + { return _rSet._nCount ? *(_rSet._aItems+_nAkt) : 0; } + const SfxPoolItem* NextItem(); + const SfxPoolItem* PrevItem(); + + BOOL IsAtStart() const { return _nAkt == _nStt; } + BOOL IsAtEnd() const { return _nAkt == _nEnd; } + + USHORT GetCurPos() const { return _nAkt; } + USHORT GetFirstPos() const { return _nStt; } + USHORT GetLastPos() const { return _nEnd; } +}; + +#endif diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx new file mode 100644 index 000000000000..81407cee2d0c --- /dev/null +++ b/svl/inc/svl/itempool.hxx @@ -0,0 +1,306 @@ +/************************************************************************* + * + * 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: itempool.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 _SFXITEMPOOL_HXX +#define _SFXITEMPOOL_HXX + +#include "svtools/svldllapi.h" + +#ifndef INCLUDED_LIMITS_H +#include <limits.h> +#define INCLUDED_LIMITS_H +#endif +#include <tools/solar.h> +#include <tools/string.hxx> +#include <svtools/svarray.hxx> +#include <svtools/poolitem.hxx> +#include <vector> + +class SvStream; +class SfxBroadcaster; +struct SfxItemPool_Impl; + +#define SFX_WHICH_MAX 4999 + +DBG_NAMEEX(SfxItemPool) + +//==================================================================== + +#define SFX_ITEM_POOLABLE 0x0001 +#define SFX_ITEM_NOT_POOLABLE 0x0002 + +#define SFX_ITEM_USERFLAG0 0x0100 +#define SFX_ITEM_USERFLAG1 0x0200 +#define SFX_ITEM_USERFLAG2 0x0400 +#define SFX_ITEM_USERFLAG3 0x0800 +#define SFX_ITEM_USERFLAG4 0x1000 +#define SFX_ITEM_USERFLAG5 0x2000 +#define SFX_ITEM_USERFLAG6 0x4000 +#define SFX_ITEM_USERFLAG7 0x8000 +#define SFX_ITEM_USERFLAG8 0x0010 +#define SFX_ITEM_USERFLAG9 0x0020 +#define SFX_ITEM_USERFLAGA 0x0040 +#define SFX_ITEM_USERFLAGB 0x0080 + +//==================================================================== + +struct SfxItemInfo +{ + USHORT _nSID; + USHORT _nFlags; +}; + +//==================================================================== + +class SfxStyleSheetIterator; +struct SfxPoolItemArray_Impl; +class SfxItemPool; + +class SVL_DLLPUBLIC SfxItemPoolUser +{ +public: + virtual void ObjectInDestruction(const SfxItemPool& rSfxItemPool) = 0; +}; + +typedef ::std::vector< SfxItemPoolUser* > SfxItemPoolUserVector; + +class SVL_DLLPUBLIC SfxItemPool + +/* [Beschreibung] + + Die von dieser Klasse abgeleiteten Klassen dienen der Bereitstellung von + Defaults von SfxPoolItems und halten konkrete (konstante) Instanzen, die + dann von mehreren Stellen (i.d.R. eines Dokuments) referenziert werden + k�nnen. + + Dadurch ist jeder Wert nur einmalig gespeichert, was zu wenig Konstruktor + und Destruktor-Aufrufen f�hrt, Vergleiche zwischen Items eines Dokuments + beschleunigt und ein einfaches Laden und Speichern von Attributen + bereitstellt. +*/ + +{ + SVL_DLLPRIVATE void readTheItems(SvStream & rStream, USHORT nCount, USHORT nVersion, + SfxPoolItem * pDefItem, SfxPoolItemArray_Impl ** pArr); + + UniString aName; + USHORT nStart, nEnd; + USHORT _nFileFormatVersion; +#ifdef TF_POOLABLE + const SfxItemInfo* pItemInfos; +#else + USHORT* pSlotIds; +#endif + SfxItemPool_Impl* pImp; + SfxPoolItem** ppStaticDefaults; + SfxPoolItem** ppPoolDefaults; + SfxItemPool* pSecondary; + SfxItemPool* pMaster; + USHORT* _pPoolRanges; + FASTBOOL bPersistentRefCounts; + +private: + // ObjectUser section + SfxItemPoolUserVector maSfxItemPoolUsers; + +public: + void AddSfxItemPoolUser(SfxItemPoolUser& rNewUser); + void RemoveSfxItemPoolUser(SfxItemPoolUser& rOldUser); + + //--------------------------------------------------------------------- +#ifndef _SFXITEMS_HXX + +friend class SfxPoolWhichMap; + +private: + inline USHORT GetIndex_Impl(USHORT nWhich) const; + inline USHORT GetSize_Impl() const { return nEnd - nStart + 1; } + + SVL_DLLPRIVATE SvStream& Load1_Impl( SvStream &rStream ); + SVL_DLLPRIVATE FASTBOOL IsItemFlag_Impl( USHORT nWhich, USHORT nFlag ) const; + +public: + // fuer dflt. SfxItemSet::CTOR, setze dflt. WhichRanges + void FillItemIdRanges_Impl( USHORT*& pWhichRanges ) const; + const USHORT* GetFrozenIdRanges() const + { return _pPoolRanges; } + FASTBOOL IsVer2_Impl() const; + +#endif + //--------------------------------------------------------------------- + +protected: + static inline void SetRefCount( SfxPoolItem& rItem, ULONG n ); + static inline ULONG AddRef( const SfxPoolItem& rItem, ULONG n = 1 ); + static inline ULONG ReleaseRef( const SfxPoolItem& rItem, ULONG n = 1); + +public: + SfxItemPool( const SfxItemPool &rPool, + BOOL bCloneStaticDefaults = FALSE ); + SfxItemPool( const UniString &rName, + USHORT nStart, USHORT nEnd, +#ifdef TF_POOLABLE + const SfxItemInfo *pItemInfos, +#endif + SfxPoolItem **pDefaults = 0, +#ifndef TF_POOLABLE + USHORT *pSlotIds = 0, +#endif + FASTBOOL bLoadRefCounts = TRUE ); +protected: + virtual ~SfxItemPool(); +public: + static void Free(SfxItemPool* pPool); + + SfxBroadcaster& BC(); + + void SetPoolDefaultItem( const SfxPoolItem& ); + const SfxPoolItem* GetPoolDefaultItem( USHORT nWhich ) const; + void ResetPoolDefaultItem( USHORT nWhich ); + + void SetDefaults( SfxPoolItem **pDefaults ); + void ReleaseDefaults( BOOL bDelete = FALSE ); + static void ReleaseDefaults( SfxPoolItem **pDefaults, USHORT nCount, BOOL bDelete = FALSE ); + + virtual SfxMapUnit GetMetric( USHORT nWhich ) const; + void SetDefaultMetric( SfxMapUnit eNewMetric ); + virtual SfxItemPresentation GetPresentation( const SfxPoolItem& rItem, + SfxItemPresentation ePresentation, + SfxMapUnit ePresentationMetric, + XubString& rText, + const IntlWrapper * pIntlWrapper + = 0 ) const; + virtual SfxItemPool* Clone() const; + UniString const & GetName() const { return aName; } + + virtual const SfxPoolItem& Put( const SfxPoolItem&, USHORT nWhich = 0 ); + virtual void Remove( const SfxPoolItem& ); + virtual const SfxPoolItem& GetDefaultItem( USHORT nWhich ) const; + + const SfxPoolItem* LoadItem( SvStream &rStream, + FASTBOOL bDirect = FALSE, + const SfxItemPool *pRefPool = 0 ); + FASTBOOL StoreItem( SvStream &rStream, + const SfxPoolItem &rItem, + FASTBOOL bDirect = FALSE ) const; + + USHORT GetSurrogate(const SfxPoolItem *) const; + const SfxPoolItem * GetItem(USHORT nWhich, USHORT nSurrogate) const; + USHORT GetItemCount(USHORT nWhich) const; + const SfxPoolItem* LoadSurrogate(SvStream& rStream, + USHORT &rWhich, USHORT nSlotId, + const SfxItemPool* pRefPool = 0 ); + FASTBOOL StoreSurrogate(SvStream& rStream, + const SfxPoolItem *pItem ) const; + + virtual SvStream & Load(SvStream &); + virtual SvStream & Store(SvStream &) const; + int HasPersistentRefCounts() const { + return bPersistentRefCounts; } + void LoadCompleted(); + + USHORT GetFirstWhich() const { return nStart; } + USHORT GetLastWhich() const { return nEnd; } + FASTBOOL IsInRange( USHORT nWhich ) const { + return nWhich >= nStart && + nWhich <= nEnd; } + FASTBOOL IsInVersionsRange( USHORT nWhich ) const; + FASTBOOL IsInStoringRange( USHORT nWhich ) const; + void SetStoringRange( USHORT nFrom, USHORT nTo ); + void SetSecondaryPool( SfxItemPool *pPool ); + SfxItemPool* GetSecondaryPool() const { + return pSecondary; } + SfxItemPool* GetMasterPool() const { + return pMaster; } + void FreezeIdRanges(); + + void Cleanup(); + void Delete(); + +#ifdef TF_POOLABLE + FASTBOOL IsItemFlag( USHORT nWhich, USHORT nFlag ) const; + FASTBOOL IsItemFlag( const SfxPoolItem &rItem, USHORT nFlag ) const + { return IsItemFlag( rItem.Which(), nFlag ); } + void SetItemInfos( const SfxItemInfo *pInfos ) + { pItemInfos = pInfos; } +#else + int HasMap() const { return 0 != pSlotIds; } + void SetMap( USHORT *pNewSlotIds ) + { pSlotIds = pNewSlotIds; } +#endif + USHORT GetWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; + USHORT GetSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; + USHORT GetTrueWhich( USHORT nSlot, BOOL bDeep = TRUE ) const; + USHORT GetTrueSlotId( USHORT nWhich, BOOL bDeep = TRUE ) const; + + void SetVersionMap( USHORT nVer, + USHORT nOldStart, USHORT nOldEnd, + USHORT *pWhichIdTab ); + USHORT GetNewWhich( USHORT nOldWhich ) const; + USHORT GetVersion() const; + USHORT GetFileFormatVersion() const + { return _nFileFormatVersion; } + void SetFileFormatVersion( USHORT nFileFormatVersion ); + USHORT GetLoadingVersion() const; + FASTBOOL IsCurrentVersionLoading() const; + + static int IsWhich(USHORT nId) { + return nId && nId <= SFX_WHICH_MAX; } + static int IsSlot(USHORT nId) { + return nId && nId > SFX_WHICH_MAX; } + + static const SfxItemPool* GetStoringPool(); + static void SetStoringPool( const SfxItemPool * ); + +private: + const SfxItemPool& operator=(const SfxItemPool &); // n.i.!! +}; + +// --------------- Inline Implementierungen ------------------------------ + +// nur der Pool darf den Referenz-Zaehler manipulieren !!! +inline void SfxItemPool::SetRefCount( SfxPoolItem& rItem, ULONG n ) +{ + rItem.SetRefCount(n); +} + +// nur der Pool darf den Referenz-Zaehler manipulieren !!! +inline ULONG SfxItemPool::AddRef( const SfxPoolItem& rItem, ULONG n ) +{ + return rItem.AddRef(n); +} + +// nur der Pool darf den Referenz-Zaehler manipulieren !!! +inline ULONG SfxItemPool::ReleaseRef( const SfxPoolItem& rItem, ULONG n ) +{ + return rItem.ReleaseRef(n); +} + +#endif diff --git a/svl/inc/svl/itemprop.hxx b/svl/inc/svl/itemprop.hxx new file mode 100644 index 000000000000..feab0eab004b --- /dev/null +++ b/svl/inc/svl/itemprop.hxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * 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: itemprop.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 _SFX_ITEMPROP_HXX +#define _SFX_ITEMPROP_HXX + +#include "svtools/svldllapi.h" +#include <tools/solar.h> +#include <tools/string.hxx> +#include <svtools/itemset.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/beans/PropertyState.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <vector> +/* -----------------------------21.02.00 11:03-------------------------------- + UNO III - Implementation + ---------------------------------------------------------------------------*/ +#define MAP_CHAR_LEN(cchar) cchar, sizeof(cchar) - 1 + +struct SfxItemPropertyMapEntry +{ + const char* pName; + USHORT nNameLen; + USHORT nWID; + const com::sun::star::uno::Type* pType; + long nFlags; + BYTE nMemberId; + +}; + +struct SfxItemPropertySimpleEntry +{ + USHORT nWID; + const com::sun::star::uno::Type* pType; + long nFlags; + BYTE nMemberId; + + SfxItemPropertySimpleEntry() : + nWID( 0 ), + pType( 0 ), + nFlags( 0 ), + nMemberId( 0 ){} + + SfxItemPropertySimpleEntry(USHORT _nWID, const com::sun::star::uno::Type* _pType, + long _nFlags, BYTE _nMemberId) : + nWID( _nWID ), + pType( _pType ), + nFlags( _nFlags ), + nMemberId( _nMemberId ){} + + SfxItemPropertySimpleEntry( const SfxItemPropertyMapEntry* pMapEntry ) : + nWID( pMapEntry->nWID ), + pType( pMapEntry->pType ), + nFlags( pMapEntry->nFlags ), + nMemberId( pMapEntry->nMemberId ){} + +}; +struct SfxItemPropertyNamedEntry : public SfxItemPropertySimpleEntry +{ + ::rtl::OUString sName; + SfxItemPropertyNamedEntry( const String& rName, const SfxItemPropertySimpleEntry& rSimpleEntry) : + SfxItemPropertySimpleEntry( rSimpleEntry ), + sName( rName ){} + +}; +typedef std::vector< SfxItemPropertyNamedEntry > PropertyEntryVector_t; +class SfxItemPropertyMap_Impl; +class SVL_DLLPUBLIC SfxItemPropertyMap +{ + SfxItemPropertyMap_Impl* m_pImpl; +public: + SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ); + SfxItemPropertyMap( const SfxItemPropertyMap* pSource ); + ~SfxItemPropertyMap(); + + const SfxItemPropertySimpleEntry* getByName( const ::rtl::OUString &rName ) const; + com::sun::star::uno::Sequence< com::sun::star::beans::Property > getProperties() const; + com::sun::star::beans::Property getPropertyByName( const ::rtl::OUString rName ) const + throw( ::com::sun::star::beans::UnknownPropertyException ); + sal_Bool hasPropertyByName( const ::rtl::OUString& rName ) const; + + void mergeProperties( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rPropSeq ); + PropertyEntryVector_t getPropertyEntries() const; + sal_uInt32 getSize() const; + +}; +/* -----------------------------21.02.00 11:19-------------------------------- + + ---------------------------------------------------------------------------*/ +class SVL_DLLPUBLIC SfxItemPropertySet +{ + SfxItemPropertyMap m_aMap; + mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo; +protected: + virtual BOOL FillItem(SfxItemSet& rSet, USHORT nWhich, BOOL bGetProperty) const; + +public: + SfxItemPropertySet( const SfxItemPropertyMapEntry *pMap ) : + m_aMap(pMap) {} + virtual ~SfxItemPropertySet(); + + void getPropertyValue( const SfxItemPropertySimpleEntry& rEntry, + const SfxItemSet& rSet, + com::sun::star::uno::Any& rAny) const + throw(::com::sun::star::uno::RuntimeException); + void getPropertyValue( const ::rtl::OUString &rName, + const SfxItemSet& rSet, + com::sun::star::uno::Any& rAny) const + throw(::com::sun::star::uno::RuntimeException, + ::com::sun::star::beans::UnknownPropertyException); + com::sun::star::uno::Any + getPropertyValue( const ::rtl::OUString &rName, + const SfxItemSet& rSet ) const + throw(::com::sun::star::uno::RuntimeException, + ::com::sun::star::beans::UnknownPropertyException); + void setPropertyValue( const SfxItemPropertySimpleEntry& rEntry, + const com::sun::star::uno::Any& aVal, + SfxItemSet& rSet ) const + throw(::com::sun::star::uno::RuntimeException, + com::sun::star::lang::IllegalArgumentException); + void setPropertyValue( const ::rtl::OUString& rPropertyName, + const com::sun::star::uno::Any& aVal, + SfxItemSet& rSet ) const + throw(::com::sun::star::uno::RuntimeException, + com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::beans::UnknownPropertyException); + + com::sun::star::beans::PropertyState + getPropertyState(const ::rtl::OUString& rName, const SfxItemSet& rSet)const + throw(com::sun::star::beans::UnknownPropertyException); + com::sun::star::beans::PropertyState + getPropertyState(const SfxItemPropertySimpleEntry& rEntry, const SfxItemSet& rSet) const + throw(); + + com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> + getPropertySetInfo() const; + const SfxItemPropertyMap* + getPropertyMap() const {return &m_aMap;} + +}; +/* -----------------------------21.02.00 11:09-------------------------------- + + ---------------------------------------------------------------------------*/ +struct SfxItemPropertySetInfo_Impl; +class SVL_DLLPUBLIC SfxItemPropertySetInfo : public + cppu::WeakImplHelper1<com::sun::star::beans::XPropertySetInfo> +{ + SfxItemPropertySetInfo_Impl* m_pImpl; + +public: + SfxItemPropertySetInfo(const SfxItemPropertyMap *pMap ); + SfxItemPropertySetInfo(const SfxItemPropertyMapEntry *pEntries ); + virtual ~SfxItemPropertySetInfo(); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL + getProperties( ) + throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::beans::Property SAL_CALL + getPropertyByName( const ::rtl::OUString& aName ) + throw(::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasPropertyByName( const ::rtl::OUString& Name ) + throw(::com::sun::star::uno::RuntimeException); + + const SfxItemPropertyMap* getMap() const; +}; +/* -----------------------------21.02.00 12:01-------------------------------- + + ---------------------------------------------------------------------------*/ +class SVL_DLLPUBLIC SfxExtItemPropertySetInfo: public cppu::WeakImplHelper1<com::sun::star::beans::XPropertySetInfo > +{ + SfxItemPropertyMap aExtMap; +public: + SfxExtItemPropertySetInfo( + const SfxItemPropertyMapEntry *pMap, + const com::sun::star::uno::Sequence<com::sun::star::beans::Property>& rPropSeq ); + virtual ~SfxExtItemPropertySetInfo(); + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL + getProperties( ) + throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::beans::Property SAL_CALL + getPropertyByName( const ::rtl::OUString& aName ) + throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + hasPropertyByName( const ::rtl::OUString& Name ) + throw(::com::sun::star::uno::RuntimeException); +}; + +#endif diff --git a/svl/inc/svl/itemset.hxx b/svl/inc/svl/itemset.hxx new file mode 100644 index 000000000000..4cc3edcf65c7 --- /dev/null +++ b/svl/inc/svl/itemset.hxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * 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: itemset.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 _SFXITEMSET_HXX +#define _SFXITEMSET_HXX + +#include "svtools/svldllapi.h" + +#if STLPORT_VERSION<321 +#include <stdarg.h> +#else +#include <cstdarg> // std::va_list and friends +#endif +#include <svtools/poolitem.hxx> +#include <tools/rtti.hxx> +#include <tools/solar.h> + +class SfxItemPool; +class SfxPoolItem; +class SvStream; + +typedef SfxPoolItem const** SfxItemArray; + +#define USHORT_ARG int + +#ifdef MI_HATS_REPARIERT +#ifndef DBG +#ifdef DBG_UTILx +#define DBG(s) s +#define _pChildCount(THIS) ( *(USHORT**)SfxPointerServer::GetServer()->GetPointer(THIS) ) +#define _pChildCountCtor ( (*(USHORT**)SfxPointerServer::GetServer()->CreatePointer(this)) = new USHORT ) +#define _pChildCountDtor ( SfxPointerServer::GetServer()->ReleasePointer(this) ) +#else +#define DBG(s) +#endif +#endif +#else +#ifdef DBG +#undef DBG +#endif +#define DBG(s) +#endif + +//======================================================================== + +#define SFX_ITEMSET_GET( rSet, pItem, ItemType, nSlotId, bDeep ) \ + const ItemType *pItem = (const ItemType*) \ + (rSet).GetItem( nSlotId, bDeep, TYPE(ItemType) ) + +//======================================================================== + +class SVL_DLLPUBLIC SfxItemSet +{ + friend class SfxItemIter; + + SfxItemPool* _pPool; // der verwendete Pool + const SfxItemSet* _pParent; // Ableitung + SfxItemArray _aItems; // Item-Feld + USHORT* _pWhichRanges; // Array von Which-Bereichen + USHORT _nCount; // Anzahl Items + + //--------------------------------------------------------------------- +#ifndef _SFXITEMS_HXX + +friend class SfxItemPoolCache; +friend class SfxAllItemSet; +friend const char *DbgCheckItemSet( const void* ); + +private: + SVL_DLLPRIVATE void InitRanges_Impl(const USHORT *nWhichPairTable); + SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, USHORT n1, USHORT n2, USHORT n3); + SVL_DLLPRIVATE void InitRanges_Impl(USHORT nWh1, USHORT nWh2); + +public: + SfxItemArray GetItems_Impl() const { return _aItems; } + +#endif + //--------------------------------------------------------------------- + +private: + const SfxItemSet& operator=(const SfxItemSet &); // n.i.!! + +protected: + // Notification-Callback + virtual void Changed( const SfxPoolItem& rOld, const SfxPoolItem& rNew ); + + // direkte Put-Methode + int PutDirect(const SfxPoolItem &rItem); + +public: + SfxItemSet( const SfxItemSet& ); + + SfxItemSet( SfxItemPool&, BOOL bTotalPoolRanges = FALSE ); + SfxItemSet( SfxItemPool&, USHORT nWhich1, USHORT nWhich2 ); + SfxItemSet( SfxItemPool&, USHORT_ARG nWh1, USHORT_ARG nWh2, USHORT_ARG nNull, ... ); + SfxItemSet( SfxItemPool&, const USHORT* nWhichPairTable ); + virtual ~SfxItemSet(); + + virtual SfxItemSet * Clone(BOOL bItems = TRUE, SfxItemPool *pToPool = 0) const; + + // Items erfragen + USHORT Count() const { return _nCount; } + USHORT TotalCount() const; + + virtual const SfxPoolItem& Get( USHORT nWhich, BOOL bSrchInParent = TRUE ) const; + const SfxPoolItem* GetItem( USHORT nWhich, BOOL bSrchInParent = TRUE, + TypeId aItemType = 0 ) const; + + // Which-Wert des Items an der Position nPos erfragen + USHORT GetWhichByPos(USHORT nPos) const; + + // Item-Status erfragen + SfxItemState GetItemState( USHORT nWhich, + BOOL bSrchInParent = TRUE, + const SfxPoolItem **ppItem = 0 ) const; + + virtual void DisableItem(USHORT nWhich); + virtual void InvalidateItem( USHORT nWhich ); + virtual USHORT ClearItem( USHORT nWhich = 0); + virtual void ClearInvalidItems( BOOL bHardDefault = FALSE ); + void InvalidateAllItems(); HACK(via nWhich = 0) + + inline void SetParent( const SfxItemSet* pNew ); + + // Items hinzufuegen, loeschen etc. + virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich ); + const SfxPoolItem* Put( const SfxPoolItem& rItem ) + { return Put(rItem, rItem.Which()); } + virtual int Put( const SfxItemSet&, + BOOL bInvalidAsDefault = TRUE ); + void PutExtended( const SfxItemSet&, + SfxItemState eDontCareAs = SFX_ITEM_UNKNOWN, + SfxItemState eDefaultAs = SFX_ITEM_UNKNOWN ); + + virtual int Set( const SfxItemSet&, BOOL bDeep = TRUE ); + + virtual void Intersect( const SfxItemSet& rSet ); + virtual void MergeValues( const SfxItemSet& rSet, BOOL bOverwriteDefaults = FALSE ); + virtual void Differentiate( const SfxItemSet& rSet ); + virtual void MergeValue( const SfxPoolItem& rItem, BOOL bOverwriteDefaults = FALSE ); + + SfxItemPool* GetPool() const { return _pPool; } + const USHORT* GetRanges() const { return _pWhichRanges; } + void SetRanges( const USHORT *pRanges ); + void MergeRange( USHORT nFrom, USHORT nTo ); + const SfxItemSet* GetParent() const { return _pParent; } + + virtual SvStream & Load( SvStream &, FASTBOOL bDirect = FALSE, + const SfxItemPool *pRefPool = 0 ); + virtual SvStream & Store( SvStream &, FASTBOOL bDirect = FALSE ) const; + + virtual int operator==(const SfxItemSet &) const; +}; + +// --------------- Inline Implementierungen ------------------------ + +inline void SfxItemSet::SetParent( const SfxItemSet* pNew ) +{ + DBG( if (_pParent) --*_pChildCount(_pParent) ); + _pParent = pNew; + DBG( if (_pParent) ++*_pChildCount(_pParent) ); +} + +//======================================================================== + +class SVL_DLLPUBLIC SfxAllItemSet: public SfxItemSet + +/* versteht alle Ranges; werden durch das Putten der Items + automatisch angepasst +*/ + +{ + SfxVoidItem aDefault; + USHORT nFree; + +public: + SfxAllItemSet( SfxItemPool &rPool ); + SfxAllItemSet( const SfxItemSet & ); + SfxAllItemSet( const SfxAllItemSet & ); + + virtual SfxItemSet * Clone( BOOL bItems = TRUE, SfxItemPool *pToPool = 0 ) const; + virtual const SfxPoolItem* Put( const SfxPoolItem&, USHORT nWhich ); + const SfxPoolItem* Put( const SfxPoolItem& rItem ) + { return Put(rItem, rItem.Which()); } + virtual int Put( const SfxItemSet&, + BOOL bInvalidAsDefault = TRUE ); +}; + +#endif // #ifndef _SFXITEMSET_HXX + diff --git a/svl/inc/svl/languageoptions.hxx b/svl/inc/svl/languageoptions.hxx new file mode 100644 index 000000000000..ed247ac01fa3 --- /dev/null +++ b/svl/inc/svl/languageoptions.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * 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: languageoptions.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 _SVTOOLS_LANGUAGEOPTIONS_HXX +#define _SVTOOLS_LANGUAGEOPTIONS_HXX + +#include "svtools/svtdllapi.h" +#include <sal/types.h> +#include <svtools/brdcst.hxx> +#include <svtools/lstner.hxx> +#include <unotools/configitem.hxx> +#include <i18npool/lang.h> + +// class SvtLanguageOptions ---------------------------------------------------- + +// these defines can be ored +#define SCRIPTTYPE_LATIN 0x01 +#define SCRIPTTYPE_ASIAN 0x02 +#define SCRIPTTYPE_COMPLEX 0x04 + +class SvtCJKOptions; +class SvtCTLOptions; + +class SVT_DLLPUBLIC SvtLanguageOptions : public SfxBroadcaster, public SfxListener +{ +private: + SvtCJKOptions* m_pCJKOptions; + SvtCTLOptions* m_pCTLOptions; + +public: + enum EOption + { + // cjk options + E_CJKFONT, + E_VERTICALTEXT, + E_ASIANTYPOGRAPHY, + E_JAPANESEFIND, + E_RUBY, + E_CHANGECASEMAP, + E_DOUBLELINES, + E_EMPHASISMARKS, + E_VERTICALCALLOUT, + E_ALLCJK, + // ctl options + E_CTLFONT, + E_CTLSEQUENCECHECKING, + E_CTLCURSORMOVEMENT, + E_CTLTEXTNUMERALS + }; + + // bDontLoad is for referencing purposes only + SvtLanguageOptions( sal_Bool _bDontLoad = sal_False ); + ~SvtLanguageOptions(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + // CJK options + sal_Bool IsCJKFontEnabled() const; + sal_Bool IsVerticalTextEnabled() const; + sal_Bool IsAsianTypographyEnabled() const; + sal_Bool IsJapaneseFindEnabled() const; + sal_Bool IsRubyEnabled() const; + sal_Bool IsChangeCaseMapEnabled() const; + sal_Bool IsDoubleLinesEnabled() const; + sal_Bool IsEmphasisMarksEnabled() const; + sal_Bool IsVerticalCallOutEnabled() const; + void SetAll( sal_Bool _bSet ); + sal_Bool IsAnyEnabled() const; + + // CTL options + void SetCTLFontEnabled( sal_Bool _bEnabled ); + sal_Bool IsCTLFontEnabled() const; + + void SetCTLSequenceChecking( sal_Bool _bEnabled ); + sal_Bool IsCTLSequenceChecking() const; + + void SetCTLSequenceCheckingRestricted( sal_Bool _bEnable ); + sal_Bool IsCTLSequenceCheckingRestricted( void ) const; + + void SetCTLSequenceCheckingTypeAndReplace( sal_Bool _bEnable ); + sal_Bool IsCTLSequenceCheckingTypeAndReplace() const; + + sal_Bool IsReadOnly(EOption eOption) const; + + // returns for a language the scripttype + static sal_uInt16 GetScriptTypeOfLanguage( sal_uInt16 nLang ); +}; +/** #i42730# Gives access to the Windows 16bit system locale + */ +class SVT_DLLPUBLIC SvtSystemLanguageOptions : public utl::ConfigItem +{ +private: + ::rtl::OUString m_sWin16SystemLocale; + +public: + SvtSystemLanguageOptions(); + ~SvtSystemLanguageOptions(); + + virtual void Commit(); + + LanguageType GetWin16SystemLanguage(); +}; + +#endif // _SVTOOLS_LANGUAGEOPTIONS_HXX + diff --git a/svl/inc/svl/lckbitem.hxx b/svl/inc/svl/lckbitem.hxx new file mode 100644 index 000000000000..b21e91a3fd46 --- /dev/null +++ b/svl/inc/svl/lckbitem.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * 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: lckbitem.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 _LCKBITEM_HXX +#define _LCKBITEM_HXX + +#include "svtools/svldllapi.h" +#include <tools/solar.h> +#include <tools/rtti.hxx> +#include <tools/stream.hxx> +#include <svtools/poolitem.hxx> + +// ----------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxLockBytesItem : public SfxPoolItem +{ + SvLockBytesRef _xVal; + +public: + TYPEINFO(); + SfxLockBytesItem(); + SfxLockBytesItem( USHORT nWhich, + SvLockBytes *pLockBytes ); + SfxLockBytesItem( USHORT nWhich, SvStream & ); + SfxLockBytesItem( const SfxLockBytesItem& ); + ~SfxLockBytesItem(); + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + + SvLockBytes* GetValue() const { return _xVal; } + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; +}; + +#endif + diff --git a/svl/inc/svl/lockfilecommon.hxx b/svl/inc/svl/lockfilecommon.hxx new file mode 100644 index 000000000000..c8bd6251f9cb --- /dev/null +++ b/svl/inc/svl/lockfilecommon.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * 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: documentlockfile.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 _SVT_LOCKFILECOMMON_HXX +#define _SVT_LOCKFILECOMMON_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/io/XTruncate.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <osl/mutex.hxx> +#include <tools/urlobj.hxx> + +#define LOCKFILE_OOOUSERNAME_ID 0 +#define LOCKFILE_SYSUSERNAME_ID 1 +#define LOCKFILE_LOCALHOST_ID 2 +#define LOCKFILE_EDITTIME_ID 3 +#define LOCKFILE_USERURL_ID 4 +#define LOCKFILE_ENTRYSIZE 5 + +namespace svt { + +// This is a general implementation that is used in document lock file implementation and in sharing control file implementation +class SVT_DLLPUBLIC LockFileCommon +{ +protected: + ::osl::Mutex m_aMutex; + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; + ::rtl::OUString m_aURL; + + + INetURLObject ResolveLinks( const INetURLObject& aDocURL ); + +public: + LockFileCommon( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, const ::rtl::OUString& aPrefix ); + ~LockFileCommon(); + + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > ParseList( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer ); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > ParseEntry( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); + static ::rtl::OUString ParseName( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& o_nCurPos ); + static ::rtl::OUString EscapeCharacters( const ::rtl::OUString& aSource ); + static ::rtl::OUString GetOOOUserName(); + static ::rtl::OUString GetCurrentLocalTime(); + static ::com::sun::star::uno::Sequence< ::rtl::OUString > GenerateOwnEntry(); +}; + +} + +#endif + diff --git a/svl/inc/svl/lstner.hxx b/svl/inc/svl/lstner.hxx new file mode 100644 index 000000000000..99a6e10701f5 --- /dev/null +++ b/svl/inc/svl/lstner.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * 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: lstner.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 _SFXLSTNER_HXX +#define _SFXLSTNER_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> +#include <svtools/svarray.hxx> + +class SfxBroadcaster; +class SfxHint; + +#ifndef _SFX_LSTNER_CXX +typedef SvPtrarr SfxBroadcasterArr_Impl; +#endif + +#define SFX_NOTIFY( rBC, rBCT, rHint, rHintT ) \ + Notify( rBC, rHint ) + +//------------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxListener +{ + SfxBroadcasterArr_Impl aBCs; + +private: + const SfxListener& operator=(const SfxListener &); // n.i., ist verboten + +public: + TYPEINFO(); + + SfxListener(); + SfxListener( const SfxListener &rCopy ); + virtual ~SfxListener(); + + BOOL StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups = FALSE ); + BOOL EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups = FALSE ); + void EndListening( USHORT nNo ); + void EndListeningAll(); + BOOL IsListening( SfxBroadcaster& rBroadcaster ) const; + + USHORT GetBroadcasterCount() const + { return aBCs.Count(); } + SfxBroadcaster* GetBroadcasterJOE( USHORT nNo ) const + { return (SfxBroadcaster*) aBCs.GetObject(nNo); } + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + +#ifndef _NOTIFY_HXX + void RemoveBroadcaster_Impl( SfxBroadcaster& rBC ); +#endif +}; + +#endif diff --git a/svl/inc/svl/macitem.hxx b/svl/inc/svl/macitem.hxx new file mode 100644 index 000000000000..2e43120f653d --- /dev/null +++ b/svl/inc/svl/macitem.hxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * 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: macitem.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 _SFXMACITEM_HXX +#define _SFXMACITEM_HXX + +// class SvxMacroItem ---------------------------------------------------- + +#include "svtools/svtdllapi.h" +#include <svtools/poolitem.hxx> +#include <tools/rtti.hxx> +#include <tools/debug.hxx> +#include <tools/string.hxx> + +#ifndef _TABLE_HXX +#include <tools/table.hxx> +#endif + +class SvStream; + +#define SVX_MACRO_LANGUAGE_JAVASCRIPT "JavaScript" +#define SVX_MACRO_LANGUAGE_STARBASIC "StarBasic" +#define SVX_MACRO_LANGUAGE_SF "Script" + +DBG_NAMEEX(SvxMacroItem) + +// ----------------------------------------------------------------------- + +//Ein Macro + +enum ScriptType +{ + STARBASIC, + JAVASCRIPT, + EXTENDED_STYPE +}; + +// Basisklasse fuer SjJSbxObject mit virtuellem Destruktor +class SjJSbxObjectBase +{ +public: + virtual ~SjJSbxObjectBase(); + virtual SjJSbxObjectBase* Clone( void ); + //virtual SjJSbxObjectBase& operator=( const SjJSbxObjectBase& rBase ); +}; + +class SjJSbxObject; + +class SVT_DLLPUBLIC SvxMacro +{ + String aMacName; + String aLibName; + // Fuer JavaScript muss ein Function-Objekt gehalten werden + SjJSbxObjectBase* pFunctionObject; + ScriptType eType; + +public: + + SvxMacro( const String &rMacName, const String &rLanguage); + + SvxMacro( const String &rMacName, const String &rLibName, + ScriptType eType); // = STARBASIC entfernt + + SvxMacro( SjJSbxObjectBase* _pFunctionObject, const String &rSource ); + ~SvxMacro(); // noetig fuer pFunctionObject + + const String &GetLibName() const { return aLibName; } + const String &GetMacName() const { return aMacName; } + String GetLanguage()const; + + ScriptType GetScriptType() const { return eType; } + + BOOL HasMacro() const { return aMacName.Len() ? TRUE : FALSE; } + +#ifdef SOLAR_JAVA + // JavaScript-Function-Objekt holen + // ACHTUNG: Implementation in SJ, Source/JScript/sjimpl.cxx + SjJSbxObjectBase* GetFunctionObject( SjJSbxObject* pParent ); +#endif + + SvxMacro& operator=( const SvxMacro& rBase ); +}; + +inline SvxMacro::SvxMacro( const String &rMacName, const String &rLibName, + ScriptType eTyp ) + : aMacName( rMacName ), aLibName( rLibName ), pFunctionObject(NULL), eType( eTyp ) +{} + +inline SvxMacro::SvxMacro( SjJSbxObjectBase* _pFunctionObject, const String &rSource ) + : aMacName( rSource ), pFunctionObject( _pFunctionObject ), eType( JAVASCRIPT ) +{} + +//Macro Table, zerstoert die Pointer im DTor! + +DECLARE_TABLE( _SvxMacroTableDtor, SvxMacro* ) + +#define SVX_MACROTBL_VERSION31 0 +#define SVX_MACROTBL_VERSION40 1 + +#define SVX_MACROTBL_AKTVERSION SVX_MACROTBL_VERSION40 + +class SVT_DLLPUBLIC SvxMacroTableDtor : public _SvxMacroTableDtor +{ +public: + inline SvxMacroTableDtor( const USHORT nInitSz = 0, const USHORT nReSz = 1 ); + inline SvxMacroTableDtor( const SvxMacroTableDtor &rCpy ) : _SvxMacroTableDtor() { *this = rCpy; } + inline ~SvxMacroTableDtor() { DelDtor(); } + SvxMacroTableDtor& operator=( const SvxMacroTableDtor &rCpy ); + + // loescht alle Eintraege + void DelDtor(); + + SvStream& Read( SvStream &, USHORT nVersion = SVX_MACROTBL_AKTVERSION ); + SvStream& Write( SvStream & ) const; + + USHORT GetVersion() const { return SVX_MACROTBL_AKTVERSION; } +}; + +inline SvxMacroTableDtor::SvxMacroTableDtor( const USHORT nInitSz, + const USHORT nReSz) + : _SvxMacroTableDtor( nInitSz, nReSz ) +{} + +/* +[Beschreibung] +Dieses Item beschreibt eine Makro-Tabelle. +*/ + +class SVT_DLLPUBLIC SvxMacroItem: public SfxPoolItem +{ +public: + TYPEINFO(); + + inline SvxMacroItem ( const USHORT nId /*= ITEMID_MACRO*/ ); + + // "pure virtual Methoden" vom SfxPoolItem + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + + inline const SvxMacroTableDtor& GetMacroTable() const { return aMacroTable;} + inline void SetMacroTable( const SvxMacroTableDtor& rTbl ) { aMacroTable = rTbl; } + + inline const SvxMacro& GetMacro( USHORT nEvent ) const; + inline BOOL HasMacro( USHORT nEvent ) const; + void SetMacro( USHORT nEvent, const SvxMacro& ); + inline BOOL DelMacro( USHORT nEvent ); + +private: + SvxMacroTableDtor aMacroTable; + + inline SvxMacroItem( const SvxMacroItem& ); + SvxMacroItem &operator=( const SvxMacroItem & ); +}; + +inline SvxMacroItem::SvxMacroItem( const USHORT nId ) + : SfxPoolItem( nId ) +{} +inline SvxMacroItem::SvxMacroItem( const SvxMacroItem &rCpy ) + : SfxPoolItem( rCpy ), + aMacroTable( rCpy.GetMacroTable() ) +{} + +inline BOOL SvxMacroItem::HasMacro( USHORT nEvent ) const +{ + return aMacroTable.IsKeyValid( nEvent ); +} +inline const SvxMacro& SvxMacroItem::GetMacro( USHORT nEvent ) const +{ + return *(aMacroTable.Get(nEvent)); +} +inline BOOL SvxMacroItem::DelMacro( USHORT nEvent ) +{ + SvxMacro *pMacro = aMacroTable.Remove( nEvent ); + delete pMacro; + return ( pMacro != 0 ); +} + +#endif diff --git a/svl/inc/svl/metitem.hxx b/svl/inc/svl/metitem.hxx new file mode 100644 index 000000000000..a37d119d57c1 --- /dev/null +++ b/svl/inc/svl/metitem.hxx @@ -0,0 +1,56 @@ +/************************************************************************* + * + * 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: metitem.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 _SFXMETRICITEM_HXX +#define _SFXMETRICITEM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/intitem.hxx> + +DBG_NAMEEX_VISIBILITY(SfxMetricItem, SVT_DLLPUBLIC) + +// ----------------------------------------------------------------------- + +class SVT_DLLPUBLIC SfxMetricItem: public SfxInt32Item +{ +public: + TYPEINFO(); + SfxMetricItem( USHORT nWhich = 0, UINT32 nValue = 0 ); + SfxMetricItem( USHORT nWhich, SvStream & ); + SfxMetricItem( const SfxMetricItem& ); + ~SfxMetricItem() { + DBG_DTOR(SfxMetricItem, 0); } + + virtual int ScaleMetrics( long lMult, long lDiv ); + virtual int HasMetrics() const; + +}; + +#endif + diff --git a/svl/inc/svl/nfkeytab.hxx b/svl/inc/svl/nfkeytab.hxx new file mode 100644 index 000000000000..ba8c24f319f6 --- /dev/null +++ b/svl/inc/svl/nfkeytab.hxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * 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: nfkeytab.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 INCLUDED_SVTOOLS_NFKEYTAB_HXX +#define INCLUDED_SVTOOLS_NFKEYTAB_HXX + +#include <tools/string.hxx> + +//! For ImpSvNumberformatScan: first the short symbols, then the long symbols! +//! e.g. first TT then TTTT +//! The internal order is essentially for the format code string scanner! +//! New keywords MUST NOT be inserted, only the NF_KEY_UNUSEDn may be used, +//! NF_KEY_LASTKEYWORD must be adjusted accordingly. Otherwise old versions +//! will fail upon reading these entries. Nevertheless, old versions are NOT +//! able to display those new keywords => blank display. +// +// Note: 2005-09-02: the above applies to the binary file format. +// +// ER 15.12.99: This table is externally only to be used with method +// String SvNumberformat::GetMappedFormatstring( const NfKeywordTable&, const LocaleDataWrapper& ); +// and method +// void SvNumberFormatter::FillKeywordTable( NfKeywordTable&, LanguageType ); +enum NfKeywordIndex +{ + NF_KEY_NONE = 0, + NF_KEY_E, // exponential symbol + NF_KEY_AMPM, // AM/PM + NF_KEY_AP, // a/p + NF_KEY_MI, // minute (!) + NF_KEY_MMI, // minute 02 (!) + NF_KEY_M, // month (!) + NF_KEY_MM, // month 02 (!) + NF_KEY_MMM, // month short name + NF_KEY_MMMM, // month long name + NF_KEY_H, // hour + NF_KEY_HH, // hour 02 + NF_KEY_S, // second + NF_KEY_SS, // second 02 + NF_KEY_Q, // quarter + NF_KEY_QQ, // quarter 02 + NF_KEY_D, // day of month + NF_KEY_DD, // day of month 02 + NF_KEY_DDD, // day of week short + NF_KEY_DDDD, // day of week long + NF_KEY_YY, // year two digits + NF_KEY_YYYY, // year four digits + NF_KEY_NN, // day of week short + NF_KEY_NNNN, // day of week long with separator + NF_KEY_CCC, // currency bank symbol (old version) + NF_KEY_GENERAL, // General / Standard + NF_KEY_LASTOLDKEYWORD = NF_KEY_GENERAL, + NF_KEY_NNN, // day of week long without separator, as of version 6, 10.10.97 + NF_KEY_WW, // week of year, as of version 8, 19.06.98 + NF_KEY_MMMMM, // first letter of month name + NF_KEY_LASTKEYWORD = NF_KEY_MMMMM, + NF_KEY_UNUSED4, + NF_KEY_QUARTER, // was quarter word, not used anymore from SRC631 on (26.04.01) + NF_KEY_TRUE, // boolean true + NF_KEY_FALSE, // boolean false + NF_KEY_BOOLEAN, // boolean + NF_KEY_COLOR, // color + NF_KEY_FIRSTCOLOR, + NF_KEY_BLACK = NF_KEY_FIRSTCOLOR, // you do know colors, don't you? + NF_KEY_BLUE, + NF_KEY_GREEN, + NF_KEY_CYAN, + NF_KEY_RED, + NF_KEY_MAGENTA, + NF_KEY_BROWN, + NF_KEY_GREY, + NF_KEY_YELLOW, + NF_KEY_WHITE, + NF_KEY_LASTCOLOR = NF_KEY_WHITE, + NF_KEY_LASTKEYWORD_SO5 = NF_KEY_LASTCOLOR, + //! Keys from here on can't be saved in SO5 file format and MUST be + //! converted to string which means losing any information. + NF_KEY_AAA, // abbreviated day name from Japanese Xcl, same as DDD or NN English + NF_KEY_AAAA, // full day name from Japanese Xcl, same as DDDD or NNN English + NF_KEY_EC, // E non-gregorian calendar year without preceding 0 + NF_KEY_EEC, // EE non-gregorian calendar year with preceding 0 (two digit) + NF_KEY_G, // abbreviated era name, latin characters M T S or H for Gengou calendar + NF_KEY_GG, // abbreviated era name + NF_KEY_GGG, // full era name + NF_KEY_R, // acts as EE (Xcl) => GR==GEE, GGR==GGEE, GGGR==GGGEE + NF_KEY_RR, // acts as GGGEE (Xcl) + NF_KEY_THAI_T, // Thai T modifier, speciality of Thai Excel, only used with Thai locale and converted to [NatNum1] + NF_KEYWORD_ENTRIES_COUNT +}; + +typedef String NfKeywordTable [NF_KEYWORD_ENTRIES_COUNT]; + +#endif // INCLUDED_SVTOOLS_NFKEYTAB_HXX + diff --git a/svl/inc/svl/nfversi.hxx b/svl/inc/svl/nfversi.hxx new file mode 100644 index 000000000000..23375369ddb3 --- /dev/null +++ b/svl/inc/svl/nfversi.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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: nfversi.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 NF_NFVERSI_HXX +#define NF_NFVERSI_HXX + +// file ID's + +#define SV_NUMBERFORMATTER_VERSION_SYSTORE 0x0004 +#define SV_NUMBERFORMATTER_VERSION_KEYWORDS 0x0005 +#define SV_NUMBERFORMATTER_VERSION_NEWSTANDARD 0x0006 +#define SV_NUMBERFORMATTER_VERSION_NF_TIME_HH_MMSS00 0x0007 +#define SV_NUMBERFORMATTER_VERSION_NF_DATE_WW 0x0008 +#define SV_NUMBERFORMATTER_VERSION_NEW_CURR 0x0009 +#define SV_NUMBERFORMATTER_VERSION_YEAR2000 0x000a +#define SV_NUMBERFORMATTER_VERSION_TWODIGITYEAR 0x000b +#define SV_NUMBERFORMATTER_VERSION_NF_DATETIME_SYS_DDMMYYYY_HHMMSS 0x000c +#define SV_NUMBERFORMATTER_VERSION_CALENDAR 0x000d +#define SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS 0x000e + +#define SV_NUMBERFORMATTER_VERSION 0x000e + +// 1 bis 18.01.96 +// 2 ab 19.01.96, TT.MM.JJJJ dazu +// 3 ab 13.02.96 (nicht emergency) #.##0,00 CCC dazu +// 4 ab 30.07.97 364i speichern, was SYSTEM wirklich war (vorhandenes +// Dummy-Feld wird benutzt, keine File-Format Aenderung) +// 5 ab 07.08.97 nicht-deutsch ist nicht immer englisch +// aeltere nicht-deutsche benutzerdefinierte Formate onLoad +// konvertieren +// 6 ab 17.10.97 neu: Keyword NNN fuer langen Wochentag ohne Separator, +// wird in aelteren Versionen nicht ausgewertet! +// Neue Standard Datumformate, DIN etc. +// 7 ab 25.05.98 StandardFormat [HH]:MM:SS,00 (NF_TIME_HH_MMSS00) fuer +// automatische Eingabe-Erkennung von 100stel Sekunden mit Stunden +// 8 ab 19.06.98 StandardFormat WW (NF_DATE_WW) fuer Kalenderwoche +// 9 ab 17.12.98 neue Waehrungsformate [$DM-xxx] +// A ab 25.01.99 Year2000 speichern/laden +// B ab 12.02.99 Year2000 ist allgemeines TwoDigitYearStart +// C ??.??.?? date/time format of system variables +// D 23.11.00 new calendar +// E 19.01.01 additional formats provided by i18n + +#endif + diff --git a/svl/inc/svl/nranges.hxx b/svl/inc/svl/nranges.hxx new file mode 100644 index 000000000000..6996669cdeb1 --- /dev/null +++ b/svl/inc/svl/nranges.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * 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: nranges.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. + * + ************************************************************************/ +#ifdef MACOSX +// We need an empty block in here. Otherwise, if the #ifndef _SFXNRANGES_HXX +// line is the first line, the Mac OS X version of the gcc preprocessor will +// incorrectly optimize the inclusion process and will never include this file +// a second time +#endif + +#ifndef _SFXNRANGES_HXX + +#ifndef NUMTYPE + +#define NUMTYPE USHORT +#define SfxNumRanges SfxUShortRanges +#include <svtools/nranges.hxx> + +#undef NUMTYPE +#define NUMTYPE ULONG +#define SfxNumRanges SfxULongRanges +#include <svtools/nranges.hxx> + +#define _SFXNRANGES_HXX + +#else +#include <tools/solar.h> + +//======================================================================== + +#define NUMTYPE_ARG int + +class SfxNumRanges +{ + NUMTYPE* _pRanges; // 0-terminated array of NUMTYPE-pairs + +public: + SfxNumRanges() : _pRanges( 0 ) {} + SfxNumRanges( const SfxNumRanges &rOrig ); + SfxNumRanges( NUMTYPE nWhich1, NUMTYPE nWhich2 ); + SfxNumRanges( NUMTYPE_ARG nWh1, NUMTYPE_ARG nWh2, NUMTYPE_ARG nNull, ... ); + SfxNumRanges( const NUMTYPE* nNumTable ); + ~SfxNumRanges() + { delete [] _pRanges; } + + BOOL operator == ( const SfxNumRanges & ) const; + BOOL operator != ( const SfxNumRanges & rRanges ) const + { return !( *this == rRanges ); } + + SfxNumRanges& operator = ( const SfxNumRanges & ); + + SfxNumRanges& operator += ( const SfxNumRanges & ); + SfxNumRanges& operator -= ( const SfxNumRanges & ); + SfxNumRanges& operator /= ( const SfxNumRanges & ); + + NUMTYPE Count() const; + BOOL IsEmpty() const + { return !_pRanges || 0 == *_pRanges; } + BOOL Contains( NUMTYPE n ) const; + BOOL Intersects( const SfxNumRanges & ) const; + + operator const NUMTYPE* () const + { return _pRanges; } +}; + +#undef NUMTYPE +#undef SfxNumRanges + +#endif + +#endif diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx new file mode 100644 index 000000000000..e8361307eb9e --- /dev/null +++ b/svl/inc/svl/ondemand.hxx @@ -0,0 +1,468 @@ +/************************************************************************* + * + * 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: ondemand.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 INCLUDED_SVTOOLS_ONDEMAND_HXX +#define INCLUDED_SVTOOLS_ONDEMAND_HXX + +#include <svtools/syslocale.hxx> +#include <i18npool/lang.h> +#include <unotools/localedatawrapper.hxx> +#include <unotools/calendarwrapper.hxx> +#include <unotools/collatorwrapper.hxx> +#include <com/sun/star/i18n/CollatorOptions.hpp> +#include <unotools/transliterationwrapper.hxx> +#include <com/sun/star/i18n/TransliterationModules.hpp> +#include <unotools/nativenumberwrapper.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +/* + On demand instanciation and initialization of several i18n wrappers, + helping the number formatter to not perform worse than it already does. + */ + +/** @short + Switch between LANGUAGE_SYSTEM and LANGUAGE_ENGLISH_US and any other + LocaleDataWrapper. + SvNumberformatter uses it upon switching locales. + + @descr + Avoids reloading and analysing of locale data again and again. + + @ATTENTION + If the default ctor is used the init() method MUST be called before + accessing any locale data. The passed parameters Locale and LanguageType + must match each other. + */ + +class OnDemandLocaleDataWrapper +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + SvtSysLocale aSysLocale; + LanguageType eCurrentLanguage; + LanguageType eLastAnyLanguage; + const LocaleDataWrapper* pSystem; + const LocaleDataWrapper* pEnglish; + LocaleDataWrapper* pAny; + const LocaleDataWrapper* pCurrent; + bool bInitialized; + +public: + OnDemandLocaleDataWrapper() + : eLastAnyLanguage( LANGUAGE_DONTKNOW ) + , pEnglish(0) + , pAny(0) + , bInitialized(false) + { + pCurrent = pSystem = aSysLocale.GetLocaleDataPtr(); + eCurrentLanguage = LANGUAGE_SYSTEM; + } + OnDemandLocaleDataWrapper( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::lang::Locale& rLocale, + LanguageType eLang + ) + : pEnglish(0) + , pAny(0) + , pCurrent(0) + , bInitialized(false) + { + pSystem = aSysLocale.GetLocaleDataPtr(); + init( rxSMgr, rLocale, eLang ); + } + ~OnDemandLocaleDataWrapper() + { + delete pEnglish; + delete pAny; + } + + bool isInitialized() const { return bInitialized; } + + bool is() const { return pCurrent != NULL; } + + void init( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::lang::Locale& rLocale, + LanguageType eLang + ) + { + xSMgr = rxSMgr; + changeLocale( rLocale, eLang ); + bInitialized = true; + } + + void changeLocale( ::com::sun::star::lang::Locale& rLocale, LanguageType eLang ) + { + switch ( eLang ) + { + case LANGUAGE_SYSTEM : + pCurrent = pSystem; + break; + case LANGUAGE_ENGLISH_US : + if ( !pEnglish ) + pEnglish = new LocaleDataWrapper( xSMgr, rLocale ); + pCurrent = pEnglish; + break; + default: + if ( !pAny ) + { + pAny = new LocaleDataWrapper( xSMgr, rLocale ); + eLastAnyLanguage = eLang; + } + else if ( eLastAnyLanguage != eLang ) + { + pAny->setLocale( rLocale ); + eLastAnyLanguage = eLang; + } + pCurrent = pAny; + } + eCurrentLanguage = eLang; + } + + LanguageType getCurrentLanguage() const + { return eCurrentLanguage; } + + LocaleDataWrapper* getAnyLocale() + { + if ( !pAny ) + { + pAny = new LocaleDataWrapper( xSMgr, pCurrent->getLocale() ); + eLastAnyLanguage = eCurrentLanguage; + } + else if ( pCurrent != pAny ) + { + pAny->setLocale( pCurrent->getLocale() ); + eLastAnyLanguage = eCurrentLanguage; + } + return pAny; + } + + const LocaleDataWrapper* get() const { return pCurrent; } + const LocaleDataWrapper* operator->() const { return get(); } + const LocaleDataWrapper& operator*() const { return *get(); } +}; + +/** Load a calendar only if it's needed. + SvNumberformatter uses it upon switching locales. + @ATTENTION If the default ctor is used the init() method MUST be called + before accessing the calendar. + */ +class OnDemandCalendarWrapper +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + ::com::sun::star::lang::Locale aLocale; + mutable CalendarWrapper* pPtr; + mutable bool bValid; + bool bInitialized; + +public: + OnDemandCalendarWrapper() + : pPtr(0) + , bValid(false) + , bInitialized(false) + {} + OnDemandCalendarWrapper( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::lang::Locale& rLocale + ) + : bValid(false) + , bInitialized(false) + { + init( rxSMgr, rLocale ); + } + ~OnDemandCalendarWrapper() + { + delete pPtr; + } + + bool isInitialized() const { return bInitialized; } + + bool is() const { return pPtr != NULL; } + + void init( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::lang::Locale& rLocale + ) + { + xSMgr = rxSMgr; + changeLocale( rLocale ); + if ( pPtr ) + { + delete pPtr; + pPtr = NULL; + } + bInitialized = true; + } + + void changeLocale( ::com::sun::star::lang::Locale& rLocale ) + { + bValid = false; + aLocale = rLocale; + } + + CalendarWrapper* get() const + { + if ( !bValid ) + { + if ( !pPtr ) + pPtr = new CalendarWrapper( xSMgr ); + pPtr->loadDefaultCalendar( aLocale ); + bValid = true; + } + return pPtr; + } + + CalendarWrapper* operator->() { return get(); } + CalendarWrapper& operator*() { return *get(); } +}; + +/** Load a collator only if it's needed. + SvNumberformatter uses it upon switching locales. + @ATTENTION If the default ctor is used the init() method MUST be called + before accessing the collator. + */ +class OnDemandCollatorWrapper +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + ::com::sun::star::lang::Locale aLocale; + mutable CollatorWrapper* pPtr; + mutable bool bValid; + bool bInitialized; + +public: + OnDemandCollatorWrapper() + : pPtr(0) + , bValid(false) + , bInitialized(false) + {} + OnDemandCollatorWrapper( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::lang::Locale& rLocale + ) + : bValid(false) + , bInitialized(false) + { + init( rxSMgr, rLocale ); + } + ~OnDemandCollatorWrapper() + { + delete pPtr; + } + + bool isInitialized() const { return bInitialized; } + + bool is() const { return pPtr != NULL; } + + void init( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ::com::sun::star::lang::Locale& rLocale + ) + { + xSMgr = rxSMgr; + changeLocale( rLocale ); + if ( pPtr ) + { + delete pPtr; + pPtr = NULL; + } + bInitialized = true; + } + + void changeLocale( ::com::sun::star::lang::Locale& rLocale ) + { + bValid = false; + aLocale = rLocale; + } + + const CollatorWrapper* get() const + { + if ( !bValid ) + { + if ( !pPtr ) + pPtr = new CollatorWrapper( xSMgr ); + pPtr->loadDefaultCollator( aLocale, ::com::sun::star::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE ); + bValid = true; + } + return pPtr; + } + + const CollatorWrapper* operator->() const { return get(); } + const CollatorWrapper& operator*() const { return *get(); } +}; + +/** Load a transliteration only if it's needed. + SvNumberformatter uses it upon switching locales. + @ATTENTION If the default ctor is used the init() method MUST be called + before accessing the transliteration. + */ +class OnDemandTransliterationWrapper +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + LanguageType eLanguage; + ::com::sun::star::i18n::TransliterationModules nType; + mutable ::utl::TransliterationWrapper* pPtr; + mutable bool bValid; + bool bInitialized; + +public: + OnDemandTransliterationWrapper() + : eLanguage( LANGUAGE_SYSTEM ) + , pPtr(0) + , bValid(false) + , bInitialized(false) + {} + OnDemandTransliterationWrapper( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + LanguageType eLang, + ::com::sun::star::i18n::TransliterationModules nTypeP + ) + : bValid(false) + , bInitialized(false) + { + init( rxSMgr, eLang, nTypeP ); + } + ~OnDemandTransliterationWrapper() + { + delete pPtr; + } + + bool isInitialized() const { return bInitialized; } + + bool is() const { return pPtr != NULL; } + + void init( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + LanguageType eLang, + ::com::sun::star::i18n::TransliterationModules nTypeP + ) + { + xSMgr = rxSMgr; + nType = nTypeP; + changeLocale( eLang ); + if ( pPtr ) + { + delete pPtr; + pPtr = NULL; + } + bInitialized = true; + } + + void changeLocale( LanguageType eLang ) + { + bValid = false; + eLanguage = eLang; + } + + const ::utl::TransliterationWrapper* get() const + { + if ( !bValid ) + { + if ( !pPtr ) + pPtr = new ::utl::TransliterationWrapper( xSMgr, nType ); + pPtr->loadModuleIfNeeded( eLanguage ); + bValid = true; + } + return pPtr; + } + + const ::utl::TransliterationWrapper* getForModule( const String& rModule, LanguageType eLang ) const + { + if ( !pPtr ) + pPtr = new ::utl::TransliterationWrapper( xSMgr, nType ); + pPtr->loadModuleByImplName( rModule, eLang ); + bValid = false; // reforce settings change in get() + return pPtr; + } + + const ::utl::TransliterationWrapper* operator->() const { return get(); } + const ::utl::TransliterationWrapper& operator*() const { return *get(); } +}; + +/** Load a native number service wrapper only if it's needed. + SvNumberformatter uses it. + + @ATTENTION + If the default ctor is used the init() method MUST be called + before accessing the native number supplier. + */ +class OnDemandNativeNumberWrapper +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + mutable NativeNumberWrapper* pPtr; + bool bInitialized; + +public: + OnDemandNativeNumberWrapper() + : pPtr(0) + , bInitialized(false) + {} + OnDemandNativeNumberWrapper( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr + ) + : pPtr(0) + , bInitialized(false) + { + init( rxSMgr ); + } + ~OnDemandNativeNumberWrapper() + { + delete pPtr; + } + + bool isInitialized() const { return bInitialized; } + + void init( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr + ) + { + xSMgr = rxSMgr; + if ( pPtr ) + { + delete pPtr; + pPtr = NULL; + } + bInitialized = true; + } + + bool is() const { return pPtr != NULL; } + + NativeNumberWrapper* get() const + { + if ( !pPtr ) + pPtr = new NativeNumberWrapper( xSMgr ); + return pPtr; + } + + NativeNumberWrapper* operator->() { return get(); } + NativeNumberWrapper& operator*() { return *get(); } +}; + +#endif // INCLUDED_SVTOOLS_ONDEMAND_HXX + diff --git a/svl/inc/svl/ownlist.hxx b/svl/inc/svl/ownlist.hxx new file mode 100644 index 000000000000..472f50e6ef60 --- /dev/null +++ b/svl/inc/svl/ownlist.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * 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: ownlist.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 _OWNLIST_HXX +#define _OWNLIST_HXX + +#include "svtools/svtdllapi.h" +#include <tools/stream.hxx> +#include <tools/ownlist.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +namespace com { namespace sun { namespace star { + namespace beans { + struct PropertyValue; + } +}}} + +//========================================================================= +class SvCommand +/* [Beschreibung] + + Enth"alt einen String, welcher das Kommando angibt und eine weiteren + String, der das Argument des Kommandos bildet. W"urde solch ein + Kommando "uber die Kommandozeile angegeben werden, s"ahe es wie folgt + aus: Kommando = Argument. +*/ +{ + String aCommand; + String aArgument; +public: + SvCommand() {} + SvCommand( const String & rCommand, const String & rArg ) + { + aCommand = rCommand; + aArgument = rArg; + } + const String & GetCommand() const { return aCommand; } + const String & GetArgument() const { return aArgument; } + + friend SvStream& operator >> ( SvStream& rStm, SvCommand & rThis ) + { + rStm.ReadByteString( rThis.aCommand, gsl_getSystemTextEncoding() ); + rStm.ReadByteString( rThis.aArgument, gsl_getSystemTextEncoding() ); + return rStm; + } + friend SvStream& operator << ( SvStream& rStm, const SvCommand & rThis ) + { + rStm.WriteByteString( rThis.aCommand, gsl_getSystemTextEncoding() ); + rStm.WriteByteString( rThis.aArgument, gsl_getSystemTextEncoding() ); + return rStm; + } +}; + +//========================================================================= +class SVT_DLLPUBLIC SvCommandList +/* [Beschreibung] + + Die Liste enth"alt Objekte vom Typ SvCommand. Wird ein Objekt + eingef"ugt, dann wird es kopiert und das neue Objekt wird + in die Liste gestellt. +*/ +{ + PRV_SV_DECL_OWNER_LIST(SvCommandList,SvCommand); + SvCommand & Append( const String & rCommand, const String & rArg ); + BOOL AppendCommands( const String & rCmd, USHORT * pEaten ); + String GetCommands() const; + + BOOL FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); + void FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& ); + + SVT_DLLPUBLIC friend SvStream& operator >> ( SvStream& rStm, SvCommandList & ); + SVT_DLLPUBLIC friend SvStream& operator << ( SvStream&, const SvCommandList & ); +}; + +#endif // _OWNLIST_HXX diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx new file mode 100644 index 000000000000..7e0fea44b87a --- /dev/null +++ b/svl/inc/svl/poolitem.hxx @@ -0,0 +1,491 @@ +/************************************************************************* + * + * 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: poolitem.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 _SFXPOOLITEM_HXX +#define _SFXPOOLITEM_HXX + +#include "svtools/svldllapi.h" +#include <com/sun/star/uno/Any.hxx> + +#define TF_POOLABLE +#include <sal/config.h> +#include <tools/rtti.hxx> +#include <limits.h> +#include <tools/solar.h> +#include <tools/debug.hxx> +#include <tools/string.hxx> +#include <svtools/svarray.hxx> +#include <svtools/hint.hxx> + +typedef long SfxArgumentError; + +class SbxVariable; +class SbxObject; +class SvStream; +class Color; +class IntlWrapper; + +namespace com { namespace sun { namespace star { namespace uno { class Any; } } } } + +#define SFX_ITEMS_DIRECT 0xffff +#define SFX_ITEMS_NULL 0xfff0 // anstelle StoreSurrogate + +#define SFX_ITEMS_POOLDEFAULT 0xffff +#define SFX_ITEMS_STATICDEFAULT 0xfffe +#define SFX_ITEMS_DELETEONIDLE 0xfffd + +#define SFX_ITEMS_OLD_MAXREF 0xffef +#define SFX_ITEMS_MAXREF 0xfffffffe +#define SFX_ITEMS_SPECIAL 0xffffffff + +#define CONVERT_TWIPS 0x80 //Uno-Konvertierung fuer Massangaben (fuer MemberId) + +// ----------------------------------------------------------------------- + +// UNO3 shortcuts + +// warning, if there is no boolean inside the any this will always return the value false +inline sal_Bool Any2Bool( const ::com::sun::star::uno::Any&rValue ) +{ + sal_Bool nValue = sal_False; + if( rValue.hasValue() ) + { + if( rValue.getValueType() == ::getCppuBooleanType() ) + { + nValue = *(sal_Bool*)rValue.getValue(); + } + else + { + sal_Int32 nNum = 0; + if( rValue >>= nNum ) + nValue = nNum != 0; + } + } + + return nValue; +} + +inline ::com::sun::star::uno::Any Bool2Any( sal_Bool bValue ) +{ + return ::com::sun::star::uno::Any( &bValue, ::getCppuBooleanType() ); +} + +// ----------------------------------------------------------------------- + +//! Notloesung!!! +enum SfxFieldUnit +{ + SFX_FUNIT_NONE, SFX_FUNIT_MM, SFX_FUNIT_CM, SFX_FUNIT_M, SFX_FUNIT_KM, + SFX_FUNIT_TWIP, SFX_FUNIT_POINT, SFX_FUNIT_PICA, + SFX_FUNIT_INCH, SFX_FUNIT_FOOT, SFX_FUNIT_MILE, SFX_FUNIT_CUSTOM +}; + +enum SfxMapUnit +{ + SFX_MAPUNIT_100TH_MM, + SFX_MAPUNIT_10TH_MM, + SFX_MAPUNIT_MM, + SFX_MAPUNIT_CM, + SFX_MAPUNIT_1000TH_INCH, + SFX_MAPUNIT_100TH_INCH, + SFX_MAPUNIT_10TH_INCH, + SFX_MAPUNIT_INCH, + SFX_MAPUNIT_POINT, + SFX_MAPUNIT_TWIP, + SFX_MAPUNIT_PIXEL, + SFX_MAPUNIT_SYSFONT, + SFX_MAPUNIT_APPFONT, + SFX_MAPUNIT_RELATIVE, + SFX_MAPUNIT_ABSOLUTE +}; + +// ----------------------------------------------------------------------- + +enum SfxItemPresentation + +/* [Beschreibung] + + Die Werte dieses Enums bezeichnen den Grad der textuellen + Presentation eines Items nach Aufruf der virtuellen Methode + <SfxPoolItem::GetPresentation()const>. +*/ + +{ + SFX_ITEM_PRESENTATION_NONE, + SFX_ITEM_PRESENTATION_NAMEONLY, + SFX_ITEM_PRESENTATION_NAMELESS, + SFX_ITEM_PRESENTATION_COMPLETE +}; + +// ----------------------------------------------------------------------- + +typedef USHORT SfxItemState; + +#define SFX_ITEM_UNKNOWN 0x0000 + +#define SFX_ITEM_DISABLED 0x0001 +#define SFX_ITEM_READONLY 0x0002 + +#define SFX_ITEM_DONTCARE 0x0010 +#define SFX_ITEM_DEFAULT 0x0020 +#define SFX_ITEM_SET 0x0030 + +// old stuff - dont use!!! +#define SFX_ITEM_AVAILABLE SFX_ITEM_DEFAULT +#define SFX_ITEM_OFF SFX_ITEM_DEFAULT +#define SFX_ITEM_ON SFX_ITEM_SET + +DBG_NAMEEX_VISIBILITY(SfxPoolItem, SVL_DLLPUBLIC) +DBG_NAMEEX(SfxVoidItem) +DBG_NAMEEX(SfxItemHandle) + +class SvXMLUnitConverter; +class SfxItemPool; +class SfxItemSet; + +class String; +namespace rtl +{ + class OUString; +} + +// ----------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxPoolItem +{ +friend class SfxItemPool; +friend class SfxItemDesruptor_Impl; +friend class SfxItemPoolCache; +friend class SfxItemSet; +friend class SfxVoidItem; + + ULONG nRefCount; // Referenzzaehler + USHORT nWhich; + USHORT nKind; + +private: + inline void SetRefCount( ULONG n ); + inline void SetKind( USHORT n ); +public: + inline ULONG AddRef( ULONG n = 1 ) const; +private: + inline ULONG ReleaseRef( ULONG n = 1 ) const; + SVL_DLLPRIVATE long Delete_Impl(void*); + +#if 0 + // @@@ virtual, but private, and dummy impl. @@@ + virtual void Store( SvStream & ) const; + virtual void GetVersion() const; +#endif + +protected: + SfxPoolItem( USHORT nWhich = 0 ); + SfxPoolItem( const SfxPoolItem& ); + +public: + TYPEINFO(); + virtual ~SfxPoolItem(); + + void SetWhich( USHORT nId ) { + DBG_CHKTHIS(SfxPoolItem, 0); + nWhich = nId; } + USHORT Which() const { + DBG_CHKTHIS(SfxPoolItem, 0); + return nWhich; } + virtual int operator==( const SfxPoolItem& ) const = 0; + int operator!=( const SfxPoolItem& rItem ) const + { return !(*this == rItem); } + virtual int Compare( const SfxPoolItem &rWith ) const; + virtual int Compare( const SfxPoolItem &rWith, const IntlWrapper& rIntlWrapper ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresentationMetric, + XubString &rText, + const IntlWrapper * pIntlWrapper = 0 ) const; + + virtual USHORT GetVersion( USHORT nFileFormatVersion ) const; + virtual int ScaleMetrics( long lMult, long lDiv ); + virtual int HasMetrics() const; + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); + + virtual SfxPoolItem* Create( SvStream &, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; + + ULONG GetRefCount() const { return nRefCount; } + inline USHORT GetKind() const { return nKind; } + + /** Read in a Unicode string from a streamed byte string representation. + + @param rStream Some (input) stream. Its Stream/TargetCharSets must + be set to correct values! + + @param rString On success, returns the reconstructed Unicode string. + + @return True if the string was successfuly read and reconstructed. + */ + static bool readByteString(SvStream & rStream, UniString & rString); + + /** Write a byte string representation of a Unicode string into a stream. + + @param rStream Some (output) stream. Its Stream/TargetCharSets must + be set to correct values! + + @param rString Some Unicode string. + */ + static void writeByteString(SvStream & rStream, + UniString const & rString); + + /** Read in a Unicode string from either a streamed Unicode or byte string + representation. + + @param rStream Some (input) stream. If bUnicode is false, its + Stream/TargetCharSets must be set to correct values! + + @param rString On success, returns the reconstructed Unicode string. + + @param bUnicode Whether to read in a stream Unicode (true) or byte + string (false) representation. + + @return True if the string was successfuly read and reconstructed. + */ + static bool readUnicodeString(SvStream & rStream, UniString & rString, + bool bUnicode); + + /** Write a Unicode string representation of a Unicode string into a + stream. + + @param rStream Some (output) stream. + + @param rString Some Unicode string. + */ + static void writeUnicodeString(SvStream & rStream, + UniString const & rString); + +private: + SfxPoolItem& operator=( const SfxPoolItem& ); // n.i.!! +}; + +// ----------------------------------------------------------------------- + +inline void SfxPoolItem::SetRefCount( ULONG n ) +{ + DBG_CHKTHIS( SfxPoolItem, 0 ); + nRefCount = n; + nKind = 0; +} + +inline void SfxPoolItem::SetKind( USHORT n ) +{ + DBG_CHKTHIS( SfxPoolItem, 0 ); + nRefCount = SFX_ITEMS_SPECIAL; + nKind = n; +} + +inline ULONG SfxPoolItem::AddRef( ULONG n ) const +{ + DBG_CHKTHIS( SfxPoolItem, 0 ); + DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); + DBG_ASSERT( ULONG_MAX - nRefCount > n, "AddRef: Referenzzaehler ueberschlaegt sich" ); + return ( ((SfxPoolItem *)this)->nRefCount += n ); +} + +inline ULONG SfxPoolItem::ReleaseRef( ULONG n ) const +{ + DBG_CHKTHIS( SfxPoolItem, 0 ); + DBG_ASSERT( nRefCount <= SFX_ITEMS_MAXREF, "AddRef mit nicht-Pool-Item" ); + DBG_ASSERT( nRefCount >= n, "ReleaseRef: Referenzzaehler ueberschlaegt sich" ); + ((SfxPoolItem *)this)->nRefCount -= n; + return nRefCount; +} + +// ----------------------------------------------------------------------- + +inline int IsPoolDefaultItem(const SfxPoolItem *pItem ) +{ + return pItem && pItem->GetKind() == SFX_ITEMS_POOLDEFAULT; +} + +inline int IsStaticDefaultItem(const SfxPoolItem *pItem ) +{ + return pItem && pItem->GetKind() == SFX_ITEMS_STATICDEFAULT; +} + +inline int IsDefaultItem( const SfxPoolItem *pItem ) +{ + return pItem && pItem->GetKind() >= SFX_ITEMS_STATICDEFAULT; +} + +inline int IsPooledItem( const SfxPoolItem *pItem ) +{ + return pItem && pItem->GetRefCount() > 0 && pItem->GetRefCount() <= SFX_ITEMS_MAXREF; +} + +inline int IsInvalidItem(const SfxPoolItem *pItem) +{ + return pItem == (SfxPoolItem *)-1; +} + +// ----------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxVoidItem: public SfxPoolItem +{ + SfxVoidItem & operator=( const SfxVoidItem& ); // not implemented. +public: + TYPEINFO(); + SfxVoidItem( USHORT nWhich ); + SfxVoidItem( USHORT nWhich, SvStream & ); + SfxVoidItem( const SfxVoidItem& ); + ~SfxVoidItem(); + + virtual int operator==( const SfxPoolItem& ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + + // von sich selbst eine Kopie erzeugen + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + void SetWhich(USHORT nWh) { nWhich = nWh; } +}; + +// ----------------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxSetItem: public SfxPoolItem +{ + SfxItemSet *pSet; + + SfxSetItem & operator=( const SfxSetItem& ); // not implemented. + +public: + TYPEINFO(); + SfxSetItem( USHORT nWhich, SfxItemSet *pSet ); + SfxSetItem( USHORT nWhich, const SfxItemSet &rSet ); + SfxSetItem( const SfxSetItem&, SfxItemPool *pPool = 0 ); + ~SfxSetItem(); + + virtual int operator==( const SfxPoolItem& ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + + // von sich selbst eine Kopie erzeugen + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const = 0; + virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const = 0; + virtual SvStream& Store(SvStream &, USHORT nVer) const; + + const SfxItemSet& GetItemSet() const + { return *pSet; } + SfxItemSet& GetItemSet() + { return *pSet; } +}; + +// ----------------------------------------------------------------------- + +#if 0 /* @@@ NOT USED @@@ */ +class SfxInvalidItem: public SfxPoolItem +{ +friend class SfxItemSet; + + const SfxPoolItem* pDefaultItem; + +private: + TYPEINFO(); + SfxInvalidItem( USHORT nWhich, const SfxPoolItem &rDefault ); + SfxInvalidItem( const SfxInvalidItem& ); + virtual ~SfxInvalidItem(); + +public: + virtual int operator==( const SfxPoolItem& ) const; + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + const SfxPoolItem* GetDefaultItem() const { return pDefaultItem; } + + // von sich selbst eine Kopie erzeugen + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nVersion) const; + virtual SvStream& Store(SvStream &, USHORT nVer ) const; +}; +#endif /* @@@ NOT USED @@@ */ + +// ----------------------------------------------------------------------- +// Handle Klasse fuer PoolItems + +class SVL_DLLPUBLIC SfxItemHandle +{ + USHORT *pRef; + SfxPoolItem *pItem; +public: + SfxItemHandle( SfxPoolItem& ); + SfxItemHandle( const SfxItemHandle& ); + ~SfxItemHandle(); + + const SfxItemHandle &operator=(const SfxItemHandle &); + const SfxPoolItem &GetItem() const { return *pItem; } +}; + +// ----------------------------------------------------------------------- + +DECL_PTRHINT(SVL_DLLPUBLIC, SfxPoolItemHint, SfxPoolItem); + +// ----------------------------------------------------------------------- + +#if 0 /* @@@ NOT USED @@@ */ +class SfxItemChangedHint: public SfxHint +{ + const SfxPoolItem& _rOld; + const SfxPoolItem& _rNew; + +public: + TYPEINFO(); \ + SfxItemChangedHint( const SfxPoolItem &rOld, + const SfxPoolItem &rNew ) + : _rOld( rOld ), + _rNew( rNew ) + {} + + const SfxPoolItem& GetOldItem() const { return _rOld; } + const SfxPoolItem& GetNewItem() const { return _rNew; } +}; + +#endif /* @@@ NOT USED @@@ */ + +#endif // #ifndef _SFXPOOLITEM_HXX diff --git a/svl/inc/svl/ptitem.hxx b/svl/inc/svl/ptitem.hxx new file mode 100644 index 000000000000..923ab73da1d5 --- /dev/null +++ b/svl/inc/svl/ptitem.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: ptitem.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 _SFXPTITEM_HXX +#define _SFXPTITEM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/poolitem.hxx> +#include <tools/gen.hxx> + +class SvStream; + +DBG_NAMEEX_VISIBILITY(SfxPointItem, SVT_DLLPUBLIC) + +// ----------------------------------------------------------------------- + +class SVT_DLLPUBLIC SfxPointItem: public SfxPoolItem +{ + Point aVal; + +public: + TYPEINFO(); + SfxPointItem(); + SfxPointItem( USHORT nWhich, const Point& rVal ); + SfxPointItem( USHORT nWhich, SvStream & ); + SfxPointItem( const SfxPointItem& ); + ~SfxPointItem() { + DBG_DTOR(SfxPointItem, 0); } + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + + virtual int operator==( const SfxPoolItem& ) const; + + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + + const Point& GetValue() const { return aVal; } + void SetValue( const Point& rNewVal ) { + DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); + aVal = rNewVal; + } + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); +}; + +#endif diff --git a/svl/inc/svl/rectitem.hxx b/svl/inc/svl/rectitem.hxx new file mode 100644 index 000000000000..39c85d9ab228 --- /dev/null +++ b/svl/inc/svl/rectitem.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: rectitem.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 _SFXRECTITEM_HXX +#define _SFXRECTITEM_HXX + +#include "svtools/svtdllapi.h" +#include <tools/debug.hxx> +#include <tools/gen.hxx> +#include <svtools/poolitem.hxx> + +class SvStream; + +DBG_NAMEEX_VISIBILITY(SfxRectangleItem, SVT_DLLPUBLIC) + +// ----------------------------------------------------------------------- + +class SVT_DLLPUBLIC SfxRectangleItem: public SfxPoolItem +{ + Rectangle aVal; + +public: + TYPEINFO(); + SfxRectangleItem(); + SfxRectangleItem( USHORT nWhich, const Rectangle& rVal ); + SfxRectangleItem( USHORT nWhich, SvStream & ); + SfxRectangleItem( const SfxRectangleItem& ); + ~SfxRectangleItem() { + DBG_DTOR(SfxRectangleItem, 0); } + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + + const Rectangle& GetValue() const { return aVal; } + void SetValue( const Rectangle& rNewVal ) { + DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); + aVal = rNewVal; + } + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); +}; + +#endif + diff --git a/svl/inc/svl/restrictedpaths.hxx b/svl/inc/svl/restrictedpaths.hxx new file mode 100644 index 000000000000..218e34cd4556 --- /dev/null +++ b/svl/inc/svl/restrictedpaths.hxx @@ -0,0 +1,85 @@ +/************************************************************************* + * + * 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: restrictedpaths.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 SVTOOLS_RESTRICTEDPATHS_HXX +#define SVTOOLS_RESTRICTEDPATHS_HXX + +#include <svtools/urlfilter.hxx> +#include <svtools/svtdllapi.h> +#include <tools/string.hxx> + +#include <vector> + +namespace svt +{ + class SVT_DLLPUBLIC RestrictedPaths : public IUrlFilter + { + private: + ::std::vector< String > m_aUnrestrictedURLs; + bool m_bFilterIsEnabled; + + public: + RestrictedPaths(); + virtual ~RestrictedPaths(); + + inline bool hasFilter() const { return !m_aUnrestrictedURLs.empty(); } + inline const ::std::vector< String >& getFilter() const { return m_aUnrestrictedURLs; } + + inline void enableFilter( bool _bEnable ) { m_bFilterIsEnabled = _bEnable; } + inline bool isFilterEnabled() const { return m_bFilterIsEnabled; } + + public: + /** checks URL access permissions + + <p>with the "restriction" feature we have in the file dialog, it's possible that + only certain URLs can be browsed. This method checks whether a given URL belongs + to this set of permitted URLs.</p> + + <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p> + */ + virtual bool isUrlAllowed( const String& _rURL ) const; + + /** checks URL access permissions + + <p>with the "restriction" feature we have in the file dialog, it's possible that + only certain URLs can be browsed. This method checks whether a given URL belongs + to this set of permitted URLs.</p> + + <p>Default behavior allows access to parent folder of a restricted folder (but not to its siblings). + If allowParents is set to <FALSE/> parent folders will be treated as forbidden. + + <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p> + */ + bool isUrlAllowed( const String& _rURL, bool allowParents ) const; + }; + +} // namespace svt + +#endif // SVTOOLS_RESTRICTEDPATHS_HXX diff --git a/svl/inc/svl/rngitem.hxx b/svl/inc/svl/rngitem.hxx new file mode 100644 index 000000000000..52831f93f71f --- /dev/null +++ b/svl/inc/svl/rngitem.hxx @@ -0,0 +1,117 @@ +/************************************************************************* + * + * 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: rngitem.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 _SFXRNGITEM_HXX + +#ifndef NUMTYPE + +#define NUMTYPE USHORT +#define SfxXRangeItem SfxRangeItem +#define SfxXRangesItem SfxUShortRangesItem +#include <svtools/rngitem.hxx> +#undef NUMTYPE +#undef SfxXRangeItem +#undef SfxXRangesItem + +#ifndef _SFXITEMS_HXX +#define NUMTYPE ULONG +#define SfxXRangeItem SfxULongRangeItem +#define SfxXRangesItem SfxULongRangesItem +#include <svtools/rngitem.hxx> +#undef NUMTYPE +#undef SfxXRangeItem +#undef SfxXRangesItem +#endif + +#define _SFXRNGITEM_HXX + +#else +#include "svtools/svtdllapi.h" +#include <svtools/poolitem.hxx> + +class SvStream; + +// ----------------------------------------------------------------------- + +class SVT_DLLPUBLIC SfxXRangeItem : public SfxPoolItem +{ +private: + NUMTYPE nFrom; + NUMTYPE nTo; +public: + TYPEINFO(); + SfxXRangeItem(); + SfxXRangeItem( USHORT nWID, NUMTYPE nFrom, NUMTYPE nTo ); + SfxXRangeItem( USHORT nWID, SvStream &rStream ); + SfxXRangeItem( const SfxXRangeItem& rItem ); + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + inline NUMTYPE& From() { return nFrom; } + inline NUMTYPE From() const { return nFrom; } + inline NUMTYPE& To() { return nTo; } + inline NUMTYPE To() const { return nTo; } + inline BOOL HasRange() const { return nTo>nFrom; } + virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; + virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; +}; + +// ----------------------------------------------------------------------- + +class SVT_DLLPUBLIC SfxXRangesItem : public SfxPoolItem +{ +private: + NUMTYPE* _pRanges; + +public: + TYPEINFO(); + SfxXRangesItem(); + SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges ); + SfxXRangesItem( USHORT nWID, SvStream &rStream ); + SfxXRangesItem( const SfxXRangesItem& rItem ); + virtual ~SfxXRangesItem(); + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + inline const NUMTYPE* GetRanges() const { return _pRanges; } + virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; + virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; +}; + +#endif +#endif diff --git a/svl/inc/svl/sfontitm.hxx b/svl/inc/svl/sfontitm.hxx new file mode 100644 index 000000000000..e1394dec91b3 --- /dev/null +++ b/svl/inc/svl/sfontitm.hxx @@ -0,0 +1,244 @@ +/************************************************************************* + * + * 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: sfontitm.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 _SFONTITM_HXX +#define _SFONTITM_HXX + +#include <tools/color.hxx> +#include <tools/gen.hxx> +#include <i18npool/lang.h> +#include <svtools/poolitem.hxx> + +//============================================================================ +class SfxFontItem: public SfxPoolItem +{ + XubString m_aName; + XubString m_aStyleName; + Size m_aSize; + Color m_aColor; + Color m_aFillColor; + rtl_TextEncoding m_nCharSet; + LanguageType m_nLanguage; + sal_Int16 m_nFamily; + sal_Int16 m_nPitch; + sal_Int16 m_nWeight; + sal_Int16 m_nWidthType; + sal_Int16 m_nItalic; + sal_Int16 m_nUnderline; + sal_Int16 m_nStrikeout; + sal_Int16 m_nOrientation; + unsigned m_bWordLine: 1; + unsigned m_bOutline: 1; + unsigned m_bShadow: 1; + unsigned m_bKerning: 1; + unsigned m_bHasFont: 1; + unsigned m_bHasColor: 1; + unsigned m_bHasFillColor: 1; + +public: + TYPEINFO(); + + inline SfxFontItem(USHORT nWhich); + + virtual int operator ==(const SfxPoolItem & rItem) const; + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const + { return new SfxFontItem(*this); } + + sal_Bool hasFont() const { return m_bHasFont; } + + sal_Bool hasColor() const { return m_bHasColor; } + + sal_Bool hasFillColor() const { return m_bHasFillColor; } + + const XubString & getName() const { return m_aName; } + + const XubString & getStyleName() const { return m_aStyleName; } + + const Size & getSize() const { return m_aSize; } + + const Color & getColor() const { return m_aColor; } + + const Color & getFillColor() const { return m_aFillColor; } + + rtl_TextEncoding getCharSet() const { return m_nCharSet; } + + LanguageType getLanguage() const { return m_nLanguage; } + + sal_Int16 getFamily() const { return m_nFamily; } + + sal_Int16 getPitch() const { return m_nPitch; } + + sal_Int16 getWeight() const { return m_nWeight; } + + sal_Int16 getWidthType() const { return m_nWidthType; } + + sal_Int16 getItalic() const { return m_nItalic; } + + sal_Int16 getUnderline() const { return m_nUnderline; } + + sal_Int16 getStrikeout() const { return m_nStrikeout; } + + sal_Int16 getOrientation() const { return m_nOrientation; } + + sal_Bool getWordLine() const { return m_bWordLine; } + + sal_Bool getOutline() const { return m_bOutline; } + + sal_Bool getShadow() const { return m_bShadow; } + + sal_Bool getKerning() const { return m_bKerning; } + + inline void setFont(sal_Int16 nTheFamily, const XubString & rTheName, + const XubString & rTheStyleName, sal_Int16 nThePitch, + rtl_TextEncoding nTheCharSet); + + inline void setWeight(sal_Int16 nTheWeight); + + inline void setItalic(sal_Int16 nTheItalic); + + inline void setHeight(sal_Int32 nHeight); + + inline void setColor(const Color & rTheColor); + + inline void setFillColor(const Color & rTheFillColor); + + inline void setUnderline(sal_Int16 nTheUnderline); + + inline void setStrikeout(sal_Int16 nTheStrikeout); + + inline void setOutline(sal_Bool bTheOutline); + + inline void setShadow(sal_Bool bTheShadow); + + inline void setLanguage(LanguageType nTheLanguage); +}; + +inline SfxFontItem::SfxFontItem(USHORT which): + SfxPoolItem(which), + m_nCharSet(RTL_TEXTENCODING_DONTKNOW), + m_nLanguage(LANGUAGE_DONTKNOW), + m_nFamily(0), // FAMILY_DONTKNOW + m_nPitch(0), // PITCH_DONTKNOW + m_nWeight(0), // WEIGHT_DONTKNOW + m_nWidthType(0), // WIDTH_DONTKNOW + m_nItalic(3), // ITALIC_DONTKNOW + m_nUnderline(4), // UNDERLINE_DONTKNOW + m_nStrikeout(3), // STRIKEOUT_DONTKNOW + m_nOrientation(0), + m_bWordLine(sal_False), + m_bOutline(sal_False), + m_bShadow(sal_False), + m_bKerning(sal_False), + m_bHasFont(sal_False), + m_bHasColor(sal_False), + m_bHasFillColor(sal_False) +{} + +inline void SfxFontItem::setFont(sal_Int16 nTheFamily, + const XubString & rTheName, + const XubString & rTheStyleName, + sal_Int16 nThePitch, + rtl_TextEncoding nTheCharSet) +{ + m_nFamily = nTheFamily; + m_aName = rTheName; + m_aStyleName = rTheStyleName; + m_nPitch = nThePitch; + m_nCharSet = nTheCharSet; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setWeight(sal_Int16 nTheWeight) +{ + m_nWeight = nTheWeight; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setItalic(sal_Int16 nTheItalic) +{ + m_nItalic = nTheItalic; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setHeight(sal_Int32 nHeight) +{ + m_aSize.setHeight(nHeight); + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setColor(const Color & rTheColor) +{ + m_aColor = rTheColor; + m_bHasColor = sal_True; +} + +inline void SfxFontItem::setFillColor(const Color & rTheFillColor) +{ + m_aFillColor = rTheFillColor; + m_bHasFillColor = sal_True; +} + +inline void SfxFontItem::setUnderline(sal_Int16 nTheUnderline) +{ + m_nUnderline = nTheUnderline; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setStrikeout(sal_Int16 nTheStrikeout) +{ + m_nStrikeout = nTheStrikeout; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setOutline(sal_Bool bTheOutline) +{ + m_bOutline = bTheOutline; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setShadow(sal_Bool bTheShadow) +{ + m_bShadow = bTheShadow; + m_bHasFont = sal_True; +} + +inline void SfxFontItem::setLanguage(LanguageType nTheLanguage) +{ + m_nLanguage = nTheLanguage; + m_bHasFont = sal_True; +} + +#endif // _SFONTITM_HXX + diff --git a/svl/inc/svl/sharecontrolfile.hxx b/svl/inc/svl/sharecontrolfile.hxx new file mode 100644 index 000000000000..8735f8c5ccf7 --- /dev/null +++ b/svl/inc/svl/sharecontrolfile.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * 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: sharecontrolfile.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 _SVT_SHARECONTROLFILE_HXX +#define _SVT_SHARECONTROLFILE_HXX + +#include <svtools/svtdllapi.h> + +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/io/XTruncate.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> + +#include <svtools/lockfilecommon.hxx> + +#define SHARED_OOOUSERNAME_ID LOCKFILE_OOOUSERNAME_ID +#define SHARED_SYSUSERNAME_ID LOCKFILE_SYSUSERNAME_ID +#define SHARED_LOCALHOST_ID LOCKFILE_LOCALHOST_ID +#define SHARED_EDITTIME_ID LOCKFILE_EDITTIME_ID +#define SHARED_USERURL_ID LOCKFILE_USERURL_ID +#define SHARED_ENTRYSIZE LOCKFILE_ENTRYSIZE + +namespace svt { + +class SVT_DLLPUBLIC ShareControlFile : public LockFileCommon +{ + ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOutputStream; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeekable; + ::com::sun::star::uno::Reference< ::com::sun::star::io::XTruncate > m_xTruncate; + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > m_aUsersData; + + void OpenStream(); + void Close(); + sal_Bool IsValid() + { + return ( m_xFactory.is() && m_xStream.is() && m_xInputStream.is() && m_xOutputStream.is() && m_xSeekable.is() && m_xTruncate.is() ); + } + +public: + + // The constructor will throw exception in case the stream can not be opened + ShareControlFile( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ); + ~ShareControlFile(); + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > GetUsersData(); + void SetUsersDataAndStore( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >& aUserNames ); + ::com::sun::star::uno::Sequence< ::rtl::OUString > InsertOwnEntry(); + bool HasOwnEntry(); + void RemoveEntry( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aOptionalSpecification = ::com::sun::star::uno::Sequence< ::rtl::OUString >() ); + void RemoveFile(); +}; + +} + +#endif + diff --git a/svl/inc/svl/slstitm.hxx b/svl/inc/svl/slstitm.hxx new file mode 100644 index 000000000000..742d437fb842 --- /dev/null +++ b/svl/inc/svl/slstitm.hxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * 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: slstitm.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 _SFXSLSTITM_HXX +#define _SFXSLSTITM_HXX + +#include "svtools/svldllapi.h" +#include <tools/rtti.hxx> +#include <tools/list.hxx> +#include <svtools/poolitem.hxx> +#include <com/sun/star/uno/Sequence.h> + +class SfxImpStringList; + +class SVL_DLLPUBLIC SfxStringListItem : public SfxPoolItem +{ +protected: + SfxImpStringList* pImp; + +public: + TYPEINFO(); + + SfxStringListItem(); + SfxStringListItem( USHORT nWhich, const List* pList=NULL ); + SfxStringListItem( USHORT nWhich, SvStream& rStream ); + SfxStringListItem( const SfxStringListItem& rItem ); + ~SfxStringListItem(); + + List * GetList(); + + const List * GetList() const + { return SAL_CONST_CAST(SfxStringListItem *, this)->GetList(); } + +#ifndef TF_POOLABLE + virtual int IsPoolable() const; +#endif + + // String-Separator: \n + virtual void SetString( const XubString& ); + virtual XubString GetString(); + + void SetStringList( const com::sun::star::uno::Sequence< rtl::OUString >& rList ); + void GetStringList( com::sun::star::uno::Sequence< rtl::OUString >& rList ) const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const; + virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; + void Sort( BOOL bAscending = TRUE, List* pParallelList = 0 ); + + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; +}; +#endif diff --git a/svl/inc/svl/smplhint.hxx b/svl/inc/svl/smplhint.hxx new file mode 100644 index 000000000000..9858fefd86f0 --- /dev/null +++ b/svl/inc/svl/smplhint.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * 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: smplhint.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 _SFXSMPLHINT_HXX +#define _SFXSMPLHINT_HXX + +#include "svtools/svldllapi.h" +#include <svtools/hint.hxx> +#include <tools/rtti.hxx> + +#define SFX_HINT_DYING 0x00000001 +#define SFX_HINT_NAMECHANGED 0x00000002 +#define SFX_HINT_TITLECHANGED 0x00000004 +#define SFX_HINT_DATACHANGED 0x00000008 +#define SFX_HINT_DOCCHANGED 0x00000010 +#define SFX_HINT_UPDATEDONE 0x00000020 +#define SFX_HINT_DEINITIALIZING 0x00000040 +#define SFX_HINT_MODECHANGED 0x00000080 +#define SFX_HINT_CANCELLABLE 0x00000100 +#define SFX_HINT_DATAAVAILABLE 0x00000200 +#define SFX_HINT_SAVECOMPLETED 0x00000400 +#define SFX_HINT_RELEASEREF 0x00000800 +#define SFX_HINT_COLORS_CHANGED 0x00001000 +#define SFX_HINT_CTL_SETTINGS_CHANGED 0x00002000 +#define SFX_HINT_ACCESSIBILITY_CHANGED 0x00004000 +#define SFX_HINT_VIEWCREATED 0x00008000 +#define SFX_HINT_USER00 0x00010000 +#define SFX_HINT_USER01 0x00020000 +#define SFX_HINT_USER02 0x00040000 +#define SFX_HINT_USER03 0x00080000 +#define SFX_HINT_USER04 0x00100000 +#define SFX_HINT_USER05 0x00200000 +#define SFX_HINT_USER06 0x00400000 +#define SFX_HINT_USER07 0x00800000 +#define SFX_HINT_USER08 0x01000000 +#define SFX_HINT_USER09 0x02000000 +#define SFX_HINT_USER10 0x04000000 +#define SFX_HINT_USER11 0x08000000 +#define SFX_HINT_USER12 0x10000000 +#define SFX_HINT_USER13 0x20000000 +#define SFX_HINT_UNDO_OPTIONS_CHANGED 0x40000000 +#define SFX_HINT_USER_OPTIONS_CHANGED 0x80000000 +#define SFX_HINT_ALL 0xFFFFFFFF + +class SVL_DLLPUBLIC SfxSimpleHint: public SfxHint +{ +private: + ULONG nId; +public: + TYPEINFO(); + SfxSimpleHint( ULONG nId ); + ULONG GetId() const { return nId; } +}; + +//-------------------------------------------------------------------- + +#define DECL_OBJHINT(Name, Type) \ + class Name: public SfxSimpleHint \ + { \ + Type aObj; \ + \ + public: \ + TYPEINFO(); \ + Name( USHORT nId, const Type& rObject ); \ + ~Name(); \ + const Type& GetObject() const { return aObj; } \ + } + +#define IMPL_OBJHINT(Name, Type) \ + TYPEINIT1(Name, SfxSimpleHint); \ + Name::Name( USHORT nID, const Type& rObject ): \ + SfxSimpleHint( nID ), aObj(rObject) \ + { } \ + Name::~Name() {} + +#endif diff --git a/svl/inc/svl/solar.hrc b/svl/inc/svl/solar.hrc new file mode 100644 index 000000000000..348422ef6477 --- /dev/null +++ b/svl/inc/svl/solar.hrc @@ -0,0 +1,312 @@ +/************************************************************************* + * + * 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: solar.hrc,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 _SOLAR_HRC +#define _SOLAR_HRC + +// defines ------------------------------------------------------------------ + +#define CREATERESMGR_NAME( Name ) #Name +#define CREATERESMGR( Name ) ResMgr::CreateResMgr( CREATERESMGR_NAME( Name ) ) + +#define RID_SFX_START 260 +#define RID_SFX_END 9999 + +#define RID_LIB_START 10000 +#define RID_LIB_END 19999 + +#define RID_SVX_START (RID_LIB_START) +#define RID_SVX_END (RID_LIB_START+499) + +#define RID_SBASIC_START (RID_LIB_START+500) +#define RID_SBASIC_END (RID_LIB_START+2999) + +#define RID_BASIC_START (RID_LIB_START+3000) +#define RID_BASIC_END (RID_LIB_START+4499) + +#define RID_UUI_START (RID_LIB_START+4500) +#define RID_UUI_END (RID_LIB_START+4599) + +#define RID_HELP_START (RID_LIB_START+4600) +#define RID_HELP_END (RID_LIB_START+4799) + +#define RID_MAIL_START (RID_LIB_START+4800) +#define RID_MAIL_END (RID_LIB_START+4849) + +#define RID_BASICIDE_START (RID_LIB_START+4850) +#define RID_BASICIDE_END (RID_LIB_START+4949) + +#define RID_SVXITEMS_START (RID_LIB_START+4950) +#define RID_SVXITEMS_END (RID_LIB_START+5599) + +#define RID_SBA_START (RID_LIB_START+5600) +#define RID_SBA_END (RID_LIB_START+5649) + +#define RID_ISETBRW_START (RID_LIB_START+5650) +#define RID_ISETBRW_END (RID_LIB_START+5699) + +#define RID_EXTENSIONS_START (RID_LIB_START+5700) +#define RID_EXTENSIONS_END (RID_LIB_START+5799) + +#define RID_EDIT_START (RID_LIB_START+5800) +#define RID_EDIT_END (RID_LIB_START+5899) + +#define RID_EDIT_START (RID_LIB_START+5800) +#define RID_EDIT_END (RID_LIB_START+5899) + +#define RID_OUTL_START (RID_LIB_START+5900) +#define RID_OUTL_END (RID_LIB_START+5919) + +#define RID_SVTOOLS_START (RID_LIB_START+5920) +#define RID_SVTOOLS_END (RID_LIB_START+5999) + +#define RID_INET_START (RID_LIB_START+6000) +#define RID_INET_END (RID_LIB_START+6059) + +#define RID_SO2_START (RID_LIB_START+6060) +#define RID_SO2_END (RID_LIB_START+6099) + +#define RID_GOODIES_START (RID_LIB_START+6100) +#define RID_GOODIES_END (RID_LIB_START+6149) + +#define RID_SJ_START (RID_LIB_START+6150) +#define RID_SJ_END (RID_LIB_START+6199) + +#define RID_SI_START (RID_LIB_START+6200) +#define RID_SI_END (RID_LIB_START+6399) + +#define RID_DLG_START (RID_LIB_START+6400) +#define RID_DLG_END (RID_LIB_START+6499) + +#define RID_OFA_START (RID_LIB_START+6500) +#define RID_OFA_END (RID_LIB_START+6999) + +#define RID_CHANNEL_START (RID_LIB_START+7000) +#define RID_CHANNEL_END (RID_LIB_START+7499) + +#define RID_CHAOS_START (RID_LIB_START+7500) +#define RID_CHAOS_END (RID_LIB_START+7999) + +#define RID_FORMS_START (RID_LIB_START+8000) +#define RID_FORMS_END (RID_LIB_START+8999) + +#define RID_FORMLAYER_START (RID_LIB_START+9000) +#define RID_FORMLAYER_END (RID_LIB_START+9199) + +#define RID_DBACCESS_START (RID_LIB_START+9200) +#define RID_DBACCESS_END (RID_LIB_START+9699) + +#define RID_MORE_EXTENSIONS_START (RID_LIB_START+9700) +#define RID_MORE_EXTENSIONS_END (RID_LIB_START+9999) + +#define RID_DB_EXTENSIONS_START (RID_LIB_START+10000) +#define RID_DB_EXTENSIONS_END (RID_LIB_START+10199) + +#define RID_FILTER_START (RID_LIB_START+10200) +#define RID_FILTER_END (RID_LIB_START+10299) + +#define RID_APP_START 20000 +#define RID_APP_END 31999 + +#define RID_SW_START (20000) +#define RID_SW_END (25999) + +#define RID_SC_START (26000) +#define RID_SC_END (26999) + +#define RID_SD_START (27000) +#define RID_SD_END (27999) + +#define RID_Sa_START (28000) +#define RID_Sa_END (28999) + +#define RID_Sb_START (29000) +#define RID_Sb_END (29999) + +#define RID_OBJ_START (30000) +#define RID_OBJ_END (32767) + +#define RID_SIM_START (RID_OBJ_START+ 0) +#define RID_SIM_END (RID_OBJ_START+ 255) + +#define RID_SMA_START (RID_OBJ_START+ 256) +#define RID_SMA_END (RID_OBJ_START+ 511) + +#define RID_SCH_START (RID_OBJ_START+ 512) +#define RID_SCH_END (RID_OBJ_START+ 767) + +#define RID_RPT_START (RID_OBJ_START+768) +#define RID_RPT_END (RID_OBJ_START+1000) + +#define RID_FORMULA_START (RID_OBJ_START+1001) +#define RID_FORMULA_END (RID_OBJ_START+1200) +// Help-Ids -------------------------------------------------------------- + +#define HID_OK_BUTTON 0 +#define HID_CANCEL_BUTTON 0 +#define HID_HELP_BUTTON 0 + +#define HID_START 32768 + +#define HID_SVTOOLS_START (HID_START+200) +#define HID_SVTOOLS_END (HID_START+299) + +#define HID_SFX_START (HID_START+300) +#define HID_SFX_END (HID_START+999) + +#define HID_LIB_START (HID_START+1000) +#define HID_LIB_END (HID_START+19999) + +#define HID_SVX_START (HID_LIB_START) +#define HID_SVX_END (HID_LIB_START+431) + +#define HID_WIZARD_START (HID_LIB_START+432) +#define HID_WIZARD_END (HID_LIB_START+999) +//please note: There is also HID_WIZARD2 below + +#define HID_EXTENSIONS_START (HID_LIB_START+1000) +#define HID_EXTENSIONS_END (HID_LIB_START+1099) + +#define HID_SO2_START (HID_LIB_START+1100) +#define HID_SO2_END (HID_LIB_START+1149) + +#define HID_MAIL_START (HID_LIB_START+1150) +#define HID_MAIL_END (HID_LIB_START+1199) + +#define HID_INET_START (HID_LIB_START+1200) +#define HID_INET_END (HID_LIB_START+1259) + +#define HID_OFA_START (HID_LIB_START+1260) +#define HID_OFA_END (HID_LIB_START+1399) + +#define HID_HELP_START (HID_LIB_START+2000) +#define HID_HELP_END (HID_LIB_START+2050) + +#define HID_CHAOS_START (HID_LIB_START+2051) +#define HID_CHAOS_END (HID_LIB_START+2069) + +#define HID_UUI_START (HID_LIB_START+2070) +#define HID_UUI_END (HID_LIB_START+2099) + +#define HID_GOODIES_START (HID_LIB_START+2100) +#define HID_GOODIES_END (HID_LIB_START+2199) + +#define HID_SCHEDULE_START (HID_LIB_START+2200) +#define HID_SCHEDULE_END (HID_LIB_START+3399) + +#define HID_CHANNEL_START (HID_LIB_START+3400) +#define HID_CHANNEL_END (HID_LIB_START+3499) + +#define HID_SBA_START (HID_LIB_START+ 3500) +#define HID_SBA_END (HID_LIB_START+ 3999) + +#define HID_FORMS_START (HID_LIB_START+4000) +#define HID_FORMS_END (HID_LIB_START+4999) + +#define HID_DBACCESS_START (HID_LIB_START+5000) +#define HID_DBACCESS_END (HID_LIB_START+5299) + +#define HID_PORTAL_START (HID_LIB_START+5300) +#define HID_PORTAL_END (HID_LIB_START+5599) + +#define HID_PORTAL_ADMIN_START (HID_LIB_START+5600) +#define HID_PORTAL_ADMIN_END (HID_LIB_START+5999) + +#define HID_SYNCACCESS_START (HID_LIB_START+6000) +#define HID_SYNCACCESS_END (HID_LIB_START+6099) + +#define HID_SVX_EXT0_START (HID_LIB_START+6100) +#define HID_SVX_EXT0_END (HID_LIB_START+6599) + +#define HID_FRAMEWORK_START (HID_LIB_START+6600) +#define HID_FRAMEWORK_END (HID_LIB_START+6999) + +#define HID_WIZARD2_START (HID_LIB_START+7000) +#define HID_WIZARD2_END (HID_LIB_START+8999) + +#define HID_DESKTOP_START (HID_LIB_START+9000) +#define HID_DESKTOP_END (HID_LIB_START+9299) + +#define HID_XMLSECURITY_START (HID_LIB_START+9300) +#define HID_XMLSECURITY_END (HID_LIB_START+9999) + +#define HID_APP_START (HID_START+20000) +#define HID_APP_END (HID_START+29999) + +#define HID_SW_START (HID_START+20000) +#define HID_SW_END (HID_START+24999) + +#define HID_SC_START (HID_START+25000) +#define HID_SC_END (HID_START+26999) + +#define HID_SD_START (HID_START+27000) +#define HID_SD_END (HID_START+27999) + +#define HID_Sa_START (HID_START+28000) +#define HID_Sa_END (HID_START+28999) + +#define HID_Sb_START (HID_START+29000) +#define HID_Sb_END (HID_START+29999) + +#define HID_OBJ_START (HID_START+30000) +#define HID_OBJ_END (HID_START+32767) + +#define HID_SIM_START (HID_OBJ_START+ 0) +#define HID_SIM_END (HID_OBJ_START+ 239) + +#define HID_AVMEDIA_START (HID_OBJ_START+ 240) +#define HID_AVMEDIA_END (HID_OBJ_START+ 255) + +#define HID_SMA_START (HID_OBJ_START+ 256) +#define HID_SMA_END (HID_OBJ_START+ 511) + +#define HID_SCH_START (HID_OBJ_START+ 512) +#define HID_SCH_END (HID_OBJ_START+ 767) + +#define HID_BASICIDE_START (HID_OBJ_START+ 768) +#define HID_BASICIDE_END (HID_OBJ_START+1023) + +#define HID_SMA2_START (HID_OBJ_START+1024) +#define HID_SMA2_END (HID_OBJ_START+1280) + +#define HID_FILTER_START (HID_OBJ_START+1281) +#define HID_FILTER_END (HID_OBJ_START+1580) + +#define HID_LICENSING_START (HID_OBJ_START+1581) +#define HID_LICENSING_END (HID_OBJ_START+1680) + +#define HID_RPT_START (HID_OBJ_START+1681) +#define HID_RPT_END (HID_OBJ_START+2080) + +#define HID_FORMULA_START (HID_OBJ_START+2081) +#define HID_FORMULA_END (HID_OBJ_START+2280) + +#endif + diff --git a/svl/inc/svl/stritem.hxx b/svl/inc/svl/stritem.hxx new file mode 100644 index 000000000000..a2430b142c1d --- /dev/null +++ b/svl/inc/svl/stritem.hxx @@ -0,0 +1,58 @@ +/************************************************************************* + * + * 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: stritem.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 _SFXSTRITEM_HXX +#define _SFXSTRITEM_HXX + +#include "svtools/svtdllapi.h" +#include <svtools/custritm.hxx> + +//============================================================================ +class SVT_DLLPUBLIC SfxStringItem: public CntUnencodedStringItem +{ +public: + TYPEINFO(); + + SfxStringItem() {} + + SfxStringItem(USHORT which, const XubString & rValue): + CntUnencodedStringItem(which, rValue) {} + + SfxStringItem(USHORT nWhich, SvStream & rStream); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; +}; + +#endif // _SFXSTRITEM_HXX + diff --git a/svl/inc/svl/style.hrc b/svl/inc/svl/style.hrc new file mode 100644 index 000000000000..ed4db1bf46d0 --- /dev/null +++ b/svl/inc/svl/style.hrc @@ -0,0 +1,42 @@ +/************************************************************************* + * + * 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: style.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 _SFX_STYLE_HRC +#define _SFX_STYLE_HRC + +#define SFXSTYLEBIT_AUTO 0x0000 // automatisch; Flags kommen von der Applikation +#define SFXSTYLEBIT_READONLY 0x2000 // benutzte Vorlage (als Suchmaske) +#define SFXSTYLEBIT_USED 0x4000 // benutzte Vorlage (als Suchmaske) +#define SFXSTYLEBIT_USERDEF 0x8000 // benutzerdefinierte Vorlage +#define SFXSTYLEBIT_ALL 0xFFFF // alle Vorlagen + +#endif + + diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx new file mode 100644 index 000000000000..17e4bf7b9c06 --- /dev/null +++ b/svl/inc/svl/style.hxx @@ -0,0 +1,400 @@ +/************************************************************************* + * + * 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: style.hxx,v $ + * $Revision: 1.5.60.1 $ + * + * 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 _SFXSTYLE_HXX +#define _SFXSTYLE_HXX + +#include <com/sun/star/style/XStyle.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> + +#include <rtl/ref.hxx> +#include <vector> +#include <comphelper/weak.hxx> +#include <cppuhelper/implbase2.hxx> +#include "svtools/svtdllapi.h" +#include <rsc/rscsfx.hxx> +#include <tools/string.hxx> +#include <svtools/hint.hxx> +#include <svtools/lstner.hxx> +#include <svtools/brdcst.hxx> +#include <svtools/poolitem.hxx> + +#ifndef _SFX_STYLE_HRC +#include <svtools/style.hrc> +#endif + +class SfxItemSet; +class SfxItemPool; + +class SfxStyleSheetBasePool; +class SvStream; + +/* +Everyone changing instances of SfxStyleSheetBasePool or SfxStyleSheetBase +mußt broadcast this using <SfxStyleSheetBasePool::GetBroadcaster()> broadcasten. +The class <SfxStyleSheetHint> is used for this, it contains an Action-Id and a +pointer to the <SfxStyleSheetBase>. The actions are: + +#define SFX_STYLESHEET_CREATED // style is created +#define SFX_STYLESHEET_MODIFIED // style is modified +#define SFX_STYLESHEET_CHANGED // style is replaced +#define SFX_STYLESHEET_ERASED // style is deleted + +The following methods already broadcast themself + +SfxStyleSheetHint(SFX_STYLESHEET_MODIFIED) from: + SfxStyleSheetBase::SetName( const String& rName ) + SfxStyleSheetBase::SetParent( const String& rName ) + SfxStyleSheetBase::SetFollow( const String& rName ) + +SfxSimpleHint(SFX_HINT_DYING) from: + SfxStyleSheetBasePool::~SfxStyleSheetBasePool() + +SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) from: + SfxStyleSheetBasePool::Make( const String& rName, + SfxStyleFamily eFam, USHORT mask, USHORT nPos) + +SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) from: + SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet ) + +SfxStyleSheetHint( SFX_STYLESHEET_ERASED, *p ) from: + SfxStyleSheetBasePool::Erase( SfxStyleSheetBase* p ) + SfxStyleSheetBasePool::Clear() +*/ + +#define VIRTUAL510 virtual + +class SVT_DLLPUBLIC SfxStyleSheetBase : public comphelper::OWeakTypeObject +{ + friend class SfxStyleSheetBasePool; + +protected: + SfxStyleSheetBasePool& rPool; // zugehoeriger Pool + SfxStyleFamily nFamily; // Familie + + UniString aName, aParent, aFollow; + rtl::OUString maDisplayName; + String aHelpFile; // Name der Hilfedatei + SfxItemSet* pSet; // ItemSet + USHORT nMask; // Flags + + ULONG nHelpId; // Hilfe-ID + + BOOL bMySet; // TRUE: Set loeschen im dtor + + SfxStyleSheetBase(); // do not use! + SfxStyleSheetBase( const UniString&, SfxStyleSheetBasePool&, SfxStyleFamily eFam, USHORT mask ); + SfxStyleSheetBase( const SfxStyleSheetBase& ); + virtual ~SfxStyleSheetBase(); + virtual void Load( SvStream&, USHORT ); + virtual void Store( SvStream& ); + +public: + TYPEINFO(); + + // returns the internal name of this style + virtual const UniString& GetName() const; + + // sets the internal name of this style + virtual BOOL SetName( const UniString& ); + + /** returns the display name of this style, it is used at the user interface. + If the display name is empty, this method returns the internal name. */ + virtual rtl::OUString GetDisplayName() const; + + // sets the display name of this style + virtual void SetDisplayName( const rtl::OUString& ); + + virtual const UniString& GetParent() const; + virtual BOOL SetParent( const UniString& ); + virtual const UniString& GetFollow() const; + virtual BOOL SetFollow( const UniString& ); + virtual BOOL HasFollowSupport() const; // Default TRUE + virtual BOOL HasParentSupport() const; // Default TRUE + virtual BOOL HasClearParentSupport() const; // Default FALSE + virtual BOOL IsUsed() const; // Default TRUE + // Default aus dem Itemset; entweder dem uebergebenen + // oder aus dem per GetItemSet() zurueckgelieferten Set + virtual UniString GetDescription(); + virtual UniString GetDescription( SfxMapUnit eMetric ); + + SfxStyleSheetBasePool& GetPool() { return rPool; } + SfxStyleFamily GetFamily() const { return nFamily; } + USHORT GetMask() const { return nMask; } + void SetMask( USHORT mask) { nMask = mask; } + BOOL IsUserDefined() const + { return BOOL( ( nMask & SFXSTYLEBIT_USERDEF) != 0 ); } + + virtual ULONG GetHelpId( String& rFile ); + virtual void SetHelpId( const String& r, ULONG nId ); + + virtual SfxItemSet& GetItemSet(); + virtual USHORT GetVersion() const; +}; + +//========================================================================= + +typedef std::vector< rtl::Reference< SfxStyleSheetBase > > SfxStyles; + +//========================================================================= + +class SVT_DLLPUBLIC SfxStyleSheetIterator + +/* [Beschreibung] + + Klasse zum Iterieren und Suchen auf einem SfxStyleSheetBasePool. + +*/ + +{ +public: + SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase, + SfxStyleFamily eFam, USHORT n=0xFFFF ); + virtual USHORT GetSearchMask() const; + virtual SfxStyleFamily GetSearchFamily() const; + virtual USHORT Count(); + virtual SfxStyleSheetBase *operator[](USHORT nIdx); + virtual SfxStyleSheetBase* First(); + virtual SfxStyleSheetBase* Next(); + virtual SfxStyleSheetBase* Find(const UniString& rStr); + virtual ~SfxStyleSheetIterator(); + +protected: + + SfxStyleSheetBasePool* pBasePool; + SfxStyleFamily nSearchFamily; + USHORT nMask; + BOOL SearchUsed() const { return bSearchUsed; } + +private: + USHORT GetPos(){return nAktPosition;} + SVT_DLLPRIVATE BOOL IsTrivialSearch(); + SVT_DLLPRIVATE BOOL DoesStyleMatch(SfxStyleSheetBase *pStyle); + + void* pImp; + SfxStyleSheetBase* pAktStyle; + USHORT nAktPosition; + BOOL bSearchUsed; + +friend class SfxStyleSheetBasePool; +}; + +//========================================================================= + +class SfxStyleSheetBasePool_Impl; + +class SVT_DLLPUBLIC SfxStyleSheetBasePool: public SfxBroadcaster, public comphelper::OWeakTypeObject +{ +friend class SfxStyleSheetIterator; +friend class SfxStyleSheetBase; + + SfxStyleSheetBasePool_Impl *pImp; + +private: + SVT_DLLPRIVATE BOOL Load1_Impl( SvStream& ); + SVT_DLLPRIVATE SfxStyleSheetIterator& GetIterator_Impl(); +protected: + String aAppName; + SfxItemPool& rPool; + SfxStyles aStyles; + SfxStyleFamily nSearchFamily; + USHORT nMask; + + SfxStyleSheetBase& Add( SfxStyleSheetBase& ); + void ChangeParent( const UniString&, const UniString&, BOOL bVirtual = TRUE ); + virtual SfxStyleSheetBase* Create( const UniString&, SfxStyleFamily, USHORT ); + virtual SfxStyleSheetBase* Create( const SfxStyleSheetBase& ); + + ~SfxStyleSheetBasePool(); + +public: + SfxStyleSheetBasePool( SfxItemPool& ); + SfxStyleSheetBasePool( const SfxStyleSheetBasePool& ); + + static String GetStreamName(); + + const String& GetAppName() const { return aAppName; } + + SfxItemPool& GetPool(); + const SfxItemPool& GetPool() const; + + virtual SfxStyleSheetIterator* CreateIterator(SfxStyleFamily, USHORT nMask); + virtual USHORT Count(); + virtual SfxStyleSheetBase* operator[](USHORT nIdx); + + virtual SfxStyleSheetBase& Make(const UniString&, + SfxStyleFamily eFam, + USHORT nMask = 0xffff , + USHORT nPos = 0xffff); + + virtual void Replace( + SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget ); + + virtual void Remove( SfxStyleSheetBase* ); + virtual void Insert( SfxStyleSheetBase* ); + + virtual void Clear(); + + SfxStyleSheetBasePool& operator=( const SfxStyleSheetBasePool& ); + SfxStyleSheetBasePool& operator+=( const SfxStyleSheetBasePool& ); + + const SfxStyles& GetStyles(); + virtual SfxStyleSheetBase* First(); + virtual SfxStyleSheetBase* Next(); + virtual SfxStyleSheetBase* Find( const UniString&, SfxStyleFamily eFam, USHORT n=0xFFFF ); + + virtual BOOL SetParent(SfxStyleFamily eFam, + const UniString &rStyle, + const UniString &rParent); + + SfxStyleSheetBase* Find(const UniString& rStr) + { return Find(rStr, nSearchFamily, nMask); } + + void SetSearchMask(SfxStyleFamily eFam, USHORT n=0xFFFF ); + USHORT GetSearchMask() const; + SfxStyleFamily GetSearchFamily() const { return nSearchFamily; } + + BOOL Load( SvStream& ); + BOOL Store( SvStream&, BOOL bUsed = TRUE ); +}; + +//========================================================================= + +class SVT_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase, + public SfxListener, public SfxBroadcaster +{ +public: + TYPEINFO(); + + SfxStyleSheet( const UniString&, const SfxStyleSheetBasePool&, SfxStyleFamily, USHORT ); + SfxStyleSheet( const SfxStyleSheet& ); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + virtual BOOL SetParent( const UniString& ); + +protected: + SfxStyleSheet(); // do not use! + virtual ~SfxStyleSheet(); +}; + +//========================================================================= + +class SVT_DLLPUBLIC SfxStyleSheetPool: public SfxStyleSheetBasePool +{ +protected: + using SfxStyleSheetBasePool::Create; + virtual SfxStyleSheetBase* Create(const UniString&, SfxStyleFamily, USHORT mask); + virtual SfxStyleSheetBase* Create(const SfxStyleSheet &); + +public: + SfxStyleSheetPool( SfxItemPool const& ); + +// virtual BOOL CopyTo(SfxStyleSheetPool &rDest, const String &rSourceName); +}; + +//========================================================================= + +#define SFX_STYLESHEET_CREATED 1 // neu +#define SFX_STYLESHEET_MODIFIED 2 // ver"andert +#define SFX_STYLESHEET_CHANGED 3 // gel"oscht und neu (ausgetauscht) +#define SFX_STYLESHEET_ERASED 4 // gel"oscht +#define SFX_STYLESHEET_INDESTRUCTION 5 // wird gerade entfernt + +#define SFX_STYLESHEETPOOL_CHANGES 1 // Aenderungen, die den Zustand + // des Pools anedern, aber nicht + // ueber die STYLESHEET Hints + // verschickt werden sollen. + +//======================================================================== + +class SVT_DLLPUBLIC SfxStyleSheetPoolHint : public SfxHint +{ + USHORT nHint; + +public: + TYPEINFO(); + + SfxStyleSheetPoolHint(USHORT nArgHint) : nHint(nArgHint){} + USHORT GetHint() const + { return nHint; } +}; + +//========================================================================= + +class SVT_DLLPUBLIC SfxStyleSheetHint: public SfxHint +{ + SfxStyleSheetBase* pStyleSh; + USHORT nHint; + +public: + TYPEINFO(); + + SfxStyleSheetHint( USHORT ); + SfxStyleSheetHint( USHORT, SfxStyleSheetBase& ); + SfxStyleSheetBase* GetStyleSheet() const + { return pStyleSh; } + USHORT GetHint() const + { return nHint; } +}; + +class SVT_DLLPUBLIC SfxStyleSheetHintExtended: public SfxStyleSheetHint +{ + String aName; + +public: + TYPEINFO(); + + SfxStyleSheetHintExtended( + USHORT, const String& rOld ); + SfxStyleSheetHintExtended( + USHORT, const String& rOld, + SfxStyleSheetBase& ); + const String& GetOldName() { return aName; } +}; + +class SVT_DLLPUBLIC SfxUnoStyleSheet : public ::cppu::ImplInheritanceHelper2< SfxStyleSheet, ::com::sun::star::style::XStyle, ::com::sun::star::lang::XUnoTunnel > +{ +public: + SfxUnoStyleSheet( const UniString& _rName, const SfxStyleSheetBasePool& _rPool, SfxStyleFamily _eFamily, USHORT _nMaske ); + SfxUnoStyleSheet( const SfxStyleSheet& _rSheet ); + + static SfxUnoStyleSheet* getUnoStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::style::XStyle >& xStyle ); + + // XUnoTunnel + virtual ::sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aIdentifier ) throw (::com::sun::star::uno::RuntimeException); + +private: + SfxUnoStyleSheet(); // not implemented + + static const ::com::sun::star::uno::Sequence< ::sal_Int8 >& getIdentifier(); +}; + +#endif + diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx new file mode 100644 index 000000000000..3ab3676fa5e0 --- /dev/null +++ b/svl/inc/svl/svarray.hxx @@ -0,0 +1,1056 @@ +/************************************************************************* + * + * 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: svarray.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 _SVARRAY_HXX +#define _SVARRAY_HXX + +#if 0 +*********************************************************************** +* +* Hier folgt die Beschreibung fuer die exportierten Makros: +* +* SV_DECL_VARARR(nm, AE, IS, GS) +* SV_IMPL_VARARR( nm, AE ) +* definiere/implementiere ein Array das einfache Objecte +* enthaelt. (Sie werden im Speicher verschoben, koennen also +* z.B. keine String sein) +* +* SV_DECL_OBJARR(nm, AE, IS, GS) +* SV_IMPL_OBJARR( nm, AE ) +* definiere/implementiere ein Array das Objecte enthaelt. +* (Hier koennen es auch Strings sein) +* +* +* SV_DECL_PTRARR(nm, AE, IS, GS) +* SV_IMPL_PTRARR(nm, AE) +* definiere/implementiere ein Array das Pointer haelt. Diese +* werden von aussen angelegt und zerstoert. Das IMPL-Makro +* wird nur benoetigt, wenn die DeleteAndDestroy Methode genutzt +* wird, diese loescht dann die Pointer und ruft deren Destruktoren +* +* SV_DECL_PTRARR_DEL(nm, AE, IS, GS) +* SV_IMPL_PTRARR(nm, AE) +* definiere/implementiere ein Array das Pointer haelt. Diese +* werden von aussen angelegt und im Destructor zerstoert. +* +* +* SV_DECL_PTRARR_SORT(nm, AE, IS, GS) +* SV_IMPL_PTRARR_SORT( nm,AE ) +* defieniere/implementiere ein Sort-Array mit Pointern, das nach +* Pointern sortiert ist. Basiert auf einem PTRARR +* +* SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS) +* SV_IMPL_PTRARR_SORT( nm,AE ) +* defieniere/implementiere ein Sort-Array mit Pointern, das nach +* Pointern sortiert ist. Basiert auf einem PTRARR_DEL +* +* SV_DECL_PTRARR_SORT(nm, AE, IS, GS) +* SV_IMPL_OP_PTRARR_SORT( nm,AE ) +* defieniere/implementiere ein Sort-Array mit Pointern, das nach +* Objecten sortiert ist. Basiert auf einem PTRARR. +* Sortierung mit Hilfe der Object-operatoren "<" und "==" +* +* SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS) +* SV_IMPL_OP_PTRARR_SORT( nm,AE ) +* defieniere/implementiere ein Sort-Array mit Pointern, das nach +* Objecten sortiert ist. Basiert auf einem PTRARR_DEL. +* Sortierung mit Hilfe der Object-operatoren "<" und "==" +* +* SV_DECL_VARARR_SORT(nm, AE, IS, GS) +* SV_IMPL_VARARR_SORT( nm,AE ) +* defieniere/implementiere ein Sort-Array mit einfachen Objecten. +* Basiert auf einem VARARR. +* Sortierung mit Hilfe der Object-operatoren "<" und "==" +* +* JP 23.12.94 neu: +* SV_DECL_PTRARR_STACK(nm, AE, IS, GS) +* ein Stack mit einem PtrArray als Grundlage. +* +* JP 09.10.96: vordefinierte Arrays: +* VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts +* PtrArr: SvStrings, SvStringsDtor +* SortArr: SvStringsSort, SvStringsSortDtor, +* SvStringsISort, SvStringsISortDtor +*********************************************************************** +#endif + +#include "svtools/svldllapi.h" + +#ifndef INCLUDED_STRING_H +#include <string.h> // memmove() +#define INCLUDED_STRING_H +#endif + +#ifndef INCLUDED_LIMITS_H +#include <limits.h> // USHRT_MAX +#define INCLUDED_LIMITS_H +#endif +#include <rtl/alloc.h> +#include <tools/solar.h> + +class String; + +#ifndef CONCAT +#define CONCAT(x,y) x##y +#endif + +class DummyType; +inline void* operator new( size_t, DummyType* pPtr ) +{ + return pPtr; +} +inline void operator delete( void*, DummyType* ) {} + +#if defined(PRODUCT) + +#define _SVVARARR_DEF_GET_OP_INLINE( nm, ArrElem ) \ +ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\ +\ +void Insert( const nm * pI, USHORT nP,\ + USHORT nS = 0, USHORT nE = USHRT_MAX )\ +{\ + if( USHRT_MAX == nE ) \ + nE = pI->nA; \ + if( nS < nE ) \ + Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\ +} + +#define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem ) + +#else + +#define _SVVARARR_DEF_GET_OP_INLINE( nm,ArrElem )\ +ArrElem& operator[](USHORT nP) const;\ +void Insert( const nm *pI, USHORT nP,\ + USHORT nS = 0, USHORT nE = USHRT_MAX ); + +#define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ +ArrElem& nm::operator[](USHORT nP) const\ +{\ + DBG_ASSERT( pData && nP < nA,"Op[]");\ + return *(pData+nP);\ +}\ +void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE)\ +{\ + DBG_ASSERT(nP<=nA,"Ins,Ar[Start.End]");\ + if( USHRT_MAX == nE ) \ + nE = pI->nA; \ + if( nStt < nE ) \ + Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\ +} + +#endif + +#define _SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ +typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +class vis nm\ +{\ +protected:\ + AE *pData;\ + USHORT nFree;\ + USHORT nA;\ +\ + void _resize(size_t n);\ +\ +public:\ + nm( USHORT= IS, BYTE= GS );\ + ~nm() { rtl_freeMemory( pData ); }\ +\ + _SVVARARR_DEF_GET_OP_INLINE(nm, AE )\ + AERef GetObject(USHORT nP) const { return (*this)[nP]; } \ +\ + void Insert( const AERef aE, USHORT nP );\ + void Insert( const AE *pE, USHORT nL, USHORT nP );\ + void Remove( USHORT nP, USHORT nL = 1 );\ + void Replace( const AERef aE, USHORT nP );\ + void Replace( const AE *pE, USHORT nL, USHORT nP );\ + USHORT Count() const { return nA; }\ + const AE* GetData() const { return (const AE*)pData; }\ +\ + void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( 0, nA, fnForEach, pArgs );\ + }\ + void ForEach( USHORT nS, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( nS, nE, fnForEach, pArgs );\ + }\ +\ + void _ForEach( USHORT nStt, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\ +\ + +#define _SV_DECL_VARARR(nm, AE, IS, GS ) \ +_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE & ) +#define _SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \ +_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE ) + +#define SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ +_SV_DECL_VARARR_GEN(nm, AE, IS, GS, AERef, vis )\ +private:\ +nm( const nm& );\ +nm& operator=( const nm& );\ +}; + +#define SV_DECL_VARARR(nm, AE, IS, GS ) \ +SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, ) +#define SV_DECL_VARARR_PLAIN(nm, AE, IS, GS ) \ +SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, ) + +#define SV_DECL_VARARR_VISIBILITY(nm, AE, IS, GS, vis ) \ +SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE &, vis ) + +#define SV_DECL_VARARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis ) \ +SV_DECL_VARARR_GEN(nm, AE, IS, GS, AE, vis ) + +#define SV_IMPL_VARARR_GEN( nm, AE, AERef )\ +nm::nm( USHORT nInit, BYTE )\ + : pData (0),\ + nFree (nInit),\ + nA (0)\ +{\ + if( nInit )\ + {\ + pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\ + DBG_ASSERT( pData, "CTOR, allocate");\ + }\ +}\ +\ +void nm::_resize (size_t n)\ +{\ + USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\ + AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\ + if ((pE != 0) || (nL == 0))\ + {\ + pData = pE;\ + nFree = nL - nA;\ + }\ +}\ +\ +void nm::Insert( const AERef aE, USHORT nP )\ +{\ + DBG_ASSERT(nP <= nA && nA < USHRT_MAX, "Ins 1");\ + if (nFree < 1)\ + _resize (nA + ((nA > 1) ? nA : 1));\ + if( pData && nP < nA )\ + memmove( pData+nP+1, pData+nP, (nA-nP) * sizeof( AE ));\ + *(pData+nP) = (AE&)aE;\ + ++nA; --nFree;\ +}\ +\ +void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ +{\ + DBG_ASSERT(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ + if (nFree < nL)\ + _resize (nA + ((nA > nL) ? nA : nL));\ + if( pData && nP < nA )\ + memmove( pData+nP+nL, pData+nP, (nA-nP) * sizeof( AE ));\ + if( pE )\ + memcpy( pData+nP, pE, nL * sizeof( AE ));\ + nA = nA + nL; nFree = nFree - nL;\ +}\ +\ +void nm::Replace( const AERef aE, USHORT nP )\ +{\ + if( nP < nA )\ + *(pData+nP) = (AE&)aE;\ +}\ +\ +void nm::Replace( const AE *pE, USHORT nL, USHORT nP )\ +{\ + if( pE && nP < nA )\ + {\ + if( nP + nL < nA )\ + memcpy( pData + nP, pE, nL * sizeof( AE ));\ + else if( nP + nL < nA + nFree )\ + {\ + memcpy( pData + nP, pE, nL * sizeof( AE ));\ + nP = nP + (nL - nA); \ + nFree = nP;\ + }\ + else \ + {\ + USHORT nTmpLen = nA + nFree - nP; \ + memcpy( pData + nP, pE, nTmpLen * sizeof( AE ));\ + nA = nA + nFree; \ + nFree = 0; \ + Insert( pE + nTmpLen, nL - nTmpLen, nA );\ + }\ + }\ +}\ +\ +void nm::Remove( USHORT nP, USHORT nL )\ +{\ + if( !nL )\ + return;\ + DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + if( pData && nP+1 < nA )\ + memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\ + nA = nA - nL; nFree = nFree + nL;\ + if (nFree > nA)\ + _resize (nA);\ +}\ +\ +void nm::_ForEach( USHORT nStt, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\ +{\ + if( nStt >= nE || nE > nA )\ + return;\ + for( ; nStt < nE && (*fnCall)( *(const AE*)(pData+nStt), pArgs ); nStt++)\ + ;\ +}\ +\ +_SVVARARR_IMPL_GET_OP_INLINE(nm, AE )\ + +#define SV_IMPL_VARARR( nm, AE ) \ +SV_IMPL_VARARR_GEN( nm, AE, AE & ) +#define SV_IMPL_VARARR_PLAIN( nm, AE ) \ +SV_IMPL_VARARR_GEN( nm, AE, AE ) + +#if defined(PRODUCT) + +#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem )\ +ArrElem& operator[](USHORT nP) const { return *(pData+nP); }\ +\ +void Insert( const nm *pI, USHORT nP,\ + USHORT nS = 0, USHORT nE = USHRT_MAX )\ +{\ + if( USHRT_MAX == nE ) \ + nE = pI->nA; \ + if( nS < nE ) \ + Insert( (const ArrElem*)pI->pData+nS, (USHORT)nE-nS, nP );\ +} + +#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem ) + +#else + +#define _SVOBJARR_DEF_GET_OP_INLINE( nm,ArrElem ) \ +ArrElem& operator[](USHORT nP) const;\ +void Insert( const nm *pI, USHORT nP,\ + USHORT nS = 0, USHORT nE = USHRT_MAX ); + +#define _SVOBJARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ +ArrElem& nm::operator[](USHORT nP) const\ +{\ + DBG_ASSERT( pData && nP < nA,"Op[]");\ + return *(pData+nP);\ +}\ +void nm::Insert( const nm *pI, USHORT nP, USHORT nStt, USHORT nE )\ +{\ + DBG_ASSERT( nP <= nA,"Ins,Ar[Start.End]");\ + if( USHRT_MAX == nE ) \ + nE = pI->nA; \ + if( nStt < nE ) \ + Insert( (const ArrElem*)pI->pData+nStt, (USHORT)nE-nStt, nP );\ +} + +#endif + +#define _SV_DECL_OBJARR(nm, AE, IS, GS)\ +typedef BOOL (*FnForEach_##nm)( const AE&, void* );\ +class nm\ +{\ +protected:\ + AE *pData;\ + USHORT nFree;\ + USHORT nA;\ +\ + void _resize(size_t n);\ + void _destroy();\ +\ +public:\ + nm( USHORT= IS, BYTE= GS );\ + ~nm() { _destroy(); }\ +\ + _SVOBJARR_DEF_GET_OP_INLINE(nm,AE)\ + AE& GetObject(USHORT nP) const { return (*this)[nP]; } \ +\ + void Insert( const AE &aE, USHORT nP );\ + void Insert( const AE *pE, USHORT nL, USHORT nP );\ + void Remove( USHORT nP, USHORT nL = 1 );\ + USHORT Count() const { return nA; }\ + const AE* GetData() const { return (const AE*)pData; }\ +\ + void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( 0, nA, fnForEach, pArgs );\ + }\ + void ForEach( USHORT nS, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( nS, nE, fnForEach, pArgs );\ + }\ +\ + void _ForEach( USHORT nStt, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnCall, void* pArgs = 0 );\ +\ + +#define SV_DECL_OBJARR(nm, AE, IS, GS)\ +_SV_DECL_OBJARR(nm, AE, IS, GS)\ +private:\ +nm( const nm& );\ +nm& operator=( const nm& );\ +}; + +#define SV_IMPL_OBJARR( nm, AE )\ +nm::nm( USHORT nInit, BYTE )\ + : pData (0),\ + nFree (nInit),\ + nA (0)\ +{\ + if( nInit )\ + {\ + pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\ + DBG_ASSERT( pData, "CTOR, allocate");\ + }\ +}\ +\ +void nm::_destroy()\ +{\ + if(pData)\ + {\ + AE* pTmp=pData;\ + for(USHORT n=0; n < nA; n++,pTmp++ )\ + {\ + pTmp->~AE();\ + }\ + rtl_freeMemory(pData);\ + pData = 0;\ + }\ +}\ +\ +void nm::_resize (size_t n)\ +{\ + USHORT nL = ((n < USHRT_MAX) ? USHORT(n) : USHRT_MAX);\ + AE* pE = (AE*)(rtl_reallocateMemory (pData, sizeof(AE) * nL));\ + if ((pE != 0) || (nL == 0))\ + {\ + pData = pE;\ + nFree = nL - nA;\ + }\ +}\ +\ +void nm::Insert( const AE &aE, USHORT nP )\ +{\ + DBG_ASSERT( nP <= nA && nA < USHRT_MAX,"Ins 1");\ + if (nFree < 1)\ + _resize (nA + ((nA > 1) ? nA : 1));\ + if( pData && nP < nA )\ + memmove( pData+nP+1, pData+nP, (nA-nP) * sizeof( AE ));\ + AE* pTmp = pData+nP;\ + new( (DummyType*) pTmp ) AE( (AE&)aE );\ + ++nA; --nFree;\ +}\ +\ +void nm::Insert( const AE* pE, USHORT nL, USHORT nP )\ +{\ + DBG_ASSERT(nP<=nA && ((long)nA+nL) < USHRT_MAX, "Ins n");\ + if (nFree < nL)\ + _resize (nA + ((nA > nL) ? nA : nL));\ + if( pData && nP < nA )\ + memmove( pData+nP+nL, pData+nP, (nA-nP) * sizeof( AE ));\ + if( pE )\ + {\ + AE* pTmp = pData+nP;\ + for( USHORT n = 0; n < nL; n++, pTmp++, pE++)\ + {\ + new( (DummyType*) pTmp ) AE( (AE&)*pE );\ + }\ + }\ + nA = nA + nL; nFree = nFree - nL;\ +}\ +\ +void nm::Remove( USHORT nP, USHORT nL )\ +{\ + if( !nL )\ + return;\ + DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + AE* pTmp=pData+nP;\ + USHORT nCtr = nP;\ + for(USHORT n=0; n < nL; n++,pTmp++,nCtr++)\ + {\ + if( nCtr < nA )\ + pTmp->~AE();\ + }\ + if( pData && nP+1 < nA )\ + memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\ + nA = nA - nL; nFree = nFree + nL;\ + if (nFree > nA) \ + _resize (nA);\ +}\ +\ +void nm::_ForEach( USHORT nStt, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnCall, void* pArgs )\ +{\ + if( nStt >= nE || nE > nA )\ + return;\ + for( ; nStt < nE && (*fnCall)( *(pData+nStt), pArgs ); nStt++)\ + ;\ +}\ +\ +_SVOBJARR_IMPL_GET_OP_INLINE(nm, AE)\ + +#define _SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AERef, vis )\ +_SV_DECL_VARARR_GEN( nm, AE, IS, GS, AERef, vis)\ +USHORT GetPos( const AERef aE ) const;\ +}; + +#define _SV_DECL_PTRARR_DEF( nm, AE, IS, GS, vis )\ +_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE &, vis ) +#define _SV_DECL_PTRARR_DEF_PLAIN( nm, AE, IS, GS, vis )\ +_SV_DECL_PTRARR_DEF_GEN( nm, AE, IS, GS, AE, vis ) + +#define SV_DECL_PTRARR_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ +typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +class vis nm: public Base \ +{\ +public:\ + nm( USHORT nIni=IS, BYTE nG=GS )\ + : Base(nIni,nG) {}\ + void Insert( const nm *pI, USHORT nP, \ + USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + Base::Insert((const Base*)pI, nP, nS, nE);\ + }\ + void Insert( const AERef aE, USHORT nP ) {\ + Base::Insert( (const VPRef )aE, nP );\ + }\ + void Insert( const AE *pE, USHORT nL, USHORT nP ) {\ + Base::Insert( (const VoidPtr*)pE, nL, nP );\ + }\ + void Replace( const AERef aE, USHORT nP ) {\ + Base::Replace( (const VPRef)aE, nP );\ + }\ + void Replace( const AE *pE, USHORT nL, USHORT nP ) {\ + Base::Replace( (const VoidPtr*)pE, nL, nP );\ + }\ + void Remove( USHORT nP, USHORT nL = 1) {\ + Base::Remove(nP,nL);\ + }\ + const AE* GetData() const {\ + return (const AE*)Base::GetData();\ + }\ + void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\ + }\ + void ForEach( USHORT nS, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\ + }\ + AE operator[]( USHORT nP )const { \ + return (AE)Base::operator[](nP); }\ + AE GetObject(USHORT nP) const { \ + return (AE)Base::GetObject(nP); }\ + \ + USHORT GetPos( const AERef aE ) const { \ + return Base::GetPos((const VPRef)aE);\ + }\ + void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\ +private:\ + nm( const nm& );\ + nm& operator=( const nm& );\ +}; + +#define SV_DECL_PTRARR(nm, AE, IS, GS )\ +SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) +#define SV_DECL_PTRARR_PLAIN(nm, AE, IS, GS )\ +SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, ) + +#define SV_DECL_PTRARR_VISIBILITY(nm, AE, IS, GS, vis )\ +SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis ) +#define SV_DECL_PTRARR_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\ +SV_DECL_PTRARR_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis ) + +#define SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, Base, AERef, VPRef, vis )\ +typedef BOOL (*FnForEach_##nm)( const AERef, void* );\ +class vis nm: public Base \ +{\ +public:\ + nm( USHORT nIni=IS, BYTE nG=GS )\ + : Base(nIni,nG) {}\ + ~nm() { DeleteAndDestroy( 0, Count() ); }\ + void Insert( const nm *pI, USHORT nP, \ + USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + Base::Insert((const Base*)pI, nP, nS, nE);\ + }\ + void Insert( const AERef aE, USHORT nP ) {\ + Base::Insert((const VPRef)aE, nP );\ + }\ + void Insert( const AE *pE, USHORT nL, USHORT nP ) {\ + Base::Insert( (const VoidPtr *)pE, nL, nP );\ + }\ + void Replace( const AERef aE, USHORT nP ) {\ + Base::Replace( (const VPRef)aE, nP );\ + }\ + void Replace( const AE *pE, USHORT nL, USHORT nP ) {\ + Base::Replace( (const VoidPtr*)pE, nL, nP );\ + }\ + void Remove( USHORT nP, USHORT nL = 1) {\ + Base::Remove(nP,nL);\ + }\ + const AE* GetData() const {\ + return (const AE*)Base::GetData();\ + }\ + void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( 0, nA, (FnForEach_##Base)fnForEach, pArgs );\ + }\ + void ForEach( USHORT nS, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( nS, nE, (FnForEach_##Base)fnForEach, pArgs );\ + }\ + AE operator[]( USHORT nP )const { \ + return (AE)Base::operator[](nP); }\ + AE GetObject( USHORT nP )const { \ + return (AE)Base::GetObject(nP); }\ + \ + USHORT GetPos( const AERef aE ) const { \ + return Base::GetPos((const VPRef)aE);\ + } \ + void DeleteAndDestroy( USHORT nP, USHORT nL=1 );\ +private:\ + nm( const nm& );\ + nm& operator=( const nm& );\ +}; + +#define SV_DECL_PTRARR_DEL(nm, AE, IS, GS )\ +SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, ) +#define SV_DECL_PTRARR_DEL_PLAIN(nm, AE, IS, GS )\ +SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, ) + +#define SV_DECL_PTRARR_DEL_VISIBILITY(nm, AE, IS, GS, vis )\ +SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis) +#define SV_DECL_PTRARR_DEL_PLAIN_VISIBILITY(nm, AE, IS, GS, vis )\ +SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarrPlain, AE, VoidPtr, vis) + +#define SV_IMPL_PTRARR_GEN(nm, AE, Base)\ +void nm::DeleteAndDestroy( USHORT nP, USHORT nL )\ +{ \ + if( nL ) {\ + DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + for( USHORT n=nP; n < nP + nL; n++ ) \ + delete *((AE*)pData+n); \ + Base::Remove( nP, nL ); \ + } \ +} + +#define SV_IMPL_PTRARR(nm, AE )\ +SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarr ) +#define SV_IMPL_PTRARR_PLAIN(nm, AE )\ +SV_IMPL_PTRARR_GEN(nm, AE, SvPtrarrPlain ) + +typedef void* VoidPtr; +_SV_DECL_PTRARR_DEF( SvPtrarr, VoidPtr, 0, 1, SVL_DLLPUBLIC ) +_SV_DECL_PTRARR_DEF_PLAIN( SvPtrarrPlain, VoidPtr, 0, 1, SVL_DLLPUBLIC ) + +// SORTARR - Begin + +#ifdef __MWERKS__ +#define __MWERKS__PRIVATE public +#else +#define __MWERKS__PRIVATE private +#endif + +#define _SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ +typedef BOOL (*FnForEach_##nm)( const AE&, void* );\ +class vis nm : __MWERKS__PRIVATE nm##_SAR \ +{\ +public:\ + nm(USHORT nSize = IS, BYTE nG = GS)\ + : nm##_SAR(nSize,nG) {}\ + void Insert( const nm *pI, USHORT nS=0, USHORT nE=USHRT_MAX );\ + BOOL Insert( const AE& aE );\ + BOOL Insert( const AE& aE, USHORT& rP );\ + void Insert( const AE *pE, USHORT nL );\ + void Remove( USHORT nP, USHORT nL = 1 );\ + void Remove( const AE& aE, USHORT nL = 1 );\ + USHORT Count() const { return nm##_SAR::Count(); }\ + const AE* GetData() const { return (const AE*)pData; }\ +\ +/* Das Ende stehe im DECL-Makro !!! */ + +#define _SV_SEEK_PTR(nm,AE)\ +BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ +{\ + register USHORT nO = nm##_SAR::Count(),\ + nM, \ + nU = 0;\ + if( nO > 0 )\ + {\ + nO--;\ + register long rCmp = (long)aE;\ + while( nU <= nO )\ + {\ + nM = nU + ( nO - nU ) / 2;\ + if( (long)*(pData + nM) == rCmp )\ + {\ + if( pP ) *pP = nM;\ + return TRUE;\ + }\ + else if( (long)*(pData+ nM) < (long)aE )\ + nU = nM + 1;\ + else if( nM == 0 )\ + {\ + if( pP ) *pP = nU;\ + return FALSE;\ + }\ + else\ + nO = nM - 1;\ + }\ + }\ + if( pP ) *pP = nU;\ + return FALSE;\ +} + +#define _SV_SEEK_PTR_TO_OBJECT( nm,AE )\ +BOOL nm::Seek_Entry( const AE aE, USHORT* pP ) const\ +{\ + register USHORT nO = nm##_SAR::Count(),\ + nM, \ + nU = 0;\ + if( nO > 0 )\ + {\ + nO--;\ + while( nU <= nO )\ + {\ + nM = nU + ( nO - nU ) / 2;\ + if( *(*((AE*)pData + nM)) == *(aE) )\ + {\ + if( pP ) *pP = nM;\ + return TRUE;\ + }\ + else if( *(*((AE*)pData + nM)) < *(aE) )\ + nU = nM + 1;\ + else if( nM == 0 )\ + {\ + if( pP ) *pP = nU;\ + return FALSE;\ + }\ + else\ + nO = nM - 1;\ + }\ + }\ + if( pP ) *pP = nU;\ + return FALSE;\ +} + +#define _SV_SEEK_OBJECT( nm,AE )\ +BOOL nm::Seek_Entry( const AE & aE, USHORT* pP ) const\ +{\ + register USHORT nO = nm##_SAR::Count(),\ + nM, \ + nU = 0;\ + if( nO > 0 )\ + {\ + nO--;\ + while( nU <= nO )\ + {\ + nM = nU + ( nO - nU ) / 2;\ + if( *(pData + nM) == aE )\ + {\ + if( pP ) *pP = nM;\ + return TRUE;\ + }\ + else if( *(pData + nM) < aE )\ + nU = nM + 1;\ + else if( nM == 0 )\ + {\ + if( pP ) *pP = nU;\ + return FALSE;\ + }\ + else\ + nO = nM - 1;\ + }\ + }\ + if( pP ) *pP = nU;\ + return FALSE;\ +} + +#define _SV_IMPL_SORTAR_ALG(nm, AE)\ +void nm::Insert( const nm * pI, USHORT nS, USHORT nE )\ +{\ + if( USHRT_MAX == nE )\ + nE = pI->Count();\ + USHORT nP;\ + const AE * pIArr = pI->GetData();\ + for( ; nS < nE; ++nS )\ + {\ + if( ! Seek_Entry( *(pIArr+nS), &nP) )\ + nm##_SAR::Insert( *(pIArr+nS), nP );\ + if( ++nP >= Count() )\ + {\ + nm##_SAR::Insert( pI, nP, nS+1, nE );\ + nS = nE;\ + }\ + }\ +}\ +\ +BOOL nm::Insert( const AE & aE )\ +{\ + USHORT nP;\ + BOOL bExist;\ + bExist = Seek_Entry( aE, &nP );\ + if( ! bExist )\ + nm##_SAR::Insert( aE, nP );\ + return !bExist;\ +}\ +BOOL nm::Insert( const AE & aE, USHORT& rP )\ +{\ + BOOL bExist;\ + bExist = Seek_Entry( aE, &rP );\ + if( ! bExist )\ + nm##_SAR::Insert( aE, rP );\ + return !bExist;\ +}\ +void nm::Insert( const AE* pE, USHORT nL)\ +{\ + USHORT nP;\ + for( USHORT n = 0; n < nL; ++n )\ + if( ! Seek_Entry( *(pE+n), &nP ))\ + nm##_SAR::Insert( *(pE+n), nP );\ +}\ +void nm::Remove( USHORT nP, USHORT nL )\ +{\ + if( nL )\ + nm##_SAR::Remove( nP, nL);\ +}\ +\ +void nm::Remove( const AE &aE, USHORT nL )\ +{\ + USHORT nP;\ + if( nL && Seek_Entry( aE, &nP ) ) \ + nm##_SAR::Remove( nP, nL);\ +}\ + +#if defined(TCPP) + +#define _SORTARR_BLC_CASTS(nm, AE )\ + BOOL Insert( AE &aE ) {\ + return Insert( (const AE&)aE );\ + }\ + USHORT GetPos( AE& aE ) const { \ + return SvPtrarr::GetPos((const VoidPtr&)aE);\ + }\ + void Remove( AE& aE, USHORT nL = 1 ) { \ + Remove( (const AE&) aE, nL );\ + } + +#else + +#define _SORTARR_BLC_CASTS(nm, AE )\ + USHORT GetPos( const AE& aE ) const { \ + return SvPtrarr::GetPos((const VoidPtr&)aE);\ + } + +#endif + +#define _SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\ +SV_DECL_PTRARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ +_SORT_CLASS_DEF(nm, AE, IS, GS, vis)\ + AE operator[](USHORT nP) const {\ + return nm##_SAR::operator[]( nP );\ + }\ + AE GetObject(USHORT nP) const {\ + return nm##_SAR::GetObject( nP );\ + }\ + BOOL Seek_Entry( const AE aE, USHORT* pP = 0 ) const;\ + void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( 0, nA, (FnForEach_SvPtrarr)fnForEach, pArgs );\ + }\ + void ForEach( USHORT nS, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( nS, nE, (FnForEach_SvPtrarr)fnForEach, pArgs );\ + }\ + void DeleteAndDestroy( USHORT nP, USHORT nL=1 ); \ + _SORTARR_BLC_CASTS(nm, AE )\ +\ +/* Das Ende stehe im DECL-Makro !!! */ + +#define _SV_DECL_PTRARR_SORT(nm, AE, IS, GS, vis)\ +_SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\ +private:\ + nm( const nm& );\ + nm& operator=( const nm& );\ +}; + +#define SV_DECL_PTRARR_SORT(nm, AE, IS, GS)\ +_SV_DECL_PTRARR_SORT(nm, AE, IS, GS, ) + +#define SV_DECL_PTRARR_SORT_VISIBILITY(nm, AE, IS, GS, vis)\ +_SV_DECL_PTRARR_SORT(nm, AE, IS, GS, vis) + + +#define _SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS, vis)\ +_SV_DECL_PTRARR_SORT_ALG(nm, AE, IS, GS, vis)\ + ~nm() { DeleteAndDestroy( 0, Count() ); }\ +private:\ + nm( const nm& );\ + nm& operator=( const nm& );\ +}; + +#define SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS)\ +_SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS, ) + +#define SV_DECL_PTRARR_SORT_DEL_VISIBILITY(nm, AE, IS, GS, vis)\ +_SV_DECL_PTRARR_SORT_DEL(nm, AE, IS, GS, vis) + +#define _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis)\ +SV_DECL_VARARR_VISIBILITY(nm##_SAR, AE, IS, GS, vis)\ +_SORT_CLASS_DEF(nm, AE, IS, GS, vis) \ + const AE& operator[](USHORT nP) const {\ + return nm##_SAR::operator[]( nP );\ + }\ + const AE& GetObject(USHORT nP) const {\ + return nm##_SAR::GetObject( nP );\ + }\ + BOOL Seek_Entry( const AE & aE, USHORT* pP = 0 ) const;\ + void ForEach( CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( 0, nA, (FnForEach_##nm##_SAR)fnForEach, pArgs );\ + }\ + void ForEach( USHORT nS, USHORT nE, \ + CONCAT( FnForEach_, nm ) fnForEach, void* pArgs = 0 )\ + {\ + _ForEach( nS, nE, (FnForEach_##nm##_SAR)fnForEach, pArgs );\ + }\ +private:\ + nm( const nm& );\ + nm& operator=( const nm& );\ +}; + +#define SV_DECL_VARARR_SORT(nm, AE, IS, GS)\ +_SV_DECL_VARARR_SORT(nm, AE, IS, GS,) + +#define SV_DECL_VARARR_SORT_VISIBILITY(nm, AE, IS, GS, vis)\ +_SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis) + +#define SV_IMPL_PTRARR_SORT( nm,AE )\ +_SV_IMPL_SORTAR_ALG( nm,AE )\ + void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \ + if( nL ) {\ + DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ + for( USHORT n=nP; n < nP + nL; n++ ) \ + delete *((AE*)pData+n); \ + SvPtrarr::Remove( nP, nL ); \ + } \ + } \ +_SV_SEEK_PTR( nm, AE ) + +#define SV_IMPL_OP_PTRARR_SORT( nm,AE )\ +_SV_IMPL_SORTAR_ALG( nm,AE )\ + void nm::DeleteAndDestroy( USHORT nP, USHORT nL ) { \ + if( nL ) {\ + DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ + for( USHORT n=nP; n < nP + nL; n++ ) \ + delete *((AE*)pData+n); \ + SvPtrarr::Remove( nP, nL ); \ + } \ + } \ +_SV_SEEK_PTR_TO_OBJECT( nm,AE ) + +#define SV_IMPL_VARARR_SORT( nm,AE )\ +SV_IMPL_VARARR(nm##_SAR, AE)\ +_SV_IMPL_SORTAR_ALG( nm,AE )\ +_SV_SEEK_OBJECT( nm,AE ) + +#define SV_DECL_PTRARR_STACK(nm, AE, IS, GS)\ +class nm: private SvPtrarr \ +{\ +public:\ + nm( USHORT nIni=IS, BYTE nG=GS )\ + : SvPtrarr(nIni,nG) {}\ + void Insert( const nm *pI, USHORT nP,\ + USHORT nS = 0, USHORT nE = USHRT_MAX ) {\ + SvPtrarr::Insert( pI, nP, nS, nE ); \ + }\ + void Remove( USHORT nP, USHORT nL = 1 ) {\ + SvPtrarr::Remove( nP, nL ); \ + }\ + void Push( const AE &aE ) {\ + SvPtrarr::Insert( (const VoidPtr &)aE, SvPtrarr::Count() );\ + }\ + USHORT Count() const { return SvPtrarr::Count(); }\ + AE operator[](USHORT nP) const {\ + return (AE)SvPtrarr::operator[]( nP );\ + }\ + AE GetObject(USHORT nP) const {\ + return (AE)SvPtrarr::GetObject( nP );\ + }\ + AE Pop(){\ + AE pRet = 0;\ + if( SvPtrarr::Count() ){\ + pRet = GetObject( SvPtrarr::Count()-1 );\ + SvPtrarr::Remove(Count()-1);\ + }\ + return pRet;\ + }\ + AE Top() const {\ + AE pRet = 0;\ + if( SvPtrarr::Count() )\ + pRet = GetObject( SvPtrarr::Count()-1 ); \ + return pRet;\ + }\ +}; + +#if defined (C40) || defined (C41) || defined (C42) || defined(C50) || defined(C52) +#define C40_INSERT( c, p, n) Insert( (c const *) p, n ) +#define C40_PUSH( c, p) Push( (c const *) p ) +#define C40_PTR_INSERT( c, p) Insert( (c const *) p ) +#define C40_REMOVE( c, p ) Remove( (c const *) p ) +#define C40_REPLACE( c, p, n) Replace( (c const *) p, n ) +#define C40_PTR_REPLACE( c, p) Replace( (c const *) p ) +#define C40_GETPOS( c, r) GetPos( (c const *)r ) +#else +#if defined WTC || defined IRIX || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400) +#define C40_INSERT( c, p, n ) Insert( (c const *&) p, n ) +#define C40_PUSH( c, p) Push( (c const *&) p ) +#define C40_PTR_INSERT( c, p ) Insert( (c const *&) p ) +#define C40_REMOVE( c, p ) Remove( (c const *&) p ) +#define C40_REPLACE( c, p, n ) Replace( (c const *&) p, n ) +#define C40_PTR_REPLACE( c, p ) Replace( (c const *&) p ) +#define C40_GETPOS( c, r) GetPos( (c const *&) r ) +#else +#define C40_INSERT( c, p, n ) Insert( p, n ) +#define C40_PUSH( c, p) Push( p ) +#define C40_PTR_INSERT( c, p ) Insert( p ) +#define C40_REMOVE( c, p) Remove( p ) +#define C40_REPLACE( c, p, n ) Replace( p, n ) +#define C40_PTR_REPLACE( c, p ) Replace( p ) +#define C40_GETPOS( c, r) GetPos( r ) +#endif +#endif + +#endif //_SVARRAY_HXX diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx new file mode 100644 index 000000000000..82681ed9d240 --- /dev/null +++ b/svl/inc/svl/svdde.hxx @@ -0,0 +1,483 @@ +/************************************************************************* + * + * 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: svdde.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 _SVDDE_HXX +#define _SVDDE_HXX + +#include "svtools/svtdllapi.h" +#include <sot/exchange.hxx> +#include <tools/string.hxx> +#include <tools/list.hxx> +#include <tools/link.hxx> + +class DdeString; +class DdeData; +class DdeConnection; +class DdeTransaction; +class DdeLink; +class DdeRequest; +class DdeWarmLink; +class DdeHotLink; +class DdePoke; +class DdeExecute; +class DdeItem; +class DdeTopic; +class DdeService; +class ConvList; +struct DdeDataImp; +struct DdeImp; +class DdeItemImp; + +#ifndef _SVDDE_NOLISTS +DECLARE_LIST( DdeConnections, DdeConnection* ) +DECLARE_LIST( DdeServices, DdeService* ) +DECLARE_LIST( DdeTopics, DdeTopic* ) +DECLARE_LIST( DdeItems, DdeItem* ) +#else +typedef List DdeConnections; +typedef List DdeServices; +typedef List DdeTopics; +typedef List DdeItems; +#endif + +//#if 0 // _SOLAR__PRIVATE +DECLARE_LIST( DdeTransactions, DdeTransaction* ) +DECLARE_LIST( DdeFormats, long ) +//#else +//typedef List DdeTransactions; +//typedef List DdeFormats; +//#endif + +#ifndef STRING_LIST +#define STRING_LIST +DECLARE_LIST( StringList, String * ) +#endif + +// ----------- +// - DdeData - +// ----------- + +class SVT_DLLPUBLIC DdeData +{ + friend class DdeInternal; + friend class DdeService; + friend class DdeConnection; + friend class DdeTransaction; + DdeDataImp* pImp; + +//#if 0 // _SOLAR__PRIVATE + SVT_DLLPRIVATE void Lock(); +//#endif + void SetFormat( ULONG nFmt ); + +public: + DdeData(); + DdeData( const void*, long, ULONG = FORMAT_STRING ); + DdeData( const String& ); + DdeData( const DdeData& ); + ~DdeData(); + + operator const void*() const; + operator long() const; + + ULONG GetFormat() const; + + DdeData& operator = ( const DdeData& ); + + static ULONG GetExternalFormat( ULONG nFmt ); + static ULONG GetInternalFormat( ULONG nFmt ); +}; +// ------------------ +// - DdeServiceList - +// ------------------ + +class DdeServiceList +{ + StringList aServices; + +public: + DdeServiceList( const String* = NULL ); + ~DdeServiceList(); + + StringList& GetServices() { return aServices; } + +private: + DdeServiceList( const DdeServiceList& ); + const DdeServiceList& operator= ( const DdeServiceList& ); +}; + +// ---------------- +// - DdeTopicList - +// ---------------- + +class DdeTopicList +{ + StringList aTopics; + +//#if 0 // _SOLAR__PRIVATE + DECL_LINK( Data, DdeData* ); +//#endif +public: + DdeTopicList( const String& ); + ~DdeTopicList(); + + StringList& GetTopics() { return aTopics; } +}; + +// ------------------ +// - DdeTransaction - +// ------------------ + +class SVT_DLLPUBLIC DdeTransaction +{ +public: + virtual void Data( const DdeData* ); + virtual void Done( BOOL bDataValid ); +protected: + DdeConnection& rDde; + DdeData aDdeData; + DdeString* pName; + short nType; + long nId; + long nTime; + Link aData; + Link aDone; + BOOL bBusy; + + DdeTransaction( DdeConnection&, const String&, long = 0 ); + +public: + virtual ~DdeTransaction(); + + BOOL IsBusy() { return bBusy; } + const String& GetName() const; + + void Execute(); + + void SetDataHdl( const Link& rLink ) { aData = rLink; } + const Link& GetDataHdl() const { return aData; } + + void SetDoneHdl( const Link& rLink ) { aDone = rLink; } + const Link& GetDoneHdl() const { return aDone; } + + void SetFormat( ULONG nFmt ) { aDdeData.SetFormat( nFmt ); } + ULONG GetFormat() const { return aDdeData.GetFormat(); } + + long GetError(); + +private: + friend class DdeInternal; + friend class DdeConnection; + + DdeTransaction( const DdeTransaction& ); + const DdeTransaction& operator= ( const DdeTransaction& ); + +}; + +// ----------- +// - DdeLink - +// ----------- + +class SVT_DLLPUBLIC DdeLink : public DdeTransaction +{ + Link aNotify; + +public: + DdeLink( DdeConnection&, const String&, long = 0 ); + virtual ~DdeLink(); + + void SetNotifyHdl( const Link& rLink ) { aNotify = rLink; } + const Link& GetNotifyHdl() const { return aNotify; } + virtual void Notify(); +}; + +// --------------- +// - DdeWarmLink - +// --------------- + +class SVT_DLLPUBLIC DdeWarmLink : public DdeLink +{ +public: + DdeWarmLink( DdeConnection&, const String&, long = 0 ); +}; + +// -------------- +// - DdeHotLink - +// -------------- + +class SVT_DLLPUBLIC DdeHotLink : public DdeLink +{ +public: + DdeHotLink( DdeConnection&, const String&, long = 0 ); +}; + +// -------------- +// - DdeRequest - +// -------------- + +class SVT_DLLPUBLIC DdeRequest : public DdeTransaction +{ +public: + DdeRequest( DdeConnection&, const String&, long = 0 ); +}; + +// ----------- +// - DdePoke - +// ----------- + +class SVT_DLLPUBLIC DdePoke : public DdeTransaction +{ +public: + DdePoke( DdeConnection&, const String&, const char*, long, + ULONG = FORMAT_STRING, long = 0 ); + DdePoke( DdeConnection&, const String&, const DdeData&, long = 0 ); + DdePoke( DdeConnection&, const String&, const String&, long = 0 ); +}; + +// -------------- +// - DdeExecute - +// -------------- + +class SVT_DLLPUBLIC DdeExecute : public DdeTransaction +{ +public: + DdeExecute( DdeConnection&, const String&, long = 0 ); +}; + +// ----------------- +// - DdeConnection - +// ----------------- + +class SVT_DLLPUBLIC DdeConnection +{ + friend class DdeInternal; + friend class DdeTransaction; + DdeTransactions aTransactions; + DdeString* pService; + DdeString* pTopic; + DdeImp* pImp; + +public: + DdeConnection( const String&, const String& ); + ~DdeConnection(); + + long GetError(); + long GetConvId(); + + static const DdeConnections& GetConnections(); + + BOOL IsConnected(); + + const String& GetServiceName(); + const String& GetTopicName(); + +private: + DdeConnection( const DdeConnection& ); + const DdeConnection& operator= ( const DdeConnection& ); +}; + +// ----------- +// - DdeItem - +// ----------- + +class SVT_DLLPUBLIC DdeItem +{ + friend class DdeInternal; + friend class DdeTopic; + DdeString* pName; + DdeTopic* pMyTopic; + DdeItemImp* pImpData; + + void IncMonitor( ULONG ); + void DecMonitor( ULONG ); + +protected: + BYTE nType; + +public: + DdeItem( const sal_Unicode* ); + DdeItem( const String& ); + DdeItem( const DdeItem& ); + virtual ~DdeItem(); + + const String& GetName() const; + short GetLinks(); + void NotifyClient(); +}; + +// ----------- +// - DdeItem - +// ----------- + +class SVT_DLLPUBLIC DdeGetPutItem : public DdeItem +{ +public: + DdeGetPutItem( const sal_Unicode* p ); + DdeGetPutItem( const String& rStr ); + DdeGetPutItem( const DdeItem& rItem ); + + virtual DdeData* Get( ULONG ); + virtual BOOL Put( const DdeData* ); + virtual void AdviseLoop( BOOL ); // AdviseLoop starten/stoppen +}; + +// ------------ +// - DdeTopic - +// ------------ + +class SVT_DLLPUBLIC DdeTopic +{ + SVT_DLLPRIVATE void _Disconnect( long ); + +public: + virtual void Connect( long ); + virtual void Disconnect( long ); + virtual DdeData* Get( ULONG ); + virtual BOOL Put( const DdeData* ); + virtual BOOL Execute( const String* ); + // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden + virtual BOOL MakeItem( const String& rItem ); + + // es wird ein Warm-/Hot-Link eingerichtet. Return-Wert + // besagt ob es geklappt hat + virtual BOOL StartAdviseLoop(); + virtual BOOL StopAdviseLoop(); + +private: + friend class DdeInternal; + friend class DdeService; + friend class DdeItem; + +private: + DdeString* pName; + String aItem; + DdeItems aItems; + Link aConnectLink; + Link aDisconnectLink; + Link aGetLink; + Link aPutLink; + Link aExecLink; + +public: + DdeTopic( const String& ); + virtual ~DdeTopic(); + + const String& GetName() const; + long GetConvId(); + + void SetConnectHdl( const Link& rLink ) { aConnectLink = rLink; } + const Link& GetConnectHdl() const { return aConnectLink; } + void SetDisconnectHdl( const Link& rLink ) { aDisconnectLink = rLink; } + const Link& GetDisconnectHdl() const { return aDisconnectLink; } + void SetGetHdl( const Link& rLink ) { aGetLink = rLink; } + const Link& GetGetHdl() const { return aGetLink; } + void SetPutHdl( const Link& rLink ) { aPutLink = rLink; } + const Link& GetPutHdl() const { return aPutLink; } + void SetExecuteHdl( const Link& rLink ) { aExecLink = rLink; } + const Link& GetExecuteHdl() const { return aExecLink; } + + void NotifyClient( const String& ); + BOOL IsSystemTopic(); + + void InsertItem( DdeItem* ); // fuer eigene Ableitungen! + DdeItem* AddItem( const DdeItem& ); // werden kopiert ! + void RemoveItem( const DdeItem& ); + const String& GetCurItem() { return aItem; } + const DdeItems& GetItems() { return aItems; } + +private: + DdeTopic( const DdeTopic& ); + const DdeTopic& operator= ( const DdeTopic& ); +}; + +// -------------- +// - DdeService - +// -------------- + +class SVT_DLLPUBLIC DdeService +{ + friend class DdeInternal; + +public: + virtual BOOL IsBusy(); + virtual String GetHelp(); + // evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden + virtual BOOL MakeTopic( const String& rItem ); + +protected: + virtual String Topics(); + virtual String Formats(); + virtual String SysItems(); + virtual String Status(); + virtual String SysTopicGet( const String& ); + virtual BOOL SysTopicExecute( const String* ); + + const DdeTopic* GetSysTopic() const { return pSysTopic; } +private: + DdeTopics aTopics; + DdeFormats aFormats; + DdeTopic* pSysTopic; + DdeString* pName; + ConvList* pConv; + short nStatus; + + SVT_DLLPRIVATE BOOL HasCbFormat( USHORT ); + +public: + DdeService( const String& ); + virtual ~DdeService(); + + const String& GetName() const; + short GetError() { return nStatus; } + + static DdeServices& GetServices(); + DdeTopics& GetTopics() { return aTopics; } + + void AddTopic( const DdeTopic& ); + void RemoveTopic( const DdeTopic& ); + + void AddFormat( ULONG ); + void RemoveFormat( ULONG ); + BOOL HasFormat( ULONG ); + +private: + // DdeService( const DdeService& ); + //int operator= ( const DdeService& ); +}; + +// ------------------ +// - DdeTransaction - +// ------------------ + +inline long DdeTransaction::GetError() +{ + return rDde.GetError(); +} +#endif // _SVDDE_HXX diff --git a/svl/inc/svl/svldata.hxx b/svl/inc/svl/svldata.hxx new file mode 100644 index 000000000000..c929faad3d13 --- /dev/null +++ b/svl/inc/svl/svldata.hxx @@ -0,0 +1,117 @@ +/************************************************************************* + * + * 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: svtdata.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 _SVTOOLS_SVTDATA_HXX +#define _SVTOOLS_SVTDATA_HXX + +#include <tools/resid.hxx> +#include <tools/simplerm.hxx> + +class ResMgr; +class SfxItemDesruptorList_Impl; +class SfxItemPool; +class Twain; + +//============================================================================ +class ImpSvtData +{ +public: + Twain * pTwain; + const SfxItemPool * pStoringPool; + SfxItemDesruptorList_Impl * pItemDesruptList; + + ResMgr * pResMgr; + ResMgr * pPatchResMgr; + + void* m_pThreadsafeRMs; + // one SimpleResMgr for each language for which a resource was requested + // (When using the 'non-simple' resmgr, the first request for any language wins, any + // further request for any other language supply the resmgr of the first call. + // For the simple resmgr we have a mgr for each language ever requested). + +private: + ImpSvtData(): + pTwain(0), pStoringPool(0), pItemDesruptList(0), pResMgr(0), + pPatchResMgr(NULL), m_pThreadsafeRMs(NULL) + {} + + ~ImpSvtData(); + +public: + ResMgr * GetResMgr(const ::com::sun::star::lang::Locale aLocale); + ResMgr * GetResMgr(); // VCL dependant, only available in SVT, not in SVL! + + ResMgr * GetPatchResMgr(); + ResMgr * GetPatchResMgr(const ::com::sun::star::lang::Locale& aLocale); + + + SimpleResMgr * GetSimpleRM(const ::com::sun::star::lang::Locale& rLocale); + + static ImpSvtData & GetSvtData(); +}; + +//============================================================================ + +class SvpResId: public ResId +{ +public: + SvpResId( USHORT nId, const ::com::sun::star::lang::Locale aLocale ): + ResId( nId, *ImpSvtData::GetSvtData().GetResMgr( aLocale ) ) {} + + // VCL dependant, only available in SVT, not in SVL! + SvpResId( USHORT nId ); +}; + + +class SvtResId: public ResId +{ +public: + SvtResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale): + ResId(nId, *ImpSvtData::GetSvtData().GetResMgr(aLocale)) {} + + SvtResId(USHORT nId): ResId(nId, *ImpSvtData::GetSvtData().GetResMgr()) {} + // VCL dependant, only available in SVT, not in SVL! +}; + +//============================================================================ +class SvtSimpleResId +{ + String m_sValue; + +public: + SvtSimpleResId(USHORT nId, const ::com::sun::star::lang::Locale aLocale) : m_sValue(ImpSvtData::GetSvtData().GetSimpleRM(aLocale)->ReadString(nId)) { }; + + operator String () const { return m_sValue; } +}; + + + +#endif // _SVTOOLS_SVTDATA_HXX + diff --git a/svl/inc/svl/svldllapi.h b/svl/inc/svl/svldllapi.h new file mode 100644 index 000000000000..29b2ae29100a --- /dev/null +++ b/svl/inc/svl/svldllapi.h @@ -0,0 +1,44 @@ +/************************************************************************* + * + * 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: svldllapi.h,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 INCLUDED_SVLDLLAPI_H +#define INCLUDED_SVLDLLAPI_H + +#include "sal/types.h" + +#if defined(SVL_DLLIMPLEMENTATION) +#define SVL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define SVL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define SVL_DLLPRIVATE SAL_DLLPRIVATE + +#endif /* INCLUDED_SVLDLLAPI_H */ + diff --git a/svl/inc/svl/svstdarr.hxx b/svl/inc/svl/svstdarr.hxx new file mode 100644 index 000000000000..050b228be4ab --- /dev/null +++ b/svl/inc/svl/svstdarr.hxx @@ -0,0 +1,274 @@ +/************************************************************************* + * + * 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: svstdarr.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. + * + ************************************************************************/ + +#if 0 +*********************************************************************** +* +* Die vordefinierte Arrays werden ueber POSITIV-Defines aktiviert: +* (die defines setzen sich aus "_SVSTDARR_" und dem Namen des Array +* ohne "Sv" zusammen) +* +* VarArr: SvBools, SvULongs, SvUShorts, SvLongs, SvShorts +* PtrArr: SvStrings, SvStringsDtor +* SortArr: SvStringsSort, SvStringsSortDtor, +* SvStringsISort, SvStringsISortDtor, +* SvUShortsSort +*********************************************************************** +#endif + +#include "svtools/svldllapi.h" +#include <svtools/svarray.hxx> + +//#ifdef _SVSTDARR_BOOLS +#ifndef _SVSTDARR_BOOLS_DECL +SV_DECL_VARARR_VISIBILITY( SvBools, BOOL, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BOOLS_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTES +#ifndef _SVSTDARR_BYTES_DECL +SV_DECL_VARARR_VISIBILITY( SvBytes, BYTE, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTES_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_ULONGS +#ifndef _SVSTDARR_ULONGS_DECL +SV_DECL_VARARR_VISIBILITY( SvULongs, ULONG, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_ULONGS_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_ULONGSSORT +#ifndef _SVSTDARR_ULONGSSORT_DECL +SV_DECL_VARARR_SORT_VISIBILITY( SvULongsSort, ULONG, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_ULONGSSORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_USHORTS +#ifndef _SVSTDARR_USHORTS_DECL +SV_DECL_VARARR_VISIBILITY( SvUShorts, USHORT, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_USHORTS_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_USHORTSSORT +#ifndef _SVSTDARR_USHORTSSORT_DECL + +typedef BOOL (*FnForEach_SvUShortsSort)( const USHORT&, void* ); +class SVL_DLLPUBLIC SvUShortsSort : __MWERKS__PRIVATE SvUShorts +{ +public: + SvUShortsSort(BYTE nSize = 1, BYTE nG = 1) + : SvUShorts(nSize,nG) {} + + void Insert( const SvUShortsSort *pI, USHORT nS=0, USHORT nE=USHRT_MAX ); + BOOL Insert( const USHORT aE ); + BOOL Insert( const USHORT aE, USHORT& rP ); + void Insert( const USHORT *pE, USHORT nL ); + // remove ab Pos + void RemoveAt( const USHORT nP, USHORT nL = 1 ); + // remove ab dem Eintrag + void Remove( const USHORT nP, USHORT nL = 1 ); + BOOL Seek_Entry( const USHORT aE, USHORT* pP = 0 ) const; + + USHORT Count() const { return SvUShorts::Count(); } + const USHORT* GetData() const { return (const USHORT*)pData; } + + const USHORT& operator[](USHORT nP) const { + return SvUShorts::operator[]( nP ); + } + const USHORT& GetObject(USHORT nP) const { + return SvUShorts::GetObject( nP ); + } + void ForEach( FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) + { + _ForEach( 0, nA, (FnForEach_SvUShorts)fnForEach, pArgs ); + } + void ForEach( USHORT nS, USHORT nE, + FnForEach_SvUShortsSort fnForEach, void* pArgs = 0 ) + { + _ForEach( nS, nE, (FnForEach_SvUShorts)fnForEach, pArgs ); + } +private: + SvUShortsSort( const SvUShortsSort& ); + SvUShortsSort& operator=( const SvUShortsSort& ); +}; + +#define _SVSTDARR_USHORTSSORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_LONGS +#ifndef _SVSTDARR_LONGS_DECL +SV_DECL_VARARR_VISIBILITY( SvLongs, long, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_LONGS_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_LONGSSORT +#ifndef _SVSTDARR_LONGSSORT_DECL +SV_DECL_VARARR_SORT_VISIBILITY( SvLongsSort, long, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_LONGSSORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_SHORTS +#ifndef _SVSTDARR_SHORTS_DECL +SV_DECL_VARARR_VISIBILITY( SvShorts, short, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_SHORTS_DECL +#endif +//#endif + +/* + form here all Arrays for Strings, ByteString and then + len of a string (xub_StrLen) +#if (defined(_SVSTDARR_STRINGS) && !defined(_SVSTDARR_STRINGS_DECL)) || \ + (defined(_SVSTDARR_STRINGSDTOR) && !defined(_SVSTDARR_STRINGSDTOR_DECL)) || \ + (defined(_SVSTDARR_STRINGSSORT) && !defined(_SVSTDARR_STRINGSSORT_DECL)) || \ + (defined(_SVSTDARR_STRINGSSORTDTOR) && !defined(_SVSTDARR_STRINGSSORTDTOR_DECL)) || \ + (defined(_SVSTDARR_STRINGSISORT) && !defined(_SVSTDARR_STRINGSISORT_DECL)) || \ + (defined(_SVSTDARR_STRINGSISORTDTOR) && !defined(_SVSTDARR_STRINGSISORTDTOR_DECL)) || \ + (defined(_SVSTDARR_BYTESTRINGS) && !defined(_SVSTDARR_BYTESTRINGS_DECL)) || \ + (defined(_SVSTDARR_BYTESTRINGSDTOR) && !defined(_SVSTDARR_BYTESTRINGSDTOR_DECL)) || \ + (defined(_SVSTDARR_BYTESTRINGSSORT) && !defined(_SVSTDARR_BYTESTRINGSSORT_DECL)) || \ + (defined(_SVSTDARR_BYTESTRINGSSORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSSORTDTOR_DECL)) || \ + (defined(_SVSTDARR_BYTESTRINGSISORT) && !defined(_SVSTDARR_BYTESTRINGSISORT_DECL)) || \ + (defined(_SVSTDARR_BYTESTRINGSISORTDTOR) && !defined(_SVSTDARR_BYTESTRINGSISORTDTOR_DECL)) || \ + (defined(_SVSTDARR_XUB_STRLEN) && !defined(_SVSTDARR_XUB_STRLEN_DECL)) ||\ + (defined(_SVSTDARR_XUB_STRLENSORT) && !defined(_SVSTDARR_XUB_STRLENSORT_DECL)) +*/ +#include <tools/string.hxx> + +typedef String* StringPtr; +typedef ByteString* ByteStringPtr; + +//#endif + +//#ifdef _SVSTDARR_STRINGS +#ifndef _SVSTDARR_STRINGS_DECL +SV_DECL_PTRARR_VISIBILITY( SvStrings, StringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_STRINGS_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_STRINGSDTOR +#ifndef _SVSTDARR_STRINGSDTOR_DECL +SV_DECL_PTRARR_DEL_VISIBILITY( SvStringsDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_STRINGSDTOR_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_STRINGSSORT +#ifndef _SVSTDARR_STRINGSSORT_DECL +SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsSort, StringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_STRINGSSORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_STRINGSSORTDTOR +#ifndef _SVSTDARR_STRINGSSORTDTOR_DECL +SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsSortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_STRINGSSORTDTOR_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_STRINGSISORT +#ifndef _SVSTDARR_STRINGSISORT_DECL +SV_DECL_PTRARR_SORT_VISIBILITY( SvStringsISort, StringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_STRINGSISORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_STRINGSISORTDTOR +#ifndef _SVSTDARR_STRINGSISORTDTOR_DECL +SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvStringsISortDtor, StringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_STRINGSISORTDTOR_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTESTRINGS +#ifndef _SVSTDARR_BYTESTRINGS_DECL +SV_DECL_PTRARR_VISIBILITY( SvByteStrings, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTESTRINGS_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTESTRINGSDTOR +#ifndef _SVSTDARR_BYTESTRINGSDTOR_DECL +SV_DECL_PTRARR_DEL_VISIBILITY( SvByteStringsDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTESTRINGSDTOR_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTESTRINGSSORT +#ifndef _SVSTDARR_BYTESTRINGSSORT_DECL +SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsSort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTESTRINGSSORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTESTRINGSSORTDTOR +#ifndef _SVSTDARR_BYTESTRINGSSORTDTOR_DECL +SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsSortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTESTRINGSSORTDTOR_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTESTRINGSISORT +#ifndef _SVSTDARR_BYTESTRINGSISORT_DECL +SV_DECL_PTRARR_SORT_VISIBILITY( SvByteStringsISort, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTESTRINGSISORT_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_BYTESTRINGSISORTDTOR +#ifndef _SVSTDARR_BYTESTRINGSISORTDTOR_DECL +SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvByteStringsISortDtor, ByteStringPtr, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_BYTESTRINGSISORTDTOR_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_XUB_STRLEN +#ifndef _SVSTDARR_XUB_STRLEN_DECL +SV_DECL_VARARR_VISIBILITY( SvXub_StrLens, xub_StrLen, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_XUB_STRLEN_DECL +#endif +//#endif + +//#ifdef _SVSTDARR_XUB_STRLENSORT +#ifndef _SVSTDARR_XUB_STRLENSORT_DECL +SV_DECL_VARARR_SORT_VISIBILITY( SvXub_StrLensSort, xub_StrLen, 1, 1, SVL_DLLPUBLIC ) +#define _SVSTDARR_XUB_STRLENSORT_DECL +#endif +//#endif + diff --git a/svl/inc/svl/svtools.hrc b/svl/inc/svl/svtools.hrc new file mode 100644 index 000000000000..245d31a2dd21 --- /dev/null +++ b/svl/inc/svl/svtools.hrc @@ -0,0 +1,526 @@ +/************************************************************************* + * + * 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: svtools.hrc,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. + * + ************************************************************************/ +#ifndef _SVTOOLS_HRC +#define _SVTOOLS_HRC "$Revision: 1.0" + +#include <svtools/solar.hrc> + +#define RID_SVTOOLS_BITMAP_START (RID_SVTOOLS_START + 0) +#define RID_SVTOOLS_IMAGELIST_START (RID_SVTOOLS_START + 0) + +//............................................................................. +// various unsorted stuff + +#define DLG_EXPORT_PIX (RID_SVTOOLS_START+1) +#define DLG_EXPORT_VEC (RID_SVTOOLS_START+2) +#define DLG_TWAIN_SOURCE (RID_SVTOOLS_START+3) + +#define DLG_SVT_EXPLORERFILE (RID_SVTOOLS_START+4) +#define DLG_SVT_QUERYFOLDERNAME (RID_SVTOOLS_START+5) +#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6) + +#define EXPORT_DIALOG_TITLE (RID_SVTOOLS_START+4) +#define KEY_MODE (RID_SVTOOLS_START+5) +#define KEY_RES (RID_SVTOOLS_START+6) +#define KEY_SIZE (RID_SVTOOLS_START+7) + +#define KEY_COLORS (RID_SVTOOLS_START+9) +#define KEY_RLE_CODING (RID_SVTOOLS_START+10) + +#define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16) + +#define STR_SVT_FILEVIEW_COLUMN_TITLE (RID_SVTOOLS_START + 20) +#define STR_SVT_FILEVIEW_COLUMN_SIZE (RID_SVTOOLS_START + 21) +#define STR_SVT_FILEVIEW_COLUMN_DATE (RID_SVTOOLS_START + 22) +#define STR_SVT_FOLDER (RID_SVTOOLS_START + 23) +#define STR_SVT_FILEVIEW_ERR_MAKEFOLDER (RID_SVTOOLS_START + 24) +#define STR_SVT_BYTES (RID_SVTOOLS_START + 25) +#define STR_SVT_KB (RID_SVTOOLS_START + 26) +#define STR_SVT_MB (RID_SVTOOLS_START + 27) +#define STR_SVT_GB (RID_SVTOOLS_START + 28) +#define STR_FILTERNAME_ALL (RID_SVTOOLS_START + 29) +#define STR_SVT_NEW_FOLDER (RID_SVTOOLS_START + 30) +#define STR_SVT_ALREADYEXISTOVERWRITE (RID_SVTOOLS_START + 31) +#define STR_SVT_FILEVIEW_COLUMN_TYPE (RID_SVTOOLS_START + 32) +#define RID_FILEVIEW_CONTEXTMENU (RID_SVTOOLS_START + 33) +#define RID_FILEOPEN_INVALIDFOLDER (RID_SVTOOLS_START + 34) +#define RID_FILEOPEN_NOTEXISTENTFILE (RID_SVTOOLS_START + 35) +#define STR_SVT_NOREMOVABLEDEVICE (RID_SVTOOLS_START + 36) + +// doc template dialog +#define DLG_DOCTEMPLATE (RID_SVTOOLS_START+50) +#define CTRL_FILEVIEW (RID_SVTOOLS_START+51) +#define STR_SVT_NEWDOC (RID_SVTOOLS_START+52) +#define STR_SVT_MYDOCS (RID_SVTOOLS_START+53) +#define STR_SVT_TEMPLATES (RID_SVTOOLS_START+54) +#define STR_SVT_SAMPLES (RID_SVTOOLS_START+55) +#define TB_SVT_FILEVIEW (RID_SVTOOLS_START+56) +#define TB_SVT_FRAMEWIN (RID_SVTOOLS_START+57) +#define STRARY_SVT_DOCINFO (RID_SVTOOLS_START+58) +#define STR_SVT_NEWDOC_HELP (RID_SVTOOLS_START+63) +#define STR_SVT_MYDOCS_HELP (RID_SVTOOLS_START+64) +#define STR_SVT_TEMPLATES_HELP (RID_SVTOOLS_START+65) +#define STR_SVT_SAMPLES_HELP (RID_SVTOOLS_START+66) + +#define STR_WARNING_ITEM (RID_SVTOOLS_START+90) +#define STR_CSTAT_NEVER_UPD (RID_SVTOOLS_START+91) +#define STR_CSTAT_IN_UPD (RID_SVTOOLS_START+92) +#define STR_CSTAT_UPD_NEWER (RID_SVTOOLS_START+93) +#define STR_CSTAT_UPD_NOT_NEWER (RID_SVTOOLS_START+94) +#define STR_CSTAT_UPD_CANCEL (RID_SVTOOLS_START+95) +#define STR_CSTAT_ERR_GENERAL (RID_SVTOOLS_START+96) +#define STR_CSTAT_ERR_NOTEXISTS (RID_SVTOOLS_START+97) +#define STR_CSTAT_ERR_NOTREACHED (RID_SVTOOLS_START+98) +#define STR_COLUM_DT_AUTO (RID_SVTOOLS_START+99) +#define STR_CSTAT_UPD_IMMEDIATELY (RID_SVTOOLS_START+100) +#define STR_CSTAT_ERR_OFFLINE (RID_SVTOOLS_START+101) + +#define CONFIG_BASIC_FORMAT_START (RID_SVTOOLS_START+102) +#define STR_BASICKEY_FORMAT_ON (RID_SVTOOLS_START+103) +#define STR_BASICKEY_FORMAT_OFF (RID_SVTOOLS_START+104) +#define STR_BASICKEY_FORMAT_YES (RID_SVTOOLS_START+105) +#define STR_BASICKEY_FORMAT_NO (RID_SVTOOLS_START+106) +#define STR_BASICKEY_FORMAT_TRUE (RID_SVTOOLS_START+107) +#define STR_BASICKEY_FORMAT_FALSE (RID_SVTOOLS_START+108) +#define CONFIG_BASIC_FORMAT_END (RID_SVTOOLS_START+109) + +#define STR_INVALIDTRYBUY (RID_SVTOOLS_START+120) +#define STR_OLDTRYBUY (RID_SVTOOLS_START+121) +#define STR_TRYBUY (RID_SVTOOLS_START+122) +#define STR_PVER_LANGUAGECODE (RID_SVTOOLS_START+124) +#define STR_PVER_LONG_LANGUAGECODE (RID_SVTOOLS_START+125) +#define STR_INVALIDPUFF (RID_SVTOOLS_START+126) +#define STR_LIMITEDPUFF (RID_SVTOOLS_START+127) +#define STR_OLDLIMITEDPUFF (RID_SVTOOLS_START+128) +#define RID_REGISTER_DIALOG (RID_SVTOOLS_START+129) +#define STR_BASICKEY_FORMAT_CURRENCY (RID_SVTOOLS_START+130) +#define STR_KEYERR_GENERAL_HELP (RID_SVTOOLS_START+131) +#define STR_KEYERR_INVALID_KEY (RID_SVTOOLS_START+132) +#define STR_KEYERR_INVALID_USERDATA (RID_SVTOOLS_START+133) +#define STR_KEYERR_INVALID_ADDRESSDATA (RID_SVTOOLS_START+134) +#define STR_KEYERR_INVALID_LICENSE (RID_SVTOOLS_START+135) +#define STR_KEYERR_INVALID_LANGUAGE (RID_SVTOOLS_START+136) +#define STR_KEYERR_INVALID_OS (RID_SVTOOLS_START+137) +#define STR_KEYERR_INVALID_NO_CNR (RID_SVTOOLS_START+138) +#define STR_KEYERR_INVALID_CNR (RID_SVTOOLS_START+139) +#define RID_LIMITED_DIALOG (RID_SVTOOLS_START+140) + +#define STR_SVT_MIMETYPE_START (RID_SVTOOLS_START+141) +#define STR_SVT_MIMETYPE_APP_OCTSTREAM (STR_SVT_MIMETYPE_START+0) +#define STR_SVT_MIMETYPE_APP_PDF (STR_SVT_MIMETYPE_START+1) +#define STR_SVT_MIMETYPE_APP_RTF (STR_SVT_MIMETYPE_START+2) +#define STR_SVT_MIMETYPE_APP_MSWORD (STR_SVT_MIMETYPE_START+3) +#define STR_SVT_MIMETYPE_APP_STARCALC (STR_SVT_MIMETYPE_START+4) +#define STR_SVT_MIMETYPE_APP_STARCHART (STR_SVT_MIMETYPE_START+5) +#define STR_SVT_MIMETYPE_APP_STARDRAW (STR_SVT_MIMETYPE_START+6) +#define STR_SVT_MIMETYPE_APP_STARIMAGE (STR_SVT_MIMETYPE_START+7) +#define STR_SVT_MIMETYPE_APP_STARMATH (STR_SVT_MIMETYPE_START+8) +#define STR_SVT_MIMETYPE_APP_STARWRITER (STR_SVT_MIMETYPE_START+9) +#define STR_SVT_MIMETYPE_APP_ZIP (STR_SVT_MIMETYPE_START+10) +#define STR_SVT_MIMETYPE_AUDIO_AIFF (STR_SVT_MIMETYPE_START+11) +#define STR_SVT_MIMETYPE_AUDIO_BASIC (STR_SVT_MIMETYPE_START+12) +#define STR_SVT_MIMETYPE_AUDIO_MIDI (STR_SVT_MIMETYPE_START+13) +#define STR_SVT_MIMETYPE_AUDIO_WAV (STR_SVT_MIMETYPE_START+14) +#define STR_SVT_MIMETYPE_IMAGE_GIF (STR_SVT_MIMETYPE_START+15) +#define STR_SVT_MIMETYPE_IMAGE_JPEG (STR_SVT_MIMETYPE_START+16) +#define STR_SVT_MIMETYPE_IMAGE_PCX (STR_SVT_MIMETYPE_START+17) +#define STR_SVT_MIMETYPE_IMAGE_BMP (STR_SVT_MIMETYPE_START+18) +#define STR_SVT_MIMETYPE_TEXT_HTML (STR_SVT_MIMETYPE_START+19) +#define STR_SVT_MIMETYPE_TEXT_PLAIN (STR_SVT_MIMETYPE_START+20) +#define STR_SVT_MIMETYPE_TEXT_URL (STR_SVT_MIMETYPE_START+21) +#define STR_SVT_MIMETYPE_TEXT_VCARD (STR_SVT_MIMETYPE_START+22) +#define STR_SVT_MIMETYPE_VIDEO_VDO (STR_SVT_MIMETYPE_START+23) +#define STR_SVT_MIMETYPE_VIDEO_MSVIDEO (STR_SVT_MIMETYPE_START+24) +#define STR_SVT_MIMETYPE_X_STARMAIL (STR_SVT_MIMETYPE_START+25) +#define STR_SVT_MIMETYPE_X_VRML (STR_SVT_MIMETYPE_START+26) +#define STR_SVT_MIMETYPE_APP_STARHELP (STR_SVT_MIMETYPE_START+27) +#define STR_SVT_MIMETYPE_APP_STARIMPRESS (STR_SVT_MIMETYPE_START+28) +#define STR_SVT_MIMETYPE_APP_SCHED_CMB (STR_SVT_MIMETYPE_START+29) +#define STR_SVT_MIMETYPE_APP_SCHED_EVT (STR_SVT_MIMETYPE_START+30) +#define STR_SVT_MIMETYPE_APP_SCHED_TASK (STR_SVT_MIMETYPE_START+31) +#define STR_SVT_MIMETYPE_APP_SCHED_TVIEW (STR_SVT_MIMETYPE_START+32) + +#define STR_SVT_MIMETYPE_CNT_MSG (STR_SVT_MIMETYPE_START+33) +#define STR_SVT_MIMETYPE_CNT_DOCUMENT (STR_SVT_MIMETYPE_START+34) +#define STR_SVT_MIMETYPE_CNT_POP3BOX (STR_SVT_MIMETYPE_START+35) +#define STR_SVT_MIMETYPE_CNT_IMAPBOX (STR_SVT_MIMETYPE_START+36) +#define STR_SVT_MIMETYPE_CNT_IMAPFLD (STR_SVT_MIMETYPE_START+37) +#define STR_SVT_MIMETYPE_CNT_VIMBOX (STR_SVT_MIMETYPE_START+38) +#define STR_SVT_MIMETYPE_CNT_VIMINBOX (STR_SVT_MIMETYPE_START+39) +#define STR_SVT_MIMETYPE_CNT_BBBOX (STR_SVT_MIMETYPE_START+40) +#define STR_SVT_MIMETYPE_CNT_VIM_BB (STR_SVT_MIMETYPE_START+41) +#define STR_SVT_MIMETYPE_CNT_NEWSBOX (STR_SVT_MIMETYPE_START+42) +#define STR_SVT_MIMETYPE_CNT_NEWSGRP (STR_SVT_MIMETYPE_START+43) +#define STR_SVT_MIMETYPE_CNT_OUTBOX (STR_SVT_MIMETYPE_START+44) +#define STR_SVT_MIMETYPE_CNT_FTPBOX (STR_SVT_MIMETYPE_START+45) +#define STR_SVT_MIMETYPE_CNT_FTPFLD (STR_SVT_MIMETYPE_START+46) +#define STR_SVT_MIMETYPE_CNT_FTPFILE (STR_SVT_MIMETYPE_START+47) +#define STR_SVT_MIMETYPE_CNT_FTPLINK (STR_SVT_MIMETYPE_START+48) +#define STR_SVT_MIMETYPE_CNT_HTTPBOX (STR_SVT_MIMETYPE_START+49) +#define STR_SVT_MIMETYPE_CNT_FSYSBOX (STR_SVT_MIMETYPE_START+50) +#define STR_SVT_MIMETYPE_CNT_FSYSFLD (STR_SVT_MIMETYPE_START+51) +#define STR_SVT_MIMETYPE_CNT_FSYSFILE (STR_SVT_MIMETYPE_START+52) +#define STR_SVT_MIMETYPE_CNT_FSYSURLFILE (STR_SVT_MIMETYPE_START+53) +#define STR_SVT_MIMETYPE_CNT_PUBLBOX (STR_SVT_MIMETYPE_START+54) +#define STR_SVT_MIMETYPE_CNT_SRCHBOX (STR_SVT_MIMETYPE_START+55) +#define STR_SVT_MIMETYPE_CNT_SUBSCRBOX (STR_SVT_MIMETYPE_START+56) +#define STR_SVT_MIMETYPE_CNT_BOOKMARK (STR_SVT_MIMETYPE_START+57) +#define STR_SVT_MIMETYPE_CNT_CDF (STR_SVT_MIMETYPE_START+58) +#define STR_SVT_MIMETYPE_CNT_CDFSUB (STR_SVT_MIMETYPE_START+59) +#define STR_SVT_MIMETYPE_CNT_CDFITEM (STR_SVT_MIMETYPE_START+60) +#define STR_SVT_MIMETYPE_CNT_STARCHANNEL (STR_SVT_MIMETYPE_START+61) +#define STR_SVT_MIMETYPE_CNT_TRASHBOX (STR_SVT_MIMETYPE_START+62) +#define STR_SVT_MIMETYPE_CNT_TRASH (STR_SVT_MIMETYPE_START+63) +#define STR_SVT_MIMETYPE_CNT_REMOV_VOL (STR_SVT_MIMETYPE_START+64) +#define STR_SVT_MIMETYPE_CNT_FIX_VOL (STR_SVT_MIMETYPE_START+65) +#define STR_SVT_MIMETYPE_CNT_REM_VOL (STR_SVT_MIMETYPE_START+66) +#define STR_SVT_MIMETYPE_CNT_RAM_VOL (STR_SVT_MIMETYPE_START+67) +#define STR_SVT_MIMETYPE_CNT_CDROM (STR_SVT_MIMETYPE_START+68) +#define STR_SVT_MIMETYPE_CNT_DISK_35 (STR_SVT_MIMETYPE_START+69) +#define STR_SVT_MIMETYPE_CNT_DISK_525 (STR_SVT_MIMETYPE_START+70) +#define STR_SVT_MIMETYPE_CNT_TAPEDRIVE (STR_SVT_MIMETYPE_START+71) +#define STR_SVT_MIMETYPE_APP_GAL (STR_SVT_MIMETYPE_START+72) +#define STR_SVT_MIMETYPE_APP_GAL_THEME (STR_SVT_MIMETYPE_START+73) +#define STR_SVT_MIMETYPE_CNT_SEPARATOR (STR_SVT_MIMETYPE_START+74) +#define STR_SVT_MIMETYPE_APP_STARW_GLOB (STR_SVT_MIMETYPE_START+75) +#define STR_SVT_MIMETYPE_APP_SDM (STR_SVT_MIMETYPE_START+76) +#define STR_SVT_MIMETYPE_APP_SMD (STR_SVT_MIMETYPE_START+77) +#define STR_SVT_MIMETYPE_APP_STARW_WEB (STR_SVT_MIMETYPE_START+78) +#define STR_SVT_MIMETYPE_SCHEDULE (STR_SVT_MIMETYPE_START+79) +#define STR_SVT_MIMETYPE_SCHEDULE_EVT (STR_SVT_MIMETYPE_START+80) +#define STR_SVT_MIMETYPE_SCHEDULE_TASK (STR_SVT_MIMETYPE_START+81) +#define STR_SVT_MIMETYPE_SCHEDULE_FEVT (STR_SVT_MIMETYPE_START+82) +#define STR_SVT_MIMETYPE_SCHEDULE_FTASK (STR_SVT_MIMETYPE_START+83) +#define STR_SVT_MIMETYPE_FRAMESET (STR_SVT_MIMETYPE_START+84) +#define STR_SVT_MIMETYPE_MACRO (STR_SVT_MIMETYPE_START+85) +#define STR_SVT_MIMETYPE_CNT_SFSYSFOLDER (STR_SVT_MIMETYPE_START+86) +#define STR_SVT_MIMETYPE_CNT_SFSYSFILE (STR_SVT_MIMETYPE_START+87) +#define STR_SVT_MIMETYPE_APP_TEMPLATE (STR_SVT_MIMETYPE_START+88) +#define STR_SVT_MIMETYPE_IMAGE_GENERIC (STR_SVT_MIMETYPE_START+89) +#define STR_SVT_MIMETYPE_APP_MSEXCEL (STR_SVT_MIMETYPE_START+90) +#define STR_SVT_MIMETYPE_APP_MSEXCEL_TEMPL (STR_SVT_MIMETYPE_START+91) +#define STR_SVT_MIMETYPE_APP_MSPPOINT (STR_SVT_MIMETYPE_START+92) +#define STR_SVT_MIMETYPE_TEXT_VCALENDAR (STR_SVT_MIMETYPE_START+93) +#define STR_SVT_MIMETYPE_TEXT_ICALENDAR (STR_SVT_MIMETYPE_START+94) +#define STR_SVT_MIMETYPE_TEXT_XMLICALENDAR (STR_SVT_MIMETYPE_START+95) +#define STR_SVT_MIMETYPE_TEXT_CDE_CALENDAR_APP (STR_SVT_MIMETYPE_START+96) +#define STR_SVT_MIMETYPE_INET_MSG_RFC822 (STR_SVT_MIMETYPE_START+97) +#define STR_SVT_MIMETYPE_INET_MULTI_ALTERNATIVE (STR_SVT_MIMETYPE_START+98) +#define STR_SVT_MIMETYPE_INET_MULTI_DIGEST (STR_SVT_MIMETYPE_START+99) +#define STR_SVT_MIMETYPE_INET_MULTI_PARALLEL (STR_SVT_MIMETYPE_START+100) +#define STR_SVT_MIMETYPE_INET_MULTI_RELATED (STR_SVT_MIMETYPE_START+101) +#define STR_SVT_MIMETYPE_INET_MULTI_MIXED (STR_SVT_MIMETYPE_START+102) +#define STR_SVT_MIMETYPE_APP_IMPRESSPACKED (STR_SVT_MIMETYPE_START+103) +#define STR_SVT_MIMETYPE_APP_JAR (STR_SVT_MIMETYPE_START+104) +#define STR_SVT_MIMETYPE_IMAGE_PNG (STR_SVT_MIMETYPE_START+105) +#define STR_SVT_MIMETYPE_IMAGE_TIFF (STR_SVT_MIMETYPE_START+106) + +#define STR_SVT_MIMETYPE_APP_SXCALC (STR_SVT_MIMETYPE_START+107) +#define STR_SVT_MIMETYPE_APP_SXCHART (STR_SVT_MIMETYPE_START+108) +#define STR_SVT_MIMETYPE_APP_SXDRAW (STR_SVT_MIMETYPE_START+109) +#define STR_SVT_MIMETYPE_APP_SXMATH (STR_SVT_MIMETYPE_START+110) +#define STR_SVT_MIMETYPE_APP_SXWRITER (STR_SVT_MIMETYPE_START+111) +#define STR_SVT_MIMETYPE_APP_SXIMPRESS (STR_SVT_MIMETYPE_START+112) +#define STR_SVT_MIMETYPE_APP_SXGLOBAL (STR_SVT_MIMETYPE_START+113) +#define STR_SVT_MIMETYPE_APP_SXIPACKED (STR_SVT_MIMETYPE_START+114) +#define STR_SVT_MIMETYPE_END (STR_SVT_MIMETYPE_APP_SXIPACKED) + +#define STR_SVT_PRNDLG_START (STR_SVT_MIMETYPE_END+1) +#define DLG_SVT_PRNDLG_PRNSETUPDLG (STR_SVT_PRNDLG_START+0) +#define DLG_SVT_PRNDLG_PRINTDLG (STR_SVT_PRNDLG_START+1) +#define STR_SVT_PRNDLG_READY (STR_SVT_PRNDLG_START+2) +#define STR_SVT_PRNDLG_PAUSED (STR_SVT_PRNDLG_START+3) +#define STR_SVT_PRNDLG_PENDING (STR_SVT_PRNDLG_START+4) +#define STR_SVT_PRNDLG_BUSY (STR_SVT_PRNDLG_START+5) +#define STR_SVT_PRNDLG_INITIALIZING (STR_SVT_PRNDLG_START+6) +#define STR_SVT_PRNDLG_WAITING (STR_SVT_PRNDLG_START+7) +#define STR_SVT_PRNDLG_WARMING_UP (STR_SVT_PRNDLG_START+8) +#define STR_SVT_PRNDLG_PROCESSING (STR_SVT_PRNDLG_START+9) +#define STR_SVT_PRNDLG_PRINTING (STR_SVT_PRNDLG_START+10) +#define STR_SVT_PRNDLG_OFFLINE (STR_SVT_PRNDLG_START+11) +#define STR_SVT_PRNDLG_ERROR (STR_SVT_PRNDLG_START+12) +#define STR_SVT_PRNDLG_SERVER_UNKNOWN (STR_SVT_PRNDLG_START+13) +#define STR_SVT_PRNDLG_PAPER_JAM (STR_SVT_PRNDLG_START+14) +#define STR_SVT_PRNDLG_PAPER_OUT (STR_SVT_PRNDLG_START+15) +#define STR_SVT_PRNDLG_MANUAL_FEED (STR_SVT_PRNDLG_START+16) +#define STR_SVT_PRNDLG_PAPER_PROBLEM (STR_SVT_PRNDLG_START+17) +#define STR_SVT_PRNDLG_IO_ACTIVE (STR_SVT_PRNDLG_START+18) +#define STR_SVT_PRNDLG_OUTPUT_BIN_FULL (STR_SVT_PRNDLG_START+19) +#define STR_SVT_PRNDLG_TONER_LOW (STR_SVT_PRNDLG_START+20) +#define STR_SVT_PRNDLG_NO_TONER (STR_SVT_PRNDLG_START+21) +#define STR_SVT_PRNDLG_PAGE_PUNT (STR_SVT_PRNDLG_START+22) +#define STR_SVT_PRNDLG_USER_INTERVENTION (STR_SVT_PRNDLG_START+23) +#define STR_SVT_PRNDLG_OUT_OF_MEMORY (STR_SVT_PRNDLG_START+24) +#define STR_SVT_PRNDLG_DOOR_OPEN (STR_SVT_PRNDLG_START+25) +#define STR_SVT_PRNDLG_POWER_SAVE (STR_SVT_PRNDLG_START+26) +#define STR_SVT_PRNDLG_DEFPRINTER (STR_SVT_PRNDLG_START+27) +#define STR_SVT_PRNDLG_JOBCOUNT (STR_SVT_PRNDLG_START+28) +#define STR_SVT_PRNDLG_END (RID_IMG_PRNDLG_NOCOLLATE_HC) + +#define STR_SVT_CALENDAR_START (STR_SVT_PRNDLG_END+1) +#define STR_SVT_CALENDAR_DAY (STR_SVT_CALENDAR_START+0) +#define STR_SVT_CALENDAR_WEEK (STR_SVT_CALENDAR_START+1) +#define STR_SVT_CALENDAR_TODAY (STR_SVT_CALENDAR_START+2) +#define STR_SVT_CALENDAR_NONE (STR_SVT_CALENDAR_START+3) +#define STR_SVT_CALENDAR_END (STR_SVT_CALENDAR_NONE) + +#define STR_SVT_PVER_START (STR_SVT_CALENDAR_END+1) +#define STR_SVT_PVER_INTERNAL (STR_SVT_PVER_START+0) +#define STR_SVT_PVER_PERSONAL_DELUXE (STR_SVT_PVER_START+1) +#define STR_SVT_PVER_PERSONAL (STR_SVT_PVER_START+2) +#define STR_SVT_PVER_PROFESSIONAL (STR_SVT_PVER_START+3) +#define STR_SVT_PVER_BUSINESS (STR_SVT_PVER_START+4) +#define STR_SVT_PVER_ENTERPRICE (STR_SVT_PVER_START+5) +#define STR_SVT_PVER_EDUCATION (STR_SVT_PVER_START+6) +#define STR_SVT_PVER_DEMO (STR_SVT_PVER_START+7) +#define STR_SVT_PVER_BETA (STR_SVT_PVER_START+8) +#define STR_SVT_PVER_OEM (STR_SVT_PVER_START+9) +#define STR_SVT_PVER_NOT_REGISTERED (STR_SVT_PVER_START+10) +#define STR_SVT_PVER_PILOT (STR_SVT_PVER_START+11) +#define STR_SVT_PVER_CAMPUS (STR_SVT_PVER_START+12) +#define STR_SVT_PVER_EVALUATION (STR_SVT_PVER_START+13) +#define STR_SVT_PVER_PARTNER (STR_SVT_PVER_START+14) +#define STR_SVT_PVER_SMALLBUSINESS (STR_SVT_PVER_START+15) +#define STR_SVT_PVER_OEM_PROFESSIONAL (STR_SVT_PVER_START+16) +#define STR_SVT_PVER_END (STR_SVT_PVER_OEM_PROFESSIONAL) + +#define STR_SVT_STYLE_START (STR_SVT_PVER_END+1) +#define STR_SVT_STYLE_LIGHT (STR_SVT_STYLE_START+0) +#define STR_SVT_STYLE_LIGHT_ITALIC (STR_SVT_STYLE_START+1) +#define STR_SVT_STYLE_NORMAL (STR_SVT_STYLE_START+2) +#define STR_SVT_STYLE_NORMAL_ITALIC (STR_SVT_STYLE_START+3) +#define STR_SVT_STYLE_BOLD (STR_SVT_STYLE_START+4) +#define STR_SVT_STYLE_BOLD_ITALIC (STR_SVT_STYLE_START+5) +#define STR_SVT_STYLE_BLACK (STR_SVT_STYLE_START+6) +#define STR_SVT_STYLE_BLACK_ITALIC (STR_SVT_STYLE_START+7) +#define STR_SVT_STYLE_END (STR_SVT_STYLE_BLACK_ITALIC) + +#define STR_SVT_FONTMAP_START (STR_SVT_STYLE_END+1) +#define STR_SVT_FONTMAP_BOTH (STR_SVT_FONTMAP_START+0) +#define STR_SVT_FONTMAP_PRINTERONLY (STR_SVT_FONTMAP_START+1) +#define STR_SVT_FONTMAP_SCREENONLY (STR_SVT_FONTMAP_START+2) +#define STR_SVT_FONTMAP_SIZENOTAVAILABLE (STR_SVT_FONTMAP_START+3) +#define STR_SVT_FONTMAP_STYLENOTAVAILABLE (STR_SVT_FONTMAP_START+4) +#define STR_SVT_FONTMAP_NOTAVAILABLE (STR_SVT_FONTMAP_START+5) +#define STR_SVT_FONTMAP_END (STR_SVT_FONTMAP_NOTAVAILABLE) + +#define STR_SVT_ERRORCONTEXT_START (STR_SVT_FONTMAP_END+1) +#define STR_ERR_HDLMESS (STR_SVT_ERRORCONTEXT_START+0) +#define RID_ERRHDL_CLASS (STR_SVT_ERRORCONTEXT_START+1) +#define RID_ERRCTX (STR_SVT_ERRORCONTEXT_START+2) +#define RID_ERRHDL (STR_SVT_ERRORCONTEXT_START+3) +#define STR_SVT_ERRORCONTEXT_END (RID_ERRHDL) + +#define STR_WIZARDDIALOG_START (STR_SVT_ERRORCONTEXT_END + 1) +#define STR_WIZDLG_FINISH (STR_WIZARDDIALOG_START + 0) +#define STR_WIZDLG_NEXT (STR_WIZARDDIALOG_START + 1) +#define STR_WIZDLG_PREVIOUS (STR_WIZARDDIALOG_START + 2) +#define STR_WIZDLG_ROADMAP_TITLE (STR_WIZARDDIALOG_START + 3) +#define STR_WIZARDDIALOG_END (STR_WIZDLG_ROADMAP_TITLE) + +#define STR_SVT_COLLATE_START (STR_WIZARDDIALOG_END+1) +#define STR_SVT_COLLATE_NORMAL (STR_SVT_COLLATE_START+0) +#define STR_SVT_COLLATE_DICTIONARY (STR_SVT_COLLATE_START+1) +#define STR_SVT_COLLATE_PINYIN (STR_SVT_COLLATE_START+2) +#define STR_SVT_COLLATE_STROKE (STR_SVT_COLLATE_START+3) +#define STR_SVT_COLLATE_RADICAL (STR_SVT_COLLATE_START+4) +#define STR_SVT_COLLATE_CHARSET (STR_SVT_COLLATE_START+5) +#define STR_SVT_COLLATE_ZHUYIN (STR_SVT_COLLATE_START+6) +#define STR_SVT_COLLATE_ALPHANUMERIC (STR_SVT_COLLATE_START+7) +#define STR_SVT_COLLATE_UNICODE (STR_SVT_COLLATE_START+8) +#define STR_SVT_COLLATE_PHONEBOOK (STR_SVT_COLLATE_START+9) +#define STR_SVT_COLLATE_PHONETIC_F (STR_SVT_COLLATE_START+10) +#define STR_SVT_COLLATE_PHONETIC_L (STR_SVT_COLLATE_START+11) +#define STR_SVT_COLLATE_END (STR_SVT_COLLATE_PHONETIC_L) + +#define STR_SVT_FILEPICKER_START (STR_SVT_COLLATE_END+1) +#define STR_SVT_FILEPICKER_AUTO_EXTENSION (STR_SVT_FILEPICKER_START+ 0) +#define STR_SVT_FILEPICKER_PASSWORD (STR_SVT_FILEPICKER_START+ 1) +#define STR_SVT_FILEPICKER_FILTER_OPTIONS (STR_SVT_FILEPICKER_START+ 2) +#define STR_SVT_FILEPICKER_READONLY (STR_SVT_FILEPICKER_START+ 3) +#define STR_SVT_FILEPICKER_INSERT_AS_LINK (STR_SVT_FILEPICKER_START+ 4) +#define STR_SVT_FILEPICKER_SHOW_PREVIEW (STR_SVT_FILEPICKER_START+ 5) +#define STR_SVT_FILEPICKER_PLAY (STR_SVT_FILEPICKER_START+ 6) +#define STR_SVT_FILEPICKER_VERSION (STR_SVT_FILEPICKER_START+ 7) +#define STR_SVT_FILEPICKER_TEMPLATES (STR_SVT_FILEPICKER_START+ 8) +#define STR_SVT_FILEPICKER_IMAGE_TEMPLATE (STR_SVT_FILEPICKER_START+ 9) +#define STR_SVT_FILEPICKER_SELECTION (STR_SVT_FILEPICKER_START+10) +#define STR_SVT_FILEPICKER_FILTER_TITLE (STR_SVT_FILEPICKER_START+11) +#define STR_SVT_FOLDERPICKER_DEFAULT_TITLE (STR_SVT_FILEPICKER_START+12) +#define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION (STR_SVT_FILEPICKER_START+13) +#define STR_SVT_FILEPICKER_END (STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION) + +// String-Ids for accessibility +#define STR_SVT_ACC_BEGIN (STR_SVT_FILEPICKER_END+1) + // FREE + // FREE +#define STR_SVT_ACC_DESC_TABLISTBOX (STR_SVT_ACC_BEGIN+2) +#define STR_SVT_ACC_DESC_FILEVIEW (STR_SVT_ACC_BEGIN+3) +#define STR_SVT_ACC_DESC_FOLDER (STR_SVT_ACC_BEGIN+4) +#define STR_SVT_ACC_DESC_FILE (STR_SVT_ACC_BEGIN+5) +#define STR_SVT_ACC_EMPTY_FIELD (STR_SVT_ACC_BEGIN+6) +#define STR_SVT_ACC_END (STR_SVT_ACC_EMPTY_FIELD) + +#define STR_SVT_INDEXENTRY_START (STR_SVT_ACC_END + 1) +#define STR_SVT_INDEXENTRY_ALPHANUMERIC (STR_SVT_INDEXENTRY_START+0) +#define STR_SVT_INDEXENTRY_DICTIONARY (STR_SVT_INDEXENTRY_START+1) +#define STR_SVT_INDEXENTRY_PINYIN (STR_SVT_INDEXENTRY_START+2) +#define STR_SVT_INDEXENTRY_RADICAL (STR_SVT_INDEXENTRY_START+3) +#define STR_SVT_INDEXENTRY_STROKE (STR_SVT_INDEXENTRY_START+4) +#define STR_SVT_INDEXENTRY_ZHUYIN (STR_SVT_INDEXENTRY_START+5) +#define STR_SVT_INDEXENTRY_PHONETIC_FS (STR_SVT_INDEXENTRY_START+6) +#define STR_SVT_INDEXENTRY_PHONETIC_FC (STR_SVT_INDEXENTRY_START+7) +#define STR_SVT_INDEXENTRY_PHONETIC_LS (STR_SVT_INDEXENTRY_START+8) +#define STR_SVT_INDEXENTRY_PHONETIC_LC (STR_SVT_INDEXENTRY_START+9) +#define STR_SVT_INDEXENTRY_END (STR_SVT_INDEXENTRY_PHONETIC_LC) + +//String - Ids for Java errors, messages +//These strings come from project desktop +//There was no time for translation, therefore the defines needed to +//remain the same. +#define STR_SVT_JAVAERROR_START (STR_SVT_INDEXENTRY_END + 1) +#define STR_QUESTION_JAVADISABLED (STR_SVT_JAVAERROR_START+0) +#define STR_ERROR_JVMCREATIONFAILED (STR_SVT_JAVAERROR_START+1) +#define STR_WARNING_JAVANOTFOUND (STR_SVT_JAVAERROR_START+2) +#define STR_WARNING_INVALIDJAVASETTINGS (STR_SVT_JAVAERROR_START+3) +#define STR_ERROR_RESTARTREQUIRED (STR_SVT_JAVAERROR_START+4) +#define STR_SVT_JAVAERROR_END (STR_ERROR_RESTARTREQUIRED) + +// String array to match UI language names to LanguageType values and vice versa +#define STR_ARR_SVT_LANGUAGE_TABLE_START (STR_SVT_JAVAERROR_END + 1) +#define STR_ARR_SVT_LANGUAGE_TABLE (STR_ARR_SVT_LANGUAGE_TABLE_START + 0) +#define STR_ARR_SVT_LANGUAGE_TABLE_END (STR_ARR_SVT_LANGUAGE_TABLE) + +//............................................................................. +// dialogs + +#define DLG_EXPORT_JPG_START (RID_SVTOOLS_START+110) +#define DLG_EXPORT_JPG (RID_SVTOOLS_START+111) +#define DLG_EXPORT_JPG_END (RID_SVTOOLS_START+112) + +#define DLG_LOGIN (RID_SVTOOLS_START+113) +#define DLG_ADDRESSBOOKSOURCE (RID_SVTOOLS_START+114) + +#define DLG_REGISTRATION_REQUEST (RID_SVTOOLS_START+115) + +#define DLG_EXPORT_EPNG (RID_SVTOOLS_START+116) +//............................................................................. +// bitmaps + +#define BMP_DEMO_FINGER (RID_SVTOOLS_BITMAP_START + 0) +#define BMP_HELP_AGENT_IMAGE (RID_SVTOOLS_BITMAP_START + 1) +#define BMP_HELP_AGENT_CLOSER (RID_SVTOOLS_BITMAP_START + 2) +#define BMP_PLUGIN (RID_SVTOOLS_BITMAP_START + 3) + +//............................................................................. +// image lists + +#define RID_IMG_EXPANDER (RID_SVTOOLS_IMAGELIST_START + 0) +#define RID_SVTOOLS_IMAGELIST_BIG (RID_SVTOOLS_IMAGELIST_START + 1) +#define RID_SVTOOLS_IMAGELIST_SMALL (RID_SVTOOLS_IMAGELIST_START + 2) +#define RID_SVTOOLS_IMAGELIST_EDITBROWSEBOX (RID_SVTOOLS_IMAGELIST_START + 3) +#define RID_SVTOOLS_IMAGELIST_BIG_HIGHCONTRAST (RID_SVTOOLS_IMAGELIST_START + 4) +#define RID_SVTOOLS_IMAGELIST_SMALL_HIGHCONTRAST (RID_SVTOOLS_IMAGELIST_START + 5) +#define RID_SVTOOLS_IMAGELIST_EDITBWSEBOX_H (RID_SVTOOLS_IMAGELIST_START + 6) +#define RID_FILEPICKER_IMAGES (RID_SVTOOLS_IMAGELIST_START + 7) +#define RID_FILEPICKER_IMAGES_HC (RID_SVTOOLS_IMAGELIST_START + 8) + +//............................................................................. +// error boxes +#define ERRBOX_REG_NOSYSBROWSER ( RID_SVTOOLS_START + 0 ) +#define ERRBOX_CHECK_PLZ ( RID_SVTOOLS_START + 11 ) + +// Java message boxes +//These strings come from project desktop +//There was no time for translation, therefore the defines needed to +//remain the same. +#define QBX_JAVADISABLED (RID_SVTOOLS_START+20) +#define ERRORBOX_JVMCREATIONFAILED (RID_SVTOOLS_START+21) +#define WARNINGBOX_JAVANOTFOUND (RID_SVTOOLS_START+22) +#define WARNINGBOX_INVALIDJAVASETTINGS (RID_SVTOOLS_START+23) +#define ERRORBOX_RESTARTREQUIRED (RID_SVTOOLS_START+24) + +//............................................................................. +// images +#define RID_IMG_TREENODE_COLLAPSED (RID_SVTOOLS_START + 0) +#define RID_IMG_TREENODE_EXPANDED (RID_SVTOOLS_START + 1) +#define RID_IMG_TREENODE_COLLAPSED_HC (RID_SVTOOLS_START + 2) +#define RID_IMG_TREENODE_EXPANDED_HC (RID_SVTOOLS_START + 3) + +#define RID_IMG_PRINTERFONT (RID_SVTOOLS_START + 12) +#define RID_IMG_BITMAPFONT (RID_SVTOOLS_START + 13) +#define RID_IMG_SCALABLEFONT (RID_SVTOOLS_START + 14) +#define RID_IMG_PRINTERFONT_HC (RID_SVTOOLS_START + 15) +#define RID_IMG_BITMAPFONT_HC (RID_SVTOOLS_START + 16) +#define RID_IMG_SCALABLEFONT_HC (RID_SVTOOLS_START + 17) + +#define IMG_SVT_FOLDER (RID_SVTOOLS_START + 40) + +#define IMG_SVT_NEWDOC (RID_SVTOOLS_START + 52) +#define IMG_SVT_MYDOCS (RID_SVTOOLS_START + 53) +#define IMG_SVT_TEMPLATES (RID_SVTOOLS_START + 54) +#define IMG_SVT_SAMPLES (RID_SVTOOLS_START + 55) + +#define IMG_SVT_NEWDOC_HC (RID_SVTOOLS_START + 59) +#define IMG_SVT_MYDOCS_HC (RID_SVTOOLS_START + 60) +#define IMG_SVT_TEMPLATES_HC (RID_SVTOOLS_START + 61) +#define IMG_SVT_SAMPLES_HC (RID_SVTOOLS_START + 62) + +#define IMG_SVT_DOCTEMPLATE_BACK_SMALL (RID_SVTOOLS_START + 70) +#define IMG_SVT_DOCTEMPLATE_BACK_LARGE (RID_SVTOOLS_START + 71) +#define IMG_SVT_DOCTEMPLATE_PREV_SMALL (RID_SVTOOLS_START + 72) +#define IMG_SVT_DOCTEMPLATE_PREV_LARGE (RID_SVTOOLS_START + 73) +#define IMG_SVT_DOCTEMPLATE_PRINT_SMALL (RID_SVTOOLS_START + 74) +#define IMG_SVT_DOCTEMPLATE_PRINT_LARGE (RID_SVTOOLS_START + 75) +#define IMG_SVT_DOCTEMPLATE_DOCINFO_SMALL (RID_SVTOOLS_START + 76) +#define IMG_SVT_DOCTEMPLATE_DOCINFO_LARGE (RID_SVTOOLS_START + 77) +#define IMG_SVT_DOCTEMPLATE_PREVIEW_SMALL (RID_SVTOOLS_START + 78) +#define IMG_SVT_DOCTEMPLATE_PREVIEW_LARGE (RID_SVTOOLS_START + 79) + +#define IMG_SVT_DOCTEMPL_HC_BACK_SMALL (RID_SVTOOLS_START + 80) +#define IMG_SVT_DOCTEMPL_HC_BACK_LARGE (RID_SVTOOLS_START + 81) +#define IMG_SVT_DOCTEMPL_HC_PREV_SMALL (RID_SVTOOLS_START + 82) +#define IMG_SVT_DOCTEMPL_HC_PREV_LARGE (RID_SVTOOLS_START + 83) +#define IMG_SVT_DOCTEMPL_HC_PRINT_SMALL (RID_SVTOOLS_START + 84) +#define IMG_SVT_DOCTEMPL_HC_PRINT_LARGE (RID_SVTOOLS_START + 85) +#define IMG_SVT_DOCTEMPL_HC_DOCINFO_SMALL (RID_SVTOOLS_START + 86) +#define IMG_SVT_DOCTEMPL_HC_DOCINFO_LARGE (RID_SVTOOLS_START + 87) +#define IMG_SVT_DOCTEMPL_HC_PREVIEW_SMALL (RID_SVTOOLS_START + 88) +#define IMG_SVT_DOCTEMPL_HC_PREVIEW_LARGE (RID_SVTOOLS_START + 89) + +#define RID_IMG_PRNDLG_COLLATE (STR_SVT_PRNDLG_START + 29) +#define RID_IMG_PRNDLG_NOCOLLATE (STR_SVT_PRNDLG_START + 30) +#define RID_IMG_PRNDLG_COLLATE_HC (STR_SVT_PRNDLG_START + 31) +#define RID_IMG_PRNDLG_NOCOLLATE_HC (STR_SVT_PRNDLG_START + 32) + +#endif // #ifndef _SVTOOLS_HRC + +// ******************************************************************* EOF + diff --git a/svl/inc/svl/syslocale.hxx b/svl/inc/svl/syslocale.hxx new file mode 100644 index 000000000000..bd853d0d4eeb --- /dev/null +++ b/svl/inc/svl/syslocale.hxx @@ -0,0 +1,78 @@ +/************************************************************************* + * + * 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: syslocale.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 INCLUDED_SVTOOLS_SYSLOCALE_HXX +#define INCLUDED_SVTOOLS_SYSLOCALE_HXX + +#include "svtools/svtdllapi.h" +#include <unotools/localedatawrapper.hxx> +#include <unotools/charclass.hxx> +#include <sal/types.h> + + +class SvtSysLocale_Impl; +namespace osl { class Mutex; } +class LocaleDataWrapper; + +/** + SvtSysLocale provides a refcounted single instance of an application wide + <type>LocaleDataWrapper</type> and <type>CharClass</type> which always + follow the locale as it is currently configured by the user. You may use + it anywhere to access the locale data elements like decimal separator and + simple date formatting and so on. Contructing and destructing a + SvtSysLocale is not expensive as long as there is at least one instance + left. + */ +class SVT_DLLPUBLIC SvtSysLocale +{ + friend class SvtSysLocale_Impl; // access to mutex + + static SvtSysLocale_Impl* pImpl; + static sal_Int32 nRefCount; + + SVT_DLLPRIVATE static ::osl::Mutex& GetMutex(); + +public: + SvtSysLocale(); + ~SvtSysLocale(); + + const LocaleDataWrapper& GetLocaleData() const; + const CharClass& GetCharClass() const; + + /** It is safe to store the pointers locally and use them AS LONG AS THE + INSTANCE OF SvtSysLocale LIVES! + It is a faster access but be sure what you do! + */ + const LocaleDataWrapper* GetLocaleDataPtr() const; + const CharClass* GetCharClassPtr() const; + +}; + +#endif // INCLUDED_SVTOOLS_SYSLOCALE_HXX diff --git a/svl/inc/svl/syslocaleoptions.hxx b/svl/inc/svl/syslocaleoptions.hxx new file mode 100644 index 000000000000..8b03785d541e --- /dev/null +++ b/svl/inc/svl/syslocaleoptions.hxx @@ -0,0 +1,164 @@ +/************************************************************************* + * + * 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: syslocaleoptions.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 INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX +#define INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX + +#include "svtools/svtdllapi.h" +#include <sal/types.h> +#include <rtl/ustring.hxx> +#include <tools/solar.h> +#include <tools/link.hxx> +#include <i18npool/lang.h> +#include <tools/string.hxx> +#include <unotools/options.hxx> + +// bits for broadcasting hints of changes in a SfxSimpleHint, may be combined +const ULONG SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001; +const ULONG SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002; + +class SvtSysLocaleOptions_Impl; +class SvtListener; +namespace osl { class Mutex; } + +class SVT_DLLPUBLIC SvtSysLocaleOptions: public utl::detail::Options +{ + static SvtSysLocaleOptions_Impl* pOptions; + static sal_Int32 nRefCount; + + SVT_DLLPRIVATE static ::osl::Mutex& GetMutex(); + +public: + + enum EOption + { + E_LOCALE, + E_CURRENCY + }; + SvtSysLocaleOptions(); + virtual ~SvtSysLocaleOptions(); + + // ConfigItem methods + + sal_Bool IsModified(); + void Commit(); + + /** Add a listener to react on config changes + which are broadcasted in a SfxSimpleHint + @return + <TRUE/> if added + <FALSE/> if not added + */ + BOOL AddListener( SvtListener& ); + BOOL RemoveListener( SvtListener& ); + + /** Block broadcasts and accumulate hints. This may be useful if, for + example, the locale and currency are changed and the currency was + empty before, since changing the locale with an empty currency does + also broadcast a change hint for the currency which would result in + two currency changes broadcasted. + + @param bBlock + <TRUE/>: broadcasts are blocked until reversed. + <FALSE/>: broadcasts are not blocked anymore. Pending hints are + broadcasted if no other instance blocks the broadcast. + + @ATTENTION + All SvtSysLocaleOptions instances point to exactly one refcounted + internal representation instance and broadcast blocks are counted. + Thus if you issue a BlockBroadcasts(TRUE) you MUST issue a matching + BlockBroadcasts(FALSE) or otherwise pending hints would never be + broadcasted again. + */ + void BlockBroadcasts( BOOL bBlock ); + + // config value access methods + + /// The config string may be empty to denote the SYSTEM locale + const ::rtl::OUString& GetLocaleConfigString() const; + void SetLocaleConfigString( const ::rtl::OUString& rStr ); + + /// The config string may be empty to denote the default currency of the locale + const ::rtl::OUString& GetCurrencyConfigString() const; + void SetCurrencyConfigString( const ::rtl::OUString& rStr ); + // determine whether the decimal separator defined in the keyboard layout is used + // or the one approriate to the locale + sal_Bool IsDecimalSeparatorAsLocale() const; + void SetDecimalSeparatorAsLocale( sal_Bool bSet); + + // convenience methods + + /** Get the LanguageType of the current locale, may be LANGUAGE_SYSTEM if + LocaleConfigString is empty. If you need the real locale used in the + application, call Application::GetSettings().GetLanguage() instead */ + LanguageType GetLocaleLanguageType() const; + + /// Get currency abbreviation and locale from an USD-en-US or EUR-de-DE string + static void GetCurrencyAbbrevAndLanguage( + String& rAbbrev, + LanguageType& eLang, + const ::rtl::OUString& rConfigString ); + + /// Create an USD-en-US or EUR-de-DE string + static ::rtl::OUString CreateCurrencyConfigString( + const String& rAbbrev, + LanguageType eLang ); + + void GetCurrencyAbbrevAndLanguage( + String& rAbbrev, + LanguageType& eLang ) const + { + GetCurrencyAbbrevAndLanguage( rAbbrev, + eLang, GetCurrencyConfigString() ); + } + + void SetCurrencyAbbrevAndLanguage( + const String& rAbbrev, + LanguageType eLang ) + { + SetCurrencyConfigString( + CreateCurrencyConfigString( + rAbbrev, eLang ) ); + } + + /** Set a link to a method to be called whenever the default currency + changes. This can be only one method, and normally it is the static + link method which calls SvNumberFormatter::SetDefaultSystemCurrency(). + This is needed because the number formatter isn't part of the svl light + library, otherwise we could call SetDefaultSystemCurrency() directly. + */ + static void SetCurrencyChangeLink( const Link& rLink ); + static const Link& GetCurrencyChangeLink(); + + /** return the readonly state of the queried option. */ + sal_Bool IsReadOnly( EOption eOption ) const; +}; + +#endif // INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX diff --git a/svl/inc/svl/szitem.hxx b/svl/inc/svl/szitem.hxx new file mode 100644 index 000000000000..d3fb920aa012 --- /dev/null +++ b/svl/inc/svl/szitem.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: szitem.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 _SFXSZITEM_HXX +#define _SFXSZITEM_HXX + +#include <tools/gen.hxx> + +#include <svtools/poolitem.hxx> + +class SfxArguments; +class SvStream; + +DBG_NAMEEX(SfxSizeItem) + +// ----------------------------------------------------------------------- + +class SfxSizeItem : public SfxPoolItem +{ +private: + Size aVal; + +public: + TYPEINFO(); + SfxSizeItem(); + SfxSizeItem( USHORT nWhich, const Size& rVal ); + SfxSizeItem( USHORT nWhich, SvStream & ); + SfxSizeItem( const SfxSizeItem& ); + ~SfxSizeItem() { DBG_DTOR(SfxSizeItem, 0); } + + virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, + SfxMapUnit eCoreMetric, + SfxMapUnit ePresMetric, + XubString &rText, + const IntlWrapper * = 0 ) const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; + + const Size& GetValue() const { return aVal; } + void SetValue( const Size& rNewVal ) { + DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); + aVal = rNewVal; } +}; + +#endif + diff --git a/svl/inc/svl/tfrmitem.hxx b/svl/inc/svl/tfrmitem.hxx new file mode 100644 index 000000000000..93e245a731a2 --- /dev/null +++ b/svl/inc/svl/tfrmitem.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * 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: tfrmitem.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 _TFRMITEM_HXX +#define _TFRMITEM_HXX + +#include <tools/rtti.hxx> + +#include <svtools/poolitem.hxx> + +class SvStream; + +enum SfxOpenMode +{ + SfxOpenSelect = 0, // selected in view + SfxOpenOpen = 1, // doubleclicked or <enter> + SfxOpenAddTask = 2, // doubleclicked or <enter> with Ctrl-Modifier + SfxOpenDontKnow = 3, + SfxOpenReserved1 = 4, + SfxOpenReserved2 = 5, + SfxOpenModeLast = 5 +}; + +DBG_NAMEEX(SfxTargetFrameItem) + +// class SfxTargetFrameItem ------------------------------------------------- + +class SfxTargetFrameItem : public SfxPoolItem +{ +private: + String _aFrames[ (USHORT)SfxOpenModeLast+1 ]; +public: + TYPEINFO(); + + SfxTargetFrameItem( const SfxTargetFrameItem& rCpy ); + SfxTargetFrameItem( USHORT nWhich ); + SfxTargetFrameItem( + USHORT nWhich, + const String& rOpenSelectFrame, + const String& rOpenOpenFrame, + const String& rOpenAddTaskFrame ); + ~SfxTargetFrameItem(); + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const; + virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + /* + Framebezeichner im Sfx: + _browser : Beamerview + _document : Desktopview + _blank : new task + "" : do nothing + */ + String GetTargetFrame( SfxOpenMode eMode ) const; +}; + +#endif + diff --git a/svl/inc/svl/tresitem.hxx b/svl/inc/svl/tresitem.hxx new file mode 100644 index 000000000000..6282d3a7d4ff --- /dev/null +++ b/svl/inc/svl/tresitem.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * 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: tresitem.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 SVTOOLS_TRESITEM_HXX +#define SVTOOLS_TRESITEM_HXX + +#include <com/sun/star/ucb/TransferResult.hpp> +#include <svtools/poolitem.hxx> + +//============================================================================ +class CntTransferResultItem: public SfxPoolItem +{ + com::sun::star::ucb::TransferResult m_aResult; + +public: + TYPEINFO(); + + CntTransferResultItem(USHORT which = 0): SfxPoolItem(which) {} + + CntTransferResultItem(USHORT which, + com::sun::star::ucb::TransferResult const & + rTheResult): + SfxPoolItem(which), m_aResult(rTheResult) {} + + virtual int operator ==(SfxPoolItem const & rItem) const; + + virtual BOOL QueryValue(com::sun::star::uno::Any & rVal, BYTE = 0) const; + + virtual BOOL PutValue(const com::sun::star::uno::Any & rVal, BYTE = 0); + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + com::sun::star::ucb::TransferResult const & GetValue() const + { return m_aResult; } +}; + +#endif // SVTOOLS_TRESITEM_HXX + diff --git a/svl/inc/svl/undo.hxx b/svl/inc/svl/undo.hxx new file mode 100644 index 000000000000..38cbfb227f1b --- /dev/null +++ b/svl/inc/svl/undo.hxx @@ -0,0 +1,240 @@ +/************************************************************************* + * + * 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: undo.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 _UNDO_HXX +#define _UNDO_HXX + +#include "svtools/svtdllapi.h" +#include <tools/rtti.hxx> +#include <tools/string.hxx> +#include <svtools/svarray.hxx> + +//==================================================================== + +class SVT_DLLPUBLIC SfxRepeatTarget +{ +public: + TYPEINFO(); + virtual ~SfxRepeatTarget() = 0; +}; + +//==================================================================== + +class SVT_DLLPUBLIC SfxUndoAction +{ + BOOL bLinked; +public: + TYPEINFO(); + SfxUndoAction(); + virtual ~SfxUndoAction(); + + virtual BOOL IsLinked(); + virtual void SetLinked( BOOL bIsLinked = TRUE ); + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget&); + virtual BOOL CanRepeat(SfxRepeatTarget&) const; + + virtual BOOL Merge( SfxUndoAction *pNextAction ); + + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&) const; + virtual USHORT GetId() const; + +private: + SfxUndoAction& operator=( const SfxUndoAction& ); // n.i.!! +}; + +//======================================================================== + +SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 ) + +//==================================================================== + +/** do not make use of this implementation details, unless you + really really have to! */ +struct SVT_DLLPUBLIC SfxUndoArray +{ + SfxUndoActions aUndoActions; + USHORT nMaxUndoActions; + USHORT nCurUndoAction; + SfxUndoArray *pFatherUndoArray; + SfxUndoArray(USHORT nMax=0): + nMaxUndoActions(nMax), nCurUndoAction(0), + pFatherUndoArray(0) {} + ~SfxUndoArray(); +}; + +//========================================================================= + +/** do not make use of this implementation details, unless you + really really have to! */ +class SVT_DLLPUBLIC SfxListUndoAction : public SfxUndoAction, public SfxUndoArray + +/* [Beschreibung] + + UndoAction zur Klammerung mehrerer Undos in einer UndoAction. + Diese Actions werden vom SfxUndoManager verwendet. Dort + wird mit < SfxUndoManager::EnterListAction > eine Klammerebene + geoeffnet und mit <SfxUndoManager::LeaveListAction > wieder + geschlossen. Redo und Undo auf SfxListUndoActions wirken + Elementweise. + +*/ +{ + public: + TYPEINFO(); + + SfxListUndoAction( const UniString &rComment, + const UniString rRepeatComment, USHORT Id, SfxUndoArray *pFather); + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget&); + virtual BOOL CanRepeat(SfxRepeatTarget&) const; + + virtual BOOL Merge( SfxUndoAction *pNextAction ); + + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&) const; + virtual USHORT GetId() const; + + void SetComment( const UniString& rComment ); + + private: + + USHORT nId; + UniString aComment, aRepeatComment; + +}; + +//========================================================================= + +class SVT_DLLPUBLIC SfxUndoManager +{ + friend class SfxLinkUndoAction; + + SfxUndoArray *pUndoArray; + SfxUndoArray *pActUndoArray; + SfxUndoArray *pFatherUndoArray; + + bool mbUndoEnabled; +public: + SfxUndoManager( USHORT nMaxUndoActionCount = 20 ); + virtual ~SfxUndoManager(); + + virtual void SetMaxUndoActionCount( USHORT nMaxUndoActionCount ); + virtual USHORT GetMaxUndoActionCount() const; + virtual void Clear(); + + virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ); + + virtual USHORT GetUndoActionCount() const; + virtual USHORT GetUndoActionId(USHORT nNo=0) const; + virtual UniString GetUndoActionComment( USHORT nNo=0 ) const; + /** returns the nNo'th undo action from the top */ + SfxUndoAction* GetUndoAction( USHORT nNo=0 ) const; + + virtual BOOL Undo( USHORT nCount=1 ); + virtual void Undo( SfxUndoAction &rAction ); + + virtual USHORT GetRedoActionCount() const; + virtual USHORT GetRedoActionId(USHORT nNo=0) const; + virtual UniString GetRedoActionComment( USHORT nNo=0 ) const; + + virtual BOOL Redo( USHORT nCount=1 ); + virtual void Redo( SfxUndoAction &rAction ); + virtual void ClearRedo(); + + virtual USHORT GetRepeatActionCount() const; + virtual UniString GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo = 0) const; + virtual BOOL Repeat( SfxRepeatTarget &rTarget, USHORT nFrom=0, USHORT nCount=1 ); + virtual void Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ); + virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo = 0 ) const; + virtual BOOL CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const; + + virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0); + virtual void LeaveListAction(); + + /** clears the redo stack and removes the top undo action */ + void RemoveLastUndoAction(); + + // enables (true) or disables (false) recording of undo actions + // If undo actions are added while undo is disabled, they are deleted. + // Disabling undo does not clear the current undo buffer! + void EnableUndo( bool bEnable ); + + // returns true if undo is currently enabled + // This returns false if undo was disabled using EnableUndo( false ) and + // also during the runtime of the Undo() and Redo() methods. + bool IsUndoEnabled() const { return mbUndoEnabled; } +}; + +//========================================================================= + +class SVT_DLLPUBLIC SfxLinkUndoAction : public SfxUndoAction + +/* [Beschreibung] + + Die SfxLinkUndoAction dient zur Verbindung zweier SfxUndoManager. Die + im ersten SfxUndoManager eingefuegten SfxUndoAction leiten ihr Undo und Redo + an den zweiten weiter, so dass ein Undo und Redo am ersten + SfxUndoManager wie eine am zweiten wirkt. + + Die SfxLinkUndoAction ist nach dem Einfuegen der SfxUndoAction am + zweiten SfxUndoManager einzufuegen. Waehrend der zweite SfxUndoManager + vom ersten ferngesteuert wird, duerfen an ihm weder Actions eingefuegt werden, + noch darf Undo/Redo aufgerufen werden. + +*/ + +{ +public: + TYPEINFO(); + SfxLinkUndoAction(SfxUndoManager *pManager); + ~SfxLinkUndoAction(); + + virtual void Undo(); + virtual void Redo(); + virtual BOOL CanRepeat(SfxRepeatTarget& r) const; + + virtual void Repeat(SfxRepeatTarget&r); + + virtual UniString GetComment() const; + virtual UniString GetRepeatComment(SfxRepeatTarget&r) const; + virtual USHORT GetId() const; + + SfxUndoAction* GetAction() const { return pAction; } + +protected: + SfxUndoManager *pUndoManager; + SfxUndoAction *pAction; + +}; + +#endif diff --git a/svl/inc/svl/urlfilter.hxx b/svl/inc/svl/urlfilter.hxx new file mode 100644 index 000000000000..6370a75a1fd7 --- /dev/null +++ b/svl/inc/svl/urlfilter.hxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * 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: urlfilter.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 SVTOOLS_URL_FILTER_HXX +#define SVTOOLS_URL_FILTER_HXX + +#include <tools/string.hxx> +#include <tools/wldcrd.hxx> +#include <functional> +#include <vector> +/** filters allowed URLs +*/ +class IUrlFilter +{ +public: + virtual bool isUrlAllowed( const String& _rURL ) const = 0; + +protected: + virtual inline ~IUrlFilter() = 0; +}; + +inline IUrlFilter::~IUrlFilter() {} + +struct FilterMatch : public ::std::unary_function< bool, WildCard > +{ +private: + const String& m_rCompareString; +public: + FilterMatch( const String& _rCompareString ) : m_rCompareString( _rCompareString ) { } + + bool operator()( const WildCard& _rMatcher ) + { + return _rMatcher.Matches( m_rCompareString ) ? true : false; + } + + static void createWildCardFilterList(const String& _rFilterList,::std::vector< WildCard >& _rFilters); +}; + +#endif // SVTOOLS_URL_FILTER_HXX diff --git a/svl/inc/svl/visitem.hxx b/svl/inc/svl/visitem.hxx new file mode 100644 index 000000000000..9ace1212d967 --- /dev/null +++ b/svl/inc/svl/visitem.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * 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: visitem.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 _SFXVISIBILITYITEM_HXX +#define _SFXVISIBILITYITEM_HXX + +#include "svtools/svldllapi.h" +#include <tools/debug.hxx> +#include <svtools/poolitem.hxx> +#include <com/sun/star/frame/status/Visibility.hpp> + +//============================================================================ +DBG_NAMEEX_VISIBILITY(SfxVisibilityItem, SVL_DLLPUBLIC) + +class SVL_DLLPUBLIC SfxVisibilityItem: public SfxPoolItem +{ + ::com::sun::star::frame::status::Visibility m_nValue; + +public: + TYPEINFO(); + + SfxVisibilityItem(USHORT which = 0, sal_Bool bVisible = sal_True): + SfxPoolItem(which) + { + m_nValue.bVisible = bVisible; + DBG_CTOR(SfxVisibilityItem, 0); + } + + SfxVisibilityItem(USHORT which, SvStream & rStream); + + SfxVisibilityItem(const SfxVisibilityItem & rItem): + SfxPoolItem(rItem), m_nValue(rItem.m_nValue) + { DBG_CTOR(SfxVisibilityItem, 0); } + + virtual ~SfxVisibilityItem() { DBG_DTOR(SfxVisibilityItem, 0); } + + virtual int operator ==(const SfxPoolItem & rItem) const; + + using SfxPoolItem::Compare; + virtual int Compare(const SfxPoolItem & rWith) const; + + virtual SfxItemPresentation GetPresentation(SfxItemPresentation, + SfxMapUnit, SfxMapUnit, + XubString & rText, + const IntlWrapper * = 0) + const; + + virtual BOOL QueryValue( com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ) const; + + virtual BOOL PutValue( const com::sun::star::uno::Any& rVal, + BYTE nMemberId = 0 ); + + virtual SfxPoolItem * Create(SvStream & rStream, USHORT) const; + + virtual SvStream & Store(SvStream & rStream, USHORT) const; + + virtual SfxPoolItem * Clone(SfxItemPool * = 0) const; + + virtual USHORT GetValueCount() const; + + virtual UniString GetValueTextByVal(BOOL bTheValue) const; + + BOOL GetValue() const { return m_nValue.bVisible; } + + void SetValue(BOOL bVisible) { m_nValue.bVisible = bVisible; } +}; + +#endif // _SFXVISIBILITYITEM_HXX diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx new file mode 100644 index 000000000000..22a258d32f88 --- /dev/null +++ b/svl/inc/svl/zforlist.hxx @@ -0,0 +1,1014 @@ +/************************************************************************* + * + * 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: zforlist.hxx,v $ + * $Revision: 1.3.148.1 $ + * + * 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 _ZFORLIST_HXX +#define _ZFORLIST_HXX + +#include "svtools/svtdllapi.h" +#include <tools/string.hxx> +#ifndef _TABLE_HXX //autogen +#include <tools/table.hxx> +#endif +#include <i18npool/lang.h> +#include <svtools/svarray.hxx> +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/i18n/NumberFormatCode.hpp> +#include <unotools/localedatawrapper.hxx> +#include <svtools/ondemand.hxx> +#include <tools/link.hxx> +#include <svtools/nfkeytab.hxx> + +#include <map> + +class Date; +class SvStream; +class Color; +class SvUShorts; +class CharClass; +class CalendarWrapper; + +class ImpSvNumberformatScan; +class ImpSvNumberInputScan; +class SvNumberformat; + +namespace com { namespace sun { namespace star { + namespace lang { + class XMultiServiceFactory; + } +}}} + + +#define SV_COUNTRY_LANGUAGE_OFFSET 5000 // Max count of formats per country/language +#define SV_MAX_ANZ_STANDARD_FORMATE 100 // Max count of builtin default formats per CL + +// Format types +#ifndef NUMBERFORMAT_ALL +// also defined in com/sun/star/util/NumberFormat.hpp +//! => put in single .idl file and include here +#define NUMBERFORMAT_ALL 0x000 /// Just for Output of total list, not a real format type +#define NUMBERFORMAT_DEFINED 0x001 /// Format defined by user +#define NUMBERFORMAT_DATE 0x002 /// Number as date +#define NUMBERFORMAT_TIME 0x004 /// Number as time +#define NUMBERFORMAT_CURRENCY 0x008 /// Number as currency +#define NUMBERFORMAT_NUMBER 0x010 /// Any "normal" number format +#define NUMBERFORMAT_SCIENTIFIC 0x020 /// Number as scientific +#define NUMBERFORMAT_FRACTION 0x040 /// Number as fraction +#define NUMBERFORMAT_PERCENT 0x080 /// Number as percent +#define NUMBERFORMAT_TEXT 0x100 /// Text format +#define NUMBERFORMAT_DATETIME 0x006 /// Number as date and time +#define NUMBERFORMAT_LOGICAL 0x400 /// Number as boolean value +#define NUMBERFORMAT_UNDEFINED 0x800 /// Format undefined yet in analyzing +#endif +#define NUMBERFORMAT_ENTRY_NOT_FOUND (sal_uInt32)(0xffffffff) /// MAX_ULONG + + +/** enum values for <method>SvNumberFormatter::GetFormatIndex</method> + + <p> + Builtin standard formats, order should be also the arrangement in the + dialog list box representation.</p> + + <p> + Date specials:<ul> + <li>SYSTEM: As set in System Regional Settings. + <li>SYS: short/long defined, order and separators from System Regional Settings. + <li>DEF: short/long and order defined, separators from System Regional Settings. + <li>DIN: all settings hard coded as DIN (Deutsche Industrie Norm) and EN (European Norm) require. + <li>all other: hard coded + </ul> + */ +enum NfIndexTableOffset +{ + NF_NUMERIC_START = 0, + + NF_NUMBER_START = NF_NUMERIC_START, + NF_NUMBER_STANDARD = NF_NUMBER_START, // Standard/General + NF_NUMBER_INT, // 0 + NF_NUMBER_DEC2, // 0.00 + NF_NUMBER_1000INT, // #,##0 + NF_NUMBER_1000DEC2, // #,##0.00 + NF_NUMBER_SYSTEM, // #,##0.00 or whatever is set in System Regional Settings + NF_NUMBER_END = NF_NUMBER_SYSTEM, + + NF_SCIENTIFIC_START, + NF_SCIENTIFIC_000E000 = NF_SCIENTIFIC_START, // 0.00E+000 + NF_SCIENTIFIC_000E00, // 0.00E+00 + NF_SCIENTIFIC_END = NF_SCIENTIFIC_000E00, + + NF_PERCENT_START, + NF_PERCENT_INT = NF_PERCENT_START, // 0% + NF_PERCENT_DEC2, // 0.00% + NF_PERCENT_END = NF_PERCENT_DEC2, + + NF_FRACTION_START, + NF_FRACTION_1 = NF_FRACTION_START, // # ?/? + NF_FRACTION_2, // # ??/?? + NF_FRACTION_END = NF_FRACTION_2, + + NF_NUMERIC_END = NF_FRACTION_END, + + NF_CURRENCY_START, + NF_CURRENCY_1000INT = NF_CURRENCY_START,// #,##0 DM + NF_CURRENCY_1000DEC2, // #,##0.00 DM + NF_CURRENCY_1000INT_RED, // #,##0 DM negative in red + NF_CURRENCY_1000DEC2_RED, // #,##0.00 DM negative in red + NF_CURRENCY_1000DEC2_CCC, // #,##0.00 DEM currency abbreviation + NF_CURRENCY_1000DEC2_DASHED, // #,##0.-- DM + NF_CURRENCY_END = NF_CURRENCY_1000DEC2_DASHED, + + NF_DATE_START, + NF_DATE_SYSTEM_SHORT = NF_DATE_START, // 08.10.97 + NF_DATE_SYSTEM_LONG, // Wednesday, 8. October 1997 + NF_DATE_SYS_DDMMYY, // 08.10.97 + NF_DATE_SYS_DDMMYYYY, // 08.10.1997 + NF_DATE_SYS_DMMMYY, // 8. Oct 97 + NF_DATE_SYS_DMMMYYYY, // 8. Oct 1997 + NF_DATE_DIN_DMMMYYYY, // 8. Oct. 1997 DIN + NF_DATE_SYS_DMMMMYYYY, // 8. October 1997 + NF_DATE_DIN_DMMMMYYYY, // 8. October 1997 DIN + NF_DATE_SYS_NNDMMMYY, // Wed, 8. Okt 97 + NF_DATE_DEF_NNDDMMMYY, // Wed 08.Okt 97 + NF_DATE_SYS_NNDMMMMYYYY, // Wed, 8. Oktober 1997 + NF_DATE_SYS_NNNNDMMMMYYYY, // Wednesday, 8. Oktober 1997 + NF_DATE_DIN_MMDD, // 10-08 DIN + NF_DATE_DIN_YYMMDD, // 97-10-08 DIN + NF_DATE_DIN_YYYYMMDD, // 1997-10-08 DIN + NF_DATE_SYS_MMYY, // 10.97 + NF_DATE_SYS_DDMMM, // 08.Oct + NF_DATE_MMMM, // October + NF_DATE_QQJJ, // 4. Quarter 97 + NF_DATE_WW, // week of year + NF_DATE_END = NF_DATE_WW, + + NF_TIME_START, + NF_TIME_HHMM = NF_TIME_START, // HH:MM + NF_TIME_HHMMSS, // HH:MM:SS + NF_TIME_HHMMAMPM, // HH:MM AM/PM + NF_TIME_HHMMSSAMPM, // HH:MM:SS AM/PM + NF_TIME_HH_MMSS, // [HH]:MM:SS + NF_TIME_MMSS00, // MM:SS,00 + NF_TIME_HH_MMSS00, // [HH]:MM:SS,00 + NF_TIME_END = NF_TIME_HH_MMSS00, + + NF_DATETIME_START, + NF_DATETIME_SYSTEM_SHORT_HHMM = NF_DATETIME_START, // 08.10.97 01:23 + NF_DATETIME_SYS_DDMMYYYY_HHMMSS, // 08.10.1997 01:23:45 + NF_DATETIME_END = NF_DATETIME_SYS_DDMMYYYY_HHMMSS, + + NF_BOOLEAN, // BOOLEAN + NF_TEXT, // @ + NF_INDEX_TABLE_ENTRIES +}; + + +// #45717# IsNumberFormat( "98-10-24", 30, x ), YMD Format set with DMY +// International settings doesn't recognize the string as a date. +/** enum values for <method>SvNumberFormatter::SetEvalDateFormat</method> + + <p>How <method>ImpSvNumberInputScan::GetDateRef</method> shall take the + DateFormat order (YMD,DMY,MDY) into account, if called from IsNumberFormat + with a date format to match against. + */ +enum NfEvalDateFormat +{ + /** DateFormat only from International, default. */ + NF_EVALDATEFORMAT_INTL, + + /** DateFormat only from date format passed to function (if any). + If no date format is passed then the DateFormat is taken from International. */ + NF_EVALDATEFORMAT_FORMAT, + + /** First try the DateFormat from International. If it doesn't match a + valid date try the DateFormat from the date format passed. */ + NF_EVALDATEFORMAT_INTL_FORMAT, + + /** First try the DateFormat from the date format passed. If it doesn't + match a valid date try the DateFormat from International. */ + NF_EVALDATEFORMAT_FORMAT_INTL +}; + + +//#if 0 // _SOLAR__PRIVATE +#define _ZFORLIST_DECLARE_TABLE +//#endif +#ifdef _ZFORLIST_DECLARE_TABLE +DECLARE_TABLE (SvNumberFormatTable, SvNumberformat*) +DECLARE_TABLE (SvNumberFormatterIndexTable, sal_uInt32*) +#else +typedef Table SvNumberFormatTable; +typedef Table SvNumberFormatterIndexTable; +#endif + +typedef ::std::map< sal_uInt32, sal_uInt32 > SvNumberFormatterMergeMap; + + +/** Language/country dependent currency entries + */ +class SVT_DLLPUBLIC NfCurrencyEntry +{ + String aSymbol; /// currency symbol + String aBankSymbol; /// currency abbreviation + LanguageType eLanguage; /// language/country value + USHORT nPositiveFormat; /// position of symbol + USHORT nNegativeFormat; /// position of symbol and type and position of negative sign + USHORT nDigits; /// count of decimal digits + sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits + + /// not implemented, prevent usage + NfCurrencyEntry( const NfCurrencyEntry& ); + /// not implemented, prevent usage + NfCurrencyEntry& operator=( const NfCurrencyEntry& ); + +private: + +//#if 0 // _SOLAR__PRIVATE + // nDecimalFormat := 0, 1, 2 + // #,##0 or #,##0.00 or #,##0.-- are assigned + SVT_DLLPRIVATE void Impl_BuildFormatStringNumChars( String&, + const LocaleDataWrapper&, USHORT nDecimalFormat ) const; +//#endif // __PRIVATE + +public: + + NfCurrencyEntry(); + NfCurrencyEntry( const LocaleDataWrapper& rLocaleData, + LanguageType eLang ); + NfCurrencyEntry( + const ::com::sun::star::i18n::Currency & rCurr, + const LocaleDataWrapper& rLocaleData, + LanguageType eLang ); + ~NfCurrencyEntry() {} + + /// Symbols and language identical + BOOL operator==( const NfCurrencyEntry& r ) const; + + /// Set this format to be the EURo entry, overwrite other settings + void SetEuro(); + BOOL IsEuro() const; + + /** Apply format information (nPositiveFormat, + nNegativeFormat, nDigits, cZeroChar) of another format. */ + void ApplyVariableInformation( const NfCurrencyEntry& ); + + const String& GetSymbol() const { return aSymbol; } + const String& GetBankSymbol() const { return aBankSymbol; } + LanguageType GetLanguage() const { return eLanguage; } + USHORT GetPositiveFormat() const { return nPositiveFormat; } + USHORT GetNegativeFormat() const { return nNegativeFormat; } + USHORT GetDigits() const { return nDigits; } + sal_Unicode GetZeroChar() const { return cZeroChar; } + + /** [$DM-407] (bBank==FALSE) or [$DEM] (bBank==TRUE) + is assigned to rStr, if bBank==FALSE and + bWithoutExtension==TRUE only [$DM] */ + void BuildSymbolString( String& rStr, BOOL bBank, + BOOL bWithoutExtension = FALSE ) const; + + /** #,##0.00 [$DM-407] is assigned to rStr, separators + from rLoc, incl. minus sign but without [RED] */ + void BuildPositiveFormatString( String& rStr, BOOL bBank, + const LocaleDataWrapper&, USHORT nDecimalFormat = 1 ) const; + void BuildNegativeFormatString( String& rStr, BOOL bBank, + const LocaleDataWrapper&, USHORT nDecimalFormat = 1 ) const; + + /** [$DM-407] (or [$DEM] if bBank==TRUE) + is appended/prepended to rStr, incl. minus sign */ + void CompletePositiveFormatString( String& rStr, BOOL bBank, + USHORT nPosiFormat ) const; + void CompleteNegativeFormatString( String& rStr, BOOL bBank, + USHORT nNegaFormat ) const; + + /// rSymStr is appended/prepended to rStr, incl. minus sign + static void CompletePositiveFormatString( String& rStr, + const String& rSymStr, USHORT nPosiFormat ); + static void CompleteNegativeFormatString( String& rStr, + const String& rSymStr, USHORT nNegaFormat ); + + /** Representation of a currency (symbol position and + negative sign) in other language settings */ + static USHORT GetEffectivePositiveFormat( USHORT nIntlFormat, + USHORT nCurrFormat, BOOL bBank ); + static USHORT GetEffectiveNegativeFormat( USHORT nIntlFormat, + USHORT nCurrFormat, BOOL bBank ); + + /// General Unicode Euro symbol + static inline sal_Unicode GetEuroSymbol() { return sal_Unicode(0x20AC); } + /** Platform and CharSet dependent Euro symbol, + needed for import/export */ + static sal_Char GetEuroSymbol( rtl_TextEncoding eTextEncoding ); +}; + +typedef NfCurrencyEntry* NfCurrencyEntryPtr; +SV_DECL_PTRARR_DEL( NfCurrencyTable, NfCurrencyEntryPtr, 128, 1 ) +typedef String* WSStringPtr; +SV_DECL_PTRARR_DEL_VISIBILITY( NfWSStringsDtor, WSStringPtr, 8, 1, SVT_DLLPUBLIC ) + + +class SvNumberFormatterRegistry_Impl; + +class SVT_DLLPUBLIC SvNumberFormatter +{ +public: + + /// Preferred ctor with service manager and language/country enum + SvNumberFormatter( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr, + LanguageType eLang + ); + + /// Depricated ctor without service manager + SvNumberFormatter( LanguageType eLang ); + + ~SvNumberFormatter(); + + /// Set CallBack to ColorTable + void SetColorLink( const Link& rColorTableCallBack ) { aColorLink = rColorTableCallBack; } + /// Do the CallBack to ColorTable + Color* GetUserDefColor(USHORT nIndex); + + /// Change language/country, also input and format scanner + void ChangeIntl( LanguageType eLnge ); + /// Change the reference null date + void ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear); + /// Change standard precision + void ChangeStandardPrec(short nPrec); + /// Set zero value suppression + void SetNoZero(BOOL bNZ) { bNoZero = bNZ; } + + /** The language with which the formatter was initialized (system setting), + NOT the current language after a ChangeIntl() */ + LanguageType GetLanguage() const { return IniLnge; } + + // Determine whether two format types are input compatible or not + BOOL IsCompatible(short eOldType, short eNewType); + + /** Get table of formats of a specific type of a locale. A format FIndex is + tested whether it has the type and locale requested, if it doesn't + match FIndex returns the default format for the type/locale. If no + specific format is to be selected FIndex may be initialized to 0. */ + SvNumberFormatTable& GetEntryTable(short eType, + sal_uInt32& FIndex, + LanguageType eLnge); + + /** Get table of formats of a specific type of a language/country. + FIndex returns the default format of that type. + If the language/country was never touched before new entries are generated */ + SvNumberFormatTable& ChangeCL(short eType, + sal_uInt32& FIndex, + LanguageType eLnge); + + /** Get table of formats of the same type as FIndex; eType and rLnge are + set accordingly. An unknown format is set to Standard/General */ + SvNumberFormatTable& GetFirstEntryTable(short& eType, + sal_uInt32& FIndex, + LanguageType& rLnge); + + /// Delete an entry including the format it is refering to + void DeleteEntry(sal_uInt32 nKey); + + /** Create new entry of a format code string for language/country. + @return + <TRUE/> if string new and ok and inserted. + <FALSE/> if string already exists or an unresolvable parse error + occured, in which case nCheckPos is the error position within rString. + If the error occurs at position 0 or rString is empty nCheckPos + will be 1, so an error in the string is always indicated by + nCheckPos not being zero. + The content of the rString variable can be changed and corrected + by the method. + nType contains the type of the format. + nKey contains the index key of the format. + */ + BOOL PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /** Same as <method>PutEntry</method> but the format code string is + considered to be of language/country eLnge and is converted to + language/country eNewLnge */ + BOOL PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, + short& nType, sal_uInt32& nKey, + LanguageType eLnge, LanguageType eNewLnge ); + + /** Same as <method>PutandConvertEntry</method> but the format code string + is considered to be of the System language/country eLnge and is + converted to another System language/country eNewLnge. In this case + the automatic currency is converted too. */ + BOOL PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, + short& nType, sal_uInt32& nKey, + LanguageType eLnge, LanguageType eNewLnge ); + + /** Similar to <method>PutEntry</method> and + <method>PutandConvertEntry</method> or + <method>PutandConvertEntrySystem</method>, the format code string + passed is considered to be of language/country eLnge. If + eLnge==LANGUAGE_SYSTEM the format code has to match eSysLnge, and if + eSysLnge is not the current application locale the format code is + converted to the current locale. Additionally, if the format code + represents an old "automatic" currency format, it is converted to the + new default currency format of the eLnge locale. The rString format + code passed as an argument may get adapted in case eLnge was used (or + is LANGUAGE_SYSTEM and eSysLnge is identical); in case it wasn't the + method works on a copy instead, otherwise the resulting string would + not match eSysLnge anymore. + + <p> This method was introduced to handle the legacy currency formats of + the "autotbl.fmt" file used by Calc and Writer and convert them to + fixed currency codes of the actual currency. Note that in the case of + legacy currency formats no special attribution is converted, only the + default currency format of the locale is chosen, and that new fixed + currency codes are of course not converted to other currencies. The + method may also be used as a general method taking, converting and + inserting almost arbitrary format codes. To insert or use, for example, + the default currency format code matching the current locale, the + method could be called with<br/> + + <code> + GetIndexPuttingAndConverting( "0 $", LANGUAGE_SYSTEM, LANGUAGE_ENGLISH_US, ...); + </code> + + @return + The index key of the resulting number format. If the format code + was empty, could not be converted or has errors, the eLnge locale's + standard number format is chosen instead. The index key is + guaranteed to represent some valid number format. If + rNewInserted==FALSE and rCheckPos>0 the format code has errors + and/or could not be converted. + */ + sal_uInt32 GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, + LanguageType eSysLnge, short & rType, + BOOL & rNewInserted, + xub_StrLen & rCheckPos ); + + /** Create a format code string using format nIndex as a template and + applying other settings (passed from the dialog) */ + void GenerateFormat( String& sString, sal_uInt32 nIndex, + LanguageType eLnge = LANGUAGE_DONTKNOW, + BOOL bThousand = FALSE, BOOL IsRed = FALSE, + USHORT nPrecision = 0, USHORT nAnzLeading = 1 ); + + /** Analyze an input string + @return + <TRUE/> if input is a number or is matching a format F_Index + F_Index is set to a matching format if number, the value is + returned in fOutNumber + <FALSE/> if input is not a number + */ + BOOL IsNumberFormat( const String& sString, sal_uInt32& F_Index, double& fOutNumber ); + + /// Format a number according to a format index, return string and color + void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex, + String& sOutString, Color** ppColor ); + + /** Format a string according to a format index, return string and color. + Formats only if the format code is of type text or the 4th subcode + of a format code is specified, otherwise sOutString will be == "" */ + void GetOutputString( String& sString, sal_uInt32 nFIndex, + String& sOutString, Color** ppColor ); + + /** Format a number according to the standard default format matching + the given format index */ + void GetInputLineString( const double& fOutNumber, + sal_uInt32 nFIndex, String& sOutString ); + + /** Format a number according to a format code string to be scanned. + @return + <FALSE/> if format code contains an error + <TRUE/> else, in which case the string and color are returned. + */ + BOOL GetPreviewString( const String& sFormatString, double fPreviewNumber, + String& sOutString, Color** ppColor, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /** Same as <method>GetPreviewString</method> but the format code string + may be either language/country eLnge or en_US english US */ + BOOL GetPreviewStringGuess( const String& sFormatString, double fPreviewNumber, + String& sOutString, Color** ppColor, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /** Test whether the format code string is already present in container + @return + NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index. + */ + sal_uInt32 TestNewString( const String& sFormatString, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /// Whether format index nFIndex is of type text or not + BOOL IsTextFormat(sal_uInt32 nFIndex) const; + /// Whether the 4th string subcode of format index nFIndex is present + BOOL HasTextFormat(sal_uInt32 nFIndex) const; + + /// Load all formats from a stream + BOOL Load( SvStream& rStream ); + /// Save all formats to a stream + BOOL Save( SvStream& rStream ) const; + /// Reset of "Used" flags + void PrepareSave(); + + /// Flag format index as used + void SetFormatUsed(sal_uInt32 nFIndex); + + /// Get additional info of a format index, e.g. for dialog box + void GetFormatSpecialInfo(sal_uInt32 nFormat, BOOL& bThousand, BOOL& IsRed, + USHORT& nPrecision, USHORT& nAnzLeading); + + /// Count of decimals + USHORT GetFormatPrecision( sal_uInt32 nFormat ) const; + + /** Get additional info of a format code string, e.g. for dialog box. + Uses a temporary parse, if possible use only if format code is not + present in container yet, otherwise ineffective. + @return + 0 if format code string parsed without errors, otherwise error + position (like nCheckPos on <method>PutEntry</method>) + */ + sal_uInt32 GetFormatSpecialInfo( const String&, BOOL& bThousand, BOOL& IsRed, + USHORT& nPrecision, USHORT& nAnzLeading, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /// Check if format code string may be deleted by user + BOOL IsUserDefined( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /** Return the format index of the format code string for language/country, + or NUMBERFORMAT_ENTRY_NOT_FOUND */ + sal_uInt32 GetEntryKey( const String& sStr, LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /// Return the format for a format index + const SvNumberformat* GetEntry(sal_uInt32 nKey) const + { return (SvNumberformat*) aFTable.Get(nKey); } + + /// Return the format index of the standard default number format for language/country + sal_uInt32 GetStandardIndex(LanguageType eLnge = LANGUAGE_DONTKNOW); + + /// Return the format index of the default format of a type for language/country + sal_uInt32 GetStandardFormat(short eType, LanguageType eLnge = LANGUAGE_DONTKNOW); + + /** Return the format index of the default format of a type for language/country. + Maybe not the default format but a special builtin format, e.g. for + NF_TIME_HH_MMSS00, if that format is passed in nFIndex. */ + sal_uInt32 GetStandardFormat( sal_uInt32 nFIndex, short eType, LanguageType eLnge ); + + /** Return the format index of the default format of a type for language/country. + Maybe not the default format but a special builtin format, e.g. for + NF_TIME_HH_MMSS00, or NF_TIME_HH_MMSS if fNumber >= 1.0 */ + sal_uInt32 GetStandardFormat( double fNumber, sal_uInt32 nFIndex, short eType, + LanguageType eLnge ); + + /// Whether nFIndex is a special builtin format + BOOL IsSpecialStandardFormat( sal_uInt32 nFIndex, LanguageType eLnge ); + + /// Return the reference date + Date* GetNullDate(); + /// Return the standard decimal precision + short GetStandardPrec(); + /// Return whether zero suppression is switched on + BOOL GetNoZero() { return bNoZero; } + /** Get the type of a format (or NUMBERFORMAT_UNDEFINED if no entry), + but with NUMBERFORMAT_DEFINED masked out */ + short GetType(sal_uInt32 nFIndex); + + /// As the name says + void ClearMergeTable(); + /// Merge in all new entries from rNewTable and return a table of resulting new format indices + SvNumberFormatterIndexTable* MergeFormatter(SvNumberFormatter& rNewTable); + + /// Whether a merge table is present or not + inline BOOL HasMergeFmtTbl() const; + /// Return the new format index for an old format index, if a merge table exists + inline sal_uInt32 GetMergeFmtIndex( sal_uInt32 nOldFmt ) const; + + /** Convert the ugly old tools' Table type bloated with new'ed sal_uInt32 + entries merge table to ::std::map with old index key and new index key. + @ATTENTION! Also clears the old table using ClearMergeTable() */ + SvNumberFormatterMergeMap ConvertMergeTableToMap(); + + /// Return the last used position ever of a language/country combination + USHORT GetLastInsertKey(sal_uInt32 CLOffset); + + /** Return the format index of a builtin format for a specific language/country. + If nFormat is not a builtin format nFormat is returned. */ + sal_uInt32 GetFormatForLanguageIfBuiltIn( sal_uInt32 nFormat, + LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /** Return the format index for a builtin format of a specific language + @see NfIndexTableOffset + */ + sal_uInt32 GetFormatIndex( NfIndexTableOffset, LanguageType eLnge = LANGUAGE_DONTKNOW ); + + /** Return enum index of a format index of a builtin format, + NF_INDEX_TABLE_ENTRIES if it's not a builtin format. + @see NfIndexTableOffset + */ + NfIndexTableOffset GetIndexTableOffset( sal_uInt32 nFormat ) const; + + /** Set evaluation type and order of input date strings + @see NfEvalDateFormat + */ + void SetEvalDateFormat( NfEvalDateFormat eEDF ) { eEvalDateFormat = eEDF; } + NfEvalDateFormat GetEvalDateFormat() const { return eEvalDateFormat; } + + /** Set TwoDigitYearStart, how the input string scanner handles a two digit year. + Default from VCL: 1930, 30-99 19xx, 00-29 20xx + + <p> Historically (prior to src513e) it was a two digit number determing + until which number the string scanner recognizes a year to be 20xx, + default <= 29 is used by SFX/OfaMiscCfg. + The name Year2000 is kept although the actual functionality is now a + TwoDigitYearStart which might be in any century. + */ + void SetYear2000( USHORT nVal ); + USHORT GetYear2000() const; + static USHORT GetYear2000Default(); + + USHORT ExpandTwoDigitYear( USHORT nYear ) const; + inline static USHORT ExpandTwoDigitYear( USHORT nYear, USHORT nTwoDigitYearStart ); + + /// DEPRICATED: Return first character of the decimal separator of the current language/country + sal_Unicode GetDecSep() const { return GetNumDecimalSep().GetChar(0); } + /// Return the decimal separator of the current language/country + String GetDecimalSep() const { return GetNumDecimalSep(); } + + /// Return the decimal separator matching the locale of the given format + String GetFormatDecimalSep( sal_uInt32 nFormat ) const; + + /// Return a <type>SvPtrArr</type> with pointers to <type>NfCurrencyEntry</type> entries + static const NfCurrencyTable& GetTheCurrencyTable(); + + /** Searches, according to the default locale currency, an entry of the + CurrencyTable which is <bold>not</bold> the first (LANGUAGE_SYSTEM) entry. + @return + <NULL/> if not found + else pointer to <type>NfCurrencyEntry</type> + */ + static const NfCurrencyEntry* MatchSystemCurrency(); + + /** Return a <type>NfCurrencyEntry</type> matching a language/country. + If language/country is LANGUAGE_SYSTEM a <method>MatchSystemCurrency</method> + call is tried to get an entry. If that fails or the corresponding + language/country is not present the entry for LANGUAGE_SYSTEM is returned. + */ + static const NfCurrencyEntry& GetCurrencyEntry( LanguageType ); + + /** Return a <type>NfCurrencyEntry</type> pointer matching a language/country + and currency abbreviation (AKA banking symbol). + This method is meant for the configuration of the default currency. + @return + <NULL/> if not found + else pointer to <type>NfCurrencyEntry</type> + */ + static const NfCurrencyEntry* GetCurrencyEntry( const String& rAbbrev, + LanguageType eLang ); + + /** Return a <type>NfCurrencyEntry</type> pointer matching the symbol + combination of a LegacyOnly currency. Note that this means only that + the currency matching both symbols was once used in the Office, but is + not offered in dialogs anymore. It doesn't even mean that the currency + symbol combination is valid, since the reason for removing it may have + been just that. #i61657# + @return + A matching entry, or else <NULL/>. + */ + static const NfCurrencyEntry* GetLegacyOnlyCurrencyEntry( + const String& rSymbol, const String& rAbbrev ); + + /** Set the default system currency. The combination of abbreviation and + language must match an existent element of theCurrencyTable. If not, + the SYSTEM (current locale) entry becomes the default. + This method is meant for the configuration of the default currency. + */ + static void SetDefaultSystemCurrency( const String& rAbbrev, LanguageType eLang ); + + /** Get all standard formats for a specific currency, formats are + appended to the <type>NfWSStringsDtor</type> list. + @param bBank + <TRUE/>: generate only format strings with currency abbreviation + <FALSE/>: mixed format strings + @return + position of default format + */ + USHORT GetCurrencyFormatStrings( NfWSStringsDtor&, const NfCurrencyEntry&, + BOOL bBank ) const; + + /** Whether nFormat is of type NUMBERFORMAT_CURRENCY and the format code + contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn]. + If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is + returned, even if the format code only contains [$xxx] ! + */ + BOOL GetNewCurrencySymbolString( sal_uInt32 nFormat, String& rSymbol, + const NfCurrencyEntry** ppEntry = NULL, BOOL* pBank = NULL ) const; + + /** Look up the corresponding <type>NfCurrencyEntry</type> matching + rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly + a rExtension (being yyy of [$xxx-yyy]) or a given language/country + value. Tries to match a rSymbol with rExtension first, then with + eFormatLanguage, then rSymbol only. This is because a currency entry + might have been constructed using I18N locale data where a used locale + of a currrency format code must not necessarily match the locale of + the locale data itself, e.g. [$HK$-40C] (being "zh_HK" locale) in + zh_CN locale data. Here the rExtension would have the value 0x40c but + eFormatLanguage of the number format would have the value of zh_CN + locale, the value with which the corresponding CurrencyEntry is + constructed. + + @param bFoundBank + Only used for output. + If the return value is not <NULL/> this value is set to <TRUE/> if + the matching entry was found by comparing rSymbol against the + CurrencyAbbreviation (AKA BankSymbol). + If the return value is <NULL/> the value of bFoundBank is undefined. + @param rSymbol + Currency symbol, preferably obtained of a format by a call to + <method>SvNumberformat::GetNewCurrencySymbol()</method> + @param rExtension + Currency extension, preferably obtained of a format by a call to + <method>SvNumberformat::GetNewCurrencySymbol()</method> + @param eFormatLanguage + The language/country value of the format of which rSymbol and + rExtension are obtained (<method>SvNumberformat::GetLanguage()</method>). + @param bOnlyStringLanguage + If <TRUE/> only entries with language/country of rExtension are + checked, no match on eFormatLanguage. If rExtension is empty all + entries are checked. + @return + The matching entry if unique (in which case bFoundBank is set), + else <NULL/>. + */ + static const NfCurrencyEntry* GetCurrencyEntry( BOOL & bFoundBank, + const String& rSymbol, const String& rExtension, + LanguageType eFormatLanguage, BOOL bOnlyStringLanguage = FALSE ); + + /// Get compatibility ("automatic" old style) currency from I18N locale data + void GetCompatibilityCurrency( String& rSymbol, String& rAbbrev ) const; + + /// Fill rList with the language/country codes that have been allocated + void GetUsedLanguages( SvUShorts& rList ); + + /// Fill a <type>NfKeywordIndex</type> table with keywords of a language/country + void FillKeywordTable( NfKeywordTable& rKeywords, LanguageType eLang ); + + /** Return a keyword for a language/country and <type>NfKeywordIndex</type> + for XML import, to generate number format strings. */ + String GetKeyword( LanguageType eLnge, USHORT nIndex ); + + /** Return the GENERAL keyword in proper case ("General") for a + language/country, used in XML import */ + String GetStandardName( LanguageType eLnge ); + + /// Skip a NumberFormatter in stream, Chart needs this + static void SkipNumberFormatterInStream( SvStream& ); + + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager; + ::com::sun::star::lang::Locale aLocale; + SvNumberFormatTable aFTable; // Table of format keys to format entries + Table aDefaultFormatKeys; // Table of default standard to format keys + SvNumberFormatTable* pFormatTable; // For the UI dialog + SvNumberFormatterIndexTable* pMergeTable; // List of indices for merging two formatters + CharClass* pCharClass; // CharacterClassification + OnDemandLocaleDataWrapper xLocaleData; // LocaleData switched between SYSTEM, ENGLISH and other + OnDemandTransliterationWrapper xTransliteration; // Transliteration loaded on demand + OnDemandCalendarWrapper xCalendar; // Calendar loaded on demand + OnDemandNativeNumberWrapper xNatNum; // Native number service loaded on demand + ImpSvNumberInputScan* pStringScanner; // Input string scanner + ImpSvNumberformatScan* pFormatScanner; // Format code string scanner + Link aColorLink; // User defined color table CallBack + sal_uInt32 MaxCLOffset; // Max language/country offset used + sal_uInt32 nDefaultSystemCurrencyFormat; // NewCurrency matching SYSTEM locale + LanguageType IniLnge; // Initialized setting language/country + LanguageType ActLnge; // Current setting language/country + NfEvalDateFormat eEvalDateFormat; // DateFormat evaluation + BOOL bNoZero; // Zero value suppression + + // cached locale data items needed almost any time + String aDecimalSep; + String aThousandSep; + String aDateSep; + +#ifdef _ZFORLIST_CXX // ----- private Methoden ----- + + SVT_DLLPRIVATE static BOOL bCurrencyTableInitialized; + SVT_DLLPRIVATE static USHORT nSystemCurrencyPosition; + SVT_DLLPRIVATE static SvNumberFormatterRegistry_Impl* pFormatterRegistry; + + // get the registry, create one if none exists + SVT_DLLPRIVATE static SvNumberFormatterRegistry_Impl& GetFormatterRegistry(); + + // called by ctors + SVT_DLLPRIVATE void ImpConstruct( LanguageType eLang ); + + // Changes initialized language/country, clears the entries and generates + // new ones, may ONLY be called by the binary file format load + SVT_DLLPRIVATE void ImpChangeSysCL( LanguageType eLnge, BOOL bLoadingSO5 ); + + // Generate builtin formats provided by i18n behind CLOffset, + // if bLoadingSO5==FALSE also generate additional i18n formats. + SVT_DLLPRIVATE void ImpGenerateFormats( sal_uInt32 CLOffset, BOOL bLoadingSO5 ); + + // Generate additional formats provided by i18n + SVT_DLLPRIVATE void ImpGenerateAdditionalFormats( + sal_uInt32 CLOffset, + NumberFormatCodeWrapper& rNumberFormatCode, + BOOL bAfterLoadingSO5 ); + + SVT_DLLPRIVATE SvNumberformat* ImpInsertFormat( + const ::com::sun::star::i18n::NumberFormatCode& rCode, + sal_uInt32 nPos, + BOOL bAfterLoadingSO5 = FALSE, + sal_Int16 nOrgIndex = 0 ); + // ImpInsertNewStandardFormat for new (since version ...) builtin formats + SVT_DLLPRIVATE SvNumberformat* ImpInsertNewStandardFormat( + const ::com::sun::star::i18n::NumberFormatCode& rCode, + sal_uInt32 nPos, + USHORT nVersion, + BOOL bAfterLoadingSO5 = FALSE, + sal_Int16 nOrgIndex = 0 ); + + // Return CLOffset or (MaxCLOffset + SV_COUNTRY_LANGUAGE_OFFSET) if new language/country + SVT_DLLPRIVATE sal_uInt32 ImpGetCLOffset(LanguageType eLnge) const; + + // Test whether format code already exists, then return index key, + // otherwise NUMBERFORMAT_ENTRY_NOT_FOUND + SVT_DLLPRIVATE sal_uInt32 ImpIsEntry( const String& rString, + sal_uInt32 CLOffset, + LanguageType eLnge ); + + // Create builtin formats for language/country if necessary, return CLOffset + SVT_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, BOOL bLoadingSO5 = FALSE ); + + // Build negative currency format, old compatibility style + SVT_DLLPRIVATE void ImpGetNegCurrFormat( String& sNegStr, const String& rCurrSymbol ); + // Build positive currency format, old compatibility style + SVT_DLLPRIVATE void ImpGetPosCurrFormat( String& sPosStr, const String& rCurrSymbol ); + + // Create <type>theCurrencyTable</type> with all <type>NfCurrencyEntry</type> + SVT_DLLPRIVATE static void ImpInitCurrencyTable(); + + // Return the format index of the currency format of the system locale. + // Format is created if not already present. + SVT_DLLPRIVATE sal_uInt32 ImpGetDefaultSystemCurrencyFormat(); + + // Return the format index of the currency format of the current locale. + // Format is created if not already present. + SVT_DLLPRIVATE sal_uInt32 ImpGetDefaultCurrencyFormat(); + + // Return the default format for a given type and current locale. + // May ONLY be called from within GetStandardFormat(). + SVT_DLLPRIVATE sal_uInt32 ImpGetDefaultFormat( short nType ); + + // Return the index in a sequence of format codes matching an enum of + // NfIndexTableOffset. If not found 0 is returned. If the sequence doesn't + // contain any format code elements a default element is created and inserted. + SVT_DLLPRIVATE sal_Int32 ImpGetFormatCodeIndex( + ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode >& rSeq, + const NfIndexTableOffset nTabOff ); + + // Adjust a sequence of format codes to contain only one (THE) default + // instead of multiple defaults for short/medium/long types. + // If there is no medium but a short and a long default the long is taken. + // Return the default index in the sequence. + // Non-PRODUCT version may check locale data for matching defaults in one + // FormatElement group. + SVT_DLLPRIVATE sal_Int32 ImpAdjustFormatCodeDefault( + ::com::sun::star::i18n::NumberFormatCode * pFormatArr, + sal_Int32 nCount, BOOL bCheckCorrectness = TRUE + ); + + // used as a loop body inside of GetNewCurrencySymbolString() and GetCurrencyEntry() +#ifndef DBG_UTIL + inline +#endif + static BOOL ImpLookupCurrencyEntryLoopBody( + const NfCurrencyEntry*& pFoundEntry, BOOL& bFoundBank, + const NfCurrencyEntry* pData, USHORT nPos, const String& rSymbol ); + + // link to be set at <method>SvtSysLocaleOptions::SetCurrencyChangeLink()</method> + DECL_DLLPRIVATE_STATIC_LINK( SvNumberFormatter, CurrencyChangeLink, void* ); + +#endif // _ZFORLIST_CXX + +public: + + // own static mutex, may also be used by internal class SvNumberFormatterRegistry_Impl + static ::osl::Mutex& GetMutex(); + + // called by SvNumberFormatterRegistry_Impl::Notify if the default system currency changes + void ResetDefaultSystemCurrency(); + + // Replace the SYSTEM language/country format codes. Called upon change of + // the user configurable locale. + // Old compatibility codes are replaced, user defined are converted, and + // new format codes are appended. + void ReplaceSystemCL( LanguageType eOldLanguage ); + + inline ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory > + GetServiceManager() const { return xServiceManager; } + + + + //! The following method is not to be used from outside but must be + //! public for the InputScanner. + // return the current FormatScanner + inline const ImpSvNumberformatScan* GetFormatScanner() const { return pFormatScanner; } + + + + //! The following methods are not to be used from outside but must be + //! public for the InputScanner and FormatScanner. + + // return current (!) Locale + inline const ::com::sun::star::lang::Locale& GetLocale() const { return aLocale; } + + // return corresponding Transliteration wrapper + inline const ::utl::TransliterationWrapper* GetTransliteration() const + { return xTransliteration.get(); } + + // return corresponding Transliteration wrapper with loadModuleByImplName() + inline const ::utl::TransliterationWrapper* GetTransliterationForModule( + const String& rModule, LanguageType eLang ) const + { return xTransliteration.getForModule( rModule, eLang ); } + + // return the corresponding CharacterClassification wrapper + inline const CharClass* GetCharClass() const { return pCharClass; } + + // return the corresponding LocaleData wrapper + inline const LocaleDataWrapper* GetLocaleData() const { return xLocaleData.get(); } + + // return the corresponding Calendar wrapper + inline CalendarWrapper* GetCalendar() const { return xCalendar.get(); } + + // return the corresponding NativeNumberSupplier wrapper + inline const NativeNumberWrapper* GetNatNum() const { return xNatNum.get(); } + + // cached locale data items + + // return the corresponding decimal separator + inline const String& GetNumDecimalSep() const { return aDecimalSep; } + + // return the corresponding group (AKA thousand) separator + inline const String& GetNumThousandSep() const { return aThousandSep; } + + // return the corresponding date separator + inline const String& GetDateSep() const { return aDateSep; } + +}; + + +// --------------------------- inline -------------------------------------- + +inline sal_uInt32 SvNumberFormatter::GetMergeFmtIndex( sal_uInt32 nOldFmt ) const +{ + sal_uInt32* pU = (pMergeTable && pMergeTable->Count()) ? (sal_uInt32*)pMergeTable->Get( nOldFmt ) : 0; + return pU ? *pU : nOldFmt; +} + +inline BOOL SvNumberFormatter::HasMergeFmtTbl() const +{ + return pMergeTable && (0 != pMergeTable->Count()); +} + + +// static +inline USHORT SvNumberFormatter::ExpandTwoDigitYear( + USHORT nYear, USHORT nTwoDigitYearStart ) +{ + if ( nYear < 100 ) + { + if ( nYear < (nTwoDigitYearStart % 100) ) + return nYear + (((nTwoDigitYearStart / 100) + 1) * 100); + else + return nYear + ((nTwoDigitYearStart / 100) * 100); + } + return nYear; +} + + + +#endif // _ZFORLIST_HXX diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx new file mode 100644 index 000000000000..ae7d961c0bc6 --- /dev/null +++ b/svl/inc/svl/zformat.hxx @@ -0,0 +1,589 @@ +/************************************************************************* + * + * 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: zformat.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 _ZFORMAT_HXX +#define _ZFORMAT_HXX + +#include "svtools/svtdllapi.h" +#include <tools/string.hxx> +#include <i18npool/mslangid.hxx> +#include <svtools/zforlist.hxx> +#include <svtools/nfversi.hxx> +#include <svtools/nfkeytab.hxx> + +// We need ImpSvNumberformatScan for the private SvNumberformat definitions. +#ifdef _ZFORMAT_CXX +#include "zforscan.hxx" +#endif + +// If comment field is also in format code string, was used for SUPD versions 371-372 +#define NF_COMMENT_IN_FORMATSTRING 0 + +namespace utl { + class DigitGroupingIterator; +} + +class SvStream; +class Color; + +class ImpSvNumberformatScan; // format code string scanner +class ImpSvNumberInputScan; // input string scanner +class ImpSvNumMultipleWriteHeader; // compatible file format +class ImpSvNumMultipleReadHeader; // compatible file format +class SvNumberFormatter; + +enum SvNumberformatLimitOps +{ + NUMBERFORMAT_OP_NO = 0, // Undefined, no OP + NUMBERFORMAT_OP_EQ = 1, // Operator = + NUMBERFORMAT_OP_NE = 2, // Operator <> + NUMBERFORMAT_OP_LT = 3, // Operator < + NUMBERFORMAT_OP_LE = 4, // Operator <= + NUMBERFORMAT_OP_GT = 5, // Operator > + NUMBERFORMAT_OP_GE = 6 // Operator >= +}; + +// SYSTEM-german to SYSTEM-xxx and vice versa conversion hack onLoad +enum NfHackConversion +{ + NF_CONVERT_NONE, + NF_CONVERT_GERMAN_ENGLISH, + NF_CONVERT_ENGLISH_GERMAN +}; + +struct ImpSvNumberformatInfo // Struct for FormatInfo +{ + String* sStrArray; // Array of symbols + short* nTypeArray; // Array of infos + USHORT nThousand; // Count of group separator sequences + USHORT nCntPre; // Count of digits before decimal point + USHORT nCntPost; // Count of digits after decimal point + USHORT nCntExp; // Count of exponent digits, or AM/PM + short eScannedType; // Type determined by scan + BOOL bThousand; // Has group (AKA thousand) separator + + void Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz ); + void Load(SvStream& rStream, USHORT nAnz); + void Save(SvStream& rStream, USHORT nAnz) const; +}; + +// NativeNumber, represent numbers using CJK or other digits if nNum>0, +// eLang specifies the Locale to use. +class SvNumberNatNum +{ + LanguageType eLang; + BYTE nNum; + BOOL bDBNum :1; // DBNum, to be converted to NatNum + BOOL bDate :1; // Used in date? (needed for DBNum/NatNum mapping) + BOOL bSet :1; // If set, since NatNum0 is possible + +public: + + static BYTE MapDBNumToNatNum( BYTE nDBNum, LanguageType eLang, BOOL bDate ); + static BYTE MapNatNumToDBNum( BYTE nNatNum, LanguageType eLang, BOOL bDate ); + + SvNumberNatNum() : eLang( LANGUAGE_DONTKNOW ), nNum(0), + bDBNum(0), bDate(0), bSet(0) {} + BOOL IsComplete() const { return bSet && eLang != LANGUAGE_DONTKNOW; } + BYTE GetRawNum() const { return nNum; } + BYTE GetNatNum() const { return bDBNum ? MapDBNumToNatNum( nNum, eLang, bDate ) : nNum; } + BYTE GetDBNum() const { return bDBNum ? nNum : MapNatNumToDBNum( nNum, eLang, bDate ); } + LanguageType GetLang() const { return eLang; } + void SetLang( LanguageType e ) { eLang = e; } + void SetNum( BYTE nNumber, BOOL bDBNumber ) + { + nNum = nNumber; + bDBNum = bDBNumber; + bSet = TRUE; + } + BOOL IsSet() const { return bSet; } + void SetDate( BOOL bDateP ) { bDate = (bDateP != 0); } +}; + +class CharClass; + +class ImpSvNumFor // One of four subformats of the format code string +{ +public: + ImpSvNumFor(); // Ctor without filling the Info + ~ImpSvNumFor(); + + void Enlarge(USHORT nAnz); // Init of arrays to the right size + void Load( SvStream& rStream, ImpSvNumberformatScan& rSc, + String& rLoadedColorName); + void Save( SvStream& rStream ) const; + + // if pSc is set, it is used to get the Color pointer + void Copy( const ImpSvNumFor& rNumFor, ImpSvNumberformatScan* pSc ); + + // Access to Info; call Enlarge before! + ImpSvNumberformatInfo& Info() { return aI;} + const ImpSvNumberformatInfo& Info() const { return aI; } + + // Get count of substrings (symbols) + USHORT GetnAnz() const { return nAnzStrings;} + + Color* GetColor() const { return pColor; } + void SetColor( Color* pCol, String& rName ) + { pColor = pCol; sColorName = rName; } + const String& GetColorName() const { return sColorName; } + + // new SYMBOLTYPE_CURRENCY in subformat? + BOOL HasNewCurrency() const; + BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; + void SaveNewCurrencyMap( SvStream& rStream ) const; + void LoadNewCurrencyMap( SvStream& rStream ); + + // [NatNum1], [NatNum2], ... + void SetNatNumNum( BYTE nNum, BOOL bDBNum ) { aNatNum.SetNum( nNum, bDBNum ); } + void SetNatNumLang( LanguageType eLang ) { aNatNum.SetLang( eLang ); } + void SetNatNumDate( BOOL bDate ) { aNatNum.SetDate( bDate ); } + const SvNumberNatNum& GetNatNum() const { return aNatNum; } + +private: + ImpSvNumberformatInfo aI; // Hilfsstruct fuer die restlichen Infos + String sColorName; // color name + Color* pColor; // pointer to color of subformat + USHORT nAnzStrings; // count of symbols + SvNumberNatNum aNatNum; // DoubleByteNumber + +}; + +class SVT_DLLPUBLIC SvNumberformat +{ +public: + // Ctor for Load + SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge ); + + // Normal ctor + SvNumberformat( String& rString, + ImpSvNumberformatScan* pSc, + ImpSvNumberInputScan* pISc, + xub_StrLen& nCheckPos, + LanguageType& eLan, + BOOL bStand = FALSE ); + + // Copy ctor + SvNumberformat( SvNumberformat& rFormat ); + + // Copy ctor with exchange of format code string scanner (used in merge) + SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& rSc ); + + ~SvNumberformat(); + + /// Get type of format, may include NUMBERFORMAT_DEFINED bit + short GetType() const + { return (nNewStandardDefined && + (nNewStandardDefined <= SV_NUMBERFORMATTER_VERSION)) ? + (eType & ~NUMBERFORMAT_DEFINED) : eType; } + + void SetType(const short eSetType) { eType = eSetType; } + // Standard means the I18N defined standard format of this type + void SetStandard() { bStandard = TRUE; } + BOOL IsStandard() const { return bStandard; } + + // For versions before version nVer it is UserDefined, for newer versions + // it is builtin. nVer of SV_NUMBERFORMATTER_VERSION_... + void SetNewStandardDefined( USHORT nVer ) + { nNewStandardDefined = nVer; eType |= NUMBERFORMAT_DEFINED; } + + USHORT GetNewStandardDefined() const { return nNewStandardDefined; } + BOOL IsAdditionalStandardDefined() const + { return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; } + + LanguageType GetLanguage() const { return eLnge;} + + const String& GetFormatstring() const { return sFormatstring; } + + // Build a format string of application defined keywords + String GetMappedFormatstring( const NfKeywordTable& rKeywords, + const LocaleDataWrapper& rLoc, + BOOL bDontQuote = FALSE ) const; + + void SetUsed(const BOOL b) { bIsUsed = b; } + BOOL GetUsed() const { return bIsUsed; } + BOOL IsStarFormatSupported() const { return bStarFlag; } + void SetStarFormatSupport( BOOL b ) { bStarFlag = b; } + + NfHackConversion Load( SvStream& rStream, ImpSvNumMultipleReadHeader& rHdr, + SvNumberFormatter* pConverter, ImpSvNumberInputScan& rISc ); + void Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr ) const; + + // Load a string which might contain an Euro symbol, + // in fact that could be any string used in number formats. + static void LoadString( SvStream& rStream, String& rStr ); + + BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor ); + BOOL GetOutputString( String& sString, String& OutString, Color** ppColor ); + + // True if type text + BOOL IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; } + // True if 4th subformat present + BOOL HasTextFormat() const + { + return (NumFor[3].GetnAnz() > 0) || + (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT); + } + + void GetFormatSpecialInfo(BOOL& bThousand, + BOOL& IsRed, + USHORT& nPrecision, + USHORT& nAnzLeading) const; + + /// Count of decimal precision + USHORT GetFormatPrecision() const { return NumFor[0].Info().nCntPost; } + + //! Read/write access on a special USHORT component, may only be used on the + //! standard format 0, 5000, ... and only by the number formatter! + USHORT GetLastInsertKey() const + { return NumFor[0].Info().nThousand; } + void SetLastInsertKey(USHORT nKey) + { NumFor[0].Info().nThousand = nKey; } + + //! Only onLoad: convert from stored to current system language/country + void ConvertLanguage( SvNumberFormatter& rConverter, + LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem = FALSE ); + + // Substring of a subformat code nNumFor (0..3) + // nPos == 0xFFFF => last substring + // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY + const String* GetNumForString( USHORT nNumFor, USHORT nPos, + BOOL bString = FALSE ) const; + + // Subtype of a subformat code nNumFor (0..3) + // nPos == 0xFFFF => last substring + // bString==TRUE: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY + short GetNumForType( USHORT nNumFor, USHORT nPos, BOOL bString = FALSE ) const; + + /** If the count of string elements (substrings, ignoring [modifiers] and + so on) in a subformat code nNumFor (0..3) is equal to the given number. + Used by ImpSvNumberInputScan::IsNumberFormatMain() to detect a matched + format. */ + BOOL IsNumForStringElementCountEqual( USHORT nNumFor, USHORT nAllCount, + USHORT nNumCount ) const + { + if ( nNumFor < 4 ) + { + // First try a simple approach. Note that this is called only + // if all MidStrings did match so far, to verify that all + // strings of the format were matched and not just the starting + // sequence, so we don't have to check if GetnAnz() includes + // [modifiers] or anything else if both counts are equal. + USHORT nCnt = NumFor[nNumFor].GetnAnz(); + if ( nAllCount == nCnt ) + return TRUE; + if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on + return ImpGetNumForStringElementCount( nNumFor ) == + (nAllCount - nNumCount); + } + return FALSE; + } + + // Whether the second subformat code is really for negative numbers + // or another limit set. + BOOL IsNegativeRealNegative() const + { + return fLimit1 == 0.0 && fLimit2 == 0.0 && + ( (eOp1 == NUMBERFORMAT_OP_GE && eOp2 == NUMBERFORMAT_OP_NO) || + (eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_LT) || + (eOp1 == NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO) ); + } + + // Whether the negative format is without a sign or not + BOOL IsNegativeWithoutSign() const; + + // Whether a new SYMBOLTYPE_CURRENCY is contained in the format + BOOL HasNewCurrency() const; + + // Build string from NewCurrency for saving it SO50 compatible + void Build50Formatstring( String& rStr ) const; + + // strip [$-yyy] from all [$xxx-yyy] leaving only xxx's, + // if bQuoteSymbol==TRUE the xxx will become "xxx" + static String StripNewCurrencyDelimiters( const String& rStr, + BOOL bQuoteSymbol ); + + // If a new SYMBOLTYPE_CURRENCY is contained if the format is of type + // NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn + // of [$xxx-nnn] are returned + BOOL GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const; + + static BOOL HasStringNegativeSign( const String& rStr ); + + /** + Whether a character at position nPos is somewhere between two matching + cQuote or not. + If nPos points to a cQuote, a TRUE is returned on an opening cQuote, + a FALSE is returned on a closing cQuote. + A cQuote between quotes may be escaped by a cEscIn, a cQuote outside of + quotes may be escaped by a cEscOut. + The default '\0' results in no escapement possible. + Defaults are set right according to the "unlogic" of the Numberformatter + */ + static BOOL IsInQuote( const String& rString, xub_StrLen nPos, + sal_Unicode cQuote = '"', + sal_Unicode cEscIn = '\0', sal_Unicode cEscOut = '\\' ); + + /** + Return the position of a matching closing cQuote if the character at + position nPos is between two matching cQuote, otherwise return + STRING_NOTFOUND. + If nPos points to an opening cQuote the position of the matching + closing cQuote is returned. + If nPos points to a closing cQuote nPos is returned. + If nPos points into a part which starts with an opening cQuote but has + no closing cQuote, rString.Len() is returned. + Uses <method>IsInQuote</method> internally, so you don't have to call + that prior to a call of this method. + */ + static xub_StrLen GetQuoteEnd( const String& rString, xub_StrLen nPos, + sal_Unicode cQuote = '"', + sal_Unicode cEscIn = '\0', sal_Unicode cEscOut = '\\' ); + + void SetComment( const String& rStr ) +#if NF_COMMENT_IN_FORMATSTRING + { SetComment( rStr, sFormatstring, sComment ); } +#else + { sComment = rStr; } +#endif + const String& GetComment() const { return sComment; } + + // Erase "{ "..." }" from format subcode string to get the pure comment (old version) + static void EraseCommentBraces( String& rStr ); + // Set comment rStr in format string rFormat and in rComment (old version) + static void SetComment( const String& rStr, String& rFormat, String& rComment ); + // Erase comment at end of rStr to get pure format code string (old version) + static void EraseComment( String& rStr ); + + /** Insert the number of blanks into the string that is needed to simulate + the width of character c for underscore formats */ + static xub_StrLen InsertBlanks( String& r, xub_StrLen nPos, sal_Unicode c ); + + /// One of YMD,DMY,MDY if date format + DateFormat GetDateOrder() const; + + /** A coded value of the exact YMD combination used, if date format. + For example: YYYY-MM-DD => ('Y' << 16) | ('M' << 8) | 'D' + or: MM/YY => ('M' << 8) | 'Y' */ + sal_uInt32 GetExactDateOrder() const; + + ImpSvNumberformatScan& ImpGetScan() const { return rScan; } + + // used in XML export + void GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1, + SvNumberformatLimitOps& rOper2, double& rVal2 ) const; + Color* GetColor( USHORT nNumFor ) const; + void GetNumForInfo( USHORT nNumFor, short& rScannedType, + BOOL& bThousand, USHORT& nPrecision, USHORT& nAnzLeading ) const; + + // rAttr.Number not empty if NatNum attributes are to be stored + void GetNatNumXml( + ::com::sun::star::i18n::NativeNumberXmlAttributes& rAttr, + USHORT nNumFor ) const; + + /** @returns <TRUE/> if E,EE,R,RR,AAA,AAAA in format code of subformat + nNumFor (0..3) and <b>no</b> preceding calendar was specified and the + currently loaded calendar is "gregorian". */ + BOOL IsOtherCalendar( USHORT nNumFor ) const + { + if ( nNumFor < 4 ) + return ImpIsOtherCalendar( NumFor[nNumFor] ); + return FALSE; + } + + /** Switches to the first non-"gregorian" calendar, but only if the current + calendar is "gregorian"; original calendar name and date/time returned, + but only if calendar switched and rOrgCalendar was empty. */ + void SwitchToOtherCalendar( String& rOrgCalendar, double& fOrgDateTime ) const; + + /** Switches to the "gregorian" calendar, but only if the current calendar + is non-"gregorian" and rOrgCalendar is not empty. Thus a preceding + ImpSwitchToOtherCalendar() call should have been placed prior to + calling this method. */ + void SwitchToGregorianCalendar( const String& rOrgCalendar, double fOrgDateTime ) const; + + /** Switches to the first specified calendar, if any, in subformat nNumFor + (0..3). Original calendar name and date/time returned, but only if + calendar switched and rOrgCalendar was empty. + + @return + <TRUE/> if a calendar was specified and switched to, + <FALSE/> else. + */ + BOOL SwitchToSpecifiedCalendar( String& rOrgCalendar, double& fOrgDateTime, + USHORT nNumFor ) const + { + if ( nNumFor < 4 ) + return ImpSwitchToSpecifiedCalendar( rOrgCalendar, + fOrgDateTime, NumFor[nNumFor] ); + return FALSE; + } + +private: + ImpSvNumFor NumFor[4]; // Array for the 4 subformats + String sFormatstring; // The format code string + String sComment; // Comment, since number formatter version 6 + double fLimit1; // Value for first condition + double fLimit2; // Value for second condition + ImpSvNumberformatScan& rScan; // Format code scanner + LanguageType eLnge; // Language/country of the format + SvNumberformatLimitOps eOp1; // Operator for first condition + SvNumberformatLimitOps eOp2; // Operator for second condition + USHORT nNewStandardDefined; // new builtin formats as of version 6 + short eType; // Type of format + BOOL bStarFlag; // Take *n format as ESC n + BOOL bStandard; // If this is a default standard format + BOOL bIsUsed; // Flag as used for storing + + SVT_DLLPRIVATE USHORT ImpGetNumForStringElementCount( USHORT nNumFor ) const; + + SVT_DLLPRIVATE BOOL ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const; + + SVT_DLLPRIVATE BOOL ImpSwitchToSpecifiedCalendar( String& rOrgCalendar, + double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const; + +#ifdef _ZFORMAT_CXX // ----- private implementation methods ----- + + const CharClass& rChrCls() const { return rScan.GetChrCls(); } + const LocaleDataWrapper& rLoc() const { return rScan.GetLoc(); } + CalendarWrapper& GetCal() const { return rScan.GetCal(); } + const SvNumberFormatter& GetFormatter() const { return *rScan.GetNumberformatter(); } + + // divide in substrings and color conditions + SVT_DLLPRIVATE short ImpNextSymbol( String& rString, + xub_StrLen& nPos, + String& sSymbol ); + + // read string until ']' and strip blanks (after condition) + SVT_DLLPRIVATE static xub_StrLen ImpGetNumber( String& rString, + xub_StrLen& nPos, + String& sSymbol ); + + // get xxx of "[$-xxx]" as LanguageType, starting at and advancing position nPos + SVT_DLLPRIVATE static LanguageType ImpGetLanguageType( const String& rString, xub_StrLen& nPos ); + + // standard number output + SVT_DLLPRIVATE void ImpGetOutputStandard( double& fNumber, String& OutString ); + // numbers in input line + SVT_DLLPRIVATE void ImpGetOutputInputLine( double fNumber, String& OutString ); + + // check subcondition + // OP undefined => -1 + // else 0 or 1 + SVT_DLLPRIVATE short ImpCheckCondition(double& fNumber, + double& fLimit, + SvNumberformatLimitOps eOp); + + SVT_DLLPRIVATE ULONG ImpGGT(ULONG x, ULONG y); + SVT_DLLPRIVATE ULONG ImpGGTRound(ULONG x, ULONG y); + + // Helper function for number strings + // append string symbols, insert leading 0 or ' ', or ... + SVT_DLLPRIVATE BOOL ImpNumberFill( String& sStr, + double& rNumber, + xub_StrLen& k, + USHORT& j, + USHORT nIx, + short eSymbolType ); + + // Helper function to fill in the integer part and the group (AKA thousand) separators + SVT_DLLPRIVATE BOOL ImpNumberFillWithThousands( String& sStr, + double& rNumber, + xub_StrLen k, + USHORT j, + USHORT nIx, + USHORT nDigCnt ); + // Hilfsfunktion zum Auffuellen der Vor- + // kommazahl auch mit Tausenderpunkt + + // Helper function to fill in the group (AKA thousand) separators + // or to skip additional digits + SVT_DLLPRIVATE void ImpDigitFill( String& sStr, + xub_StrLen nStart, + xub_StrLen& k, + USHORT nIx, + xub_StrLen & nDigitCount, + utl::DigitGroupingIterator & ); + + SVT_DLLPRIVATE BOOL ImpGetDateOutput( double fNumber, + USHORT nIx, + String& OutString ); + SVT_DLLPRIVATE BOOL ImpGetTimeOutput( double fNumber, + USHORT nIx, + String& OutString ); + SVT_DLLPRIVATE BOOL ImpGetDateTimeOutput( double fNumber, + USHORT nIx, + String& OutString ); + + // Switches to the "gregorian" calendar if the current calendar is + // non-"gregorian" and the era is a "Dummy" era of a calendar which doesn't + // know a "before" era (like zh_TW ROC or ja_JP Gengou). If switched and + // rOrgCalendar was "gregorian" the string is emptied. If rOrgCalendar was + // empty the previous calendar name and date/time are returned. + SVT_DLLPRIVATE BOOL ImpFallBackToGregorianCalendar( String& rOrgCalendar, double& fOrgDateTime ); + + // Append a "G" short era string of the given calendar. In the case of a + // Gengou calendar this is a one character abbreviation, for other + // calendars the XExtendedCalendar::getDisplayString() method is called. + SVT_DLLPRIVATE static void ImpAppendEraG( String& OutString, const CalendarWrapper& rCal, + sal_Int16 nNatNum ); + + SVT_DLLPRIVATE BOOL ImpGetNumberOutput( double fNumber, + USHORT nIx, + String& OutString ); + + SVT_DLLPRIVATE void ImpCopyNumberformat( const SvNumberformat& rFormat ); + + // normal digits or other digits, depending on ImpSvNumFor.aNatNum, + // [NatNum1], [NatNum2], ... + SVT_DLLPRIVATE String ImpGetNatNumString( const SvNumberNatNum& rNum, sal_Int32 nVal, + USHORT nMinDigits = 0 ) const; + + String ImpIntToString( USHORT nIx, sal_Int32 nVal, USHORT nMinDigits = 0 ) const + { + const SvNumberNatNum& rNum = NumFor[nIx].GetNatNum(); + if ( nMinDigits || rNum.IsComplete() ) + return ImpGetNatNumString( rNum, nVal, nMinDigits ); + return String::CreateFromInt32( nVal ); + } + + // transliterate according to NativeNumber + SVT_DLLPRIVATE void ImpTransliterateImpl( String& rStr, const SvNumberNatNum& rNum ) const; + + void ImpTransliterate( String& rStr, const SvNumberNatNum& rNum ) const + { + if ( rNum.IsComplete() ) + ImpTransliterateImpl( rStr, rNum ); + } + +#endif // _ZFORMAT_CXX + +}; + +#endif // _ZFORMAT_HXX diff --git a/svl/inc/urihelper.hxx b/svl/inc/urihelper.hxx new file mode 100644 index 000000000000..209f3f04e28a --- /dev/null +++ b/svl/inc/urihelper.hxx @@ -0,0 +1,238 @@ +/************************************************************************* + * + * 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: urihelper.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. + * + ************************************************************************/ + +#ifndef SVTOOLS_URIHELPER_HXX +#define SVTOOLS_URIHELPER_HXX + +#include "svtools/svtdllapi.h" +#include "com/sun/star/uno/Reference.hxx" +#include <com/sun/star/uno/RuntimeException.hpp> +#include <rtl/textenc.h> +#include <tools/link.hxx> +#include <tools/solar.h> +#include <tools/urlobj.hxx> + +namespace com { namespace sun { namespace star { + namespace uno { class XComponentContext; } + namespace uri { class XUriReference; } +} } } +namespace rtl { class OUString; } +class ByteString; +class CharClass; +class UniString; + +//============================================================================ +namespace URIHelper { + +/** + @ATT + Calling this function with defaulted arguments rMaybeFileHdl = Link() and + bCheckFileExists = true often leads to results that are not intended: + Whenever the given rTheBaseURIRef is a file URL, the given rTheRelURIRef is + relative, and rTheRelURIRef could also be smart-parsed as a non-file URL + (e.g., the relative URL "foo/bar" can be smart-parsed as "http://foo/bar"), + then SmartRel2Abs called with rMaybeFileHdl = Link() and bCheckFileExists = + true returns the non-file URL interpretation. To avoid this, either pass + some non-null rMaybeFileHdl if you want to check generated file URLs for + existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false + if you want to generate file URLs without checking for their existence. +*/ +SVT_DLLPUBLIC UniString +SmartRel2Abs(INetURLObject const & rTheBaseURIRef, + ByteString const & rTheRelURIRef, + Link const & rMaybeFileHdl = Link(), + bool bCheckFileExists = true, + bool bIgnoreFragment = false, + INetURLObject::EncodeMechanism eEncodeMechanism + = INetURLObject::WAS_ENCODED, + INetURLObject::DecodeMechanism eDecodeMechanism + = INetURLObject::DECODE_TO_IURI, + rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8, + bool bRelativeNonURIs = false, + INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT); + +/** + @ATT + Calling this function with defaulted arguments rMaybeFileHdl = Link() and + bCheckFileExists = true often leads to results that are not intended: + Whenever the given rTheBaseURIRef is a file URL, the given rTheRelURIRef is + relative, and rTheRelURIRef could also be smart-parsed as a non-file URL + (e.g., the relative URL "foo/bar" can be smart-parsed as "http://foo/bar"), + then SmartRel2Abs called with rMaybeFileHdl = Link() and bCheckFileExists = + true returns the non-file URL interpretation. To avoid this, either pass + some non-null rMaybeFileHdl if you want to check generated file URLs for + existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false + if you want to generate file URLs without checking for their existence. +*/ +SVT_DLLPUBLIC UniString +SmartRel2Abs(INetURLObject const & rTheBaseURIRef, + UniString const & rTheRelURIRef, + Link const & rMaybeFileHdl = Link(), + bool bCheckFileExists = true, + bool bIgnoreFragment = false, + INetURLObject::EncodeMechanism eEncodeMechanism + = INetURLObject::WAS_ENCODED, + INetURLObject::DecodeMechanism eDecodeMechanism + = INetURLObject::DECODE_TO_IURI, + rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8, + bool bRelativeNonURIs = false, + INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT); + +//============================================================================ +SVT_DLLPUBLIC void SetMaybeFileHdl(Link const & rTheMaybeFileHdl); + +//============================================================================ +SVT_DLLPUBLIC Link GetMaybeFileHdl(); + +/** + Converts a URI reference to a relative one, ignoring certain differences (for + example, treating file URLs for case-ignoring file systems + case-insensitively). + + @param context a component context; must not be null + + @param baseUriReference a base URI reference + + @param uriReference a URI reference + + @return a URI reference representing the given uriReference relative to the + given baseUriReference; if the given baseUriReference is not an absolute, + hierarchical URI reference, or the given uriReference is not a valid URI + reference, null is returned + + @exception std::bad_alloc if an out-of-memory condition occurs + + @exception com::sun::star::uno::RuntimeException if any error occurs + */ +SVT_DLLPUBLIC com::sun::star::uno::Reference< com::sun::star::uri::XUriReference > +normalizedMakeRelative( + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + const & context, + rtl::OUString const & baseUriReference, rtl::OUString const & uriReference); + +/** + A variant of normalizedMakeRelative with a simplified interface. + + Internally calls normalizedMakeRelative with the default component context. + + @param baseUriReference a base URI reference, passed to + normalizedMakeRelative + + @param uriReference a URI reference, passed to normalizedMakeRelative + + @return if the XUriReference returnd by normalizedMakeRelative is empty, + uriReference is returned unmodified; otherwise, the result of calling + XUriReference::getUriReference on the XUriReference returnd by + normalizedMakeRelative is returned + + @exception std::bad_alloc if an out-of-memory condition occurs + + @exception com::sun::star::uno::RuntimeException if any error occurs + + @deprecated + No code should rely on the default component context. +*/ +SVT_DLLPUBLIC rtl::OUString simpleNormalizedMakeRelative( + rtl::OUString const & baseUriReference, rtl::OUString const & uriReference); + +//============================================================================ +SVT_DLLPUBLIC UniString +FindFirstURLInText(UniString const & rText, + xub_StrLen & rBegin, + xub_StrLen & rEnd, + CharClass const & rCharClass, + INetURLObject::EncodeMechanism eMechanism + = INetURLObject::WAS_ENCODED, + rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8, + INetURLObject::FSysStyle eStyle + = INetURLObject::FSYS_DETECT); + +//============================================================================ +/** Remove any password component from both absolute and relative URLs. + + @ATT The current implementation will not remove a password from a + relative URL that has an authority component (e.g., the password is not + removed from the relative ftp URL <//user:password@domain/path>). But + since our functions to translate between absolute and relative URLs never + produce relative URLs with authority components, this is no real problem. + + @ATT For relative URLs (or anything not recognized as an absolute URI), + the current implementation will return the input unmodified, not applying + any translations implied by the encode/decode parameters. + + @param rURI An absolute or relative URI reference. + + @param eEncodeMechanism See the general discussion for INetURLObject set- + methods. + + @param eDecodeMechanism See the general discussion for INetURLObject get- + methods. + + @param eCharset See the general discussion for INetURLObject get- and + set-methods. + + @return The input URI with any password component removed. + */ +SVT_DLLPUBLIC UniString +removePassword(UniString const & rURI, + INetURLObject::EncodeMechanism eEncodeMechanism + = INetURLObject::WAS_ENCODED, + INetURLObject::DecodeMechanism eDecodeMechanism + = INetURLObject::DECODE_TO_IURI, + rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); + +//============================================================================ +/** Query the notational conventions used in the file system provided by some + file content provider. + + @param rFileUrl This file URL determines which file content provider is + used to query the desired information. (The UCB's usual mapping from URLs + to content providers is used.) + + @param bAddConvenienceStyles If true, the return value contains not only + the style bit corresponding to the queried content provider's conventions, + but may also contain additional style bits that make using this function + more convenient in certain situations. Currently, the effect is that + FSYS_UNX is extended with FSYS_VOS, and both FSYS_DOS and FSYS_MAC are + extended with FSYS_VOS and FSYS_UNX (i.e., the---unambiguous---detection + of VOS style and Unix style file system paths is always enabled); also, in + case the content provider's conventions cannot be determined, FSYS_DETECT + is returned instead of FSysStyle(0). + + @return The style bit corresponding to the queried content provider's + conventions, or FSysStyle(0) if these cannot be determined. + */ +SVT_DLLPUBLIC INetURLObject::FSysStyle queryFSysStyle(UniString const & rFileUrl, + bool bAddConvenienceStyles = true) + throw (com::sun::star::uno::RuntimeException); + +} + +#endif // SVTOOLS_URIHELPER_HXX diff --git a/svl/inc/urlbmk.hxx b/svl/inc/urlbmk.hxx new file mode 100644 index 000000000000..d3342b398878 --- /dev/null +++ b/svl/inc/urlbmk.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * 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: urlbmk.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 _URLBMK_HXX +#define _URLBMK_HXX + + +#include <tools/string.hxx> + +//========================================================================= + +class INetBookmark + +/* [Beschreibung] + + Diese Klasse stellt ein Bookmark dar, welches aus einer URL und + einem dazuge"horigen Beschreibungstext besteht. + + Es gibt ein eigenes Clipboardformat und Hilfsmethoden zum Kopieren + und Einf"ugen in und aus Clipboard und DragServer. +*/ + +{ + String aUrl; + String aDescr; + +protected: + + void SetURL( const String& rS ) { aUrl = rS; } + void SetDescription( const String& rS ) { aDescr = rS; } + +public: + INetBookmark( const String &rUrl, const String &rDescr ) + : aUrl( rUrl ), aDescr( rDescr ) + {} + INetBookmark() + {} + + const String& GetURL() const { return aUrl; } + const String& GetDescription() const { return aDescr; } +}; + + +#endif + diff --git a/svl/inc/whiter.hxx b/svl/inc/whiter.hxx new file mode 100644 index 000000000000..87ed2cbc76f0 --- /dev/null +++ b/svl/inc/whiter.hxx @@ -0,0 +1,63 @@ +/************************************************************************* + * + * 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: whiter.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 _SFX_WHITER_HXX +#define _SFX_WHITER_HXX + +#include "svtools/svldllapi.h" + +#ifndef INCLUDED_LIMITS_H +#include <limits.h> +#define INCLUDED_LIMITS_H +#endif +#include <tools/solar.h> + +class SfxItemSet; + + +// INCLUDE --------------------------------------------------------------- + +class SVL_DLLPUBLIC SfxWhichIter +{ + const USHORT *pRanges, *pStart; + USHORT nOfst, nFrom, nTo; + +public: + SfxWhichIter( const SfxItemSet& rSet, USHORT nFrom = 0, USHORT nTo = USHRT_MAX ); + ~SfxWhichIter(); + + USHORT GetCurWhich() const { return *pRanges + nOfst; } + USHORT NextWhich(); + USHORT PrevWhich(); + + USHORT FirstWhich(); + USHORT LastWhich(); +}; + +#endif diff --git a/svl/inc/xmlement.hxx b/svl/inc/xmlement.hxx new file mode 100644 index 000000000000..ed0e4dafc57a --- /dev/null +++ b/svl/inc/xmlement.hxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * 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: xmlement.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 _SVTOOLS_XMLEMENT_HXX +#define _SVTOOLS_XMLEMENT_HXX + +#ifndef _SAL_TYPES_H +#include <sal/types.h> +#endif + +struct SvXMLEnumMapEntry +{ + const sal_Char *pName; + sal_uInt16 nValue; +}; + + +#endif // _SVTOOLS_XMLEMENT_HXX + |