/usr/include/KF5/mailcommon/snippetsmanager.h is in libkf5mailcommon-dev 4:16.04.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | /*
Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
Author Tobias Koenig <tokoe@kdab.com>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef MAILCOMMON_SNIPPETSMANAGER_H
#define MAILCOMMON_SNIPPETSMANAGER_H
#include "mailcommon_export.h"
#include <QObject>
class KActionCollection;
class QAbstractItemModel;
class QAction;
class QItemSelectionModel;
namespace MailCommon
{
class MAILCOMMON_EXPORT SnippetsManager : public QObject
{
Q_OBJECT
Q_PROPERTY(QAbstractItemModel *model READ model)
Q_PROPERTY(QItemSelectionModel *selectionModel READ selectionModel)
Q_PROPERTY(QAction *addSnippetAction READ addSnippetAction)
Q_PROPERTY(QAction *editSnippetAction READ editSnippetAction)
Q_PROPERTY(QAction *deleteSnippetAction READ deleteSnippetAction)
Q_PROPERTY(QAction *addSnippetGroupAction READ addSnippetGroupAction)
Q_PROPERTY(QAction *editSnippetGroupAction READ editSnippetGroupAction)
Q_PROPERTY(QAction *deleteSnippetGroupAction READ deleteSnippetGroupAction)
Q_PROPERTY(QAction *insertSnippetAction READ insertSnippetAction)
Q_PROPERTY(bool snippetGroupSelected READ snippetGroupSelected)
Q_PROPERTY(QString selectedName READ selectedName)
public:
/**
* Creates a new snippets manager.
*
* @param actionCollection The action collection where the manager will
* register the snippet shortcuts at.
* @param parent The parent object.
*/
explicit SnippetsManager(KActionCollection *actionCollection,
QObject *parent = Q_NULLPTR, QWidget *widget = Q_NULLPTR);
/**
* Destroys the snippets manager.
*/
~SnippetsManager();
/**
* Sets the editor object the snippet manager will act on.
*
* @param editor The editor object
* @param insertSnippetMethod The name of the method will be executed to
* insert a snippet into the editor. This method
* must provide a single QString parameter.
* @param dropSignal The signature of the signal that is emitted by the editor
* object when a snippet has been dropped on it.
*
* Example usage:
*
* @code
*
* KMComposerEditor *editor = ...
*
* snippetsManager->setEditor( editor, "insertPlainText", SIGNAL( insertSnippet() ) );
*
* @endcode
*/
void setEditor(QObject *editor, const char *insertSnippetMethod, const char *dropSignal);
/**
* Returns the model that represents the snippets.
*/
QAbstractItemModel *model() const;
/**
* Returns the selection model that is used by the manager to select the
* snippet or snippet group to work on.
*/
QItemSelectionModel *selectionModel() const;
/**
* Returns the action that handles adding new snippets.
*/
QAction *addSnippetAction() const;
/**
* Returns the action that handles editing the currently selected snippet.
*/
QAction *editSnippetAction() const;
/**
* Returns the action that handles deleting the currently selected snippet.
*/
QAction *deleteSnippetAction() const;
/**
* Returns the action that handles adding new snippet groups.
*/
QAction *addSnippetGroupAction() const;
/**
* Returns the action that handles editing the currently selected snippet group.
*/
QAction *editSnippetGroupAction() const;
/**
* Returns the action that handles deleting the currently selected snippet group.
*/
QAction *deleteSnippetGroupAction() const;
/**
* Returns the action that handles inserting a snippet into the editor.
*/
QAction *insertSnippetAction() const;
/**
* Returns whether the currently selected item is a snippet group.
*/
bool snippetGroupSelected() const;
/**
* Returns the name of the currently selected snippet or snippet group.
*/
QString selectedName() const;
private:
//@cond PRIVATE
class Private;
Private *const d;
Q_PRIVATE_SLOT(d, void selectionChanged())
Q_PRIVATE_SLOT(d, void addSnippet())
Q_PRIVATE_SLOT(d, void editSnippet())
Q_PRIVATE_SLOT(d, void deleteSnippet())
Q_PRIVATE_SLOT(d, void addSnippetGroup())
Q_PRIVATE_SLOT(d, void editSnippetGroup())
Q_PRIVATE_SLOT(d, void deleteSnippetGroup())
Q_PRIVATE_SLOT(d, void insertSelectedSnippet())
Q_PRIVATE_SLOT(d, void insertActionSnippet())
Q_PRIVATE_SLOT(d, void dndDone())
Q_PRIVATE_SLOT(d, void slotAddNewDndSnippset(QString))
//@endcond
};
}
#endif
|