LibreOffice Module cui (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
FmSearchDialog Class Referencefinal

Dialog for searching in Forms/Tables. More...

#include <cuifmsearch.hxx>

Inheritance diagram for FmSearchDialog:
[legend]
Collaboration diagram for FmSearchDialog:
[legend]

Public Member Functions

 FmSearchDialog (weld::Window *pParent, const OUString &strInitialText, const std::vector< OUString > &_rContexts, sal_Int16 nInitialContext, const Link< FmSearchContext &, sal_uInt32 > &lnkContextSupplier)
 This can search in different sets of fields. More...
 
virtual short run () override
 
virtual ~FmSearchDialog () override
 
void SetFoundHandler (const Link< FmFoundRecordInformation &, void > &lnk)
 The found-handler gets in the 'found'-case a pointer on a FmFoundRecordInformation-structure (which is only valid in the handler; so if one needs to memorize the data, don't copy the pointer but the structure). More...
 
void SetCanceledNotFoundHdl (const Link< FmFoundRecordInformation &, void > &lnk)
 If the search has been cancelled or has been finished without success, the current data set is always displayed in the search dialog. More...
 
void SetActiveField (const OUString &strField)
 
- Public Member Functions inherited from weld::GenericDialogController
 GenericDialogController (weld::Widget *pParent, const OUString &rUIFile, const OUString &rDialogId, bool bMobile=false)
 
virtual DialoggetDialog () override
 
virtual ~GenericDialogController () COVERITY_NOEXCEPT_FALSE override
 
- Public Member Functions inherited from weld::DialogController
virtual DialoggetDialog ()=0
 
const DialoggetConstDialog () const
 
virtual short run ()
 
void set_title (const OUString &rTitle)
 
OUString get_title () const
 
void set_help_id (const OUString &rHelpId)
 
OUString get_help_id () const
 
void response (int nResponse)
 
virtual ~DialogController () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

void Init (std::u16string_view strVisibleFields, const OUString &strInitialText)
 
void OnFound (const css::uno::Any &aCursorPos, sal_Int16 nFieldPos)
 
void EnableSearchUI (bool bEnable)
 
void EnableSearchForDependees (bool bEnable)
 
void InitContext (sal_Int16 nContext)
 
void LoadParams ()
 
void SaveParams () const
 
 DECL_LINK (OnToggledSearchRadio, weld::Toggleable &, void)
 
 DECL_LINK (OnToggledFieldRadios, weld::Toggleable &, void)
 
 DECL_LINK (OnClickedSearchAgain, weld::Button &, void)
 
 DECL_LINK (OnClickedSpecialSettings, weld::Button &, void)
 
 DECL_LINK (OnSearchTextModified, weld::ComboBox &, void)
 
 DECL_LINK (OnPositionSelected, weld::ComboBox &, void)
 
 DECL_LINK (OnFieldSelected, weld::ComboBox &, void)
 
 DECL_LINK (OnFocusGrabbed, weld::Widget &, void)
 
 DECL_LINK (OnCheckBoxToggled, weld::Toggleable &, void)
 
 DECL_LINK (OnContextSelection, weld::ComboBox &, void)
 
 DECL_LINK (OnSearchProgress, const FmSearchProgress *, void)
 
void initCommon (const css::uno::Reference< css::sdbc::XResultSet > &_rxCursor)
 

Private Attributes

OUString m_sSearch
 
OUString m_sCancel
 
Link< FmFoundRecordInformation &, void > m_lnkFoundHandler
 Handler for "found". More...
 
Link< FmFoundRecordInformation &, void > m_lnkCanceledNotFoundHdl
 Handler for Positioning the Cursors. More...
 
Link< FmSearchContext &, sal_uInt32 > m_lnkContextSupplier
 for search in contexts More...
 
std::vector< OUString > m_arrContextFields
 memorize the currently selected field for every context More...
 
std::unique_ptr< FmSearchEnginem_pSearchEngine
 
std::unique_ptr<::svxform::FmSearchConfigItemm_pConfig
 
std::unique_ptr< weld::RadioButtonm_prbSearchForText
 
std::unique_ptr< weld::RadioButtonm_prbSearchForNull
 
std::unique_ptr< weld::RadioButtonm_prbSearchForNotNull
 
std::unique_ptr< weld::ComboBoxm_pcmbSearchText
 
std::unique_ptr< weld::Labelm_pftForm
 
std::unique_ptr< weld::ComboBoxm_plbForm
 
std::unique_ptr< weld::RadioButtonm_prbAllFields
 
std::unique_ptr< weld::RadioButtonm_prbSingleField
 
std::unique_ptr< weld::ComboBoxm_plbField
 
std::unique_ptr< weld::Labelm_pftPosition
 
std::unique_ptr< weld::ComboBoxm_plbPosition
 
std::unique_ptr< weld::CheckButtonm_pcbUseFormat
 
std::unique_ptr< weld::CheckButtonm_pcbCase
 
std::unique_ptr< weld::CheckButtonm_pcbBackwards
 
std::unique_ptr< weld::CheckButtonm_pcbStartOver
 
std::unique_ptr< weld::CheckButtonm_pcbWildCard
 
std::unique_ptr< weld::CheckButtonm_pcbRegular
 
std::unique_ptr< weld::CheckButtonm_pcbApprox
 
std::unique_ptr< weld::Buttonm_ppbApproxSettings
 
std::unique_ptr< weld::CheckButtonm_pHalfFullFormsCJK
 
std::unique_ptr< weld::CheckButtonm_pSoundsLikeCJK
 
std::unique_ptr< weld::Buttonm_pSoundsLikeCJKSettings
 
std::unique_ptr< weld::Labelm_pftRecord
 
std::unique_ptr< weld::Labelm_pftHint
 
std::unique_ptr< weld::Buttonm_pbSearchAgain
 
std::unique_ptr< weld::Buttonm_pbClose
 

Friends

class FmSearchEngine
 

Additional Inherited Members

- Static Public Member Functions inherited from weld::DialogController
static bool runAsync (const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
 
- Protected Attributes inherited from weld::GenericDialogController
std::unique_ptr< weld::Builderm_xBuilder
 
std::shared_ptr< weld::Dialogm_xDialog
 

Detailed Description

Dialog for searching in Forms/Tables.

Definition at line 39 of file cuifmsearch.hxx.

Constructor & Destructor Documentation

◆ FmSearchDialog()

FmSearchDialog::FmSearchDialog ( weld::Window pParent,
const OUString &  strInitialText,
const std::vector< OUString > &  _rContexts,
sal_Int16  nInitialContext,
const Link< FmSearchContext &, sal_uInt32 > &  lnkContextSupplier 
)

This can search in different sets of fields.

There is a number of contexts; their names are in strContexts (separated by ';'), the user can choose one of them. When the user chooses a context, lnkContextSupplier is called, it gets a pointer on a FmSearchContext-structure, that has to be filled. The following counts for the search : a) in case of formatted search the iterator itself is used (like in the first constructor) b) in case of formatted search NOT the FormatKey at the fields of the iterator is used, but the respective TextComponent is asked (that's why the original iterator is used; by its move the controls behind the TextComponent-interface are updated hopefully) c) in case of not-formatted search a clone of the iterator is used (because the TextComponent-interfaces don't need to be asked) (of course needed : the string number i in strUsedFields of a context must correspond with the interface number i in the arrFields of the context)

Definition at line 71 of file cuifmsearch.cxx.

References FmSearchContext::arrFields, Link< typename Arg, typename Ret >::Call(), Cancel, DBG_ASSERT, FmSearchEngine, GetStandardText(), comphelper::string::getTokenCount(), Init(), initCommon(), Link< typename Arg, typename Ret >::IsSet(), LINK, m_arrContextFields, m_lnkContextSupplier, m_pbSearchAgain, m_pcmbSearchText, m_pftForm, m_plbForm, m_pSearchEngine, m_sSearch, FmSearchContext::nContext, FmSearchContext::sFieldDisplayNames, FmSearchContext::strUsedFields, and FmSearchContext::xCursor.

◆ ~FmSearchDialog()

FmSearchDialog::~FmSearchDialog ( )
overridevirtual

Definition at line 155 of file cuifmsearch.cxx.

References m_pConfig, m_pSearchEngine, and SaveParams().

Member Function Documentation

◆ DECL_LINK() [1/11]

FmSearchDialog::DECL_LINK ( OnCheckBoxToggled  ,
weld::Toggleable ,
void   
)
private

◆ DECL_LINK() [2/11]

FmSearchDialog::DECL_LINK ( OnClickedSearchAgain  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [3/11]

FmSearchDialog::DECL_LINK ( OnClickedSpecialSettings  ,
weld::Button ,
void   
)
private

◆ DECL_LINK() [4/11]

FmSearchDialog::DECL_LINK ( OnContextSelection  ,
weld::ComboBox ,
void   
)
private

◆ DECL_LINK() [5/11]

FmSearchDialog::DECL_LINK ( OnFieldSelected  ,
weld::ComboBox ,
void   
)
private

◆ DECL_LINK() [6/11]

FmSearchDialog::DECL_LINK ( OnFocusGrabbed  ,
weld::Widget ,
void   
)
private

◆ DECL_LINK() [7/11]

FmSearchDialog::DECL_LINK ( OnPositionSelected  ,
weld::ComboBox ,
void   
)
private

◆ DECL_LINK() [8/11]

FmSearchDialog::DECL_LINK ( OnSearchProgress  ,
const FmSearchProgress ,
void   
)
private

◆ DECL_LINK() [9/11]

FmSearchDialog::DECL_LINK ( OnSearchTextModified  ,
weld::ComboBox ,
void   
)
private

◆ DECL_LINK() [10/11]

FmSearchDialog::DECL_LINK ( OnToggledFieldRadios  ,
weld::Toggleable ,
void   
)
private

◆ DECL_LINK() [11/11]

FmSearchDialog::DECL_LINK ( OnToggledSearchRadio  ,
weld::Toggleable ,
void   
)
private

◆ EnableSearchForDependees()

void FmSearchDialog::EnableSearchForDependees ( bool  bEnable)
private

◆ EnableSearchUI()

void FmSearchDialog::EnableSearchUI ( bool  bEnable)
private

◆ Init()

void FmSearchDialog::Init ( std::u16string_view  strVisibleFields,
const OUString &  strInitialText 
)
private

◆ initCommon()

void FmSearchDialog::initCommon ( const css::uno::Reference< css::sdbc::XResultSet > &  _rxCursor)
private

◆ InitContext()

void FmSearchDialog::InitContext ( sal_Int16  nContext)
private

◆ LoadParams()

void FmSearchDialog::LoadParams ( )
private

◆ OnFound()

void FmSearchDialog::OnFound ( const css::uno::Any &  aCursorPos,
sal_Int16  nFieldPos 
)
private

◆ run()

short FmSearchDialog::run ( )
overridevirtual

Reimplemented from weld::DialogController.

Definition at line 236 of file cuifmsearch.cxx.

References m_pSearchEngine, and weld::DialogController::run().

◆ SaveParams()

void FmSearchDialog::SaveParams ( ) const
private

◆ SetActiveField()

void FmSearchDialog::SetActiveField ( const OUString &  strField)
inline

Definition at line 171 of file cuifmsearch.hxx.

References m_plbField.

◆ SetCanceledNotFoundHdl()

void FmSearchDialog::SetCanceledNotFoundHdl ( const Link< FmFoundRecordInformation &, void > &  lnk)
inline

If the search has been cancelled or has been finished without success, the current data set is always displayed in the search dialog.

This handler exists to make this synchronous with the possible display of the caller (it does not necessarily need to be set). The pointer that is passed to the handler points to a FmFoundRecordInformation-structure, for which aPosition and possibly (in a search with contexts) nContext are valid.

Definition at line 128 of file cuifmsearch.hxx.

References m_lnkCanceledNotFoundHdl.

◆ SetFoundHandler()

void FmSearchDialog::SetFoundHandler ( const Link< FmFoundRecordInformation &, void > &  lnk)
inline

The found-handler gets in the 'found'-case a pointer on a FmFoundRecordInformation-structure (which is only valid in the handler; so if one needs to memorize the data, don't copy the pointer but the structure).

This handler MUST be set. Furthermore, it should be considered, that during the handler the search-dialog is still modal.

Definition at line 117 of file cuifmsearch.hxx.

References m_lnkFoundHandler.

Friends And Related Function Documentation

◆ FmSearchEngine

friend class FmSearchEngine
friend

Definition at line 41 of file cuifmsearch.hxx.

Referenced by FmSearchDialog().

Member Data Documentation

◆ m_arrContextFields

std::vector<OUString> FmSearchDialog::m_arrContextFields
private

memorize the currently selected field for every context

Definition at line 53 of file cuifmsearch.hxx.

Referenced by FmSearchDialog(), and InitContext().

◆ m_lnkCanceledNotFoundHdl

Link<FmFoundRecordInformation&, void> FmSearchDialog::m_lnkCanceledNotFoundHdl
private

Handler for Positioning the Cursors.

Definition at line 48 of file cuifmsearch.hxx.

Referenced by SetCanceledNotFoundHdl().

◆ m_lnkContextSupplier

Link<FmSearchContext&, sal_uInt32> FmSearchDialog::m_lnkContextSupplier
private

for search in contexts

Definition at line 50 of file cuifmsearch.hxx.

Referenced by FmSearchDialog(), and InitContext().

◆ m_lnkFoundHandler

Link<FmFoundRecordInformation&, void> FmSearchDialog::m_lnkFoundHandler
private

Handler for "found".

Definition at line 46 of file cuifmsearch.hxx.

Referenced by OnFound(), and SetFoundHandler().

◆ m_pbClose

std::unique_ptr<weld::Button> FmSearchDialog::m_pbClose
private

Definition at line 86 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), and initCommon().

◆ m_pbSearchAgain

std::unique_ptr<weld::Button> FmSearchDialog::m_pbSearchAgain
private

Definition at line 85 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), EnableSearchUI(), FmSearchDialog(), and Init().

◆ m_pcbApprox

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbApprox
private

Definition at line 78 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and LoadParams().

◆ m_pcbBackwards

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbBackwards
private

Definition at line 74 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), Init(), and LoadParams().

◆ m_pcbCase

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbCase
private

Definition at line 73 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and LoadParams().

◆ m_pcbRegular

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbRegular
private

Definition at line 77 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and LoadParams().

◆ m_pcbStartOver

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbStartOver
private

Definition at line 75 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), and Init().

◆ m_pcbUseFormat

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbUseFormat
private

Definition at line 72 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and LoadParams().

◆ m_pcbWildCard

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pcbWildCard
private

Definition at line 76 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and LoadParams().

◆ m_pcmbSearchText

std::unique_ptr<weld::ComboBox> FmSearchDialog::m_pcmbSearchText
private

◆ m_pConfig

std::unique_ptr<::svxform::FmSearchConfigItem> FmSearchDialog::m_pConfig
private

Definition at line 58 of file cuifmsearch.hxx.

Referenced by Init(), LoadParams(), SaveParams(), and ~FmSearchDialog().

◆ m_pftForm

std::unique_ptr<weld::Label> FmSearchDialog::m_pftForm
private

Definition at line 65 of file cuifmsearch.hxx.

Referenced by FmSearchDialog().

◆ m_pftHint

std::unique_ptr<weld::Label> FmSearchDialog::m_pftHint
private

Definition at line 84 of file cuifmsearch.hxx.

◆ m_pftPosition

std::unique_ptr<weld::Label> FmSearchDialog::m_pftPosition
private

Definition at line 70 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees().

◆ m_pftRecord

std::unique_ptr<weld::Label> FmSearchDialog::m_pftRecord
private

Definition at line 83 of file cuifmsearch.hxx.

Referenced by initCommon(), and InitContext().

◆ m_pHalfFullFormsCJK

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pHalfFullFormsCJK
private

Definition at line 80 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), initCommon(), and LoadParams().

◆ m_plbField

std::unique_ptr<weld::ComboBox> FmSearchDialog::m_plbField
private

◆ m_plbForm

std::unique_ptr<weld::ComboBox> FmSearchDialog::m_plbForm
private

Definition at line 66 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), FmSearchDialog(), and OnFound().

◆ m_plbPosition

std::unique_ptr<weld::ComboBox> FmSearchDialog::m_plbPosition
private

Definition at line 71 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and LoadParams().

◆ m_ppbApproxSettings

std::unique_ptr<weld::Button> FmSearchDialog::m_ppbApproxSettings
private

Definition at line 79 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), and Init().

◆ m_prbAllFields

std::unique_ptr<weld::RadioButton> FmSearchDialog::m_prbAllFields
private

Definition at line 67 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), Init(), InitContext(), LoadParams(), OnFound(), and SaveParams().

◆ m_prbSearchForNotNull

std::unique_ptr<weld::RadioButton> FmSearchDialog::m_prbSearchForNotNull
private

Definition at line 63 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), Init(), LoadParams(), and SaveParams().

◆ m_prbSearchForNull

std::unique_ptr<weld::RadioButton> FmSearchDialog::m_prbSearchForNull
private

Definition at line 62 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), Init(), LoadParams(), and SaveParams().

◆ m_prbSearchForText

std::unique_ptr<weld::RadioButton> FmSearchDialog::m_prbSearchForText
private

Definition at line 61 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), EnableSearchUI(), Init(), and LoadParams().

◆ m_prbSingleField

std::unique_ptr<weld::RadioButton> FmSearchDialog::m_prbSingleField
private

Definition at line 68 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), Init(), InitContext(), and LoadParams().

◆ m_pSearchEngine

std::unique_ptr<FmSearchEngine> FmSearchDialog::m_pSearchEngine
private

◆ m_pSoundsLikeCJK

std::unique_ptr<weld::CheckButton> FmSearchDialog::m_pSoundsLikeCJK
private

Definition at line 81 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), initCommon(), and LoadParams().

◆ m_pSoundsLikeCJKSettings

std::unique_ptr<weld::Button> FmSearchDialog::m_pSoundsLikeCJKSettings
private

Definition at line 82 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), Init(), and initCommon().

◆ m_sCancel

OUString FmSearchDialog::m_sCancel
private

Definition at line 44 of file cuifmsearch.hxx.

Referenced by EnableSearchUI().

◆ m_sSearch

OUString FmSearchDialog::m_sSearch
private

Definition at line 43 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), and FmSearchDialog().


The documentation for this class was generated from the following files: