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 OString &rDialogId)
 
virtual DialoggetDialog () override
 
virtual ~GenericDialogController () COVERITY_NOEXCEPT_FALSE override
 
- Public Member Functions inherited from weld::DialogController
const DialoggetConstDialog () const
 
void set_title (const OUString &rTitle)
 
OUString get_title () const
 
void set_help_id (const OString &rHelpId)
 
OString get_help_id () const
 
void response (int nResponse)
 
virtual ~DialogController () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

void Init (const OUString &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 (OnClickedFieldRadios, weld::Button &, 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::ToggleButton &, 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 &, voidm_lnkFoundHandler
 Handler for "found". More...
 
Link< FmFoundRecordInformation &, voidm_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 ( 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 74 of file cuifmsearch.cxx.

References Link< class, class >::Call(), Cancel, DBG_ASSERT, FmSearchEngine, comphelper::getProcessComponentContext(), comphelper::string::getTokenCount(), Init(), initCommon(), Link< class, class >::IsSet(), LINK, m_arrContextFields, m_lnkContextSupplier, m_pbSearchAgain, m_pcmbSearchText, m_pftForm, m_plbForm, m_pSearchEngine, m_sSearch, and FmSearchContext::nContext.

FmSearchDialog::~FmSearchDialog ( )
overridevirtual

Definition at line 158 of file cuifmsearch.cxx.

References m_pConfig, m_pSearchEngine, and SaveParams().

Member Function Documentation

FmSearchDialog::DECL_LINK ( OnClickedFieldRadios  ,
weld::Button ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnClickedSearchAgain  ,
weld::Button ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnClickedSpecialSettings  ,
weld::Button ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnSearchTextModified  ,
weld::ComboBox ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnPositionSelected  ,
weld::ComboBox ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnFieldSelected  ,
weld::ComboBox ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnFocusGrabbed  ,
weld::Widget ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnCheckBoxToggled  ,
weld::ToggleButton ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnContextSelection  ,
weld::ComboBox ,
void   
)
private
FmSearchDialog::DECL_LINK ( OnSearchProgress  ,
const FmSearchProgress ,
void   
)
private
void FmSearchDialog::EnableSearchForDependees ( bool  bEnable)
private
void FmSearchDialog::EnableSearchUI ( bool  bEnable)
private
void FmSearchDialog::Init ( const OUString &  strVisibleFields,
const OUString &  strInitialText 
)
private
void FmSearchDialog::initCommon ( const css::uno::Reference< css::sdbc::XResultSet > &  _rxCursor)
private
void FmSearchDialog::InitContext ( sal_Int16  nContext)
private
void FmSearchDialog::LoadParams ( )
private
void FmSearchDialog::OnFound ( const css::uno::Any &  aCursorPos,
sal_Int16  nFieldPos 
)
private
short FmSearchDialog::run ( )
overridevirtual

Reimplemented from weld::DialogController.

Definition at line 239 of file cuifmsearch.cxx.

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

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

Definition at line 162 of file cuifmsearch.hxx.

References m_plbField.

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 123 of file cuifmsearch.hxx.

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 115 of file cuifmsearch.hxx.

Friends And Related Function Documentation

friend class FmSearchEngine
friend

Definition at line 41 of file cuifmsearch.hxx.

Referenced by FmSearchDialog().

Member Data Documentation

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

memorize the currently selected field for every context

Definition at line 52 of file cuifmsearch.hxx.

Referenced by FmSearchDialog(), and InitContext().

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

Handler for Positioning the Cursors.

Definition at line 47 of file cuifmsearch.hxx.

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

for search in contexts

Definition at line 49 of file cuifmsearch.hxx.

Referenced by FmSearchDialog(), and InitContext().

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

Handler for "found".

Definition at line 46 of file cuifmsearch.hxx.

Referenced by OnFound().

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

Definition at line 85 of file cuifmsearch.hxx.

Referenced by EnableSearchUI().

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

Definition at line 84 of file cuifmsearch.hxx.

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

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

Definition at line 77 of file cuifmsearch.hxx.

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

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

Definition at line 73 of file cuifmsearch.hxx.

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

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

Definition at line 72 of file cuifmsearch.hxx.

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

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

Definition at line 76 of file cuifmsearch.hxx.

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

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

Definition at line 74 of file cuifmsearch.hxx.

Referenced by EnableSearchUI(), and Init().

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

Definition at line 71 of file cuifmsearch.hxx.

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

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

Definition at line 75 of file cuifmsearch.hxx.

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

std::unique_ptr<weld::ComboBox> FmSearchDialog::m_pcmbSearchText
private
std::unique_ptr<::svxform::FmSearchConfigItem> FmSearchDialog::m_pConfig
private

Definition at line 57 of file cuifmsearch.hxx.

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

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

Definition at line 64 of file cuifmsearch.hxx.

Referenced by FmSearchDialog().

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

Definition at line 83 of file cuifmsearch.hxx.

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

Definition at line 69 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees().

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

Definition at line 82 of file cuifmsearch.hxx.

Referenced by InitContext().

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

Definition at line 79 of file cuifmsearch.hxx.

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

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

Definition at line 65 of file cuifmsearch.hxx.

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

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

Definition at line 70 of file cuifmsearch.hxx.

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

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

Definition at line 78 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), and Init().

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

Definition at line 66 of file cuifmsearch.hxx.

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

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

Definition at line 62 of file cuifmsearch.hxx.

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

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

Definition at line 61 of file cuifmsearch.hxx.

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

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

Definition at line 60 of file cuifmsearch.hxx.

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

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

Definition at line 67 of file cuifmsearch.hxx.

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

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

Definition at line 80 of file cuifmsearch.hxx.

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

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

Definition at line 81 of file cuifmsearch.hxx.

Referenced by EnableSearchForDependees(), and Init().

OUString FmSearchDialog::m_sCancel
private

Definition at line 44 of file cuifmsearch.hxx.

Referenced by EnableSearchUI().

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: