A view widget to display a library resource's contents. More...
#include <klflibview.h>
Public Slots | |
virtual void | updateResourceEngine ()=0 |
virtual void | updateResourceProp (int propId)=0 |
virtual void | updateResourceData (const QString &subres, int modifyType, const QList< KLFLib::entryId > &entryIdList)=0 |
virtual void | updateResourceDefaultSubResourceChanged (const QString &newSubResource) |
virtual bool | selectEntries (const QList< KLFLib::entryId > &idList)=0 |
virtual void | restore (uint restoreFlags=KLFLib::RestoreLatexAndStyle)=0 |
virtual void | restoreWithStyle () |
virtual void | restoreLatexOnly () |
virtual void | wantMoreCategorySuggestions () |
Signals | |
void | requestRestore (const KLFLibEntry &entry, uint restoreflags=KLFLib::RestoreLatexAndStyle) |
void | requestRestoreStyle (const KLFStyle &style) |
void | resourceDataChanged (const QList< KLFLib::entryId > &entryIdList) |
void | entriesSelected (const KLFLibEntryList &entries) |
void | moreCategorySuggestions (const QStringList &categorylist) |
void | operationStartReportingProgress (KLFProgressReporter *progressReporter, const QString &descriptiveText) |
A view widget to display a library resource's contents.
A base API for a widget that will display a KLFLibResourceEngine's contents. For example one could create a QTreeView and display the contents in there (that's what KLFLibDefaultView does...).
Note: The operationStartReportingProgress() signal is purposed for when long update operations are necessary. It is to be used by subclasses exactly like in KLFLibResourceEngine.
If the reimplementation of this view can be searched with a KLFSearchBar, reimplement searchable() to return a KLFSearchable object for this view.
Definition at line 82 of file klflibview.h.
KLFAbstractLibView::KLFAbstractLibView | ( | QWidget * | parent | ) |
Definition at line 171 of file klflibview.cpp.
|
inlinevirtual |
Definition at line 87 of file klflibview.h.
Subclasses may add items to the context menu by returning them in this function.
pos | is the position relative to widget where the menu was requested. |
The default implementation returns an empty list.
Reimplemented in KLFLibDefaultView.
Definition at line 200 of file klflibview.cpp.
Referenced by KLFLibBrowser::slotShowContextMenu().
|
pure virtual |
Compare this resource view's URL to another URL.
Compares the URL of the resource we are viewing with the URL other
, and returns an OR-ed combination of enum KlfUrlCompareFlag values of URL-comparision tests that have turned out to be true (see KlfUrlCompareFlag for a list of tests).
This function is supposed to answer to the following questions, each a condition as whether to return a URL comparation flag or not:
KlfUrlCompareEqual:
does this view show the same information as a view whose URL would be other
?KlfUrlCompareLessSpecific:
does this view show MORE information than the other
view ("less specific information" <=> "shows more") ?KLFUrlCompareMoreSpecific:
does this view show LESS information than the other
view ?KLFUrlComapreBaseEqual:
does this view show the same resource as the other
view, but possibly does not the same specific information, eg. not the same sub-resource.The interestFlags
is a binary OR'ed value of KlfUrlCompareFlag values of tests to be performed. Any flag that is set in interestFlags
indicates that the return value of this function, when binary-AND'ed with that flag, is the result (T or F) of the test the flag stands for. However, if a flag is not set in interestFlags
, its state in the return value by this function is undefined.
See also klfUrlCompare().
Implemented in KLFLibDefaultView.
|
signal |
Emitted when the selection has changed, eg. user selected or deselected some entries.
Referenced by KLFLibDefaultView::slotSelectAll(), and KLFLibDefaultView::slotViewSelectionChanged().
|
pure virtual |
Subclasses should reimplement this function to return a list of all known categories to suggest to the user, eg. in a completion list for an editable combo box to edit categories.
Implemented in KLFLibDefaultView.
Referenced by wantMoreCategorySuggestions().
|
signal |
Subclasses should emit this signal with lists of categories they come accross, so that the editor can suggest these as completions upon editing category
Referenced by wantMoreCategorySuggestions().
|
signal |
Emitted by subclasses to announce the beginning of a long operation during which progress will be reported through the given progressReporter
.
Should be used in the same way as KLFLibResourceEngine::operationStartReportingProgress().
Referenced by KLFLibDefaultView::updateResourceEngine().
|
signal |
Is emitted (by subclasses) when a latex entry is selected to be restored (eg. the entry was double-clicked).
entry | is the data to restore |
restoreflags | provides information on which part of entry to restore. See the possible flags in KLFLib::RestoreMode. |
Referenced by KLFLibDefaultView::restore(), and KLFLibDefaultView::slotEntryDoubleClicked().
|
signal |
Is emitted (by subclasses) when the view wants the main application (or the framework that uses this class) to restore the given style style
. No latex is to be restored.
|
signal |
Subclasses must emit this signal AFTER they have refreshed.
Referenced by KLFLibDefaultView::slotResourceDataChanged().
|
inlinevirtual |
Definition at line 89 of file klflibview.h.
Referenced by KLFLibDefaultView::compareUrlTo(), KLFLibDefaultView::showColumns(), KLFLibBrowser::slotCopyMoveToResource(), KLFLibBrowser::slotCut(), KLFLibBrowser::slotDeleteSelected(), KLFLibBrowser::slotEntriesSelected(), KLFLibBrowser::slotMetaInfoChanged(), KLFLibBrowser::slotPaste(), KLFLibBrowser::slotResourceNewSubRes(), KLFLibBrowser::slotShowContextMenu(), KLFLibDefaultView::sortBy(), KLFLibDefaultView::updateResourceData(), KLFLibDefaultView::updateResourceEngine(), and KLFLibDefaultView::updateResourceProp().
|
pure virtualslot |
Collects the necessary information and emits requestRestore()
|
pure virtual |
Restores the state described in state
(which was previously, possibly in another session, returned by saveGuiState())
Implemented in KLFLibDefaultView.
Referenced by KLFLibBrowserViewContainer::loadGuiState(), and KLFLibBrowserViewContainer::openView().
|
inlinevirtualslot |
Provides a reasonable default implementation that should suit for most purposes.
Definition at line 245 of file klflibview.h.
References KLFLib::RestoreLatex.
Referenced by KLFLibBrowser::slotRestoreLatexOnly().
|
inlinevirtualslot |
Provides a reasonable default implementation that should suit for most purposes.
Definition at line 243 of file klflibview.h.
References KLFLib::RestoreLatexAndStyle.
Referenced by KLFLibBrowser::slotRestoreWithStyle().
|
pure virtual |
Saves the current GUI state (eg. column widths and order, etc.)
Implemented in KLFLibDefaultView.
Referenced by KLFLibBrowserViewContainer::saveGuiState().
|
inlinevirtual |
Reimplemented in KLFLibDefaultView.
Definition at line 167 of file klflibview.h.
References propId, KLFLib::RestoreLatexAndStyle, and style.
Referenced by KLFLibBrowserViewContainer::slotCurrentChanged().
|
pure virtual |
Subclasses should return a list of entries that have been selected by the user.
Implemented in KLFLibDefaultView.
Referenced by KLFLibBrowser::slotCopy(), KLFLibBrowser::slotCopyMoveToResource(), KLFLibBrowserViewContainer::slotCurrentChanged(), KLFLibBrowser::slotCut(), KLFLibBrowser::slotExportSelection(), KLFLibBrowser::slotMetaInfoChanged(), KLFLibBrowser::slotResourceDataChanged(), KLFLibBrowser::slotShowContextMenu(), KLFLibBrowser::slotTabResourceShown(), and KLFLibBrowser::slotUpdateForResourceProperty().
|
pure virtual |
Subclasses should return a list of resource-entry-IDs that have been selected by the user.
Implemented in KLFLibDefaultView.
Referenced by KLFLibBrowser::slotCopyMoveToResource(), KLFLibBrowser::slotCut(), KLFLibBrowser::slotDeleteSelected(), and KLFLibBrowser::slotMetaInfoChanged().
|
pure virtualslot |
Subclasses should reimplement to update the given property to the given value on all library entries that are selected by the user. (They have to actually perform the change in the resource, eg with KLFLibResourceEngine::changeEntries()).
Referenced by KLFLibBrowser::slotMetaInfoChanged().
|
virtual |
Definition at line 176 of file klflibview.cpp.
References updateResourceData(), updateResourceDefaultSubResourceChanged(), updateResourceEngine(), and updateResourceProp().
Referenced by KLFLibDefaultViewFactory::createLibView().
|
pure virtualslot |
Implemented in KLFLibDefaultView.
Referenced by setResourceEngine().
|
virtualslot |
Default implementation calls updateResourceEngine()
Definition at line 190 of file klflibview.cpp.
References updateResourceEngine().
Referenced by setResourceEngine().
|
pure virtualslot |
Implemented in KLFLibDefaultView.
Referenced by setResourceEngine(), and updateResourceDefaultSubResourceChanged().
|
pure virtualslot |
Implemented in KLFLibDefaultView.
Referenced by setResourceEngine().
|
pure virtual |
Display Resource URL. NOT exactly like KLFLibResourceEngine::url() !
Returns an URL describing exactly what is shown to user, based on the resource engine's URL.
resourceEngine()->url()
. It returns in the URL exactly the information that is displayed to user. For example, a view that can handle displaying all sub-resources will NOT include the default sub-resource in its URL, however a view displaying only the default sub-resource will include a "klfDefaultSubResource" query item to distinguish it from another view acting on the same base URL but displaying a different sub-resource. Implemented in KLFLibDefaultView.
Referenced by KLFLibBrowser::slotCopy(), KLFLibBrowser::slotShowContextMenu(), and KLFLibBrowserViewContainer::url().
|
inline |
Returns TRUE if a non-NULL
resource engine has been set.
Definition at line 134 of file klflibview.h.
|
virtualslot |
Called by the owner of the view. This function fetches category suggestions (by calling the virtual getCategorySuggestions() reimplemented by subclasses) and emits the signal moreCategorySuggestions().
Subclasses need not reimplement this function.
Definition at line 195 of file klflibview.cpp.
References getCategorySuggestions(), and moreCategorySuggestions().
Referenced by KLFLibBrowser::openResource(), and KLFLibDefaultView::updateResourceEngine().