pPaypalButton.sip 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. class pPaypalButton : QPushButton
  2. {
  3. %TypeHeaderCode
  4. #include <gui/pPaypalButton.h>
  5. %End
  6. public:
  7. /*!
  8. Create an instance of button having \a parent as parent.
  9. */
  10. pPaypalButton( QWidget* parent = 0 );
  11. /*!
  12. Reimplemented.
  13. */
  14. virtual QSize minimumSizeHint() const;
  15. /*!
  16. Reimplemented.
  17. */
  18. virtual QSize sizeHint() const;
  19. /*!
  20. Reimplemented.
  21. */
  22. virtual bool event( QEvent* event );
  23. /*!
  24. Return the http post action url.
  25. */
  26. QString actionPost() const;
  27. /*!
  28. Return your donation item business id.
  29. */
  30. QString businessId() const;
  31. /*!
  32. Return your donation item name.
  33. */
  34. QString itemName() const;
  35. /*!
  36. Return your donation item id.
  37. */
  38. QString itemId() const;
  39. /*!
  40. Return the currency used by your donation item.
  41. */
  42. QString currencyCode() const;
  43. /*!
  44. Return true if the http request should be automatically opened using QDesktopServices::openUrl() else false.
  45. */
  46. bool autoOpenUrl() const;
  47. /*!
  48. Return the final generated url that will be opened when clicking the button.
  49. */
  50. QUrl url() const;
  51. /*!
  52. Return the pixmap url for \a locale.
  53. */
  54. static QUrl pixmapUrl( const QString& locale );
  55. public slots:
  56. /*!
  57. Set the http post action to \a url.
  58. */
  59. void setActionPost( const QString& value );
  60. /*!
  61. Set the donation item business id to \a value.
  62. */
  63. void setBusinessId( const QString& value );
  64. /*!
  65. Set the donation item name to \a value.
  66. */
  67. void setItemName( const QString& value );
  68. /*!
  69. Set the donation item id to \a value.
  70. */
  71. void setItemId( const QString& value );
  72. /*!
  73. Set the donation item currency code to \a value..
  74. */
  75. void setCurrencyCode( const QString& value );
  76. /*!
  77. Set if the button should automatically open url() when the user click on the button.
  78. Give true to automatically open it, else give false and handle the clicked( const QUrl& ) signal.
  79. */
  80. void setAutoOpenUrl( bool open );
  81. protected:
  82. QPixmap pixmap( const QUrl& url ) const;
  83. /*!
  84. Reimplemented.
  85. */
  86. virtual void paintEvent( QPaintEvent* event );
  87. void localeChanged();
  88. protected slots:
  89. void updatePixmap();
  90. void _q_clicked();
  91. void networkAccessManager_cached( const QUrl& url );
  92. void networkAccessManager_error( const QUrl& url, const QString& message );
  93. void networkAccessManager_cacheCleared();
  94. signals:
  95. /*!
  96. This signal is emit when the user click the button and that autoOpenUrl() is false.
  97. */
  98. void clicked( const QUrl& url );
  99. };