LibreOffice Module connectivity (master) 1
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
dbtools::FilterManager Class Reference

manages the filter of a database component with filter properties More...

#include <filtermanager.hxx>

Public Types

enum class  FilterComponent {
  PublicFilter ,
  LinkFilter ,
  PublicHaving ,
  LinkHaving
}
 

Public Member Functions

 FilterManager ()
 ctor More...
 
void initialize (const css::uno::Reference< css::beans::XPropertySet > &_rxComponentAggregate)
 late ctor More...
 
void dispose ()
 makes the object forgetting the references to the database component More...
 
const OUString & getFilterComponent (FilterComponent _eWhich) const
 
void setFilterComponent (FilterComponent _eWhich, const OUString &_rComponent)
 
bool isApplyPublicFilter () const
 
void setApplyPublicFilter (bool _bApply)
 

Private Member Functions

OUString getComposedFilter () const
 retrieves a filter which is a conjunction of all single filter components More...
 
OUString getComposedHaving () const
 
bool isThereAtMostOneFilterComponent (OUString &o_singleComponent) const
 checks whether there is only one (or even no) non-empty filter component More...
 
bool isThereAtMostOneHavingComponent (OUString &o_singleComponent) const
 

Static Private Member Functions

static void appendFilterComponent (OUStringBuffer &io_appendTo, std::u16string_view i_component)
 appends one filter component to the statement in our composer More...
 

Private Attributes

css::uno::Reference< css::beans::XPropertySetm_xComponentAggregate
 
OUString m_aPublicFilterComponent
 
OUString m_aPublicHavingComponent
 
OUString m_aLinkFilterComponent
 
OUString m_aLinkHavingComponent
 
bool m_bApplyPublicFilter
 

Detailed Description

manages the filter of a database component with filter properties

The idea is that the filter which a database component actually really uses is composed of several single filter components (which all are conjunctive).

First, there is a component which is visible to the clients of the database component itself - if they ask the database component for the Filter property, they will get this public filter.

Second, there is an implicit filter, which is (to be) created from the MasterFields and DetailFields property of the database component, if the latter denote columns.
For instance, if there is a link-pair CustomerID->cid, where |CustomerID| is a column of the master database component, and |cid| is a column of the detail database component (the database component we're responsible for), then there will be an implicit filter "cid = :param_cid_link" (or something like this), which is never visible to the clients of the database component, but nevertheless needs to be propagated to the aggregated RowSet.
Actually, this implicit filter is maintained by the FormParameterManager.

Potentially, there could be more filter components (for instance, you could imagine database component controls which act as live filter, which could be implemented with a third component), but at the moment there are only these two.

Definition at line 57 of file filtermanager.hxx.

Member Enumeration Documentation

◆ FilterComponent

Enumerator
PublicFilter 
LinkFilter 
PublicHaving 
LinkHaving 

Definition at line 60 of file filtermanager.hxx.

Constructor & Destructor Documentation

◆ FilterManager()

dbtools::FilterManager::FilterManager ( )
explicit

ctor

Definition at line 40 of file filtermanager.cxx.

Member Function Documentation

◆ appendFilterComponent()

void dbtools::FilterManager::appendFilterComponent ( OUStringBuffer &  io_appendTo,
std::u16string_view  i_component 
)
staticprivate

appends one filter component to the statement in our composer

Definition at line 155 of file filtermanager.cxx.

Referenced by getComposedFilter(), and getComposedHaving().

◆ dispose()

void dbtools::FilterManager::dispose ( void  )

makes the object forgetting the references to the database component

Definition at line 56 of file filtermanager.cxx.

References m_xComponentAggregate.

◆ getComposedFilter()

OUString dbtools::FilterManager::getComposedFilter ( ) const
private

retrieves a filter which is a conjunction of all single filter components

Definition at line 217 of file filtermanager.cxx.

References appendFilterComponent(), isThereAtMostOneFilterComponent(), m_aLinkFilterComponent, m_aPublicFilterComponent, and m_bApplyPublicFilter.

Referenced by setApplyPublicFilter(), and setFilterComponent().

◆ getComposedHaving()

OUString dbtools::FilterManager::getComposedHaving ( ) const
private

◆ getFilterComponent()

const OUString & dbtools::FilterManager::getFilterComponent ( FilterComponent  _eWhich) const

◆ initialize()

void dbtools::FilterManager::initialize ( const css::uno::Reference< css::beans::XPropertySet > &  _rxComponentAggregate)

◆ isApplyPublicFilter()

bool dbtools::FilterManager::isApplyPublicFilter ( ) const
inline

Definition at line 90 of file filtermanager.hxx.

◆ isThereAtMostOneFilterComponent()

bool dbtools::FilterManager::isThereAtMostOneFilterComponent ( OUString &  o_singleComponent) const
private

checks whether there is only one (or even no) non-empty filter component

Definition at line 170 of file filtermanager.cxx.

References m_aLinkFilterComponent, m_aPublicFilterComponent, and m_bApplyPublicFilter.

Referenced by getComposedFilter().

◆ isThereAtMostOneHavingComponent()

bool dbtools::FilterManager::isThereAtMostOneHavingComponent ( OUString &  o_singleComponent) const
private

◆ setApplyPublicFilter()

void dbtools::FilterManager::setApplyPublicFilter ( bool  _bApply)

◆ setFilterComponent()

void dbtools::FilterManager::setFilterComponent ( FilterComponent  _eWhich,
const OUString &  _rComponent 
)

Member Data Documentation

◆ m_aLinkFilterComponent

OUString dbtools::FilterManager::m_aLinkFilterComponent
private

◆ m_aLinkHavingComponent

OUString dbtools::FilterManager::m_aLinkHavingComponent
private

◆ m_aPublicFilterComponent

OUString dbtools::FilterManager::m_aPublicFilterComponent
private

◆ m_aPublicHavingComponent

OUString dbtools::FilterManager::m_aPublicHavingComponent
private

◆ m_bApplyPublicFilter

bool dbtools::FilterManager::m_bApplyPublicFilter
private

◆ m_xComponentAggregate

css::uno::Reference< css::beans::XPropertySet > dbtools::FilterManager::m_xComponentAggregate
private

Definition at line 70 of file filtermanager.hxx.

Referenced by dispose(), initialize(), setApplyPublicFilter(), and setFilterComponent().


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