Albert
Loading...
Searching...
No Matches
albert Namespace Reference

Classes

class  Action
 Action used by result items (Item). More...
 
class  BackgroundExecutor
 Provides a lean interface for recurring indexing tasks. More...
 
class  Dependency
 Base class for StrongDependency and WeakDependency. More...
 
class  Extension
 Abstract extension class. More...
 
class  ExtensionPlugin
 Convenience base class for extension plugins. More...
 
class  ExtensionRegistry
 The common extension pool. More...
 
class  ExtensionWatcher
 Non-QObject extension registry observer. More...
 
class  FallbackHandler
 Abstract fallback provider. More...
 
class  Frontend
 The interface for albert frontends. More...
 
class  GlobalQueryHandler
 Abstract global query handler. More...
 
class  IndexItem
 An item utlized by ItemIndex. More...
 
class  IndexQueryHandler
 Index query handler class. More...
 
class  InputHistory
 Input history class. More...
 
class  Item
 Result items displayed in the query results list. More...
 
class  Match
 The Match class. More...
 
class  Matcher
 The Matcher class. More...
 
class  Notification
 The notification class. More...
 
class  PluginInstance
 Abstract plugin instance class. More...
 
class  PluginLoader
 Plugin loader interface class. More...
 
class  PluginMetaData
 Common plugin metadata of plugins. More...
 
class  PluginProvider
 Plugin provider interface class. More...
 
class  Query
 Common query object. More...
 
class  RankItem
 Scored item Used to rank item results of mutliple handlers. More...
 
class  StandardItem
 General purpose value type Item implememtation. More...
 
class  StrongDependency
 Convenience holder class for plugin hard dependencies. More...
 
class  TriggerQueryHandler
 Abstract trigger query handler. More...
 
class  WeakDependency
 Convenience holder class for plugin soft dependencies. More...
 

Enumerations

enum class  ItemRoles {
  TextRole = Qt::DisplayRole , SubTextRole = Qt::UserRole , InputActionRole , IconUrlsRole ,
  ActionsListRole
}
 Convention on the item roles passed around. More...
 

Functions

QPixmap pixmapFromUrl (const QString &url, const QSize &requestedSize)
 URL based icon factory.
 
QPixmap pixmapFromUrls (const QStringList &urls, const QSize &requestedSize)
 URL list based icon factory.
 
QIcon iconFromUrl (const QString &url)
 URL based icon factory.
 
QIcon iconFromUrls (const QStringList &urls)
 URL list based icon factory.
 
QPixmap genericPixmap (int size, const QColor &bgcolor={}, const QColor &fgcolor=Qt::black, const QString &text={}, float scalar=1.)
 Generic pixmap factory.
 
QIcon genericIcon (int size, const QColor &bgcolor={}, const QColor &fgcolor=Qt::black, const QString &text={}, float scalar=1.)
 Generic icon factory.
 
QIcon fileIcon (const QString &path)
 Create an icon for a file using QFileIconProvider.
 
QNetworkAccessManager * network ()
 The global QNetworkAccessManager.
 
void showSettings (QString plugin_id={})
 Open/Show the settings window (of plugin).
 
QString configLocation ()
 The app config location.
 
QString cacheLocation ()
 The app cache location.
 
QString dataLocation ()
 The app data location.
 
std::unique_ptr< QSettings > settings ()
 Persistent app settings storage.
 
std::unique_ptr< QSettings > state ()
 The persistent app state storage.
 
void openWebsite ()
 Open the albert website in default browser.
 
void openUrl (const QUrl &url)
 Open the specified url in default browser.
 
void openUrl (const QString &url)
 Open the specified url in default browser.
 
void setClipboardText (const QString &text)
 Set the system clipboard.
 
bool havePasteSupport ()
 Check paste support of the platform.
 
void setClipboardTextAndPaste (const QString &text)
 Set the system clipboard and paste the content to the front-most window.
 
long long runDetachedProcess (const QStringList &commandline, const QString &working_dir={})
 Run a detached process.
 

Enumeration Type Documentation

◆ ItemRoles

enum class albert::ItemRoles
strong

Convention on the item roles passed around.

Enumerator
TextRole 

QString, The text.

SubTextRole 

QString, The subtext.

InputActionRole 

QString, The tab action text.

IconUrlsRole 

QStringList, Urls for icon lookup.

ActionsListRole 

QStringList, List of action names.

Function Documentation

◆ cacheLocation()

QString albert::cacheLocation ( )

The app cache location.

The path to the directory where cache files should be stored.

Returns
The app cache location.

◆ configLocation()

QString albert::configLocation ( )

The app config location.

The path to the directory where configuration files should be stored.

Returns
The app config location.

◆ dataLocation()

QString albert::dataLocation ( )

The app data location.

The path to the directory where data files should be stored.

Returns
The app data location.

◆ fileIcon()

QIcon albert::fileIcon ( const QString &  path)

Create an icon for a file using QFileIconProvider.

Parameters
pathThe path to the file.
Returns
The file icon.

◆ genericIcon()

QIcon albert::genericIcon ( int  size,
const QColor &  bgcolor = {},
const QColor &  fgcolor = Qt::black,
const QString &  text = {},
float  scalar = 1. 
)

Generic icon factory.

Supports drawing a background circle with some text on it.

Parameters
bgcolorThe background color. Default: none.
fgcolorThe text color. Default: black.
textThe text to display. Default: empty.
scalarScalar for the default font size which is the pixmap height. Default: 1.
Returns
The generic pixmap.

◆ genericPixmap()

QPixmap albert::genericPixmap ( int  size,
const QColor &  bgcolor = {},
const QColor &  fgcolor = Qt::black,
const QString &  text = {},
float  scalar = 1. 
)

Generic pixmap factory.

Supports drawing a background circle with some text on it.

Parameters
bgcolorThe background color. Default: none.
fgcolorThe text color. Default: black.
textThe text to display. Default: empty.
scalarScalar for the default font size which is the pixmap height. Default: 1.
Returns
The generic icon.

◆ havePasteSupport()

bool albert::havePasteSupport ( )

Check paste support of the platform.

Returns
True if requirements for setClipboardTextAndPaste(…) are met.
Since
0.24

◆ iconFromUrl()

QIcon albert::iconFromUrl ( const QString &  url)

URL based icon factory.

Parameters
urlThe icon URL.
Returns
The icon, if available, null icon otherwise.

◆ iconFromUrls()

QIcon albert::iconFromUrls ( const QStringList &  urls)

URL list based icon factory.

See iconFromUrl(const QString &url).

Parameters
urlsThe icon URLs.
Returns
The first icon available in the urls list. Null icon otherwise.

◆ network()

QNetworkAccessManager * albert::network ( )

The global QNetworkAccessManager.

Returns
The global QNetworkAccessManager.

◆ openUrl() [1/2]

void albert::openUrl ( const QString &  url)

Open the specified url in default browser.

Parameters
urlThe url to open

◆ openUrl() [2/2]

void albert::openUrl ( const QUrl &  url)

Open the specified url in default browser.

Parameters
urlThe url to open

◆ openWebsite()

void albert::openWebsite ( )

Open the albert website in default browser.

◆ pixmapFromUrl()

QPixmap albert::pixmapFromUrl ( const QString &  url,
const QSize &  requestedSize 
)

URL based icon factory.

Supported URL schemes:

Examples

/absolute/path/to/a/local/image/file.png
file:/absolute/path/to/a/local/image/file.png
:path-to-a-qresource-file
qrc:path-to-a-qresource-file
qfip:/path/to/any/file/for/example/a.pdf
qsp:SP_TrashIcon
xdg:some-themed-icon-name
gen:?background=blue&foreground=red&text=Hi&fontscalar=0.5
Parameters
urlThe icon URL.
requestedSizeThe size the pixmap should have if possible.
Returns
The pixmap, if available, null pixmap otherwise. The size can be smaller than requestedSize, but is never larger.

◆ pixmapFromUrls()

QPixmap albert::pixmapFromUrls ( const QStringList &  urls,
const QSize &  requestedSize 
)

URL list based icon factory.

See pixmapFromUrl(const QString &url, QSize *size, const QSize &requestedSize).

Parameters
urlsThe icon URLs.
requestedSizeThe size the pixmap should have if possible.
Returns
The first pixmap available in the urls list. Null pixmap otherwise.

◆ runDetachedProcess()

long long albert::runDetachedProcess ( const QStringList &  commandline,
const QString &  working_dir = {} 
)

Run a detached process.

Parameters
commandlineThe command line to run
working_dirThe working directory
Returns
The process id

◆ setClipboardText()

void albert::setClipboardText ( const QString &  text)

Set the system clipboard.

Parameters
textThe text to set

◆ setClipboardTextAndPaste()

void albert::setClipboardTextAndPaste ( const QString &  text)

Set the system clipboard and paste the content to the front-most window.

Check albert::havePasteSupport before using this function.

Parameters
textThe text to set and paste

◆ settings()

std::unique_ptr< QSettings > albert::settings ( )

Persistent app settings storage.

Returns
Preconfigured QSettings object for configuration storage.

◆ showSettings()

void albert::showSettings ( QString  plugin_id = {})

Open/Show the settings window (of plugin).

Parameters
plugin_idId of the plugin whose settings should be displayed.

◆ state()

std::unique_ptr< QSettings > albert::state ( )

The persistent app state storage.

Returns
Preconfigured QSettings object for state storage.