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

Albert core interface namespace. More...

Namespaces

namespace  detail
 Albert private namespace.
 
namespace  util
 Albert utility namespace.
 

Classes

class  Action
 Action used by result items (Item). More...
 
class  Extension
 Abstract extension class. More...
 
class  ExtensionRegistry
 The common extension pool. More...
 
class  FallbackHandler
 Abstract fallback provider. More...
 
class  GlobalQueryHandler
 Abstract global query handler. More...
 
class  Icon
 Abstract icon engine. More...
 
class  Item
 Result items displayed in the query results list. More...
 
class  PluginInstance
 Abstract plugin instance class. More...
 
class  PluginLoader
 Asynchronous plugin loader turning a physical plugin into a logical PluginInstance. More...
 
class  PluginMetadata
 Common plugin metadata. More...
 
class  PluginProvider
 Plugin provider interface class. More...
 
class  Query
 Common query object. More...
 
class  RankItem
 An Item with a score. More...
 
class  TriggerQueryHandler
 Abstract trigger query handler. More...
 
class  UrlHandler
 Albert scheme URL handler interface. More...
 

Functions

void show (const QString &input_text={})
 Shows the frontend.
 
void showSettings (QString plugin_id={})
 Creates and/or shows the settings window.
 
void restart ()
 Restarts the application.
 
void quit ()
 Quits the application.
 
const std::filesystem::path & configLocation ()
 Returns the application config location.
 
const std::filesystem::path & cacheLocation ()
 Returns the application cache location.
 
const std::filesystem::path & dataLocation ()
 Returns the application data location.
 
std::unique_ptr< QSettings > settings ()
 Returns a QSettings object for configuration storage.
 
std::unique_ptr< QSettings > state ()
 Returns a QSettings object for state storage.
 
const ExtensionRegistryextensionRegistry ()
 Returns a const reference to the central ExtensionRegistry.
 

Icon utilities

enum  StandardIconType {
  TitleBarMenuButton , TitleBarMinButton , TitleBarMaxButton , TitleBarCloseButton ,
  TitleBarNormalButton , TitleBarShadeButton , TitleBarUnshadeButton , TitleBarContextHelpButton ,
  DockWidgetCloseButton , MessageBoxInformation , MessageBoxWarning , MessageBoxCritical ,
  MessageBoxQuestion , DesktopIcon , TrashIcon , ComputerIcon ,
  DriveFDIcon , DriveHDIcon , DriveCDIcon , DriveDVDIcon ,
  DriveNetIcon , DirOpenIcon , DirClosedIcon , DirLinkIcon ,
  DirLinkOpenIcon , FileIcon , FileLinkIcon , ToolBarHorizontalExtensionButton ,
  ToolBarVerticalExtensionButton , FileDialogStart , FileDialogEnd , FileDialogToParent ,
  FileDialogNewFolder , FileDialogDetailedView , FileDialogInfoView , FileDialogContentsView ,
  FileDialogListView , FileDialogBack , DirIcon , DialogOkButton ,
  DialogCancelButton , DialogHelpButton , DialogOpenButton , DialogSaveButton ,
  DialogCloseButton , DialogApplyButton , DialogResetButton , DialogDiscardButton ,
  DialogYesButton , DialogNoButton , ArrowUp , ArrowDown ,
  ArrowLeft , ArrowRight , ArrowBack , ArrowForward ,
  DirHomeIcon , CommandLink , VistaShield , BrowserReload ,
  BrowserStop , MediaPlay , MediaStop , MediaPause ,
  MediaSkipForward , MediaSkipBackward , MediaSeekForward , MediaSeekBackward ,
  MediaVolume , MediaVolumeMuted , LineEditClearButton , DialogYesToAllButton ,
  DialogNoToAllButton , DialogSaveAllButton , DialogAbortButton , DialogRetryButton ,
  DialogIgnoreButton , RestoreDefaultsButton , TabCloseButton
}
 This enum describes the available standard icons. More...
 
QIcon qIcon (std::unique_ptr< albert::Icon > icon)
 Returns a QIcon using icon as icon engine.
 
std::unique_ptr< IconiconFromUrl (const QString &url)
 Returns a built-in icon for the given url.
 
std::unique_ptr< IconiconFromUrls (const QStringList &urls)
 Returns a built-in icon for the given urls.
 
std::unique_ptr< IconmakeImageIcon (const QString &path)
 Returns an icon from an image file at path.
 
std::unique_ptr< IconmakeImageIcon (const std::filesystem::path &path)
 Returns an icon from an image file at path.
 
std::unique_ptr< IconmakeFileTypeIcon (const QString &path)
 Returns an icon representing the file type of the file at path.
 
std::unique_ptr< IconmakeFileTypeIcon (const std::filesystem::path &path)
 Returns an icon representing the file type of the file at path.
 
std::unique_ptr< IconmakeStandardIcon (StandardIconType type)
 Returns a standard icon for the given type.
 
std::unique_ptr< IconmakeThemeIcon (const QString &icon_name)
 Returns an icon from the current icon theme with the given icon_name.
 
const QBrush & graphemeIconDefaultColor ()
 Returns the default color (black).
 
double graphemeIconDefaultScalar ()
 Returns the default scaling factor (1.0).
 
std::unique_ptr< IconmakeGraphemeIcon (const QString &grapheme, double scalar=graphemeIconDefaultScalar(), const QBrush &color=graphemeIconDefaultColor())
 Returns an icon rendering the given grapheme, scaled by scalar and colored with color.
 
const QBrush & rectIconDefaultColor ()
 Returns the default color (black).
 
const QBrush & rectIconDefaultBorderColor ()
 Returns the default border color (black).
 
double rectIconDefaultRadius ()
 Returns the default border radius (1.0).
 
int rectIconDefaultBorderWidth ()
 Returns the default border width (0).
 
std::unique_ptr< IconmakeRectIcon (const QBrush &color=rectIconDefaultColor(), double radius=rectIconDefaultRadius(), int border_width=rectIconDefaultBorderWidth(), const QBrush &border_color=rectIconDefaultBorderColor())
 Returns a simple rectangular icon with the given color, radius, border_width and border_color.
 
const QBrush & iconifiedIconDefaultColor ()
 Returns the default background color (a top down gradient from white to some darker white).
 
double iconifiedIconDefaultBorderRadius ()
 Returns the default relative radius 1.0.
 
int iconifiedIconDefaultBorderWidth ()
 Returns the default border width (1).
 
const QBrush & iconifiedIconDefaultBorderColor ()
 Returns the default border color (a gradient slightly darker than the default background).
 
std::unique_ptr< IconmakeIconifiedIcon (std::unique_ptr< Icon > src, const QBrush &color=iconifiedIconDefaultColor(), double border_radius=iconifiedIconDefaultBorderRadius(), int border_width=iconifiedIconDefaultBorderWidth(), const QBrush &border_color=iconifiedIconDefaultBorderColor())
 Returns an iconified src.
 
double composedIconDefaultSize ()
 Returns the default relative size 0.7.
 
double composedIconDefaultPos1 ()
 Returns the default relative position 0.0 of the first item.
 
double composedIconDefaultPos2 ()
 Returns the default relative position 1.0 of the second item.
 
std::unique_ptr< IconmakeComposedIcon (std::unique_ptr< Icon > src1, std::unique_ptr< Icon > src2, double size1=composedIconDefaultSize(), double size2=composedIconDefaultSize(), double x1=composedIconDefaultPos1(), double y1=composedIconDefaultPos1(), double x2=composedIconDefaultPos2(), double y2=composedIconDefaultPos2())
 Returns a composed icon of src1 and src2.
 

Detailed Description

Albert core interface namespace.

Enumeration Type Documentation

◆ StandardIconType

This enum describes the available standard icons.

See Qt documentation for more details.

Enumerator
TitleBarMenuButton 
TitleBarMinButton 
TitleBarMaxButton 
TitleBarCloseButton 
TitleBarNormalButton 
TitleBarShadeButton 
TitleBarUnshadeButton 
TitleBarContextHelpButton 
DockWidgetCloseButton 
MessageBoxInformation 
MessageBoxWarning 
MessageBoxCritical 
MessageBoxQuestion 
DesktopIcon 
TrashIcon 
ComputerIcon 
DriveFDIcon 
DriveHDIcon 
DriveCDIcon 
DriveDVDIcon 
DriveNetIcon 
DirOpenIcon 
DirClosedIcon 
DirLinkIcon 
DirLinkOpenIcon 
FileIcon 
FileLinkIcon 
ToolBarHorizontalExtensionButton 
ToolBarVerticalExtensionButton 
FileDialogStart 
FileDialogEnd 
FileDialogToParent 
FileDialogNewFolder 
FileDialogDetailedView 
FileDialogInfoView 
FileDialogContentsView 
FileDialogListView 
FileDialogBack 
DirIcon 
DialogOkButton 
DialogCancelButton 
DialogHelpButton 
DialogOpenButton 
DialogSaveButton 
DialogCloseButton 
DialogApplyButton 
DialogResetButton 
DialogDiscardButton 
DialogYesButton 
DialogNoButton 
ArrowUp 
ArrowDown 
ArrowLeft 
ArrowRight 
ArrowBack 
ArrowForward 
DirHomeIcon 
CommandLink 
VistaShield 
BrowserReload 
BrowserStop 
MediaPlay 
MediaStop 
MediaPause 
MediaSkipForward 
MediaSkipBackward 
MediaSeekForward 
MediaSeekBackward 
MediaVolume 
MediaVolumeMuted 
LineEditClearButton 
DialogYesToAllButton 
DialogNoToAllButton 
DialogSaveAllButton 
DialogAbortButton 
DialogRetryButton 
DialogIgnoreButton 
RestoreDefaultsButton 
TabCloseButton 

Function Documentation

◆ cacheLocation()

const std::filesystem::path & albert::cacheLocation ( )

Returns the application cache location.

This function is thread-safe.

◆ composedIconDefaultPos1()

double albert::composedIconDefaultPos1 ( )

Returns the default relative position 0.0 of the first item.

◆ composedIconDefaultPos2()

double albert::composedIconDefaultPos2 ( )

Returns the default relative position 1.0 of the second item.

◆ composedIconDefaultSize()

double albert::composedIconDefaultSize ( )

Returns the default relative size 0.7.

◆ configLocation()

const std::filesystem::path & albert::configLocation ( )

Returns the application config location.

This function is thread-safe.

◆ dataLocation()

const std::filesystem::path & albert::dataLocation ( )

Returns the application data location.

This function is thread-safe.

◆ extensionRegistry()

const ExtensionRegistry & albert::extensionRegistry ( )

Returns a const reference to the central ExtensionRegistry.

Registering plugins via this registry is not allowed. Use PluginInstance::extensions(). See also util::WeakDependency and util::StrongDependency.

◆ graphemeIconDefaultColor()

const QBrush & albert::graphemeIconDefaultColor ( )

Returns the default color (black).

◆ graphemeIconDefaultScalar()

double albert::graphemeIconDefaultScalar ( )

Returns the default scaling factor (1.0).

◆ iconFromUrl()

std::unique_ptr< Icon > albert::iconFromUrl ( const QString &  url)

Returns a built-in icon for the given url.

See also Icon::toUrl.

◆ iconFromUrls()

std::unique_ptr< Icon > albert::iconFromUrls ( const QStringList urls)

Returns a built-in icon for the given urls.

See also Icon::toUrl.

◆ iconifiedIconDefaultBorderColor()

const QBrush & albert::iconifiedIconDefaultBorderColor ( )

Returns the default border color (a gradient slightly darker than the default background).

◆ iconifiedIconDefaultBorderRadius()

double albert::iconifiedIconDefaultBorderRadius ( )

Returns the default relative radius 1.0.

◆ iconifiedIconDefaultBorderWidth()

int albert::iconifiedIconDefaultBorderWidth ( )

Returns the default border width (1).

◆ iconifiedIconDefaultColor()

const QBrush & albert::iconifiedIconDefaultColor ( )

Returns the default background color (a top down gradient from white to some darker white).

◆ makeComposedIcon()

std::unique_ptr< Icon > albert::makeComposedIcon ( std::unique_ptr< Icon src1,
std::unique_ptr< Icon src2,
double  size1 = composedIconDefaultSize(),
double  size2 = composedIconDefaultSize(),
double  x1 = composedIconDefaultPos1(),
double  y1 = composedIconDefaultPos1(),
double  x2 = composedIconDefaultPos2(),
double  y2 = composedIconDefaultPos2() 
)

Returns a composed icon of src1 and src2.

size1 and size2 specify the relative sizes (0.0 - 1.0) of the icons. x1, y1, x2, and y2 specify the relative positions (0.0 - 1.0, 0.5 is centered) of the icons.

◆ makeFileTypeIcon() [1/2]

std::unique_ptr< Icon > albert::makeFileTypeIcon ( const QString &  path)

Returns an icon representing the file type of the file at path.

◆ makeFileTypeIcon() [2/2]

std::unique_ptr< Icon > albert::makeFileTypeIcon ( const std::filesystem::path &  path)

Returns an icon representing the file type of the file at path.

◆ makeGraphemeIcon()

std::unique_ptr< Icon > albert::makeGraphemeIcon ( const QString &  grapheme,
double  scalar = graphemeIconDefaultScalar(),
const QBrush &  color = graphemeIconDefaultColor() 
)

Returns an icon rendering the given grapheme, scaled by scalar and colored with color.

◆ makeIconifiedIcon()

std::unique_ptr< Icon > albert::makeIconifiedIcon ( std::unique_ptr< Icon src,
const QBrush &  color = iconifiedIconDefaultColor(),
double  border_radius = iconifiedIconDefaultBorderRadius(),
int  border_width = iconifiedIconDefaultBorderWidth(),
const QBrush &  border_color = iconifiedIconDefaultBorderColor() 
)

Returns an iconified src.

i.e. drawn in a colored rounded rectangle with a border. color specifies the background color, border_width the border width in device independent pixels, border_radius the relative border radius (0.0 - 1.0), and border_color the border color.

◆ makeImageIcon() [1/2]

std::unique_ptr< Icon > albert::makeImageIcon ( const QString &  path)

Returns an icon from an image file at path.

◆ makeImageIcon() [2/2]

std::unique_ptr< Icon > albert::makeImageIcon ( const std::filesystem::path &  path)

Returns an icon from an image file at path.

◆ makeRectIcon()

std::unique_ptr< Icon > albert::makeRectIcon ( const QBrush &  color = rectIconDefaultColor(),
double  radius = rectIconDefaultRadius(),
int  border_width = rectIconDefaultBorderWidth(),
const QBrush &  border_color = rectIconDefaultBorderColor() 
)

Returns a simple rectangular icon with the given color, radius, border_width and border_color.

◆ makeStandardIcon()

std::unique_ptr< Icon > albert::makeStandardIcon ( StandardIconType  type)

Returns a standard icon for the given type.

◆ makeThemeIcon()

std::unique_ptr< Icon > albert::makeThemeIcon ( const QString &  icon_name)

Returns an icon from the current icon theme with the given icon_name.

◆ qIcon()

QIcon albert::qIcon ( std::unique_ptr< albert::Icon icon)

Returns a QIcon using icon as icon engine.

◆ quit()

void albert::quit ( )

Quits the application.

This function is thread-safe.

◆ rectIconDefaultBorderColor()

const QBrush & albert::rectIconDefaultBorderColor ( )

Returns the default border color (black).

◆ rectIconDefaultBorderWidth()

int albert::rectIconDefaultBorderWidth ( )

Returns the default border width (0).

◆ rectIconDefaultColor()

const QBrush & albert::rectIconDefaultColor ( )

Returns the default color (black).

◆ rectIconDefaultRadius()

double albert::rectIconDefaultRadius ( )

Returns the default border radius (1.0).

◆ restart()

void albert::restart ( )

Restarts the application.

This function is thread-safe.

◆ settings()

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

Returns a QSettings object for configuration storage.

This function is thread-safe.

◆ show()

void albert::show ( const QString &  input_text = {})

Shows the frontend.

If input_text is not null the input is set.

◆ showSettings()

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

Creates and/or shows the settings window.

If specified the settings of the plugin with the id plugin_id are shown.

◆ state()

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

Returns a QSettings object for state storage.

This function is thread-safe.