summaryrefslogtreecommitdiff
path: root/framework/inc
diff options
context:
space:
mode:
Diffstat (limited to 'framework/inc')
-rw-r--r--framework/inc/classes/resource.hrc1
-rwxr-xr-x[-rw-r--r--]framework/inc/helper/mischelper.hxx55
-rw-r--r--framework/inc/uielement/langselectionmenucontroller.hxx3
-rw-r--r--framework/inc/uielement/langselectionstatusbarcontroller.hxx17
4 files changed, 68 insertions, 8 deletions
diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc
index a2bf56376913..8c9bd2e854b0 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -55,6 +55,7 @@
#define STR_SET_LANGUAGE_FOR_PARAGRAPH (RID_STR_START+19)
#define STR_SET_LANGUAGE_FOR_ALL_TEXT (RID_STR_START+20)
#define STR_UNTITLED_DOCUMENT (RID_STR_START+21)
+#define STR_RESET_TO_DEFAULT_LANGUAGE (RID_STR_START+22)
#define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION (RID_MENU_START+0)
diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx
index 96329d4f98b9..6a1886244b54 100644..100755
--- a/framework/inc/helper/mischelper.hxx
+++ b/framework/inc/helper/mischelper.hxx
@@ -34,10 +34,56 @@
#include <i18npool/lang.h>
#include <svl/languageoptions.hxx>
+#include <rtl/ustring.hxx>
+
+#include <set>
+
+class SvtLanguageTable;
+
+
+// flags for script types in use within selection
+#define LS_SCRIPT_LATIN 0x0001
+#define LS_SCRIPT_ASIAN 0x0002
+#define LS_SCRIPT_COMPLEX 0x0004
+
namespace framework
{
+// menu ids for language status bar control
+enum LangMenuIDs
+{
+ MID_LANG_SEL_1 = 1, // need to start with 1 since xPopupMenu->execute will return 0 if the menu is cancelled
+ MID_LANG_SEL_2,
+ MID_LANG_SEL_3,
+ MID_LANG_SEL_4,
+ MID_LANG_SEL_5,
+ MID_LANG_SEL_6,
+ MID_LANG_SEL_7,
+ MID_LANG_SEL_8,
+ MID_LANG_SEL_9,
+ MID_LANG_SEL_NONE,
+ MID_LANG_SEL_RESET,
+ MID_LANG_SEL_MORE,
+
+ MID_LANG_PARA_SEPERATOR,
+ MID_LANG_PARA_STRING,
+
+ MID_LANG_PARA_1,
+ MID_LANG_PARA_2,
+ MID_LANG_PARA_3,
+ MID_LANG_PARA_4,
+ MID_LANG_PARA_5,
+ MID_LANG_PARA_6,
+ MID_LANG_PARA_7,
+ MID_LANG_PARA_8,
+ MID_LANG_PARA_9,
+ MID_LANG_PARA_NONE,
+ MID_LANG_PARA_RESET,
+ MID_LANG_PARA_MORE,
+};
+
+
inline bool IsScriptTypeMatchingToLanguage( sal_Int16 nScriptType, LanguageType nLang )
{
return 0 != (nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ));
@@ -63,6 +109,15 @@ public:
,sal_Bool& _rIni
,const sal_Char* _pName);
+void FillLangItems( std::set< ::rtl::OUString > &rLangItems,
+ const SvtLanguageTable &rLanguageTable,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame,
+ const LanguageGuessingHelper & rLangGuessHelper,
+ sal_Int16 nScriptType,
+ const ::rtl::OUString & rCurLang,
+ const ::rtl::OUString & rKeyboardLang,
+ const ::rtl::OUString & rGuessedTextLang );
+
} // namespace framework
#endif // __MISC_HELPER_HXX_
diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx b/framework/inc/uielement/langselectionmenucontroller.hxx
index a73a8f13b92e..257638ecd77f 100644
--- a/framework/inc/uielement/langselectionmenucontroller.hxx
+++ b/framework/inc/uielement/langselectionmenucontroller.hxx
@@ -102,11 +102,10 @@ namespace framework
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xMenuDispatch_Font;
::rtl::OUString m_aMenuCommandURL_CharDlgForParagraph;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > m_xMenuDispatch_CharDlgForParagraph;
- ::rtl::OUString m_aCurrentLanguage;
::rtl::OUString m_aCurLang;
sal_Int16 m_nScriptType;
::rtl::OUString m_aKeyboardLang;
- ::rtl::OUString m_aGuessedText;
+ ::rtl::OUString m_aGuessedTextLang;
LanguageGuessingHelper m_aLangGuessHelper;
void fillPopupMenu( com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu >& rPopupMenu, const Mode rMode );
diff --git a/framework/inc/uielement/langselectionstatusbarcontroller.hxx b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
index 09cd83901b1e..4d46538eb6d6 100644
--- a/framework/inc/uielement/langselectionstatusbarcontroller.hxx
+++ b/framework/inc/uielement/langselectionstatusbarcontroller.hxx
@@ -35,9 +35,15 @@
#include <stdtypes.h>
#include <com/sun/star/linguistic2/XLanguageGuessing.hpp>
#include <svtools/statusbarcontroller.hxx>
+#include <rtl/ustring.hxx>
#include "helper/mischelper.hxx"
+#include <set>
+
+class SvtLanguageTable;
+
+
// component helper namespace
namespace framework {
@@ -86,12 +92,11 @@ class LangSelectionStatusbarController : public svt::StatusbarController
void operator =(LangSelectionStatusbarController &); // not defined
- sal_Bool m_bShowMenu;
- sal_Int16 m_nScriptType;
- ::rtl::OUString m_aCurrentLanguage;
- ::rtl::OUString m_aCurLang;
- ::rtl::OUString m_aKeyboardLang;
- ::rtl::OUString m_aGuessedText;
+ sal_Bool m_bShowMenu; // if the menu is to be displayed or not (depending on the selected object/text)
+ sal_Int16 m_nScriptType; // the flags for the different script types available in the selection, LATIN = 0x0001, ASIAN = 0x0002, COMPLEX = 0x0004
+ ::rtl::OUString m_aCurLang; // the language of the current selection, "*" if there are more than one languages
+ ::rtl::OUString m_aKeyboardLang; // the keyboard language
+ ::rtl::OUString m_aGuessedTextLang; // the 'guessed' language for the selection, "" if none could be guessed
LanguageGuessingHelper m_aLangGuessHelper;
void LangMenu() throw (::com::sun::star::uno::RuntimeException);