Messagelib
pane.cpp
94 Pane::Pane(bool restoreSession, QAbstractItemModel *model, QItemSelectionModel *selectionModel, QWidget *parent)
103 const auto *proxyModel = qobject_cast<const QAbstractProxyModel *>(d->mSelectionModel->model());
111 const auto nextProxyModel = qobject_cast<const QAbstractProxyModel *>(proxyModel->sourceModel());
182 mXmlGuiClient->actionCollection()->setDefaultShortcut(action, QKeySequence(QStringLiteral("Alt+%1").arg(i)));
201 d->mXmlGuiClient->actionCollection()->setDefaultShortcut(showHideQuicksearch, Qt::CTRL | Qt::Key_H);
204 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("show_quick_search"), showHideQuicksearch);
222 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("view_message_list"), d->mActionMenu);
229 d->mXmlGuiClient->actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_O));
259 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("activate_next_tab"), d->mActivateNextTabAction);
262 d->mXmlGuiClient->actionCollection()->setDefaultShortcuts(d->mActivateNextTabAction, nextShortcut);
269 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("activate_previous_tab"), d->mActivatePreviousTabAction);
270 d->mXmlGuiClient->actionCollection()->setDefaultShortcuts(d->mActivatePreviousTabAction, prevShortcut);
281 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("move_tab_left"), d->mMoveTabLeftAction);
289 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("move_tab_right"), d->mMoveTabRightAction);
299 d->mXmlGuiClient->actionCollection()->addAction(QStringLiteral("close_current_tab"), d->mCloseTabAction);
323 return w->selectNextMessageItem(messageTypeFilter, existingSelectionBehaviour, centerItem, loop);
341 return w->selectPreviousMessageItem(messageTypeFilter, existingSelectionBehaviour, centerItem, loop);
347 bool Pane::focusNextMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
362 bool Pane::focusPreviousMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
390 bool Pane::selectFirstMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem)
539 mSelectionModel->select(mapSelectionFromSource(s->selection()), QItemSelectionModel::ClearAndSelect);
688 mSelectionModel->select(mapSelectionFromSource(s->selection()), QItemSelectionModel::ClearAndSelect);
721 QAction *lockTabAction = menu.addAction(w->isLocked() ? i18nc("@action:inmenu", "Unlock Tab") : i18nc("@action:inmenu", "Lock Tab"));
722 lockTabAction->setIcon(w->isLocked() ? QIcon::fromTheme(QStringLiteral("lock")) : QIcon::fromTheme(QStringLiteral("unlock")));
754 q->setTabIcon(indexBar, isLocked ? QIcon::fromTheme(QStringLiteral("lock")) : QIcon::fromTheme(QStringLiteral("unlock")));
762 MessageList::StorageModel *Pane::createStorageModel(QAbstractItemModel *model, QItemSelectionModel *selectionModel, QObject *parent)
799 void Pane::updateTabIconText(const Akonadi::Collection &collection, const QString &label, const QIcon &icon)
977 Akonadi::Item::List Pane::itemListFromPersistentSet(MessageList::Core::MessageItemSetReference ref)
994 void Pane::markMessageItemsAsAboutToBeRemoved(MessageList::Core::MessageItemSetReference ref, bool bMark)
1057 return w->getSelectionStats(selectedItems, selectedVisibleItems, allSelectedBelongToSameThread, includeCollapsedChildren);
1060 MessageList::Core::MessageItemSetReference Pane::selectionAsPersistentSet(bool includeCollapsedChildren) const
1144 const QStringList list = MessageList::MessageListSettings::self()->config()->groupList().filter(QRegularExpression(QStringLiteral("MessageListTab\\d+")));
1156 KConfigGroup grp(MessageList::MessageListSettings::self()->config(), QStringLiteral("MessageListTab%1").arg(elementTab));
1169 if (MessageList::MessageListSettings::self()->config()->hasGroup(QStringLiteral("MessageListPane"))) {
1189 KConfigGroup grp(MessageList::MessageListSettings::self()->config(), QStringLiteral("MessageListTab%1").arg(index));
void append(const T &value)
T & first()
const QList< QKeySequence > & tabPrev()
void markMessageItemsAsAboutToBeRemoved(MessageList::Core::MessageItemSetReference ref, bool bMark)
If bMark is true this function marks the messages as "about to be removed" so they appear dimmer and ...
Definition: pane.cpp:994
bool selectionEmpty() const
Fast function that determines if the selection is empty.
Definition: pane.cpp:1038
int indexOf(QWidget *w) const const
bool selectLastMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem)
Selects the last message item in the view that matches the specified Core::MessageTypeFilter.
Definition: pane.cpp:405
DisplayRole
MouseButtonPress
void focusQuickSearch(const QString &selectedText=QString())
Sets the focus on the quick search line of the currently active tab.
Definition: pane.cpp:472
QStringView right(qsizetype length) const const
QPoint mapFrom(const QWidget *parent, const QPoint &pos) const const
QVector< qlonglong > selectionAsMessageItemListId(bool includeCollapsedChildren=true) const
Returns the currently selected Items id(bound to current StorageModel).
Definition: pane.cpp:959
void reloadGlobalConfiguration()
Reloads global configuration and eventually reloads all the views.
Definition: pane.cpp:1089
const QItemSelection selection() const const
pos
const QAbstractItemModel * model() const const
KMime::Message::Ptr currentMessage() const
Returns the current message for the list as KMime::Message::Ptr.
Definition: pane.cpp:921
void messageSelected(const Akonadi::Item &item)
Emitted when a message is selected (that is, single clicked and thus made current in the view) Note t...
void customContextMenuRequested(const QPoint &pos)
MessageList::Core::MessageItemSetReference selectionAsPersistentSet(bool includeCollapsedChildren=true) const
Return a persistent set from current selection.
Definition: pane.cpp:1060
void setCurrentThreadExpanded(bool expand)
If expand is true then it expands the current thread, otherwise collapses it.
Definition: pane.cpp:433
void setTabText(int index, const QString &label)
void messageSelected(const Akonadi::Item &item)
Emitted when a message is selected (that is, single clicked and thus made current in the view) Note t...
void clicked(bool checked)
QIcon fromTheme(const QString &name)
void chop(int n)
int indexOf(const T &value, int from) const const
void selectFocusedMessageItem(bool centerItem)
Selects the currently focused message item.
Definition: pane.cpp:377
QObject * sender() const const
bool isThreaded() const
Returns true if the current Aggregation is threaded, false otherwise (or if there is no current Aggre...
Definition: pane.cpp:1029
CustomContextMenu
void setTabsClosable(bool closeable)
TopLeftCorner
void setMovable(bool movable)
int tabAt(const QPoint &position) const const
KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass)
MiddleButton
void selectionChanged()
Emitted when the selection in the view changes.
void setCornerWidget(QWidget *widget, Qt::Corner corner)
count
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual bool eventFilter(QObject *watched, QEvent *event)
MessageList::Core::MessageItemSetReference currentThreadAsPersistentSet() const
Return a persistent set from current thread.
Definition: pane.cpp:1069
void setIcon(const QIcon &icon)
Akonadi::Item::List itemListFromPersistentSet(MessageList::Core::MessageItemSetReference ref)
Return Akonadi::Item from messageItemReference.
Definition: pane.cpp:977
QStringList filter(QStringView str, Qt::CaseSensitivity cs) const const
QString i18n(const char *text, const TYPE &arg...)
void setCurrentFolder(const Akonadi::Collection &fld, const QModelIndex &etmIndex, bool preferEmptyTab=false, MessageList::Core::PreSelectionMode preSelectionMode=MessageList::Core::PreSelectLastSelected, const QString &overrideLabel=QString())
Sets the current folder to be displayed by this Pane.
Definition: pane.cpp:776
bool selectFirstMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem)
Selects the first message item in the view that matches the specified Core::MessageTypeFilter.
Definition: pane.cpp:390
const QList< QKeySequence > & tabNext()
QWidget * widget(int index) const const
void installEventFilter(QObject *filterObj)
bool isEmpty() const const
void currentChanged(int index)
The Akonadi specific implementation of the Core::StorageModel.
Definition: storagemodel.h:35
RightSide
void messageStatusChangeRequest(const Akonadi::Item &item, const Akonadi::MessageStatus &set, const Akonadi::MessageStatus &clear)
Emitted when a message wants its status to be changed.
bool isEmpty() const const
PreSelectionMode
Pre-selection is the action of automatically selecting a message just after the folder has finished l...
Definition: messagelist/src/core/enums.h:40
void setCurrentWidget(QWidget *widget)
Akonadi::Item::List currentThreadAsMessageList() const
Returns the Akonadi::Item bound to the current StorageModel that are part of the current thread.
Definition: pane.cpp:968
Key_H
KSharedConfigPtr config()
bool selectPreviousMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, MessageList::Core::ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop)
Selects the previous message item in the view.
Definition: pane.cpp:329
QWidget * currentWidget() const const
void setEnabled(bool)
void setXmlGuiClient(KXMLGUIClient *xmlGuiClient)
Sets the XML GUI client which the pane is used in.
Definition: pane.cpp:196
QItemSelectionModel * currentItemSelectionModel()
Returns the QItemSelectionModel for the currently displayed tab.
Definition: pane.cpp:1094
bool isRightToLeft()
void setAllGroupsExpanded(bool expand)
If expand is true then it expands all the groups (only the toplevel group item: inner threads are NOT...
Definition: pane.cpp:459
QString currentFilterSearchString() const
Returns the search term in the current quicksearch field.
Definition: pane.cpp:1020
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void populateStatusFilterCombo()
This is called to setup the status filter's QComboBox.
Definition: widgetbase.cpp:212
QString label(StandardShortcut id)
void setAllThreadsExpanded(bool expand)
If expand is true then it expands all the threads, otherwise collapses them.
Definition: pane.cpp:446
void statusMessage(const QString &message)
Notify the outside when updating the status bar with a message could be useful.
QTabBar * tabBar() const const
bool selectNextMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, MessageList::Core::ExistingSelectionBehaviour existingSelectionBehaviour, bool centerItem, bool loop)
Selects the next message item in the view.
Definition: pane.cpp:311
void triggered(bool checked)
void messageActivated(const Akonadi::Item &item)
Emitted when a message is doubleclicked or activated by other input means.
void statusMessage(const QString &message)
Notify the outside when updating the status bar with a message could be useful.
QModelIndexList selectedRows(int column) const const
QString fromLatin1(const char *str, int size)
void messageActivated(const Akonadi::Item &item)
Emitted when a message is doubleclicked or activated by other input means.
QItemSelectionModel * createNewTab()
Add a new tab to the Pane and select it.
Definition: pane.cpp:811
int addTab(QWidget *page, const QString &label)
bool focusNextMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
Focuses the next message item in the view without actually selecting it.
Definition: pane.cpp:347
void selectionChanged()
Emitted when the selection in the view changes.
currentIndex
CTRL
ExistingSelectionBehaviour
This enum is used in the view message selection functions (for instance View::selectNextMessage())
Definition: messagelist/src/core/enums.h:59
QVector< KMime::Message::Ptr > selectionAsMessageList(bool includeCollapsedChildren=true) const
Returns the currently selected KMime::Message::Ptr (bound to current StorageModel).
Definition: pane.cpp:932
bool getSelectionStats(Akonadi::Item::List &selectedItems, Akonadi::Item::List &selectedVisibleItems, bool *allSelectedBelongToSameThread, bool includeCollapsedChildren=true) const
Fills the lists of the selected message serial numbers and of the selected+visible ones.
Definition: pane.cpp:1047
QString i18nc(const char *context, const char *text, const TYPE &arg...)
void setDocumentMode(bool set)
bool focusPreviousMessageItem(MessageList::Core::MessageTypeFilter messageTypeFilter, bool centerItem, bool loop)
Focuses the previous message item in the view without actually selecting it.
Definition: pane.cpp:362
void messageStatusChangeRequest(const Akonadi::Item &item, const Akonadi::MessageStatus &set, const Akonadi::MessageStatus &clear)
Emitted when a message wants its status to be changed.
void setTabIcon(int index, const QIcon &icon)
QChar * data()
MessageTypeFilter
This enum is used in the view message selection functions (for instance View::nextMessageItem()).
Definition: messagelist/src/core/enums.h:51
QVector< Akonadi::MessageStatus > currentFilterStatus() const
Returns the Akonadi::MessageStatus in the current quicksearch field.
Definition: pane.cpp:1002
QString asprintf(const char *cformat,...)
virtual void clear()
void setFocus()
Akonadi::Item::List selectionAsMessageItemList(bool includeCollapsedChildren=true) const
Returns the currently selected Items (bound to current StorageModel).
Definition: pane.cpp:941
qint64 Id
QObject * parent() const const
const QAbstractItemModel * model() const const
void deletePersistentSet(MessageList::Core::MessageItemSetReference ref)
Deletes the persistent set pointed by the specified reference.
Definition: pane.cpp:986
Akonadi::Item currentItem() const
Returns the current message for the list as Akonadi::Item.
Definition: pane.cpp:910
void tabCloseRequested(int index)
virtual bool event(QEvent *ev) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:01:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:01:57 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.