Kaydet (Commit) 0ab5802e authored tarafından Eike Rathke's avatar Eike Rathke

more SvxLanguageBoxBase interfacing

Change-Id: Ife9317d40756099ae4d8ecb84cccea91bd75a14c
üst 5b2f1b46
...@@ -69,6 +69,14 @@ public: ...@@ -69,6 +69,14 @@ public:
LanguageType GetSelectLanguage() const; LanguageType GetSelectLanguage() const;
bool IsLanguageSelected( const LanguageType eLangType ) const; bool IsLanguageSelected( const LanguageType eLangType ) const;
void SetNoSelectionLBB();
void HideLBB();
void DisableLBB();
void SaveValueLBB();
sal_Int32 GetSelectEntryPosLBB( sal_Int32 nSelIndex = 0 ) const;
void* GetEntryDataLBB( sal_Int32 nPos ) const;
sal_Int32 GetSavedValueLBB() const;
protected: protected:
Image m_aNotCheckedImage; Image m_aNotCheckedImage;
Image m_aCheckedImage; Image m_aCheckedImage;
...@@ -89,11 +97,16 @@ protected: ...@@ -89,11 +97,16 @@ protected:
SVX_DLLPRIVATE virtual void ImplClear() = 0; SVX_DLLPRIVATE virtual void ImplClear() = 0;
SVX_DLLPRIVATE virtual sal_Int32 ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) = 0; SVX_DLLPRIVATE virtual sal_Int32 ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) = 0;
SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, void* pData ) = 0; SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, void* pData ) = 0;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetSelectEntryPos() const = 0; SVX_DLLPRIVATE virtual sal_Int32 ImplGetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const = 0;
SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const = 0; SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const = 0;
SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) = 0; SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) = 0;
SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const = 0; SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const = 0;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const = 0; SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const = 0;
SVX_DLLPRIVATE virtual void ImplSetNoSelection() = 0;
SVX_DLLPRIVATE virtual void ImplHide() = 0;
SVX_DLLPRIVATE virtual void ImplDisable() = 0;
SVX_DLLPRIVATE virtual void ImplSaveValue() = 0;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetSavedValue() const = 0;
}; };
...@@ -110,11 +123,16 @@ private: ...@@ -110,11 +123,16 @@ private:
SVX_DLLPRIVATE virtual void ImplClear() SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplClear() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, void* pData ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, void* pData ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetSelectEntryPos() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplGetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplDisable() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSaveValue() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetSavedValue() const SAL_OVERRIDE;
}; };
...@@ -125,17 +143,24 @@ public: ...@@ -125,17 +143,24 @@ public:
virtual ~SvxLanguageComboBox(); virtual ~SvxLanguageComboBox();
private: private:
sal_Int32 mnSavedValuePos;
SVX_DLLPRIVATE virtual sal_Int32 ImplInsertImgEntry( const OUString& rEntry, sal_Int32 nPos, bool bChecked ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplInsertImgEntry( const OUString& rEntry, sal_Int32 nPos, bool bChecked ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplRemoveEntryAt( sal_Int32 nPos ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplRemoveEntryAt( sal_Int32 nPos ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplClear() SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplClear() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplInsertEntry( const OUString& rEntry, sal_Int32 nPos ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, void* pData ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSetEntryData( sal_Int32 nPos, void* pData ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetSelectEntryPos() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplGetSelectEntryPos( sal_Int32 nSelIndex = 0 ) const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual void* ImplGetEntryData( sal_Int32 nPos ) const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) SAL_OVERRIDE; SVX_DLLPRIVATE virtual void ImplSelectEntryPos( sal_Int32 nPos, bool bSelect ) SAL_OVERRIDE;
SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const SAL_OVERRIDE; SVX_DLLPRIVATE virtual bool ImplIsEntryPosSelected( sal_Int32 nPos ) const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const SAL_OVERRIDE; SVX_DLLPRIVATE virtual sal_Int32 ImplGetEntryCount() const SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSetNoSelection() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplHide() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplDisable() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual void ImplSaveValue() SAL_OVERRIDE;
SVX_DLLPRIVATE virtual sal_Int32 ImplGetSavedValue() const SAL_OVERRIDE;
}; };
#endif #endif
......
...@@ -459,6 +459,42 @@ sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const ...@@ -459,6 +459,42 @@ sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const
} }
void SvxLanguageBoxBase::SetNoSelectionLBB()
{
ImplSetNoSelection();
}
void SvxLanguageBoxBase::HideLBB()
{
ImplHide();
}
void SvxLanguageBoxBase::DisableLBB()
{
ImplDisable();
}
void SvxLanguageBoxBase::SaveValueLBB()
{
ImplSaveValue();
}
sal_Int32 SvxLanguageBoxBase::GetSelectEntryPosLBB( sal_Int32 nSelIndex ) const
{
return ImplGetSelectEntryPos( nSelIndex);
}
void* SvxLanguageBoxBase::GetEntryDataLBB( sal_Int32 nPos ) const
{
return ImplGetEntryData( nPos);
}
sal_Int32 SvxLanguageBoxBase::GetSavedValueLBB() const
{
return ImplGetSavedValue();
}
SvxLanguageBox::SvxLanguageBox( Window* pParent, WinBits nBits, bool bCheck ) SvxLanguageBox::SvxLanguageBox( Window* pParent, WinBits nBits, bool bCheck )
: ListBox( pParent, nBits ) : ListBox( pParent, nBits )
, SvxLanguageBoxBase( bCheck ) , SvxLanguageBoxBase( bCheck )
...@@ -477,6 +513,7 @@ SvxLanguageBox::~SvxLanguageBox() ...@@ -477,6 +513,7 @@ SvxLanguageBox::~SvxLanguageBox()
SvxLanguageComboBox::SvxLanguageComboBox( Window* pParent, WinBits nBits, bool bCheck ) SvxLanguageComboBox::SvxLanguageComboBox( Window* pParent, WinBits nBits, bool bCheck )
: ComboBox( pParent, nBits ) : ComboBox( pParent, nBits )
, SvxLanguageBoxBase( bCheck ) , SvxLanguageBoxBase( bCheck )
, mnSavedValuePos( COMBOBOX_ENTRY_NOTFOUND )
{ {
// display entries sorted // display entries sorted
SetStyle( GetStyle() | WB_SORT ); SetStyle( GetStyle() | WB_SORT );
...@@ -546,14 +583,14 @@ void SvxLanguageComboBox::ImplSetEntryData( sal_Int32 nPos, void* pData ) ...@@ -546,14 +583,14 @@ void SvxLanguageComboBox::ImplSetEntryData( sal_Int32 nPos, void* pData )
} }
sal_Int32 SvxLanguageBox::ImplGetSelectEntryPos() const sal_Int32 SvxLanguageBox::ImplGetSelectEntryPos( sal_Int32 nSelIndex ) const
{ {
return GetSelectEntryPos(); return GetSelectEntryPos( nSelIndex);
} }
sal_Int32 SvxLanguageComboBox::ImplGetSelectEntryPos() const sal_Int32 SvxLanguageComboBox::ImplGetSelectEntryPos( sal_Int32 nSelIndex ) const
{ {
return GetSelectEntryPos(); return GetSelectEntryPos( nSelIndex);
} }
...@@ -601,4 +638,60 @@ sal_Int32 SvxLanguageComboBox::ImplGetEntryCount() const ...@@ -601,4 +638,60 @@ sal_Int32 SvxLanguageComboBox::ImplGetEntryCount() const
} }
void SvxLanguageBox::ImplSetNoSelection()
{
SetNoSelection();
}
void SvxLanguageComboBox::ImplSetNoSelection()
{
SetNoSelection();
}
void SvxLanguageBox::ImplHide()
{
Hide();
}
void SvxLanguageComboBox::ImplHide()
{
Hide();
}
void SvxLanguageBox::ImplDisable()
{
Disable();
}
void SvxLanguageComboBox::ImplDisable()
{
Disable();
}
void SvxLanguageBox::ImplSaveValue()
{
SaveValue();
}
void SvxLanguageComboBox::ImplSaveValue()
{
// Emulate the ListBox behavior.
mnSavedValuePos = GetSelectEntryPos();
}
sal_Int32 SvxLanguageBox::ImplGetSavedValue() const
{
return GetSavedValue();
}
sal_Int32 SvxLanguageComboBox::ImplGetSavedValue() const
{
return mnSavedValuePos;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment