• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Konsole

Konsole::Profile

Konsole::Profile Class Reference

#include <Profile.h>

Inheritance diagram for Konsole::Profile:

Inheritance graph
[legend]

List of all members.


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.

TODO: Profile inherits from QObject so that it can store a guarded pointer to the parent profile using QPointer<Profile>. Try to find a more light-weight solution to this.

Definition at line 61 of file Profile.h.


Public Types

enum  Property {
  Path, Name, Title, Icon,
  Command, Arguments, Environment, Directory,
  LocalTabTitleFormat, RemoteTabTitleFormat, ShowMenuBar, TabBarMode,
  Font, ColorScheme, KeyBindings, HistoryMode,
  HistorySize, ScrollBarPosition, BlinkingTextEnabled, FlowControlEnabled,
  AllowProgramsToResizeWindow, BlinkingCursorEnabled, UseCustomCursorColor, CursorShape,
  CustomCursorColor, WordCharacters, TabBarPosition, DefaultEncoding,
  AntiAliasFonts
}
enum  TabBarModeEnum { AlwaysHideTabBar = 0, ShowTabBarAsNeeded = 1, AlwaysShowTabBar = 2 }
enum  TabBarPositionEnum { TabBarBottom = 0, TabBarTop = 1 }
enum  HistoryModeEnum { DisableHistory = 0, FixedSizeHistory = 1, UnlimitedHistory = 2 }
enum  ScrollBarPositionEnum { ScrollBarLeft = 0, ScrollBarRight = 1, ScrollBarHidden = 2 }
enum  CursorShapeEnum { BlockCursor = 0, IBeamCursor = 1, UnderlineCursor = 2 }

Public Member Functions

 Profile (Profile *parent=0)
virtual ~Profile ()
void setParent (Profile *parent)
const Profile * parent () const
virtual QVariant property (Property property) const
virtual void setProperty (Property property, const QVariant &value)
virtual bool isPropertySet (Property property) const
virtual QHash< Property, QVariant > setProperties () const
bool isEmpty () const
bool isHidden () const
void setHidden (bool hidden)
QString path () const
QString name () const
QString defaultWorkingDirectory () const
QString icon () const
QString command () const
QStringList arguments () const
QFont font () const
QString colorScheme () const
QStringList environment () const
QString terminal () const

Static Public Member Functions

static bool isNameRegistered (const QString &name)
static Property lookupByName (const QString &name)
static QList< QString > namesForProperty (Property property)
static QString primaryNameForProperty (Property property)
static void registerName (Property property, const QString &name)

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.

Title  (QString) Title of this profile that will be displayed.

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)

ShowMenuBar  (bool) Specifies whether the menu bar should be shown in the main application window.

TabBarMode  (TabBarModeEnum) Specifies when the tab bar should be shown in the main 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.
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. Only applicable if the HistoryMode property is FixedSizeHistory

ScrollBarPosition  (ScrollBarPositionEnum) Specifies the position of the scroll bar in terminal displays using this profile.
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

AllowProgramsToResizeWindow  (bool) Specifies whether programs running in the terminal are allowed to resize the terminal display.
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.

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.
TabBarPosition  (TabBarPositionEnum) Position of the tab-bar relative to the terminal displays.

DefaultEncoding  (String) Default text codec
AntiAliasFonts  (bool) Whether fonts should be aliased or not

Definition at line 73 of file Profile.h.

enum Konsole::Profile::TabBarModeEnum

This enum describes the available modes for showing or hiding the tab bar.

Enumerator:
AlwaysHideTabBar  The tab bar is never shown.

ShowTabBarAsNeeded  The tab bar is shown if there are multiple tabs open or hidden otherwise.

AlwaysShowTabBar  The tab bar is always shown.

Definition at line 187 of file Profile.h.

enum Konsole::Profile::TabBarPositionEnum

This enum describes the available tab bar positions.

Enumerator:
TabBarBottom  Show tab bar below displays.

TabBarTop  Show tab bar above displays.

Definition at line 200 of file Profile.h.

enum Konsole::Profile::HistoryModeEnum

This enum describes the modes available to remember lines of output produced by the terminal.

Enumerator:
DisableHistory  No output is remembered.

As soon as lines of text are scrolled off-screen they are lost.

FixedSizeHistory  A fixed number of lines of output are remembered.

Once the limit is reached, the oldest lines are lost.

UnlimitedHistory  All output is remembered for the duration of the session.

Typically this means that lines are recorded to a file as they are scrolled off-screen.

Definition at line 212 of file Profile.h.

enum Konsole::Profile::ScrollBarPositionEnum

This enum describes the positions where the terminal display's scroll bar may be placed.

Enumerator:
ScrollBarLeft  Show the scroll-bar on the left of the terminal display.

ScrollBarRight  Show the scroll-bar on the right of the terminal display.

ScrollBarHidden  Do not show the scroll-bar.

Definition at line 229 of file Profile.h.

enum Konsole::Profile::CursorShapeEnum

This enum describes the shapes used to draw the cursor in terminal displays.

Enumerator:
BlockCursor  Use a solid rectangular block to draw the cursor.

IBeamCursor  Use an 'I' shape, similar to that used in text editing applications, to draw the cursor.

UnderlineCursor  Draw a line underneath the cursor's position.

Definition at line 240 of file Profile.h.


Constructor & Destructor Documentation

Profile::Profile ( Profile *  parent = 0  ) 

Constructs a new profile.

Definition at line 158 of file Profile.cpp.

virtual Konsole::Profile::~Profile (  )  [inline, virtual]

Definition at line 254 of file Profile.h.


Member Function Documentation

void Profile::setParent ( Profile *  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 167 of file Profile.cpp.

const Profile * Profile::parent (  )  const

Returns the parent profile.

Definition at line 168 of file Profile.cpp.

QVariant Profile::property ( Property  property  )  const [virtual]

Returns the current value of the specified property.

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 179 of file Profile.cpp.

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

Sets the value of the specified property to value.

Definition at line 190 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 194 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 174 of file Profile.cpp.

bool Profile::isEmpty (  )  const

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

Definition at line 170 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 164 of file Profile.cpp.

void Profile::setHidden ( bool  hidden  ) 

Specifies whether this is a hidden profile.

See isHidden()

Definition at line 165 of file Profile.cpp.

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

Convenience method for property(Profile::Path).

Definition at line 303 of file Profile.h.

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

Convenience method for property(Profile::Name).

Definition at line 306 of file Profile.h.

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

Convenience method for property(Profile::Directory).

Definition at line 309 of file Profile.h.

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

Convenience method for property(Profile::Icon).

Definition at line 313 of file Profile.h.

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

Convenience method for property(Profile::Command).

Definition at line 316 of file Profile.h.

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

Convenience method for property(Profile::Arguments).

Definition at line 319 of file Profile.h.

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

Convenience method for property(Profile::Font).

Definition at line 322 of file Profile.h.

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

Convenience method for property(Profile::ColorScheme).

Definition at line 325 of file Profile.h.

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

Convenience method for property(Profile::Environment).

Definition at line 328 of file Profile.h.

QString Konsole::Profile::terminal (  )  const [inline]

Convenience method.

Returns the value of the "TERM" value in the environment list.

Definition at line 334 of file Profile.h.

bool Profile::isNameRegistered ( const QString &  name  )  [static]

Returns true if name has been associated with an element from the Property enum or false otherwise.

Definition at line 199 of file Profile.cpp.

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

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

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

Definition at line 207 of file Profile.cpp.

QList< QString > Profile::namesForProperty ( Property  property  )  [static]

Returns the string names associated with the specified property from the Property enum, in the order the associations were created using registerName().

Definition at line 221 of file Profile.cpp.

QString Profile::primaryNameForProperty ( Property  property  )  [static]

Returns the primary name for the specified property.

TODO More documentation

Definition at line 214 of file Profile.cpp.

void Profile::registerName ( Property  property,
const QString &  name 
) [static]

Adds an association between a string name and a property.

Subsequent calls to lookupByName() with name as the argument will return property.

Definition at line 228 of file Profile.cpp.


The documentation for this class was generated from the following files:
  • Profile.h
  • Profile.cpp

Konsole

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

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal