libyui-ncurses  2.54.5
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
 Set language and encoding for the locale environment ($LANG). More...
 
virtual std::string askForExistingDirectory (const std::string &startDir, const std::string &headline) override
 Open a directory selection box and prompt the user for an existing directory. More...
 
virtual std::string askForExistingFile (const std::string &startWith, const std::string &filter, const std::string &headline) override
 Open a file selection box and prompt the user for an existing file. More...
 
virtual std::string askForSaveFileName (const std::string &startWith, const std::string &filter, const std::string &headline) override
 Open a file selection box and prompt the user for a file to save data to. More...
 
virtual void beep () override
 Beep. More...
 
virtual void redrawScreen () override
 Redraw the screen. More...
 
virtual void initConsoleKeyboard () override
 Initialize the (text) console keyboard. More...
 
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
 Set the (text) console font according to the current encoding etc. More...
 
virtual int runInTerminal (const std::string &command) override
 Run a shell command (typically an interactive program using NCurses) in a terminal (window). More...
 
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
 Set the application title. More...
 
virtual void openUI () override
 To mix TUI (NCurses) with stdio, enclose the UI parts within openUI/closeUI. More...
 
virtual void closeUI () override
 

Protected Member Functions

 NCApplication ()
 Constructor. More...
 
virtual ~NCApplication ()
 Destructor.
 

Friends

class YNCursesUI
 

Detailed Description

Definition at line 31 of file NCApplication.h.

Constructor & Destructor Documentation

◆ NCApplication()

NCApplication::NCApplication ( )
protected

Constructor.

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

Definition at line 37 of file NCApplication.cc.

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.

Definition at line 97 of file NCApplication.cc.

Here is the call graph for this function:

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

Definition at line 81 of file NCApplication.cc.

Here is the call graph for this function:

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

Definition at line 65 of file NCApplication.cc.

Here is the call graph for this function:

◆ beep()

void NCApplication::beep ( )
overridevirtual

Beep.

Reimplemented from YApplication.

Definition at line 112 of file NCApplication.cc.

◆ initConsoleKeyboard()

void NCApplication::initConsoleKeyboard ( )
overridevirtual

Initialize the (text) console keyboard.

Reimplemented from YApplication.

Definition at line 125 of file NCApplication.cc.

◆ openUI()

void NCApplication::openUI ( )
overridevirtual

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

Reimplemented from YApplication.

Definition at line 185 of file NCApplication.cc.

Here is the call graph for this function:

◆ redrawScreen()

void NCApplication::redrawScreen ( )
overridevirtual

Redraw the screen.

Reimplemented from YApplication.

Definition at line 118 of file NCApplication.cc.

Here is the call graph for this function:

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

Definition at line 196 of file NCApplication.cc.

Here is the call graph for this function:

◆ setApplicationTitle()

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

Set the application title.

Reimplemented from YApplication.

Definition at line 264 of file NCApplication.cc.

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

Definition at line 152 of file NCApplication.cc.

Here is the call graph for this function:

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

Definition at line 49 of file NCApplication.cc.


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