Grantlee: Grantlee::TagLibraryInterface Class Reference

Grantlee 5.3.0

Public Member Functions | List of all members
Grantlee::TagLibraryInterface Class Reference

The TagLibraryInterface returns available tags and filters from libraries. More...

`#include <grantlee/taglibraryinterface.h>`

## Public Member Functions
virtual QHash< QString, Filter * > | filters (const QString &name={})
virtual QHash< QString, AbstractNodeFactory * > | nodeFactories (const QString &name={})

## Detailed Description

This interface must be implemented in tag and filter libraries.

The implementation will usually be very simple.

class MyTagLibrary : public QObject, public TagLibraryInterface
{
Q_OBJECT
Q_INTERFACES( Grantlee::TagLibraryInterface )
public:
MyTagLibrary( QObject *parent = {} )
: QObject( parent ) {
}
QHash<QString, AbstractNodeFactory*>
nodeFactories(const QString &name = {}) {
Q_UNUSED( name );
QHash<QString, AbstractNodeFactory*> nodeFactories;
nodeFactories.insert( "mytag1", new MyTag1() );
nodeFactories.insert( "mytag2", new MyTag2() );
return nodeFactories;
}
QHash<QString, Filter*> filters( const QString &name = {} ) {
Q_UNUSED( name );
QHash<QString, Filter*> filters;
filters.insert( "myfilter1", new MyFilter1() );
filters.insert( "myfilter2", new MyFilter2() );
return filters;
}
};
Grantlee::TagLibraryInterface
The TagLibraryInterface returns available tags and filters from libraries.
Definition: taglibraryinterface.h:80

Author
  Stephen Kelly steve.nosp@m.ire@.nosp@m.gmail.nosp@m..com

Definition at line 79 of file taglibraryinterface.h.

## Constructor & Destructor Documentation

## ◆ ~TagLibraryInterface()

virtual Grantlee::TagLibraryInterface::~TagLibraryInterface | ( |  | ) |
| inlinevirtual

Definition at line 82 of file taglibraryinterface.h.

## Member Function Documentation

## ◆ filters()

virtual QHash< QString, Filter * > Grantlee::TagLibraryInterface::filters | ( | const QString & | name = `{}` | ) |
| inlinevirtual

Returns the Filter implementations available in this library.

Definition at line 98 of file taglibraryinterface.h.

## ◆ nodeFactories()

virtual QHash< QString, AbstractNodeFactory * > Grantlee::TagLibraryInterface::nodeFactories | ( | const QString & | name = `{}` | ) |
| inlinevirtual

Returns the AbstractNodeFactory implementations available in this library.

Definition at line 88 of file taglibraryinterface.h.