summaryrefslogtreecommitdiff
path: root/sw/inc/breakit.hxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-08-23 07:28:06 +0000
committerRüdiger Timm <rt@openoffice.org>2004-08-23 07:28:06 +0000
commit02b3d536f6efb2536d993a4b62031d2cc724999d (patch)
tree1ed10d3da89e3a4c5076f1f44df1b305b80a776e /sw/inc/breakit.hxx
parentbfcfdb8df8d074e528617bedc44e8dd94ff0c278 (diff)
INTEGRATION: CWS tune03 (1.7.82); FILE MERGED
2004/07/19 19:10:27 mhu 1.7.82.1: #i29979# Added SW_DLLPUBLIC/PRIVATE (see swdllapi.h) to exported symbols/classes.
Diffstat (limited to 'sw/inc/breakit.hxx')
-rw-r--r--sw/inc/breakit.hxx75
1 files changed, 55 insertions, 20 deletions
diff --git a/sw/inc/breakit.hxx b/sw/inc/breakit.hxx
index 1a316fb9233b..0cad4ef0f0b3 100644
--- a/sw/inc/breakit.hxx
+++ b/sw/inc/breakit.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: breakit.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: hr $ $Date: 2004-05-10 16:11:54 $
+ * last change: $Author: rt $ $Date: 2004-08-23 08:28:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,14 +69,14 @@
#include <tools/lang.hxx>
#endif
-/*************************************************************************
- * class SwBreakIt
- *************************************************************************/
-
#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
#include <com/sun/star/uno/Reference.h>
#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+
#ifndef _COM_SUN_STAR_I18N_XBREAKITERATOR_HPP_
#include <com/sun/star/i18n/XBreakIterator.hpp>
#endif
@@ -87,40 +87,75 @@
class String;
+/*************************************************************************
+ * class SwBreakIt
+ *************************************************************************/
+
+namespace css = com::sun::star;
+
class SwBreakIt
{
-public:
- com::sun::star::uno::Reference < com::sun::star::i18n::XBreakIterator > xBreak;
-private:
- com::sun::star::lang::Locale* pLocale;
- com::sun::star::i18n::ForbiddenCharacters* pForbidden;
+ css::uno::Reference< css::lang::XMultiServiceFactory > m_xMSF;
+
+ css::lang::Locale * m_pLocale;
+ css::i18n::ForbiddenCharacters * m_pForbidden;
+
LanguageType aLast; // language of the current locale
LanguageType aForbiddenLang; // language of the current forbiddenChar struct
void _GetLocale( const LanguageType aLang );
void _GetForbidden( const LanguageType aLang );
-public:
+
+ // forbidden and not implemented.
SwBreakIt();
- ~SwBreakIt() { delete pLocale; delete pForbidden; }
- com::sun::star::lang::Locale& GetLocale( const LanguageType aLang )
+ SwBreakIt( const SwBreakIt &);
+ SwBreakIt & operator= ( const SwBreakIt &);
+
+ // private (see @ _Create, _Delete).
+ explicit SwBreakIt(
+ const css::uno::Reference< css::lang::XMultiServiceFactory > & rxMSF);
+ ~SwBreakIt();
+
+public:
+ // private (see @ source/core/bastyp/init.cxx).
+ static void _Create(
+ const css::uno::Reference< css::lang::XMultiServiceFactory > & rxMSF);
+ static void _Delete();
+
+public:
+ static SwBreakIt * Get();
+
+ // @@@ backward compatibility @@@
+ css::uno::Reference< css::i18n::XBreakIterator > xBreak;
+
+ const css::uno::Reference< css::i18n::XBreakIterator > & GetBreakIter()
{
- if( aLast != aLang )
+ return xBreak;
+ }
+
+ const css::lang::Locale& GetLocale( const LanguageType aLang )
+ {
+ if( !m_pLocale || aLast != aLang )
_GetLocale( aLang );
- return *pLocale;
+ return *m_pLocale;
}
- com::sun::star::i18n::ForbiddenCharacters& GetForbidden( const LanguageType aLang )
+
+ const css::i18n::ForbiddenCharacters& GetForbidden( const LanguageType aLang )
{
- if( !pForbidden || aForbiddenLang != aLang )
+ if( !m_pForbidden || aForbiddenLang != aLang )
_GetForbidden( aLang );
- return *pForbidden;
+ return *m_pForbidden;
}
USHORT GetRealScriptOfText( const String& rTxt, xub_StrLen nPos ) const;
USHORT GetAllScriptsOfText( const String& rTxt ) const;
};
+#define SW_BREAKITER() SwBreakIt::Get()
+#define SW_XBREAKITER() SW_BREAKITER()->GetBreakIter()
+
+// @@@ backward compatibility @@@
extern SwBreakIt* pBreakIt;
-SwBreakIt* GetBreakIt(); //CHINA001 add for swui
#endif