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

Konsole

Konsole::Profile

Konsole::Profile Class Reference

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

#include <Profile.h>

Inheritance diagram for Konsole::Profile:

Inheritance graph
[legend]

List of all members.


Public Types

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

Public Member Functions

QStringList arguments () const
GroupPtr asGroup ()
const GroupPtr asGroup () const
void clone (Ptr profile, bool differentOnly=true)
QString colorScheme () const
QString command () const
QString defaultWorkingDirectory () const
QStringList environment () const
QFont font () const
QString icon () const
bool isEmpty () const
bool isHidden () const
virtual bool isPropertySet (Property property) const
QString name () const
const Ptr parent () const
QString path () const
 Profile (Ptr parent=Ptr())
template<class T >
T property (Property property) const
void setHidden (bool hidden)
void setParent (Ptr parent)
virtual QHash< Property, QVariant > setProperties () const
virtual void setProperty (Property property, const QVariant &value)
virtual ~Profile ()

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)

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 64 of file Profile.h.


Member Typedef Documentation

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

Definition at line 73 of file Profile.h.

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

Reimplemented in Konsole::ProfileGroup.

Definition at line 72 of file Profile.h.


Member Enumeration Documentation

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 242 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 214 of file Profile.h.

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.
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

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
StartInCurrentSessionDir  (bool) Whether new sessions should be started in the same directory as the currently active session.

ShowNewAndCloseTabButtons  (bool) Whether a 'New Tab' and 'Close Tab' buttons should be shown on the tab bar

Definition at line 82 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 231 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 189 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 202 of file Profile.h.


Constructor & Destructor Documentation

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

Constructs a new profile.

Parameters:
parent The 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 instead.

Definition at line 186 of file Profile.cpp.

Profile::~Profile (  )  [virtual]

Definition at line 214 of file Profile.cpp.


Member Function Documentation

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

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

Definition at line 344 of file Profile.h.

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

Definition at line 514 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 508 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:
profile The profile to copy properties from
differentOnly If 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 191 of file Profile.cpp.

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

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

Definition at line 350 of file Profile.h.

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

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

Definition at line 341 of file Profile.h.

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

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

Definition at line 334 of file Profile.h.

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

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

Definition at line 353 of file Profile.h.

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

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

Definition at line 347 of file Profile.h.

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

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

Definition at line 338 of file Profile.h.

bool Profile::isEmpty (  )  const

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

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

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 240 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 235 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 248 of file Profile.cpp.

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

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

Definition at line 331 of file Profile.h.

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

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

Returns the parent profile.

Definition at line 221 of file Profile.cpp.

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

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

Definition at line 328 of file Profile.h.

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

Returns the primary name for the specified property.

TODO More documentation

Definition at line 255 of file Profile.cpp.

QVariant 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 416 of file Profile.h.

void Profile::setHidden ( bool  hidden  ) 

Specifies whether this is a hidden profile.

See isHidden()

Definition at line 218 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 220 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 227 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 231 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.7
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