libyui-ncurses
 
Loading...
Searching...
No Matches
NCApplication Class Reference
Inheritance diagram for NCApplication:
Collaboration diagram for NCApplication:

Public Member Functions

virtual void setLanguage (const std::string &language, const std::string &encoding=std::string()) override
 
virtual std::string askForExistingDirectory (const std::string &startDir, const std::string &headline) override
 
virtual std::string askForExistingFile (const std::string &startWith, const std::string &filter, const std::string &headline) override
 
virtual std::string askForSaveFileName (const std::string &startWith, const std::string &filter, const std::string &headline) override
 
virtual void beep () override
 
virtual void redrawScreen () override
 
virtual void initConsoleKeyboard () override
 
virtual void setConsoleFont (const std::string &console_magic, const std::string &font, const std::string &screen_map, const std::string &unicode_map, const std::string &language) override
 
virtual int runInTerminal (const std::string &command) override
 
virtual int displayWidth () override
 
virtual int displayHeight () override
 
virtual int displayDepth () override
 
virtual long displayColors () override
 
virtual int defaultWidth () override
 
virtual int defaultHeight () override
 
virtual bool isTextMode () override
 
virtual bool hasImageSupport () override
 
virtual bool hasIconSupport () override
 
virtual bool hasAnimationSupport () override
 
virtual bool hasFullUtf8Support () override
 
virtual bool richTextSupportsTable () override
 
virtual bool leftHandedMouse () override
 
virtual void setApplicationTitle (const std::string &title) override
 
virtual void openUI () override
 
virtual void closeUI () override
 

Protected Member Functions

 NCApplication ()
 
virtual ~NCApplication ()
 

Friends

class YNCursesUI
 

Constructor & Destructor Documentation

◆ NCApplication()

NCApplication::NCApplication ( )
protected

Constructor.

Use YUI::app() to get the singleton for this class.

◆ ~NCApplication()

NCApplication::~NCApplication ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ askForExistingDirectory()

std::string NCApplication::askForExistingDirectory ( const std::string & startDir,
const std::string & headline )
overridevirtual

Open a directory selection box and prompt the user for an existing directory.

'startDir' is the initial directory that is displayed.

'headline' is an explanatory text for the directory selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected directory name or an empty std::string if the user canceled the operation.

Implemented from YApplication.

◆ askForExistingFile()

std::string NCApplication::askForExistingFile ( const std::string & startWith,
const std::string & filter,
const std::string & headline )
overridevirtual

Open a file selection box and prompt the user for an existing file.

'startWith' is the initial directory or file.

'filter' is one or more blank-separated file patterns, e.g. "*.png *.jpg"

'headline' is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected file name or an empty std::string if the user canceled the operation.

Implemented from YApplication.

◆ askForSaveFileName()

std::string NCApplication::askForSaveFileName ( const std::string & startWith,
const std::string & filter,
const std::string & headline )
overridevirtual

Open a file selection box and prompt the user for a file to save data to. Automatically asks for confirmation if the user selects an existing file.

'startWith' is the initial directory or file.

'filter' is one or more blank-separated file patterns, e.g. "*.png *.jpg"

'headline' is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected file name or an empty std::string if the user canceled the operation.

Implemented from YApplication.

◆ beep()

void NCApplication::beep ( )
overridevirtual

Beep.

Reimplemented from YApplication.

◆ initConsoleKeyboard()

void NCApplication::initConsoleKeyboard ( )
overridevirtual

Initialize the (text) console keyboard.

Reimplemented from YApplication.

◆ openUI()

void NCApplication::openUI ( )
overridevirtual

To mix TUI (NCurses) with stdio, enclose the UI parts within openUI/closeUI

Reimplemented from YApplication.

◆ redrawScreen()

void NCApplication::redrawScreen ( )
overridevirtual

Redraw the screen.

Reimplemented from YApplication.

◆ runInTerminal()

int NCApplication::runInTerminal ( const std::string & command)
overridevirtual

Run a shell command (typically an interactive program using NCurses) in a terminal (window).

Here in the NCurses UI, this shuts down the NCurses lib, runs the command and then restores the status of the NCurses lib so that the next instance of the NCurses lib from the started command doesn't interfere with the NCurses UI's instance.

Reimplemented from YApplication.

◆ setApplicationTitle()

void NCApplication::setApplicationTitle ( const std::string & title)
overridevirtual

Set the application title

Reimplemented from YApplication.

◆ setConsoleFont()

void NCApplication::setConsoleFont ( const std::string & console_magic,
const std::string & font,
const std::string & screen_map,
const std::string & unicode_map,
const std::string & language )
overridevirtual

Set the (text) console font according to the current encoding etc. See the setfont(8) command and the console HowTo for details.

Reimplemented from YApplication.

Moving that code from YNCursesUI to this class turned out to be impossible (or at least a lot more work than it's worth) that I finally gave it up.

◆ setLanguage()

void NCApplication::setLanguage ( const std::string & language,
const std::string & encoding = std::string() )
overridevirtual

Set language and encoding for the locale environment ($LANG).

'language' is the ISO short code ("de_DE", "en_US", ...).

'encoding' an (optional) encoding ("utf8", ...) that will be appended if present.

Reimplemented from YApplication.


The documentation for this class was generated from the following files: