28 #include <qapplication.h>
33 #include <type_traits>
36 #include <yui/YSimpleEventHandler.h>
37 #include <yui/YCommandLine.h>
39 #define YQWidgetMargin 4
40 #define YQWidgetSpacing 4
41 #define YQButtonBorder 3
47 #define pclass(ptr) std::remove_reference<decltype(*ptr)>::type
71 YQUI(
bool withThreads );
112 virtual YApplication * createApplication();
141 {
return _eventHandler.eventPendingFor( widget ); }
329 virtual void idleLoop(
int fd_ycp );
356 QMap<QString, int> screenShotNo;
357 QString screenShotNameTemplate;
364 bool _received_ycp_command;
367 QTimer * _busyCursorTimer;
369 YSimpleEventHandler _eventHandler;
372 QPalette _normalPalette;
373 bool _usingVisionImpairedPalette;
375 bool _leftHandedMouse;
376 bool _askedForLeftHandedMouse;
381 QString _applicationTitle;
402 void slotBusyCursor();
403 void slotReceivedYCPCommand();
413 YUI * createUI(
bool withThreads );
bool fullscreen() const
Return 'true' if defaultsize windows should use the full screen.
void receivedYCPCommand()
Notification that a YCP command has been received on fd_ycp to leave idleLoop()
static YQApplication * yqApp()
Return the global YApplication object as YQApplication.
void askConfigureLogging()
Open dialog to configure logging.
void forceUnblockEvents()
Force unblocking all events, no matter how many times blockEvents() has This returns 0 if there is no...
bool eventPendingFor(YWidget *widget) const
Returns 'true' if there is any event pending for the specified widget.
void setApplicationTitle(const QString &title)
Sets the application name for the window title.
int defaultSize(YUIDimension dim) const
Returns size for opt(defaultsize) dialogs (in one dimension).
void makeScreenShot(std::string filename)
Make a screen shot in .png format and save it to 'filename'.
void askSaveLogs()
Open file selection box and let the user save y2logs to that location.
virtual YEvent * runPkgSelection(YWidget *packageSelector)
UI-specific runPkgSeleciton method: Start the package selection.
void toggleRecordMacro()
Toggle macro recording (activated by Ctrl-Shift-Alt-M): Stop macro recording if it is in progress...
virtual YOptionalWidgetFactory * createOptionalWidgetFactory()
Create the widget factory that provides all the createXY() methods for optional ("special") widgets a...
QString applicationTitle()
Returns the application name for the window title (e.g.
void calcDefaultSize()
Calculate size of opt(defaultsize) dialogs.
bool usingVisionImpairedPalette() const
Returns 'true' if high-contrast colors for vision impaired users is in use.
Helper class that acts as a Qt signal receiver for YQUI.
void sendEvent(YEvent *event)
Widget event handlers (slots) call this when an event occured that should be the answer to a UserInpu...
YQUI(bool withThreads)
Constructor.
virtual void idleLoop(int fd_ycp)
Idle around until fd_ycp is readable and handle repaints.
void probeX11Display(const YCommandLine &cmdLine)
Probe the X11 display.
virtual bool eventsBlocked() const
Returns 'true' if events are currently blocked.
bool noBorder() const
Return 'true' if defaultsize windows should not get window manager borders / frames.
virtual void deleteNotify(YWidget *widget)
Notification that a widget is being deleted.
void busyCursor()
Show mouse cursor indicating busy state.
void processCommandLineArgs(int argc, char **argv)
Handle command line args.
static QPalette visionImpairedPalette()
Returns a high-contrast color palette suitable for vision impaired users.
YEvent * consumePendingEvent()
Return the pending event, if there is one, and mark it as "consumed".
virtual void uiThreadDestructor()
Destroy whatever needs to be destroyed within the UI thread.
QPalette normalPalette() const
Returns the normal color palette.
virtual void blockEvents(bool block=true)
Block (or unblock) events.
void timeoutBusyCursor()
Show mouse cursor indicating busy state if the UI is unable to respond to user input for more than a ...
bool fatalError() const
Returns 'true' if the UI had a fatal error that requires the application to abort.
bool close()
Application shutdown.
void normalCursor()
Show normal mouse cursor not indicating busy status.
void initUI()
Post-constructor initialization.
YEvent * pendingEvent() const
Returns the last event that isn't processed yet or 0 if there is none.
void askPlayMacro()
Open file selection box and ask for a macro file to play (activated by Ctrl-Shift-Alt-P) ...
virtual ~YQUI()
Destructor.
void raiseFatalError()
Raise a fatal UI error.
static void setTextdomain(const char *domain)
Initialize and set a textdomain for gettext()
void toggleVisionImpairedPalette()
Toggle between the vision impaired and the normal color palette.
static YQUI * ui()
Access the global Qt-UI.
virtual YWidgetFactory * createWidgetFactory()
Create the widget factory that provides all the createXY() methods for standard (mandatory, i.e.