26 #ifndef YQApplication_h
27 #define YQApplication_h
30 #include <qtranslator.h>
33 #include "YQPackageSelectorPluginStub.h"
34 #include "YQGraphPluginStub.h"
35 #include <yui/YApplication.h>
38 class YQPackageSelectorPlugin;
79 virtual void setLanguage(
const std::string & language,
80 const std::string & encoding = std::string() );
101 const std::string & encoding = std::string() );
152 virtual std::string
glyph(
const std::string & glyphSymbolName );
169 const std::string & headline );
188 const std::string & filter,
189 const std::string & headline );
210 const std::string & filter,
211 const std::string & headline );
217 const QString & filter,
218 const QString & headline );
229 virtual bool openContextMenu (
const YItemCollection & itemCollection );
313 virtual int displayWidth();
314 virtual int displayHeight();
315 virtual int displayDepth();
316 virtual long displayColors();
319 virtual int defaultWidth();
320 virtual int defaultHeight();
326 virtual bool isTextMode() {
return false; }
327 virtual bool hasImageSupport() {
return true; }
328 virtual bool hasIconSupport() {
return true; }
329 virtual bool hasAnimationSupport() {
return true; }
330 virtual bool hasFullUtf8Support() {
return true; }
331 virtual bool richTextSupportsTable() {
return true; }
332 virtual bool hasWizardDialogSupport() {
return true; }
333 virtual bool leftHandedMouse();
359 QString
fontKey(
const QString & lang );
368 QFont * _currentFont;
369 QFont * _headingFont;
392 int _autoNormalFontSize;
393 int _autoHeadingFontSize;
395 bool _leftHandedMouse;
396 bool _askedForLeftHandedMouse;
398 QPoint _contextMenuPos;
virtual void setApplicationIcon(const std::string &icon)
Set the application Icon.
void setAutoFonts(bool useAutoFonts)
Set whether or not fonts should automatically be picked.
static YQPackageSelectorPluginStub * packageSelectorPlugin()
Return the package selector plugin singleton or creates it (including loading the plugin lib) if it d...
void pickAutoFonts()
Determine good fonts based on defaultsize geometry and set _auto_normal_font_size and _auto_heading_f...
virtual bool openContextMenu(const YItemCollection &itemCollection)
Open a context menu for a widget.
virtual QPoint contextMenuPos()
Return position of the context menu (in gloabl coordinates)
virtual std::string askForExistingFile(const std::string &startWith, const std::string &filter, const std::string &headline)
Open a file selection box and prompt the user for an existing file.
virtual void setLanguage(const std::string &language, const std::string &encoding=std::string())
Set language and encoding for the locale environment ($LANG).
virtual void setApplicationTitle(const std::string &title)
Set the application title.
virtual void normalCursor()
Change the (mouse) cursor back from busy status to normal.
virtual std::string glyph(const std::string &glyphSymbolName)
Return a std::string for a named glyph.
QTranslator * _qtTranslations
Translator for the predefined Qt dialogs.
const QFont & boldFont()
Returns the application's default bold font.
YQApplication()
Constructor.
virtual ~YQApplication()
Destructor.
const QFont & currentFont()
Returns the application's default font.
virtual void setContextMenuPos(QPoint contextMenuPos)
Sets the position of the context menu (in gloabl coordinates)
void loadPredefinedQtTranslations()
Load translations for Qt's predefined dialogs like file selection box etc.
virtual int deviceUnits(YUIDimension dim, float layoutUnits)
Convert logical layout spacing units into device dependent units.
QSettings * _langFonts
Language-specific font settings.
static YQGraphPluginStub * graphPlugin()
Return the package selector plugin singleton or creates it (including loading the plugin lib) if it d...
virtual float layoutUnits(YUIDimension dim, int deviceUnits)
Convert device dependent units into logical layout spacing units.
void maybeLeftHandedUser()
A mouse click with the wrong mouse button was detected - e.g., a right click on a push button.
void setLayoutDirection(const std::string &language)
Set the layout direction (left-to-right or right-to-left) from 'language'.
virtual std::string askForSaveFileName(const std::string &startWith, const std::string &filter, const std::string &headline)
Open a file selection box and prompt the user for a file to save data to.
void deleteFonts()
Delete the fonts so they will be reloaded upon their next usage.
virtual std::string askForExistingDirectory(const std::string &startDir, const std::string &headline)
Open a directory selection box and prompt the user for an existing directory.
virtual void makeScreenShot(const std::string &fileName)
Make a screen shot and save it to the specified file.
QString _fontFamily
Font family or list of font families to use ("Sans Serif" etc.)
virtual void busyCursor()
Change the (mouse) cursor to indicate busy status.
void setLangFonts(const std::string &language, const std::string &encoding=std::string())
Set fonts according to the specified language and encoding.
QString fontKey(const QString &lang)
Constructs a key for the language specific font file: "font[lang]" for font[de_DE] = "Sans Serif" fon...
const QFont & headingFont()
Returns the application's heading font.
bool autoFonts() const
Returns 'true' if the UI automatically picks fonts, disregarding Qt standard settings.