MailCommon::SnippetsManager Class

class MailCommon::SnippetsManager

The SnippetsManager class. More...

Header: #include <MailCommon/SnippetsManager>
CMake: find_package(KPim6MailCommon REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MailCommon)
Inherits: QObject

Public Functions

SnippetsManager(KActionCollection *actionCollection, QObject *parent = nullptr, QWidget *widget = nullptr)
virtual ~SnippetsManager() override
QAction *addSnippetAction() const
QAction *addSnippetGroupAction() const
QAction *deleteSnippetAction() const
QAction *deleteSnippetGroupAction() const
QAction *editSnippetAction() const
QAction *editSnippetGroupAction() const
QAction *insertSnippetAction() const
QAbstractItemModel *model() const
QString selectedName() const
QItemSelectionModel *selectionModel() const
bool snippetGroupSelected() const

Signals

void insertSnippet()
void insertSnippetInfo(const MailCommon::SnippetInfo &info)

Detailed Description

Author: Laurent Montel <montel@kde.org>

Member Function Documentation

[explicit] SnippetsManager::SnippetsManager(KActionCollection *actionCollection, QObject *parent = nullptr, QWidget *widget = nullptr)

Creates a new snippets manager.

actionCollection The action collection where the manager will register the snippet shortcuts at. parent The parent object. widget The widget.

[override virtual noexcept] SnippetsManager::~SnippetsManager()

Destroys the snippets manager.

QAction *SnippetsManager::addSnippetAction() const

Returns the action that handles adding new snippets.

QAction *SnippetsManager::addSnippetGroupAction() const

Returns the action that handles adding new snippet groups.

QAction *SnippetsManager::deleteSnippetAction() const

Returns the action that handles deleting the currently selected snippet.

QAction *SnippetsManager::deleteSnippetGroupAction() const

Returns the action that handles deleting the currently selected snippet group.

QAction *SnippetsManager::editSnippetAction() const

Returns the action that handles editing the currently selected snippet.

QAction *SnippetsManager::editSnippetGroupAction() const

Returns the action that handles editing the currently selected snippet group.

[signal] void SnippetsManager::insertSnippet()

Emitted when a snippet is requested to be inserted into the editor.

QAction *SnippetsManager::insertSnippetAction() const

Returns the action that handles inserting a snippet into the editor.

[signal] void SnippetsManager::insertSnippetInfo(const MailCommon::SnippetInfo &info)

Emitted when a specific snippet should be inserted with all its details.

info The snippet information to insert

QAbstractItemModel *SnippetsManager::model() const

Returns the model that represents the snippets.

QString SnippetsManager::selectedName() const

Returns the name of the currently selected snippet or snippet group.

QItemSelectionModel *SnippetsManager::selectionModel() const

Returns the selection model that is used by the manager to select the snippet or snippet group to work on.

bool SnippetsManager::snippetGroupSelected() const

Returns whether the currently selected item is a snippet group.