• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • Konsole
  • Profile
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Konsole::Profile Class Reference

#include <Profile.h>

Inheritance diagram for Konsole::Profile:
Inheritance graph
[legend]

Public Types

typedef KSharedPtr< ProfileGroup > GroupPtr
 
enum  Property {
  Path, Name, UntranslatedName, Icon,
  Command, Arguments, Environment, Directory,
  LocalTabTitleFormat, RemoteTabTitleFormat, ShowTerminalSizeHint, Font,
  ColorScheme, KeyBindings, HistoryMode, HistorySize,
  ScrollBarPosition, ScrollFullPage, BidiRenderingEnabled, BlinkingTextEnabled,
  FlowControlEnabled, LineSpacing, BlinkingCursorEnabled, UseCustomCursorColor,
  CursorShape, CustomCursorColor, WordCharacters, TripleClickMode,
  UnderlineLinksEnabled, OpenLinksByDirectClickEnabled, CtrlRequiredForDrag, AutoCopySelectedText,
  TrimTrailingSpacesInSelectedText, PasteFromSelectionEnabled, PasteFromClipboardEnabled, MiddleClickPasteMode,
  DefaultEncoding, AntiAliasFonts, BoldIntense, StartInCurrentSessionDir,
  SilenceSeconds, BellMode, TerminalColumns, TerminalRows,
  MenuIndex, MouseWheelZoomEnabled
}
 
typedef KSharedPtr< Profile > Ptr
 

Public Member Functions

 Profile (Ptr parent=Ptr())
 
virtual ~Profile ()
 
bool antiAliasFonts () const
 
QStringList arguments () const
 
const GroupPtr asGroup () const
 
GroupPtr asGroup ()
 
bool autoCopySelectedText () const
 
bool bidiRenderingEnabled () const
 
bool blinkingCursorEnabled () const
 
bool blinkingTextEnabled () const
 
bool boldIntense () const
 
void clone (Ptr profile, bool differentOnly=true)
 
QString colorScheme () const
 
QString command () const
 
QColor customCursorColor () const
 
QString defaultEncoding () const
 
QString defaultWorkingDirectory () const
 
QStringList environment () const
 
bool flowControlEnabled () const
 
QFont font () const
 
int historySize () const
 
QString icon () const
 
bool isEmpty () const
 
bool isHidden () const
 
virtual bool isPropertySet (Property property) const
 
QString keyBindings () const
 
int lineSpacing () const
 
QString localTabTitleFormat () const
 
QString menuIndex () const
 
int menuIndexAsInt () const
 
bool mouseWheelZoomEnabled () const
 
QString name () const
 
const Ptr parent () const
 
QString path () const
 
const QStringList propertiesInfoList () const
 
template<class T >
T property (Property property) const
 
template<>
QVariant property (Property aProperty) const
 
QString remoteTabTitleFormat () const
 
void setHidden (bool hidden)
 
void setParent (Ptr parent)
 
virtual QHash< Property, QVariant > setProperties () const
 
virtual void setProperty (Property property, const QVariant &value)
 
bool showTerminalSizeHint () const
 
int silenceSeconds () const
 
bool startInCurrentSessionDir () const
 
int terminalColumns () const
 
int terminalRows () const
 
bool underlineLinksEnabled () const
 
QString untranslatedName () const
 
bool useCustomCursorColor () const
 
QString wordCharacters () const
 
- Public Member Functions inherited from QSharedData
 QSharedData ()
 
 QSharedData (const QSharedData &other)
 

Static Public Member Functions

static Property lookupByName (const QString &name)
 

Detailed Description

Represents a terminal set-up which can be used to set the initial state of new terminal sessions or applied to existing sessions.

Profiles consist of a number of named properties, which can be retrieved using property() and set using setProperty(). isPropertySet() can be used to check whether a particular property has been set in a profile.

Profiles support a simple form of inheritance. When a new Profile is constructed, a pointer to a parent profile can be passed to the constructor. When querying a particular property of a profile using property(), the profile will return its own value for that property if one has been set or otherwise it will return the parent's value for that property.

Profiles can be loaded from disk using ProfileReader instances and saved to disk using ProfileWriter instances.

Definition at line 60 of file Profile.h.

Member Typedef Documentation

typedef KSharedPtr<ProfileGroup> Konsole::Profile::GroupPtr

Definition at line 68 of file Profile.h.

typedef KSharedPtr<Profile> Konsole::Profile::Ptr

Definition at line 67 of file Profile.h.

Member Enumeration Documentation

enum Konsole::Profile::Property

This enum describes the available properties which a Profile may consist of.

Properties can be set using setProperty() and read using property()

Enumerator
Path 

(QString) Path to the profile's configuration file on-disk.

Name 

(QString) The descriptive name of this profile.

UntranslatedName 

(QString) The untranslated name of this profile.

Warning: this is an internal property. Do not touch it.

Icon 

(QString) The name of the icon associated with this profile.

This is used in menus and tabs to represent the profile.

Command 

(QString) The command to execute ( excluding arguments ) when creating a new terminal session using this profile.

Arguments 

(QStringList) The arguments which are passed to the program specified by the Command property when creating a new terminal session using this profile.

Environment 

(QStringList) Additional environment variables (in the form of NAME=VALUE pairs) which are passed to the program specified by the Command property when creating a new terminal session using this profile.

Directory 

(QString) The initial working directory for sessions created using this profile.

LocalTabTitleFormat 

(QString) The format used for tab titles when running normal commands.

RemoteTabTitleFormat 

(QString) The format used for tab titles when the session is running a remote command (eg.

SSH)

ShowTerminalSizeHint 

(bool) Specifies whether show hint for terminal size after resizing the application window.

Font 

(QFont) The font to use in terminal displays using this profile.

ColorScheme 

(QString) The name of the color scheme to use in terminal displays using this profile.

Color schemes are managed by the ColorSchemeManager class.

KeyBindings 

(QString) The name of the key bindings.

Key bindings are managed by the KeyboardTranslatorManager class.

HistoryMode 

(HistoryModeEnum) Specifies the storage type used for keeping the output produced by terminal sessions using this profile.

See Enum::HistoryModeEnum

HistorySize 

(int) Specifies the number of lines of output to remember in terminal sessions using this profile.

Once the limit is reached, the oldest lines are lost if the HistoryMode property is FixedSizeHistory

ScrollBarPosition 

(ScrollBarPositionEnum) Specifies the position of the scroll bar in terminal displays using this profile.

See Enum::ScrollBarPositionEnum

ScrollFullPage 

(bool) Specifies whether the PageUp/Down will scroll the full height or half height.

BidiRenderingEnabled 

(bool) Specifies whether the terminal will enable Bidirectional text display

BlinkingTextEnabled 

(bool) Specifies whether text in terminal displays is allowed to blink.

FlowControlEnabled 

(bool) Specifies whether the flow control keys (typically Ctrl+S, Ctrl+Q) have any effect.

Also known as Xon/Xoff

LineSpacing 

(int) Specifies the pixels between the terminal lines.

BlinkingCursorEnabled 

(bool) Specifies whether the cursor blinks ( in a manner similar to text editing applications )

UseCustomCursorColor 

(bool) If true, terminal displays use a fixed color to draw the cursor, specified by the CustomCursorColor property.

Otherwise the cursor changes color to match the character underneath it.

CursorShape 

(CursorShapeEnum) The shape used by terminal displays to represent the cursor.

See Enum::CursorShapeEnum

CustomCursorColor 

(QColor) The color used by terminal displays to draw the cursor.

Only applicable if the UseCustomCursorColor property is true.

WordCharacters 

(QString) A string consisting of the characters used to delimit words when selecting text in the terminal display.

TripleClickMode 

(TripleClickModeEnum) Specifies which part of current line should be selected with triple click action.

See Enum::TripleClickModeEnum

UnderlineLinksEnabled 

(bool) If true, text that matches a link or an email address is underlined when hovered by the mouse pointer.

OpenLinksByDirectClickEnabled 

(bool) If true, links can be opened by direct mouse click.

CtrlRequiredForDrag 

(bool) If true, control key must be pressed to click and drag selected text.

AutoCopySelectedText 

(bool) If true, automatically copy selected text into the clipboard

TrimTrailingSpacesInSelectedText 

(bool) If true, trailing spaces are trimmed in selected text

PasteFromSelectionEnabled 

(bool) If true, middle mouse button pastes from X Selection

PasteFromClipboardEnabled 

(bool) If true, middle mouse button pastes from Clipboard

MiddleClickPasteMode 

(MiddleClickPasteModeEnum) Specifies the source from which mouse middle click pastes data.

See Enum::MiddleClickPasteModeEnum

DefaultEncoding 

(String) Default text codec

AntiAliasFonts 

(bool) Whether fonts should be aliased or not

BoldIntense 

(bool) Whether character with intense colors should be rendered in bold font or just in bright color.

StartInCurrentSessionDir 

(bool) Whether new sessions should be started in the same directory as the currently active session.

SilenceSeconds 

(int) Specifies the threshold of detected silence in seconds.

BellMode 

(BellModeEnum) Specifies the behavior of bell.

See Enum::BellModeEnum

TerminalColumns 

(int) Specifies the preferred columns.

TerminalRows 

(int) Specifies the preferred rows.

MenuIndex 

Index of profile in the File Menu WARNING: this is currently an internal field, which is expected to be zero on disk.

Do not modify it manually.

  In future, the format might be #.#.# to account for levels
MouseWheelZoomEnabled 

(bool) If true, mouse wheel scroll with Ctrl key pressed increases/decreases the terminal font size.

Definition at line 77 of file Profile.h.

Constructor & Destructor Documentation

Profile::Profile ( Profile::Ptr  parent = Ptr())
explicit

Constructs a new profile.

Parameters
parentThe parent profile. When querying the value of a property using property(), if the property has not been set in this profile then the parent's value for the property will be returned.

Definition at line 203 of file Profile.cpp.

Profile::~Profile ( )
virtual

Definition at line 227 of file Profile.cpp.

Member Function Documentation

bool Konsole::Profile::antiAliasFonts ( ) const
inline

Convenience method for property<bool>(Profile::AntiAliasFonts)

Definition at line 470 of file Profile.h.

QStringList Konsole::Profile::arguments ( ) const
inline

Convenience method for property<QStringList>(Profile::Arguments)

Definition at line 365 of file Profile.h.

const Profile::GroupPtr Konsole::Profile::asGroup ( ) const
inline

Returns this profile as a group or null if this profile is not a group.

Definition at line 653 of file Profile.h.

Profile::GroupPtr Konsole::Profile::asGroup ( )
inline

Definition at line 659 of file Profile.h.

bool Konsole::Profile::autoCopySelectedText ( ) const
inline

Definition at line 460 of file Profile.h.

bool Konsole::Profile::bidiRenderingEnabled ( ) const
inline

Convenience method for property<bool>(Profile::BidiRenderingEnabled)

Definition at line 410 of file Profile.h.

bool Konsole::Profile::blinkingCursorEnabled ( ) const
inline

Convenience method for property<bool>(Profile::BlinkingCursorEnabled)

Definition at line 431 of file Profile.h.

bool Konsole::Profile::blinkingTextEnabled ( ) const
inline

Convenience method for property<bool>(Profile::BlinkingTextEnabled)

Definition at line 421 of file Profile.h.

bool Konsole::Profile::boldIntense ( ) const
inline

Convenience method for property<bool>(Profile::BoldIntense)

Definition at line 475 of file Profile.h.

void Profile::clone ( Profile::Ptr  profile,
bool  differentOnly = true 
)

Copies all properties except Name and Path from the specified profile into this profile.

Parameters
profileThe profile to copy properties from
differentOnlyIf true, only properties in profile which have a different value from this profile's current value (either set via setProperty() or inherited from the parent profile) will be set.

Definition at line 208 of file Profile.cpp.

QString Konsole::Profile::colorScheme ( ) const
inline

Convenience method for property<QString>(Profile::ColorScheme)

Definition at line 390 of file Profile.h.

QString Konsole::Profile::command ( ) const
inline

Convenience method for property<QString>(Profile::Command)

Definition at line 360 of file Profile.h.

QColor Konsole::Profile::customCursorColor ( ) const
inline

Convenience method for property<bool>(Profile::CustomCursorColor)

Definition at line 446 of file Profile.h.

QString Konsole::Profile::defaultEncoding ( ) const
inline

Convenience method for property<QString>(Profile::DefaultEncoding)

Definition at line 465 of file Profile.h.

QString Konsole::Profile::defaultWorkingDirectory ( ) const
inline

Convenience method for property<QString>(Profile::Directory)

Definition at line 350 of file Profile.h.

QStringList Konsole::Profile::environment ( ) const
inline

Convenience method for property<QStringList>(Profile::Environment)

Definition at line 395 of file Profile.h.

bool Konsole::Profile::flowControlEnabled ( ) const
inline

Convenience method for property<bool>(Profile::FlowControlEnabled)

Definition at line 436 of file Profile.h.

QFont Konsole::Profile::font ( ) const
inline

Convenience method for property<QFont>(Profile::Font)

Definition at line 385 of file Profile.h.

int Konsole::Profile::historySize ( ) const
inline

Convenience method for property<QString>(Profile::HistorySize)

Definition at line 405 of file Profile.h.

QString Konsole::Profile::icon ( ) const
inline

Convenience method for property<QString>(Profile::Icon)

Definition at line 355 of file Profile.h.

bool Profile::isEmpty ( ) const

Returns true if no properties have been set in this Profile instance.

Definition at line 248 of file Profile.cpp.

bool Profile::isHidden ( ) const

Returns true if this is a 'hidden' profile which should not be displayed in menus or saved to disk.

This is used for the fallback profile, in case there are no profiles on disk which can be loaded, or for overlay profiles created to handle command-line arguments which change profile properties.

Definition at line 230 of file Profile.cpp.

bool Profile::isPropertySet ( Property  property) const
virtual

Returns true if the specified property has been set in this Profile instance.

Definition at line 260 of file Profile.cpp.

QString Konsole::Profile::keyBindings ( ) const
inline

Convenience method for property<QString>(Profile::KeyBindings)

Definition at line 400 of file Profile.h.

int Konsole::Profile::lineSpacing ( ) const
inline

Convenience method for property<bool>(Profile::LineSpacing)

Definition at line 415 of file Profile.h.

QString Konsole::Profile::localTabTitleFormat ( ) const
inline

Convenience method for property<QString>(Profile::LocalTabTitleFormat)

Definition at line 370 of file Profile.h.

Profile::Property Profile::lookupByName ( const QString &  name)
static

Returns the element from the Property enum associated with the specified name.

Parameters
nameThe name of the property to look for, this is case insensitive.

Definition at line 265 of file Profile.cpp.

QString Konsole::Profile::menuIndex ( ) const
inline

Convenience method for property<QString>(Profile::MenuIndex)

Definition at line 500 of file Profile.h.

int Profile::menuIndexAsInt ( ) const

Definition at line 283 of file Profile.cpp.

bool Konsole::Profile::mouseWheelZoomEnabled ( ) const
inline

Convenience method for property<bool>(Profile::MouseWheelZoomEnabled)

Definition at line 426 of file Profile.h.

QString Konsole::Profile::name ( ) const
inline

Convenience method for property<QString>(Profile::Name)

Definition at line 340 of file Profile.h.

const Profile::Ptr Profile::parent ( ) const

Returns the parent profile.

Definition at line 243 of file Profile.cpp.

QString Konsole::Profile::path ( ) const
inline

Convenience method for property<QString>(Profile::Path)

Definition at line 335 of file Profile.h.

const QStringList Profile::propertiesInfoList ( ) const

Return a list of all properties names and their type (for use with -p option).

Definition at line 293 of file Profile.cpp.

template<class T >
T Konsole::Profile::property ( Property  property) const
inline

Returns the current value of the specified property, cast to type T.

Internally properties are stored using the QVariant type and cast to T using QVariant::value<T>();

If the specified property has not been set in this profile, and a non-null parent was specified in the Profile's constructor, the parent's value for property will be returned.

Definition at line 559 of file Profile.h.

template<>
QVariant Konsole::Profile::property ( Property  aProperty) const
inline

Definition at line 564 of file Profile.h.

QString Konsole::Profile::remoteTabTitleFormat ( ) const
inline

Convenience method for property<QString>(Profile::RemoteTabTitleFormat)

Definition at line 375 of file Profile.h.

void Profile::setHidden ( bool  hidden)

Specifies whether this is a hidden profile.

See isHidden()

Definition at line 234 of file Profile.cpp.

void Profile::setParent ( Profile::Ptr  parent)

Changes the parent profile.

When calling the property() method, if the specified property has not been set for this profile, the parent's value for the property will be returned instead.

Definition at line 239 of file Profile.cpp.

QHash< Profile::Property, QVariant > Profile::setProperties ( ) const
virtual

Returns a map of the properties set in this Profile instance.

Definition at line 252 of file Profile.cpp.

void Profile::setProperty ( Property  property,
const QVariant &  value 
)
virtual

Sets the value of the specified property to value.

Reimplemented in Konsole::ProfileGroup.

Definition at line 256 of file Profile.cpp.

bool Konsole::Profile::showTerminalSizeHint ( ) const
inline

Convenience method for property<bool>(Profile::ShowTerminalSizeHint)

Definition at line 380 of file Profile.h.

int Konsole::Profile::silenceSeconds ( ) const
inline

Convenience method for property<QString>(Profile::SilenceSeconds)

Definition at line 485 of file Profile.h.

bool Konsole::Profile::startInCurrentSessionDir ( ) const
inline

Convenience method for property<bool>(Profile::StartInCurrentSessionDir)

Definition at line 480 of file Profile.h.

int Konsole::Profile::terminalColumns ( ) const
inline

Convenience method for property<QString>(Profile::TerminalColumns)

Definition at line 490 of file Profile.h.

int Konsole::Profile::terminalRows ( ) const
inline

Convenience method for property<QString>(Profile::TerminalRows)

Definition at line 495 of file Profile.h.

bool Konsole::Profile::underlineLinksEnabled ( ) const
inline

Convenience method for property<bool>(Profile::UnderlineLinksEnabled)

Definition at line 456 of file Profile.h.

QString Konsole::Profile::untranslatedName ( ) const
inline

Convenience method for property<QString>(Profile::UntranslatedName)

Definition at line 345 of file Profile.h.

bool Konsole::Profile::useCustomCursorColor ( ) const
inline

Convenience method for property<bool>(Profile::UseCustomCursorColor)

Definition at line 441 of file Profile.h.

QString Konsole::Profile::wordCharacters ( ) const
inline

Convenience method for property<QString>(Profile::WordCharacters)

Definition at line 451 of file Profile.h.


The documentation for this class was generated from the following files:
  • Profile.h
  • Profile.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal