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;
405 #endif // YQApplication_h
virtual void normalCursor()
Change the (mouse) cursor back from busy status to normal.
virtual int deviceUnits(YUIDimension dim, float layoutUnits)
Convert logical layout spacing units into device dependent units.
virtual std::string glyph(const std::string &glyphSymbolName)
Return a std::string for a named glyph.
void setLayoutDirection(const std::string &language)
Set the layout direction (left-to-right or right-to-left) from 'language'.
void maybeLeftHandedUser()
A mouse click with the wrong mouse button was detected - e.g., a right click on a push button...
virtual QPoint contextMenuPos()
Return position of the context menu (in gloabl coordinates)
virtual ~YQApplication()
Destructor.
virtual void setApplicationTitle(const std::string &title)
Set the application title.
virtual void busyCursor()
Change the (mouse) cursor to indicate busy status.
QSettings * _langFonts
Language-specific font settings.
void setAutoFonts(bool useAutoFonts)
Set whether or not fonts should automatically be picked.
void setLangFonts(const std::string &language, const std::string &encoding=std::string())
Set fonts according to the specified language and encoding.
void deleteFonts()
Delete the fonts so they will be reloaded upon their next usage.
QTranslator * _qtTranslations
Translator for the predefined Qt dialogs.
virtual bool openContextMenu(const YItemCollection &itemCollection)
Open a context menu for a widget.
QString fontKey(const QString &lang)
Constructs a key for the language specific font file: "font[lang]" for font[de_DE] = "Sans Serif" fon...
static YQGraphPluginStub * graphPlugin()
Return the package selector plugin singleton or creates it (including loading the plugin lib) if it d...
virtual void setContextMenuPos(QPoint contextMenuPos)
Sets the position of the context menu (in gloabl coordinates)
virtual void setApplicationIcon(const std::string &icon)
Set the application Icon.
virtual void makeScreenShot(const std::string &fileName)
Make a screen shot and save it to the specified file.
const QFont & headingFont()
Returns the application's heading font.
QString _fontFamily
Font family or list of font families to use ("Sans Serif" etc.)
YQApplication()
Constructor.
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 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.
bool autoFonts() const
Returns 'true' if the UI automatically picks fonts, disregarding Qt standard settings.
virtual void setLanguage(const std::string &language, const std::string &encoding=std::string())
Set language and encoding for the locale environment ($LANG).
virtual float layoutUnits(YUIDimension dim, int deviceUnits)
Convert device dependent units into logical layout spacing units.
const QFont & boldFont()
Returns the application's default bold font.
void loadPredefinedQtTranslations()
Load translations for Qt's predefined dialogs like file selection box etc.
void pickAutoFonts()
Determine good fonts based on defaultsize geometry and set _auto_normal_font_size and _auto_heading_f...
static YQPackageSelectorPluginStub * packageSelectorPlugin()
Return the package selector plugin singleton or creates it (including loading the plugin lib) if it d...
const QFont & currentFont()
Returns the application's default font.
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.