Advertisement
Guest User

Untitled

a guest
May 29th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.87 KB | None | 0 0
  1. #ifndef MTABSTRACTTOGGLE_H
  2. #define MTABSTRACTTOGGLE_H
  3.  
  4. #include <QString>
  5. #include <QUrl>
  6. #include <QtGui/QImage>
  7.  
  8. class MTAbstractToggle
  9. {
  10. public:
  11.     /* isToggle() should returns whether this is a toggle or not, not being
  12.      * a toggle means that the widget created should not have a visual switch
  13.      * and that the toggle would only act as a button */
  14.     virtual bool isToggle() = 0;
  15.  
  16.     /* isActive() should return the current state of the widget, whatever it
  17.      * returns should be the same as the state indicated by the signal
  18.      * void toggleStateChanged(bool state) */
  19.     virtual bool isActive() = 0;
  20.  
  21.     /* toggleName() should return the name of the plugin/toggle, for example
  22.      * a WiFi toggle would return "WiFi Toggle" or "WiFi" */
  23.     virtual QString toggleName() = 0;
  24.  
  25.     /* toggleDeveloper() should return the name of the developer of the toggle,
  26.      * this may not be used at first, but it may help in support cases */
  27.     virtual QString toggleDeveloper() = 0;
  28.  
  29.     /* toggleSupportUrl() should return the URL to contact in case there's a
  30.      * problem with the toggle, this can be a null QUrl. */
  31.     virtual QUrl toggleSupportUrl() = 0;
  32.  
  33.     /* toggleIcon() should return the icon to be shown in the toggle's widget,
  34.      * in case this icon needs to be dynamic, it can be changed by emitting
  35.      * iconChanged(QImage icon) */
  36.     virtual QImage toggleIcon() = 0;
  37.  
  38.     /* Due to limitations in Qt's Plugin interface, I can't provide virtual slots
  39.      * since this class doesn't inherit QObject, please define these in your plugin.
  40.  
  41. signals:
  42.     void stateChanged(bool state);
  43.     void isWorkingStateChanged(bool working);
  44.     void iconChanged(QImage icon);
  45.  
  46. public slots:
  47.     void onToggleClicked();
  48.     */
  49. };
  50.  
  51. Q_DECLARE_INTERFACE(MTAbstractToggle, "org.xceleo.mohammadag.MTAbstractToggle/1.0")
  52.  
  53. #endif // MTABSTRACTTOGGLE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement