25 #ifndef YApplication_h
31 #include "YMenuItem.h"
32 #include "YIconLoader.h"
137 const std::string & encoding = std::string() );
143 std::string
language(
bool stripEncoding =
false )
const;
166 virtual std::string
glyph(
const std::string & glyphSymbolName );
183 const std::string & headline ) = 0;
202 const std::string & filter,
203 const std::string & headline ) = 0;
224 const std::string & filter,
225 const std::string & headline ) = 0;
258 void setReleaseNotes(
const std::map<std::string,std::string> & relNotes );
353 const std::string & font,
354 const std::string & screen_map,
355 const std::string & unicode_map,
380 virtual void closeUI() {}
393 virtual int displayWidth() = 0;
394 virtual int displayHeight() = 0;
395 virtual int displayDepth() = 0;
396 virtual long displayColors() = 0;
399 virtual int defaultWidth() = 0;
400 virtual int defaultHeight() = 0;
406 virtual bool isTextMode() = 0;
407 virtual bool hasImageSupport() = 0;
408 virtual bool hasIconSupport() = 0;
409 virtual bool hasAnimationSupport() = 0;
410 virtual bool hasFullUtf8Support() = 0;
411 virtual bool richTextSupportsTable() = 0;
412 virtual bool leftHandedMouse() = 0;
413 virtual bool hasWizardDialogSupport() {
return false; }
446 #define YApplication_h
448 #endif // YApplication_h
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)
Set the (text) console font according to the current encoding etc.
virtual float layoutUnits(YUIDimension dim, int deviceUnits)
Convert device dependent units into logical layout spacing units.
virtual void initConsoleKeyboard()
Initialize the (text) console keyboard.
virtual const std::string & applicationIcon() const
Get the application Icon.
virtual void openUI()
To mix TUI (NCurses) with stdio, enclose the UI parts within openUI/closeUI.
void setReleaseNotes(const std::map< std::string, std::string > &relNotes)
Set release notes; map product => text.
virtual void setReverseLayout(bool reverse)
Set reverse layout for Arabic / Hebrew support.
std::vector< YItem * > YItemCollection
Collection of pointers to YItem.
virtual ~YApplication()
Destructor.
virtual void busyCursor()
Change the (mouse) cursor to indicate busy status.
Abstract base class of a libYUI user interface.
virtual void normalCursor()
Change the (mouse) cursor back from busy status to normal.
std::string productName() const
Get the current product name ("openSUSE", "SLES", ...).
YWidget * findWidget(YWidgetID *id, bool doThrow=true) const
Find a widget in the topmost dialog by its ID.
virtual void makeScreenShot(const std::string &fileName)
Make a screen shot and save it to the specified file.
virtual void setLanguage(const std::string &language, const std::string &encoding=std::string())
Set language and encoding for the locale environment ($LANG).
YApplication()
Constructor.
std::map< std::string, std::string > releaseNotes() const
Get the current release notes map.
std::string language(bool stripEncoding=false) const
Return the current language from the locale environment ($LANG).
virtual std::string glyph(const std::string &glyphSymbolName)
Return a string for a named glyph:
virtual void setApplicationTitle(const std::string &title)
Set the application title.
Class for application-wide values and functions.
virtual bool openContextMenu(const YItemCollection &itemCollection)
Open a context menu for a widget.
virtual void redrawScreen()
Redraw the screen.
virtual std::string askForSaveFileName(const std::string &startWith, const std::string &filter, const std::string &headline)=0
Open a file selection box and prompt the user for a file to save data to.
virtual void setApplicationIcon(const std::string &icon)
Set the application Icon.
bool reverseLayout() const
Returns 'true' if widget geometry should be reversed for languages that have right-to-left writing di...
int defaultFunctionKey(const std::string &label) const
Return the default function key number for a widget with the specified label or 0 if there is none.
virtual void setProductName(const std::string &productName)
Set the current product name ("openSUSE", "SLES", ...).
virtual int deviceUnits(YUIDimension dim, float layoutUnits)
Convert logical layout spacing units into device dependent units.
virtual const std::string & applicationTitle() const
Get the application title.
virtual std::string askForExistingFile(const std::string &startWith, const std::string &filter, const std::string &headline)=0
Open a file selection box and prompt the user for an existing file.
virtual void setIconBasePath(const std::string &newIconBasePath)
Set the icon base path.
void clearDefaultFunctionKeys()
Clear all previous label-to-function-key mappings.
bool showProductLogo() const
Return true if product logo should be shown.
virtual std::string askForExistingDirectory(const std::string &startDir, const std::string &headline)=0
Open a directory selection box and prompt the user for an existing directory.
virtual int runInTerminal(const std::string &command)
Run a shell command (typically an interactive program using NCurses) in a terminal (window).
virtual std::string iconBasePath() const
Get the base path for icons used by the UI.
void setDefaultFunctionKey(const std::string &label, int fkey)
Add a mapping from the specified label to the specified F-key number.
void setShowProductLogo(bool show)
Set whether the product logo (in top bar) should be shown.