LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
sd::framework::ResourceId Class Referencefinal

Implementation of the css::drawing::framework::ResourceId service and the css::drawing::framework::XResourceId interface. More...

#include <ResourceId.hxx>

Inheritance diagram for sd::framework::ResourceId:
[legend]
Collaboration diagram for sd::framework::ResourceId:
[legend]

Public Member Functions

 ResourceId ()
 Create a new, empty resource id. More...
 
 ResourceId (std::vector< OUString > &&rsResourceURLs)
 Create a new resource id that is described by the given URLs. More...
 
 ResourceId (const OUString &rsResourceURL)
 Create a new resource id that has an empty anchor. More...
 
 ResourceId (const OUString &rsResourceURL, const OUString &rsAnchorURL)
 Create a new resource id for the given resource type and an anchor that is specified by a single URL. More...
 
 ResourceId (const OUString &rsResourceURL, const OUString &rsFirstAnchorURL, const css::uno::Sequence< OUString > &rAnchorURLs)
 Create a new resource id with an anchor that consists of a sequence of URLs that is extended by a further URL. More...
 
virtual ~ResourceId () override
 
virtual OUString SAL_CALL getResourceURL () override
 
virtual css::util::URL SAL_CALL getFullResourceURL () override
 
virtual sal_Bool SAL_CALL hasAnchor () override
 
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL getAnchor () override
 
virtual css::uno::Sequence< OUString > SAL_CALL getAnchorURLs () override
 
virtual OUString SAL_CALL getResourceTypePrefix () override
 
virtual sal_Int16 SAL_CALL compareTo (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId) override
 
virtual sal_Bool SAL_CALL isBoundTo (const css::uno::Reference< css::drawing::framework::XResourceId > &rxResourceId, css::drawing::framework::AnchorBindingMode eMode) override
 
virtual sal_Bool SAL_CALL isBoundToURL (const OUString &rsAnchorURL, css::drawing::framework::AnchorBindingMode eMode) override
 
virtual css::uno::Reference< css::drawing::framework::XResourceId > SAL_CALL clone () override
 
void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &aArguments) override
 
OUString SAL_CALL getImplementationName () override
 
sal_Bool SAL_CALL supportsService (OUString const &ServiceName) override
 
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 

Private Member Functions

sal_Int16 CompareToLocalImplementation (const ResourceId &rId) const
 Compare the called ResourceId object to the given ResourceId object. More...
 
sal_Int16 CompareToExternalImplementation (const css::uno::Reference< css::drawing::framework::XResourceId > &rxId) const
 Compare the called ResourceId object to the given XResourceId object reference. More...
 
bool IsBoundToAnchor (const OUString *psFirstAnchorURL, const css::uno::Sequence< OUString > *paAnchorURLs, css::drawing::framework::AnchorBindingMode eMode) const
 Return whether the called ResourceId object is bound to the anchor consisting of the URLs given by psFirstAnchorURL and paAnchorURLs. More...
 
bool IsBoundToAnchor (const ::std::vector< OUString > &rResourceURLs, css::drawing::framework::AnchorBindingMode eMode) const
 Return whether the called ResourceId object is bound to the anchor consisting of the URLs in rResourceURLs. More...
 
void ParseResourceURL ()
 

Private Attributes

std::vector< OUString > maResourceURLs
 The set of URLs that consist of the resource URL at index 0 and the anchor URLs and indices 1 and above. More...
 
std::unique_ptr< css::util::URL > mpURL
 

Static Private Attributes

static css::uno::WeakReference< css::util::XURLTransformer > mxURLTransformerWeak
 

Detailed Description

Implementation of the css::drawing::framework::ResourceId service and the css::drawing::framework::XResourceId interface.

Definition at line 48 of file ResourceId.hxx.

Constructor & Destructor Documentation

◆ ResourceId() [1/5]

sd::framework::ResourceId::ResourceId ( )

Create a new, empty resource id.

Definition at line 51 of file ResourceId.cxx.

Referenced by clone(), and getAnchor().

◆ ResourceId() [2/5]

sd::framework::ResourceId::ResourceId ( std::vector< OUString > &&  rsResourceURLs)

Create a new resource id that is described by the given URLs.

Parameters
rsResourceURLsThe first URL specifies the type of resource. The other URLs describe its anchor. The set of URLs may be empty. The result is then the same as returned by ResourceId() default constructor.

Definition at line 56 of file ResourceId.cxx.

References ParseResourceURL().

◆ ResourceId() [3/5]

sd::framework::ResourceId::ResourceId ( const OUString &  rsResourceURL)

Create a new resource id that has an empty anchor.

Parameters
rsResourceURLWhen this resource URL is empty then the resulting ResourceId object is identical to when the ResourceId() default constructor had been called.

Definition at line 63 of file ResourceId.cxx.

References maResourceURLs, and ParseResourceURL().

◆ ResourceId() [4/5]

sd::framework::ResourceId::ResourceId ( const OUString &  rsResourceURL,
const OUString &  rsAnchorURL 
)

Create a new resource id for the given resource type and an anchor that is specified by a single URL.

This constructor can be used for example for views that are bound to panes.

Parameters
rsResourceURLThe URL of the actual resource.
rsAnchorURLThe single URL of the anchor.

Definition at line 73 of file ResourceId.cxx.

References maResourceURLs, and ParseResourceURL().

◆ ResourceId() [5/5]

sd::framework::ResourceId::ResourceId ( const OUString &  rsResourceURL,
const OUString &  rsFirstAnchorURL,
const css::uno::Sequence< OUString > &  rAnchorURLs 
)

Create a new resource id with an anchor that consists of a sequence of URLs that is extended by a further URL.

Parameters
rsResourceURLThe URL of the actual resource.
rsFirstAnchorURLThis URL extends the anchor given by rAnchorURLs.
rAnchorURLsAn anchor as it is returned by XResourceId::getAnchorURLs().

◆ ~ResourceId()

sd::framework::ResourceId::~ResourceId ( )
overridevirtual

Definition at line 95 of file ResourceId.cxx.

References mpURL.

Member Function Documentation

◆ clone()

Reference< XResourceId > SAL_CALL sd::framework::ResourceId::clone ( )
overridevirtual

Definition at line 344 of file ResourceId.cxx.

References maResourceURLs, and ResourceId().

◆ compareTo()

sal_Int16 SAL_CALL sd::framework::ResourceId::compareTo ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxResourceId)
overridevirtual

◆ CompareToExternalImplementation()

sal_Int16 sd::framework::ResourceId::CompareToExternalImplementation ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxId) const
private

Compare the called ResourceId object to the given XResourceId object reference.

The comparison is done via the UNO interface. Namely, it uses the getResourceURL() and the getAnchorURLs() methods to get access to the URLs of the given object.

Definition at line 263 of file ResourceId.cxx.

References maResourceURLs, and nIndex.

Referenced by compareTo().

◆ CompareToLocalImplementation()

sal_Int16 sd::framework::ResourceId::CompareToLocalImplementation ( const ResourceId rId) const
private

Compare the called ResourceId object to the given ResourceId object.

This uses the implementation of both objects to speed up the comparison.

Definition at line 221 of file ResourceId.cxx.

References maResourceURLs, and nIndex.

Referenced by compareTo().

◆ getAnchor()

Reference< XResourceId > SAL_CALL sd::framework::ResourceId::getAnchor ( )
overridevirtual

Definition at line 137 of file ResourceId.cxx.

References maResourceURLs, nIndex, and ResourceId().

◆ getAnchorURLs()

Sequence< OUString > SAL_CALL sd::framework::ResourceId::getAnchorURLs ( )
overridevirtual

Definition at line 151 of file ResourceId.cxx.

References maResourceURLs.

◆ getFullResourceURL()

util::URL SAL_CALL sd::framework::ResourceId::getFullResourceURL ( )
overridevirtual

Definition at line 110 of file ResourceId.cxx.

References aURL, maResourceURLs, mpURL, and mxURLTransformerWeak.

◆ getImplementationName()

OUString sd::framework::ResourceId::getImplementationName ( )
override

Definition at line 375 of file ResourceId.cxx.

◆ getResourceTypePrefix()

OUString SAL_CALL sd::framework::ResourceId::getResourceTypePrefix ( )
overridevirtual

Definition at line 165 of file ResourceId.cxx.

References maResourceURLs.

◆ getResourceURL()

OUString SAL_CALL sd::framework::ResourceId::getResourceURL ( )
overridevirtual

Definition at line 101 of file ResourceId.cxx.

References maResourceURLs.

◆ getSupportedServiceNames()

css::uno::Sequence< OUString > sd::framework::ResourceId::getSupportedServiceNames ( )
override

Definition at line 385 of file ResourceId.cxx.

◆ hasAnchor()

sal_Bool SAL_CALL sd::framework::ResourceId::hasAnchor ( )
overridevirtual

Definition at line 131 of file ResourceId.cxx.

References maResourceURLs.

◆ initialize()

void SAL_CALL sd::framework::ResourceId::initialize ( const css::uno::Sequence< css::uno::Any > &  aArguments)
override

Definition at line 351 of file ResourceId.cxx.

References aArguments, maResourceURLs, and ParseResourceURL().

◆ isBoundTo()

sal_Bool SAL_CALL sd::framework::ResourceId::isBoundTo ( const css::uno::Reference< css::drawing::framework::XResourceId > &  rxResourceId,
css::drawing::framework::AnchorBindingMode  eMode 
)
overridevirtual

Definition at line 309 of file ResourceId.cxx.

References eMode, IsBoundToAnchor(), and maResourceURLs.

◆ IsBoundToAnchor() [1/2]

bool sd::framework::ResourceId::IsBoundToAnchor ( const ::std::vector< OUString > &  rResourceURLs,
css::drawing::framework::AnchorBindingMode  eMode 
) const
private

Return whether the called ResourceId object is bound to the anchor consisting of the URLs in rResourceURLs.

Parameters
rResourceURLsA possibly empty list of anchor URLs.
eModeThis specifies whether the called resource has to be directly bound to the given anchor in order to return <TRUE> or whether it can be bound indirectly, too.

◆ IsBoundToAnchor() [2/2]

bool sd::framework::ResourceId::IsBoundToAnchor ( const OUString *  psFirstAnchorURL,
const css::uno::Sequence< OUString > *  paAnchorURLs,
css::drawing::framework::AnchorBindingMode  eMode 
) const
private

Return whether the called ResourceId object is bound to the anchor consisting of the URLs given by psFirstAnchorURL and paAnchorURLs.

Parameters
psFirstAnchorURLOptional first URL of the anchor. This can be missing or present independently of paAnchorURLs.
paAnchorURLsOptional set of additional anchor URLs. This can be missing or present independently of psFirstAnchorURL.
eModeThis specifies whether the called resource has to be directly bound to the given anchor in order to return <TRUE> or whether it can be bound indirectly, too.

Referenced by isBoundTo(), and isBoundToURL().

◆ isBoundToURL()

sal_Bool SAL_CALL sd::framework::ResourceId::isBoundToURL ( const OUString &  rsAnchorURL,
css::drawing::framework::AnchorBindingMode  eMode 
)
overridevirtual

Definition at line 336 of file ResourceId.cxx.

References eMode, and IsBoundToAnchor().

◆ ParseResourceURL()

void sd::framework::ResourceId::ParseResourceURL ( )
private

◆ supportsService()

sal_Bool sd::framework::ResourceId::supportsService ( OUString const &  ServiceName)
override

Definition at line 380 of file ResourceId.cxx.

References ServiceName, and cppu::supportsService().

Member Data Documentation

◆ maResourceURLs

std::vector<OUString> sd::framework::ResourceId::maResourceURLs
private

The set of URLs that consist of the resource URL at index 0 and the anchor URLs and indices 1 and above.

Definition at line 157 of file ResourceId.hxx.

Referenced by clone(), compareTo(), CompareToExternalImplementation(), CompareToLocalImplementation(), getAnchor(), getAnchorURLs(), getFullResourceURL(), getResourceTypePrefix(), getResourceURL(), hasAnchor(), initialize(), isBoundTo(), ParseResourceURL(), and ResourceId().

◆ mpURL

std::unique_ptr<css::util::URL> sd::framework::ResourceId::mpURL
private

Definition at line 159 of file ResourceId.hxx.

Referenced by getFullResourceURL(), ParseResourceURL(), and ~ResourceId().

◆ mxURLTransformerWeak

WeakReference< util::XURLTransformer > sd::framework::ResourceId::mxURLTransformerWeak
staticprivate

Definition at line 161 of file ResourceId.hxx.

Referenced by getFullResourceURL(), and ParseResourceURL().


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