[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions

KLFLibBrowser Class Reference

#include <klflibbrowser.h>

Inheritance diagram for KLFLibBrowser:
Inheritance graph
[legend]
Collaboration diagram for KLFLibBrowser:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ResourceRoleFlag {
  NoRoleFlag = 0x00000000, NoCloseRoleFlag = 0x00000001, HistoryRoleFlag = 0x00010000, ArchiveRoleFlag = 0x00020000,
  SpecialResourceRoleMask = 0x00ff0000, NoChangeFlag = 0x01000000, OpenNoRaise = 0x02000000, NowMask = 0xff000000
}

Public Slots

bool openResource (const QUrl &url, uint resourceRoleFlags=NoChangeFlag, const QString &viewTypeIdentifier=QString())
bool openResource (const QString &url, uint resourceRoleFlags=NoChangeFlag, const QString &viewTypeIdentifier=QString())
bool openResource (KLFLibResourceEngine *resource, uint resourceRoleFlags=NoChangeFlag, const QString &viewTypeIdentifier=QString())
bool openResourceFromGuiState (const QUrl &url, const QVariantMap &guiState)
bool closeResource (const QUrl &url)
void retranslateUi (bool alsoBaseUi=true)

Signals

void requestRestore (const KLFLibEntry &entry, uint restoreFlags)
void requestRestoreStyle (const KLFStyle &style)
void resourceTabChanged (const QUrl &currentUrl)
void libEntriesSelected (const KLFLibEntryList &entries)

Public Member Functions

 KLFLibBrowser (QWidget *parent=NULL)
virtual ~KLFLibBrowser ()
virtual bool eventFilter (QObject *object, QEvent *event)
QList< QUrlopenUrls () const
QUrl currentUrl ()
 Returns the URL of the current tab page.
int currentUrlIndex ()
 Returns the index of currentUrl() in openUrls()
KLFLibResourceEnginegetOpenResource (const QUrl &url)
KLFAbstractLibViewgetView (const QUrl &url)
KLFAbstractLibViewgetView (KLFLibResourceEngine *resource)
QVariantMap saveGuiState ()
void loadGuiState (const QVariantMap &state, bool openURLs=true)

Static Public Member Functions

static QString displayTitle (KLFLibResourceEngine *resource)

Protected Slots

void slotRestoreWithStyle ()
void slotRestoreLatexOnly ()
void slotDeleteSelected ()
void slotRefreshResourceActionsEnabled ()
void slotTabResourceShown (int tabIndex)
void slotShowTabContextMenu (const QPoint &pos)
void slotResourceRename ()
void slotResourceRenameSubResource ()
void slotResourceRename (bool renameSubResource)
void slotResourceRenameFinished ()
bool slotResourceClose (KLFLibBrowserViewContainer *view=NULL, bool force=false)
void slotResourceProperties ()
bool slotResourceNewSubRes ()
bool slotResourceDelSubRes ()
bool slotResourceOpen ()
bool slotResourceNew ()
bool slotResourceSaveTo ()
void slotResourceDataChanged (const QList< KLFLib::entryId > &entryIdList)
void slotResourcePropertyChanged (int propId)
void slotUpdateForResourceProperty (KLFLibResourceEngine *resource, int propId)
void slotSubResourcePropertyChanged (const QString &subResource, int propId)
void slotDefaultSubResourceChanged (const QString &subResource)
void slotEntriesSelected (const KLFLibEntryList &entries)
void slotAddCategorySuggestions (const QStringList &catlist)
void slotShowContextMenu (const QPoint &pos)
void slotMetaInfoChanged (const QMap< int, QVariant > &props)
void slotCopyToResource ()
void slotMoveToResource ()
void slotCopyMoveToResource (QObject *sender, bool move)
void slotCopyMoveToResource (KLFAbstractLibView *dest, KLFAbstractLibView *source, bool move)
void slotCut ()
void slotCopy ()
void slotPaste ()
void slotOpenAll ()
bool slotExport ()
bool slotExportSelection ()
void slotStartProgress (KLFProgressReporter *progressReporter, const QString &text)

Protected Member Functions

KLFLibBrowserViewContainerfindOpenUrl (const QUrl &url)
KLFLibBrowserViewContainerfindOpenResource (KLFLibResourceEngine *resource)
KLFLibBrowserViewContainercurView ()
KLFAbstractLibViewcurLibView ()
KLFLibBrowserViewContainerviewForTabIndex (int tab)
QList
< KLFLibBrowserViewContainer * > 
findByRoleFlags (uint flags, uint mask)
KLFLibBrowserViewContainerfindSpecialResource (uint specialResourceRoleFlag)
bool event (QEvent *event)
void showEvent (QShowEvent *event)
void timerEvent (QTimerEvent *event)

Detailed Description

Definition at line 44 of file klflibbrowser.h.


Member Enumeration Documentation

Enumerator:
NoRoleFlag 

This resource has nothing special.

NoCloseRoleFlag 

Resource 'Close' GUI button is disabled (grayed)

HistoryRoleFlag 

This resource is the History resource.

ArchiveRoleFlag 

This resource is the Archive resource.

SpecialResourceRoleMask 

Mask to extract the 'special resource' type (eg. history)

NoChangeFlag 

Instructs to not set new flags for already-open resources.

OpenNoRaise 

Instructs not to raise the tab during this call of openResource()

NowMask 

These flags are not stored, they act upon the openResource() call only.

Definition at line 51 of file klflibbrowser.h.


Constructor & Destructor Documentation

KLFLibBrowser::KLFLibBrowser ( QWidget parent = NULL)
KLFLibBrowser::~KLFLibBrowser ( ) [virtual]

Definition at line 175 of file klflibbrowser.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QList::size().


Member Function Documentation

bool KLFLibBrowser::closeResource ( const QUrl url) [slot]

Definition at line 631 of file klflibbrowser.cpp.

References findOpenUrl(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and slotResourceClose().

KLFAbstractLibView * KLFLibBrowser::curLibView ( ) [protected]
QUrl KLFLibBrowser::currentUrl ( )

Returns the URL of the current tab page.

Definition at line 228 of file klflibbrowser.cpp.

References currentUrlIndex(), and QList::size().

Referenced by saveGuiState().

int KLFLibBrowser::currentUrlIndex ( )

Returns the index of currentUrl() in openUrls()

Definition at line 220 of file klflibbrowser.cpp.

References curView(), and QList::indexOf().

Referenced by currentUrl().

KLFLibBrowserViewContainer * KLFLibBrowser::curView ( ) [protected]
QString KLFLibBrowser::displayTitle ( KLFLibResourceEngine resource) [static]
bool KLFLibBrowser::event ( QEvent event) [protected]

Reimplemented from QWidget.

Definition at line 1737 of file klflibbrowser.cpp.

References QEvent::accept(), QWidget::hide(), QKeyEvent::key(), and QEvent::type().

bool KLFLibBrowser::eventFilter ( QObject object,
QEvent event 
) [virtual]
QList< KLFLibBrowserViewContainer * > KLFLibBrowser::findByRoleFlags ( uint  flags,
uint  mask 
) [protected]

Definition at line 413 of file klflibbrowser.cpp.

References klfDbg, klfFmtCC, and QList::size().

KLFLibBrowserViewContainer * KLFLibBrowser::findOpenResource ( KLFLibResourceEngine resource) [protected]
KLFLibBrowserViewContainer * KLFLibBrowser::findOpenUrl ( const QUrl url) [protected]
KLFLibBrowserViewContainer* KLFLibBrowser::findSpecialResource ( uint  specialResourceRoleFlag) [inline, protected]

Definition at line 220 of file klflibbrowser.h.

References QList::isEmpty().

Referenced by slotMetaInfoChanged().

KLFLibResourceEngine * KLFLibBrowser::getOpenResource ( const QUrl url)

Returns the KLFLibResourceEngine that is managing the display of the currently open URL url. The url must currently be open.

Note:
Mind that KLFLibBrowser deletes the views and their corresponding engines upon destruction.

Definition at line 247 of file klflibbrowser.cpp.

References findOpenUrl(), and KLFLibBrowserViewContainer::resourceEngine().

Referenced by KLFMainWin::loadLibrary(), and slotExport().

KLFAbstractLibView * KLFLibBrowser::getView ( const QUrl url)

Returns the view that is used to display the resource with URL url.

Note:
the returned view belongs to this KLFLibBrowser object.

Definition at line 255 of file klflibbrowser.cpp.

References findOpenUrl(), and KLFLibBrowserViewContainer::view().

KLFAbstractLibView * KLFLibBrowser::getView ( KLFLibResourceEngine resource)

Returns the view that is used to display the resource resource.

Note:
the returned view belongs to this KLFLibBrowser object.

Definition at line 263 of file klflibbrowser.cpp.

References findOpenResource(), and KLFLibBrowserViewContainer::view().

void KLFLibBrowser::libEntriesSelected ( const KLFLibEntryList entries) [signal]

Referenced by slotEntriesSelected().

void KLFLibBrowser::loadGuiState ( const QVariantMap &  state,
bool  openURLs = true 
)
bool KLFLibBrowser::openResource ( const QString url,
uint  resourceRoleFlags = NoChangeFlag,
const QString viewTypeIdentifier = QString() 
) [slot]

Convenience function. Equivalent to

 openResource(QUrl(url), ...) 

Definition at line 429 of file klflibbrowser.cpp.

References KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, and openResource().

bool KLFLibBrowser::openResource ( KLFLibResourceEngine resource,
uint  resourceRoleFlags = NoChangeFlag,
const QString viewTypeIdentifier = QString() 
) [slot]

Overloaded member, provided for convenience.

Opens a previously (independently) open resource and displays it in the library.

Warning:
this library browser takes ownership of the resource and will delete it when done using it.

Definition at line 467 of file klflibbrowser.cpp.

References KLFLibResourceEngine::AllActionsData, QList::append(), KLFLibViewFactory::canCreateLibView(), KLFLibResourceEngine::canModifyData(), KLFLibResourceEngine::defaultSubResource(), KLFLibViewFactory::defaultViewTypeIdentifier(), displayTitle(), KLFLibResourceEngine::FeatureSubResourceProps, KLFLibResourceEngine::FeatureSubResources, KLFLibViewFactory::findFactoryFor(), findOpenResource(), KLF_ASSERT_NOT_NULL, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, klfDbgT, OpenNoRaise, openResource(), KLFLibBrowserViewContainer::openView(), requestRestore(), requestRestoreStyle(), QObject::setParent(), KLFLibResourceEngine::setViewType(), slotAddCategorySuggestions(), slotDefaultSubResourceChanged(), slotEntriesSelected(), slotResourceDataChanged(), slotResourcePropertyChanged(), slotShowContextMenu(), slotStartProgress(), slotSubResourcePropertyChanged(), KLFLibResourceEngine::subResourceProperty(), KLFLibResourceEngine::SubResPropViewType, KLFLibResourceEngine::suggestedViewTypeIdentifier(), KLFLibResourceEngine::supportedFeatureFlags(), QUrl::toString(), KLFLibResourceEngine::url(), KLFLibBrowserViewContainer::view(), KLFLibResourceEngine::viewType(), KLFAbstractLibView::wantMoreCategorySuggestions(), and KLFLibResourceEngine::WantUrlDefaultSubResource.

bool KLFLibBrowser::openResource ( const QUrl url,
uint  resourceRoleFlags = NoChangeFlag,
const QString viewTypeIdentifier = QString() 
) [slot]

If the url is not already open, opens the given URL. An appropriate factory needs to be installed supporting that scheme. Then an appropriate view is created using the view factories.

If the url is already open, then the appropriate tab is raised.

Resource flags are updated in both cases.

If an empty viewTypeIdentifier is given, the view type identifier suggested by the resource itself is taken. If the latter is empty, then the default view type identifier (KLFLibViewFactory::defaultViewTypeIdentifier) is considered.

Definition at line 436 of file klflibbrowser.cpp.

References KLFLibEngineFactory::findFactoryFor(), findOpenUrl(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, OpenNoRaise, KLFLibEngineFactory::openResource(), QUrl::scheme(), and QUrl::toString().

Referenced by KLFMainWin::loadLibrary(), KLFMainWin::openLibFile(), openResource(), openResourceFromGuiState(), slotOpenAll(), slotResourceNew(), slotResourceNewSubRes(), and slotResourceOpen().

bool KLFLibBrowser::openResourceFromGuiState ( const QUrl url,
const QVariantMap &  guiState 
) [slot]

[ADVANCED USAGE] Overloaded member, provided for conenience. This function should not be called directly normally, use it only if you want to play with the library browser's advanced functions. Use loadGuiState() to load saved GUI state instead.

[internal:] The guiState is exactly in the format that can be given to KLFLibBrowserViewContainer::loadGuiState().

Definition at line 614 of file klflibbrowser.cpp.

References findOpenUrl(), KLF_ASSERT_NOT_NULL, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibBrowserViewContainer::loadGuiState(), NoChangeFlag, and openResource().

Referenced by loadGuiState().

QList< QUrl > KLFLibBrowser::openUrls ( ) const

Definition at line 237 of file klflibbrowser.cpp.

References QList::size().

Referenced by saveGuiState().

void KLFLibBrowser::requestRestore ( const KLFLibEntry entry,
uint  restoreFlags 
) [signal]

Referenced by openResource().

void KLFLibBrowser::requestRestoreStyle ( const KLFStyle style) [signal]

Referenced by KLFLibBrowser(), and openResource().

void KLFLibBrowser::resourceTabChanged ( const QUrl currentUrl) [signal]

Referenced by slotTabResourceShown().

void KLFLibBrowser::retranslateUi ( bool  alsoBaseUi = true) [slot]

Definition at line 162 of file klflibbrowser.cpp.

Referenced by KLFLibBrowser().

QVariantMap KLFLibBrowser::saveGuiState ( )
void KLFLibBrowser::showEvent ( QShowEvent event) [protected]
void KLFLibBrowser::slotAddCategorySuggestions ( const QStringList catlist) [protected, slot]

Definition at line 1228 of file klflibbrowser.cpp.

References klfDbg.

Referenced by openResource().

void KLFLibBrowser::slotCopy ( ) [protected, slot]
void KLFLibBrowser::slotCopyMoveToResource ( QObject sender,
bool  move 
) [protected, slot]
void KLFLibBrowser::slotCopyMoveToResource ( KLFAbstractLibView dest,
KLFAbstractLibView source,
bool  move 
) [protected, slot]
void KLFLibBrowser::slotCopyToResource ( ) [protected, slot]
Note:
important data is defined in sender's custom properties (a QAction)

Definition at line 1394 of file klflibbrowser.cpp.

References slotCopyMoveToResource().

Referenced by slotShowContextMenu().

void KLFLibBrowser::slotCut ( ) [protected, slot]
void KLFLibBrowser::slotDefaultSubResourceChanged ( const QString subResource) [protected, slot]

sender is used to find resource engine emitter.

Definition at line 1096 of file klflibbrowser.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibResourceEngine::PropLocked, KLFLibResourceEngine::PropTitle, and slotUpdateForResourceProperty().

Referenced by openResource().

void KLFLibBrowser::slotDeleteSelected ( ) [protected, slot]
void KLFLibBrowser::slotEntriesSelected ( const KLFLibEntryList entries) [protected, slot]
bool KLFLibBrowser::slotExport ( ) [protected, slot]
bool KLFLibBrowser::slotExportSelection ( ) [protected, slot]
void KLFLibBrowser::slotMetaInfoChanged ( const QMap< int, QVariant > &  props) [protected, slot]
void KLFLibBrowser::slotMoveToResource ( ) [protected, slot]
Note:
important data is defined in sender's custom properties (a QAction)

Definition at line 1399 of file klflibbrowser.cpp.

References slotCopyMoveToResource().

Referenced by slotShowContextMenu().

void KLFLibBrowser::slotOpenAll ( ) [protected, slot]
void KLFLibBrowser::slotPaste ( ) [protected, slot]
void KLFLibBrowser::slotRefreshResourceActionsEnabled ( ) [protected, slot]
bool KLFLibBrowser::slotResourceClose ( KLFLibBrowserViewContainer view = NULL,
bool  force = false 
) [protected, slot]
void KLFLibBrowser::slotResourceDataChanged ( const QList< KLFLib::entryId > &  entryIdList) [protected, slot]
bool KLFLibBrowser::slotResourceDelSubRes ( ) [protected, slot]
bool KLFLibBrowser::slotResourceNew ( ) [protected, slot]
bool KLFLibBrowser::slotResourceNewSubRes ( ) [protected, slot]
bool KLFLibBrowser::slotResourceOpen ( ) [protected, slot]
void KLFLibBrowser::slotResourceProperties ( ) [protected, slot]
void KLFLibBrowser::slotResourcePropertyChanged ( int  propId) [protected, slot]

sender is used to find resource engine emitter.

Definition at line 1034 of file klflibbrowser.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and slotUpdateForResourceProperty().

Referenced by openResource().

void KLFLibBrowser::slotResourceRename ( bool  renameSubResource) [protected, slot]
void KLFLibBrowser::slotResourceRename ( ) [protected, slot]

Definition at line 752 of file klflibbrowser.cpp.

Referenced by KLFLibBrowser(), and slotResourceRenameSubResource().

void KLFLibBrowser::slotResourceRenameFinished ( ) [protected, slot]
void KLFLibBrowser::slotResourceRenameSubResource ( ) [protected, slot]

Definition at line 756 of file klflibbrowser.cpp.

References slotResourceRename().

Referenced by KLFLibBrowser().

bool KLFLibBrowser::slotResourceSaveTo ( ) [protected, slot]

Definition at line 1000 of file klflibbrowser.cpp.

Referenced by KLFLibBrowser().

void KLFLibBrowser::slotRestoreLatexOnly ( ) [protected, slot]
void KLFLibBrowser::slotRestoreWithStyle ( ) [protected, slot]
void KLFLibBrowser::slotShowContextMenu ( const QPoint pos) [protected, slot]
void KLFLibBrowser::slotShowTabContextMenu ( const QPoint pos) [protected, slot]

Definition at line 741 of file klflibbrowser.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and QMenu::popup().

Referenced by KLFLibBrowser().

void KLFLibBrowser::slotStartProgress ( KLFProgressReporter progressReporter,
const QString text 
) [protected, slot]
void KLFLibBrowser::slotSubResourcePropertyChanged ( const QString subResource,
int  propId 
) [protected, slot]

sender is used to find resource engine emitter.

Todo:
......... CHECK that subResource is our current sub-resource

Definition at line 1072 of file klflibbrowser.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibResourceEngine::PropLocked, KLFLibResourceEngine::PropTitle, slotUpdateForResourceProperty(), KLFLibResourceEngine::SubResPropLocked, and KLFLibResourceEngine::SubResPropTitle.

Referenced by openResource().

void KLFLibBrowser::slotTabResourceShown ( int  tabIndex) [protected, slot]
void KLFLibBrowser::slotUpdateForResourceProperty ( KLFLibResourceEngine resource,
int  propId 
) [protected, slot]
void KLFLibBrowser::timerEvent ( QTimerEvent event) [protected]

Definition at line 1750 of file klflibbrowser.cpp.

KLFLibBrowserViewContainer * KLFLibBrowser::viewForTabIndex ( int  tab) [protected]

Definition at line 409 of file klflibbrowser.cpp.


The documentation for this class was generated from the following files:

Generated by doxygen 1.7.3