LibreOffice Module sw (master)  1
wordcountctrl.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #include <swtypes.hxx>
11 #include <strings.hrc>
12 #include <wordcountctrl.hxx>
13 #include <svl/stritem.hxx>
14 
16 
18  sal_uInt16 _nSlotId,
19  sal_uInt16 _nId,
20  StatusBar& rStb) :
21  SfxStatusBarControl(_nSlotId, _nId, rStb)
22 {
23 }
24 
26 {
27 }
28 
30  sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState )
31 {
32  if (eState == SfxItemState::DEFAULT) // Can access pState
33  GetStatusBar().SetItemText( GetId(), static_cast<const SfxStringItem*>(pState)->GetValue() );
34 
35  GetStatusBar().SetQuickHelpText(GetId(), SwResId(STR_WORDCOUNT_HINT));
36 }
37 
38 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::string GetValue
SwWordCountStatusBarControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb)
sal_uInt16 GetId() const
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
Word count status bar control for Writer.
virtual ~SwWordCountStatusBarControl() override
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
SfxItemState
StatusBar & GetStatusBar() const
void SetItemText(sal_uInt16 nItemId, const OUString &rText)
SFX_IMPL_STATUSBAR_CONTROL(SwWordCountStatusBarControl, SfxStringItem)
virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override